summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autodoc/source/display/html/cfrstd.cxx4
-rw-r--r--basic/source/app/app.cxx35
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/call.s16
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx7
-rw-r--r--chart2/prj/build.lst3
-rw-r--r--chart2/source/controller/accessibility/AccessibleBase.cxx65
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartElement.cxx12
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartShape.cxx289
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartShape.hxx104
-rw-r--r--chart2/source/controller/accessibility/AccessibleChartView.cxx48
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.cxx116
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.hxx (renamed from configmgr/source/inc/nodevisitor.hxx)70
-rw-r--r--chart2/source/controller/accessibility/ChartElementFactory.cxx7
-rw-r--r--chart2/source/controller/accessibility/makefile.mk4
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx7
-rw-r--r--chart2/source/controller/dialogs/ResourceIds.hrc2
-rw-r--r--chart2/source/controller/dialogs/Strings.src5
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeFont.cxx92
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeFont.src (renamed from configmgr/source/api2/committer.hxx)57
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx93
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.src (renamed from configmgr/source/backend/backendstratalistener.cxx)63
-rw-r--r--chart2/source/controller/dialogs/makefile.mk6
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx21
-rw-r--r--chart2/source/controller/inc/AccessibleBase.hxx20
-rw-r--r--chart2/source/controller/inc/AccessibleChartView.hxx18
-rw-r--r--chart2/source/controller/inc/MenuResIds.hrc (renamed from configmgr/workben/memory/testmodules.hxx)21
-rw-r--r--chart2/source/controller/inc/ObjectHierarchy.hxx30
-rw-r--r--chart2/source/controller/inc/ShapeController.hrc (renamed from configmgr/source/treemgr/viewaccess.cxx)48
-rw-r--r--chart2/source/controller/inc/dlg_ShapeFont.hxx (renamed from configmgr/source/inc/localizedtreeactions.hxx)41
-rw-r--r--chart2/source/controller/inc/dlg_ShapeParagraph.hxx (renamed from configmgr/source/inc/nodeconverter.hxx)49
-rw-r--r--chart2/source/controller/main/ChartController.cxx104
-rw-r--r--chart2/source/controller/main/ChartController.hxx27
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx58
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx288
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx710
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx83
-rw-r--r--chart2/source/controller/main/ChartTransferable.hxx6
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.cxx64
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.hxx44
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx46
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.hxx11
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx674
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.hrc (renamed from configmgr/source/treemgr/viewfactory.hxx)45
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.hxx93
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx67
-rw-r--r--chart2/source/controller/main/ElementSelector.hxx3
-rw-r--r--chart2/source/controller/main/FeatureCommandDispatchBase.cxx114
-rw-r--r--chart2/source/controller/main/FeatureCommandDispatchBase.hxx115
-rw-r--r--chart2/source/controller/main/ImplUndoManager.cxx (renamed from chart2/source/tools/ImplUndoManager.cxx)28
-rw-r--r--chart2/source/controller/main/ImplUndoManager.hxx (renamed from chart2/source/tools/ImplUndoManager.hxx)16
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx259
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx246
-rw-r--r--chart2/source/controller/main/SelectionHelper.hxx18
-rw-r--r--chart2/source/controller/main/ShapeController.cxx738
-rw-r--r--chart2/source/controller/main/ShapeController.hxx100
-rw-r--r--chart2/source/controller/main/ShapeToolbarController.cxx298
-rw-r--r--chart2/source/controller/main/ShapeToolbarController.hxx103
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.cxx6
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.hxx3
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx (renamed from chart2/source/tools/UndoGuard.cxx)0
-rw-r--r--chart2/source/controller/main/UndoManager.cxx (renamed from chart2/source/tools/UndoManager.cxx)100
-rw-r--r--chart2/source/controller/main/_serviceregistration_controller.cxx13
-rw-r--r--chart2/source/controller/main/makefile.mk9
-rw-r--r--chart2/source/controller/makefile.mk1
-rw-r--r--chart2/source/controller/menus/ShapeContextMenu.src124
-rw-r--r--chart2/source/controller/menus/ShapeEditContextMenu.src (renamed from configmgr/source/inc/cachefactory.hxx)54
-rw-r--r--[-rwxr-xr-x]chart2/source/controller/menus/makefile.mk (renamed from crashrep/source/unx/res/makefile.mk)42
-rw-r--r--chart2/source/inc/ChartModelHelper.hxx2
-rw-r--r--chart2/source/inc/ObjectIdentifier.hxx32
-rw-r--r--chart2/source/inc/Strings.hrc4
-rw-r--r--chart2/source/inc/UndoGuard.hxx11
-rw-r--r--chart2/source/inc/UndoManager.hxx22
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx2
-rw-r--r--chart2/source/inc/servicenames.hxx5
-rw-r--r--chart2/source/model/main/ChartModel.cxx67
-rw-r--r--chart2/source/model/main/ChartModel.hxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/ImplChartModel.cxx49
-rw-r--r--chart2/source/model/main/ImplChartModel.hxx22
-rw-r--r--chart2/source/tools/ChartModelHelper.cxx7
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx158
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx114
-rw-r--r--chart2/source/tools/makefile.mk3
-rw-r--r--chart2/source/view/main/ChartView.cxx121
-rw-r--r--chart2/source/view/main/ChartView.hxx21
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx73
-rw-r--r--chart2/uiconfig/toolbar/arrowshapes.xml34
-rw-r--r--chart2/uiconfig/toolbar/basicshapes.xml29
-rw-r--r--chart2/uiconfig/toolbar/calloutshapes.xml11
-rw-r--r--chart2/uiconfig/toolbar/drawbar.xml20
-rw-r--r--chart2/uiconfig/toolbar/flowchartshapes.xml36
-rw-r--r--chart2/uiconfig/toolbar/starshapes.xml17
-rw-r--r--chart2/uiconfig/toolbar/symbolshapes.xml24
-rw-r--r--configmgr/inc/configmgr/detail/configmgrdllapi.hxx41
-rw-r--r--configmgr/inc/configmgr/update.hxx51
-rw-r--r--configmgr/inc/makefile.mk34
-rw-r--r--configmgr/inc/pch/precompiled_configmgr.cxx51
-rw-r--r--configmgr/inc/pch/precompiled_configmgr.hxx267
-rw-r--r--configmgr/prj/build.lst21
-rw-r--r--configmgr/prj/d.lst16
-rw-r--r--configmgr/qa/unit/common.hxx111
-rw-r--r--configmgr/qa/unit/configmgrrc22
-rw-r--r--configmgr/qa/unit/data.xcd (renamed from configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu)175
-rw-r--r--configmgr/qa/unit/data/org/openoffice/Setup.xcu43
-rw-r--r--configmgr/qa/unit/export.map7
-rw-r--r--configmgr/qa/unit/makefile.mk78
-rw-r--r--[-rwxr-xr-x]configmgr/qa/unit/no_localization (renamed from connectivity/util/delzip)0
-rw-r--r--configmgr/qa/unit/performance.cxx268
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/Setup.xcs72
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs62
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs49
-rw-r--r--configmgr/qa/unit/test.cxx678
-rw-r--r--configmgr/qa/unit/threading.cxx259
-rw-r--r--configmgr/qa/unit/ubootstrap.cxx120
-rw-r--r--configmgr/qa/unit/urebootstrap.ini (renamed from configmgr/version.mk)26
-rw-r--r--[-rwxr-xr-x]configmgr/qa/unit/version.map (renamed from crashrep/scripts/makefile.mk)25
-rw-r--r--configmgr/qa/unoapi/cfgmgr2.sce34
-rw-r--r--configmgr/qa/unoapi/knownissues.xcl55
-rw-r--r--configmgr/qa/unoapi/makefile.mk22
-rw-r--r--configmgr/qa/unoapi/module.sce (renamed from configmgr/makefile.pmk)7
-rw-r--r--configmgr/source/README156
-rw-r--r--configmgr/source/access.cxx2186
-rw-r--r--configmgr/source/access.hxx582
-rw-r--r--configmgr/source/api/confevents.cxx302
-rw-r--r--configmgr/source/api/confsvccomponent.cxx100
-rw-r--r--configmgr/source/api2/accessimpl.cxx804
-rw-r--r--configmgr/source/api2/accessimpl.hxx136
-rw-r--r--configmgr/source/api2/apiaccessobj.cxx290
-rw-r--r--configmgr/source/api2/apiaccessobj.hxx145
-rw-r--r--configmgr/source/api2/apiaccessobj.inl260
-rw-r--r--configmgr/source/api2/apifactory.cxx335
-rw-r--r--configmgr/source/api2/apifactory.hxx119
-rw-r--r--configmgr/source/api2/apifactoryimpl.cxx352
-rw-r--r--configmgr/source/api2/apifactoryimpl.hxx68
-rw-r--r--configmgr/source/api2/apinodeaccess.cxx178
-rw-r--r--configmgr/source/api2/apinodeaccess.hxx172
-rw-r--r--configmgr/source/api2/apinodeupdate.cxx169
-rw-r--r--configmgr/source/api2/apinodeupdate.hxx174
-rw-r--r--configmgr/source/api2/apinotifierimpl.cxx329
-rw-r--r--configmgr/source/api2/apinotifierimpl.hxx102
-rw-r--r--configmgr/source/api2/apiserviceinfo.cxx337
-rw-r--r--configmgr/source/api2/apiserviceinfo.hxx69
-rw-r--r--configmgr/source/api2/apitreeaccess.cxx110
-rw-r--r--configmgr/source/api2/apitreeaccess.hxx176
-rw-r--r--configmgr/source/api2/apitreeimplobj.cxx1001
-rw-r--r--configmgr/source/api2/apitreeimplobj.hxx189
-rw-r--r--configmgr/source/api2/broadcaster.cxx1226
-rw-r--r--configmgr/source/api2/broadcaster.hxx88
-rw-r--r--configmgr/source/api2/committer.cxx130
-rw-r--r--configmgr/source/api2/confignotifier.cxx243
-rw-r--r--configmgr/source/api2/confignotifier.hxx197
-rw-r--r--configmgr/source/api2/elementaccess.cxx486
-rw-r--r--configmgr/source/api2/elementaccess.hxx383
-rw-r--r--configmgr/source/api2/elementimpl.cxx588
-rw-r--r--configmgr/source/api2/elementimpl.hxx157
-rw-r--r--configmgr/source/api2/groupaccess.cxx144
-rw-r--r--configmgr/source/api2/groupaccess.hxx135
-rw-r--r--configmgr/source/api2/groupobjects.cxx407
-rw-r--r--configmgr/source/api2/groupobjects.hxx268
-rw-r--r--configmgr/source/api2/groupupdate.cxx104
-rw-r--r--configmgr/source/api2/groupupdate.hxx98
-rw-r--r--configmgr/source/api2/listenercontainer.cxx80
-rw-r--r--configmgr/source/api2/listenercontainer.hxx581
-rw-r--r--configmgr/source/api2/makefile.mk79
-rw-r--r--configmgr/source/api2/notifierimpl.hxx238
-rw-r--r--configmgr/source/api2/objectregistry.hxx95
-rw-r--r--configmgr/source/api2/propertiesfilterednotifier.cxx151
-rw-r--r--configmgr/source/api2/propertiesfilterednotifier.hxx76
-rw-r--r--configmgr/source/api2/propertyinfohelper.cxx72
-rw-r--r--configmgr/source/api2/propertyinfohelper.hxx56
-rw-r--r--configmgr/source/api2/propertysetaccess.cxx275
-rw-r--r--configmgr/source/api2/propertysetaccess.hxx215
-rw-r--r--configmgr/source/api2/propsetaccessimpl.cxx1284
-rw-r--r--configmgr/source/api2/propsetaccessimpl.hxx138
-rw-r--r--configmgr/source/api2/provider.cxx711
-rw-r--r--configmgr/source/api2/provider.hxx198
-rw-r--r--configmgr/source/api2/providerimpl.cxx893
-rw-r--r--configmgr/source/api2/providerimpl.hxx228
-rw-r--r--configmgr/source/api2/setaccess.cxx185
-rw-r--r--configmgr/source/api2/setaccess.hxx167
-rw-r--r--configmgr/source/api2/setobjects.cxx547
-rw-r--r--configmgr/source/api2/setobjects.hxx358
-rw-r--r--configmgr/source/api2/setupdate.cxx241
-rw-r--r--configmgr/source/api2/setupdate.hxx208
-rw-r--r--configmgr/source/api2/translatechanges.cxx283
-rw-r--r--configmgr/source/api2/translatechanges.hxx117
-rw-r--r--configmgr/source/api2/treeiterators.cxx93
-rw-r--r--configmgr/source/api2/treeiterators.hxx85
-rw-r--r--configmgr/source/api2/updateimpl.cxx647
-rw-r--r--configmgr/source/api2/updateimpl.hxx95
-rw-r--r--configmgr/source/backend/backendaccess.cxx827
-rw-r--r--configmgr/source/backend/backendaccess.hxx157
-rw-r--r--configmgr/source/backend/backendfactory.cxx329
-rw-r--r--configmgr/source/backend/backendnotifier.cxx195
-rw-r--r--configmgr/source/backend/backendnotifier.hxx120
-rw-r--r--configmgr/source/backend/backendstratalistener.hxx74
-rw-r--r--configmgr/source/backend/basicimporthandler.cxx114
-rw-r--r--configmgr/source/backend/basicimporthandler.hxx96
-rw-r--r--configmgr/source/backend/basicupdatemerger.cxx338
-rw-r--r--configmgr/source/backend/basicupdatemerger.hxx157
-rw-r--r--configmgr/source/backend/binarycache.cxx248
-rw-r--r--configmgr/source/backend/binarycache.hxx100
-rw-r--r--configmgr/source/backend/binaryreader.cxx690
-rw-r--r--configmgr/source/backend/binaryreader.hxx85
-rw-r--r--configmgr/source/backend/binaryreadhandler.cxx687
-rw-r--r--configmgr/source/backend/binaryreadhandler.hxx133
-rw-r--r--configmgr/source/backend/binarytype.hxx61
-rw-r--r--configmgr/source/backend/binarywritehandler.cxx489
-rw-r--r--configmgr/source/backend/binarywritehandler.hxx117
-rw-r--r--configmgr/source/backend/binarywriter.cxx215
-rw-r--r--configmgr/source/backend/binarywriter.hxx76
-rw-r--r--configmgr/source/backend/componentdatahelper.cxx614
-rw-r--r--configmgr/source/backend/componentdatahelper.hxx219
-rw-r--r--configmgr/source/backend/emptylayer.cxx225
-rw-r--r--configmgr/source/backend/emptylayerimpl.hxx136
-rw-r--r--configmgr/source/backend/importmergehandler.cxx296
-rw-r--r--configmgr/source/backend/importmergehandler.hxx134
-rw-r--r--configmgr/source/backend/importsvc.cxx335
-rw-r--r--configmgr/source/backend/importsvc.hxx154
-rw-r--r--configmgr/source/backend/layerdefaultremover.cxx275
-rw-r--r--configmgr/source/backend/layerdefaultremover.hxx132
-rw-r--r--configmgr/source/backend/layermerge.cxx1036
-rw-r--r--configmgr/source/backend/layermerge.hxx188
-rw-r--r--configmgr/source/backend/layerupdate.cxx110
-rw-r--r--configmgr/source/backend/layerupdate.hxx87
-rw-r--r--configmgr/source/backend/layerupdatebuilder.cxx299
-rw-r--r--configmgr/source/backend/layerupdatebuilder.hxx105
-rw-r--r--configmgr/source/backend/layerupdatehandler.cxx313
-rw-r--r--configmgr/source/backend/layerupdatehandler.hxx154
-rw-r--r--configmgr/source/backend/layerupdatemerger.cxx512
-rw-r--r--configmgr/source/backend/layerupdatemerger.hxx130
-rw-r--r--configmgr/source/backend/makefile.mk77
-rw-r--r--configmgr/source/backend/mergedcomponentdata.cxx173
-rw-r--r--configmgr/source/backend/mergedcomponentdata.hxx99
-rw-r--r--configmgr/source/backend/multistratumbackend.cxx931
-rw-r--r--configmgr/source/backend/multistratumbackend.hxx219
-rw-r--r--configmgr/source/backend/schemabuilder.cxx536
-rw-r--r--configmgr/source/backend/schemabuilder.hxx151
-rw-r--r--configmgr/source/backend/singlebackendadapter.cxx336
-rw-r--r--configmgr/source/backend/singlebackendadapter.hxx142
-rw-r--r--configmgr/source/backend/updatedata.cxx455
-rw-r--r--configmgr/source/backend/updatedata.hxx266
-rw-r--r--configmgr/source/backend/updatedispatch.cxx496
-rw-r--r--configmgr/source/backend/updatedispatch.hxx103
-rw-r--r--configmgr/source/backend/updatesvc.cxx278
-rw-r--r--configmgr/source/backend/updatesvc.hxx122
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.cxx361
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.hxx165
-rw-r--r--configmgr/source/backendhelper/behelper.uno.xml35
-rw-r--r--configmgr/source/backendhelper/componentdf.cxx88
-rw-r--r--configmgr/source/backendhelper/exports.dxp3
-rw-r--r--configmgr/source/backendhelper/makefile.mk69
-rw-r--r--configmgr/source/broadcaster.cxx237
-rw-r--r--configmgr/source/broadcaster.hxx181
-rw-r--r--configmgr/source/childaccess.cxx391
-rw-r--r--configmgr/source/childaccess.hxx157
-rw-r--r--configmgr/source/components.cxx652
-rw-r--r--configmgr/source/components.hxx151
-rw-r--r--configmgr/source/configurationprovider.cxx519
-rw-r--r--configmgr/source/configurationprovider.hxx67
-rw-r--r--configmgr/source/configurationregistry.cxx950
-rw-r--r--configmgr/source/configurationregistry.hxx57
-rw-r--r--configmgr/source/data.cxx318
-rw-r--r--configmgr/source/data.hxx86
-rw-r--r--configmgr/source/data/anydata.cxx468
-rw-r--r--configmgr/source/data/makefile.mk50
-rw-r--r--configmgr/source/data/sequence.cxx490
-rw-r--r--configmgr/source/defaultprovider.cxx131
-rw-r--r--configmgr/source/defaultprovider.hxx59
-rw-r--r--configmgr/source/groupnode.cxx88
-rw-r--r--configmgr/source/groupnode.hxx75
-rw-r--r--configmgr/source/inc/anydata.hxx78
-rw-r--r--configmgr/source/inc/anynoderef.hxx157
-rw-r--r--configmgr/source/inc/anypair.hxx118
-rw-r--r--configmgr/source/inc/apitypes.hxx89
-rw-r--r--configmgr/source/inc/attributes.hxx133
-rw-r--r--configmgr/source/inc/autoobject.hxx97
-rw-r--r--configmgr/source/inc/autoreferencemap.hxx129
-rw-r--r--configmgr/source/inc/backendfactory.hxx68
-rw-r--r--configmgr/source/inc/bootstrap.hxx240
-rw-r--r--configmgr/source/inc/bootstrapcontext.hxx168
-rw-r--r--configmgr/source/inc/bufferedfile.hxx65
-rw-r--r--configmgr/source/inc/builddata.hxx69
-rw-r--r--configmgr/source/inc/change.hxx504
-rw-r--r--configmgr/source/inc/confapifactory.hxx178
-rw-r--r--configmgr/source/inc/confevents.hxx213
-rw-r--r--configmgr/source/inc/configdefaultprovider.hxx95
-rw-r--r--configmgr/source/inc/configexcept.hxx117
-rw-r--r--configmgr/source/inc/configgroup.hxx114
-rw-r--r--configmgr/source/inc/configinteractionhandler.hxx81
-rw-r--r--configmgr/source/inc/configpath.hxx446
-rw-r--r--configmgr/source/inc/configset.hxx143
-rw-r--r--configmgr/source/inc/confsvccomponent.hxx88
-rw-r--r--configmgr/source/inc/datalock.hxx68
-rw-r--r--configmgr/source/inc/defaultprovider.hxx73
-rw-r--r--configmgr/source/inc/emptylayer.hxx53
-rw-r--r--configmgr/source/inc/filehelper.hxx114
-rw-r--r--configmgr/source/inc/flags.hxx133
-rw-r--r--configmgr/source/inc/interactionrequest.hxx163
-rw-r--r--configmgr/source/inc/logger.hxx113
-rw-r--r--configmgr/source/inc/matchlocale.hxx215
-rw-r--r--configmgr/source/inc/mergechange.hxx68
-rw-r--r--configmgr/source/inc/mergeddataprovider.hxx173
-rw-r--r--configmgr/source/inc/namecreator.hxx73
-rw-r--r--configmgr/source/inc/node.hxx229
-rw-r--r--configmgr/source/inc/nodechange.hxx157
-rw-r--r--configmgr/source/inc/nodechangeinfo.hxx246
-rw-r--r--configmgr/source/inc/noderef.hxx268
-rw-r--r--configmgr/source/inc/options.hxx102
-rw-r--r--configmgr/source/inc/oslstream.hxx131
-rw-r--r--configmgr/source/inc/propertysethelper.hxx110
-rw-r--r--configmgr/source/inc/request.hxx152
-rw-r--r--configmgr/source/inc/requestoptions.hxx121
-rw-r--r--configmgr/source/inc/requesttypes.hxx234
-rw-r--r--configmgr/source/inc/roottree.hxx112
-rw-r--r--configmgr/source/inc/sequence.hxx105
-rw-r--r--configmgr/source/inc/serviceinfohelper.hxx135
-rw-r--r--configmgr/source/inc/simpleinteractionrequest.hxx101
-rw-r--r--configmgr/source/inc/stack.hxx58
-rw-r--r--configmgr/source/inc/strdecl.hxx60
-rw-r--r--configmgr/source/inc/strings.hxx74
-rw-r--r--configmgr/source/inc/template.hxx107
-rw-r--r--configmgr/source/inc/tracer.hxx135
-rw-r--r--configmgr/source/inc/tree.hxx665
-rw-r--r--configmgr/source/inc/treeactions.hxx89
-rw-r--r--configmgr/source/inc/treechangefactory.hxx104
-rw-r--r--configmgr/source/inc/treechangelist.hxx120
-rw-r--r--configmgr/source/inc/treefragment.hxx138
-rw-r--r--configmgr/source/inc/treemanager.hxx157
-rw-r--r--configmgr/source/inc/treenodefactory.hxx96
-rw-r--r--configmgr/source/inc/treesegment.hxx73
-rw-r--r--configmgr/source/inc/typeconverter.hxx80
-rw-r--r--configmgr/source/inc/updatehelper.hxx46
-rw-r--r--configmgr/source/inc/utility.hxx50
-rw-r--r--configmgr/source/inc/valuenode.hxx293
-rw-r--r--configmgr/source/inc/valueref.hxx132
-rw-r--r--configmgr/source/inc/valuetypeconverter.hxx155
-rw-r--r--configmgr/source/inc/wrapexception.hxx128
-rw-r--r--configmgr/source/localbe/localdataimportsvc.cxx357
-rw-r--r--configmgr/source/localbe/localdataimportsvc.hxx98
-rw-r--r--configmgr/source/localbe/localfilehelper.cxx242
-rw-r--r--configmgr/source/localbe/localfilehelper.hxx124
-rw-r--r--configmgr/source/localbe/localfilelayer.cxx608
-rw-r--r--configmgr/source/localbe/localfilelayer.hxx492
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.cxx533
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.hxx100
-rw-r--r--configmgr/source/localbe/localmultistratum.cxx247
-rw-r--r--configmgr/source/localbe/localmultistratum.hxx97
-rw-r--r--configmgr/source/localbe/localoutputstream.cxx196
-rw-r--r--configmgr/source/localbe/localoutputstream.hxx103
-rw-r--r--configmgr/source/localbe/localschemasupplier.cxx288
-rw-r--r--configmgr/source/localbe/localschemasupplier.hxx115
-rw-r--r--configmgr/source/localbe/localsinglebackend.cxx798
-rw-r--r--configmgr/source/localbe/localsinglebackend.hxx245
-rw-r--r--configmgr/source/localbe/localsinglestratum.cxx230
-rw-r--r--configmgr/source/localbe/localsinglestratum.hxx147
-rw-r--r--configmgr/source/localbe/localstratumbase.cxx253
-rw-r--r--configmgr/source/localbe/localstratumbase.hxx199
-rw-r--r--configmgr/source/localbe/makefile.mk57
-rw-r--r--configmgr/source/localizedpropertynode.cxx87
-rw-r--r--configmgr/source/localizedpropertynode.hxx76
-rw-r--r--configmgr/source/localizedvaluenode.cxx78
-rw-r--r--configmgr/source/localizedvaluenode.hxx66
-rw-r--r--configmgr/source/lock.cxx39
-rw-r--r--configmgr/source/lock.hxx41
-rw-r--r--configmgr/source/makefile.mk83
-rw-r--r--configmgr/source/misc/anypair.cxx688
-rw-r--r--configmgr/source/misc/bootstrap.cxx701
-rw-r--r--configmgr/source/misc/bootstrapcontext.cxx414
-rw-r--r--configmgr/source/misc/bufferedfile.cxx130
-rw-r--r--configmgr/source/misc/configinteractionhandler.cxx112
-rw-r--r--configmgr/source/misc/configunoreg.cxx386
-rw-r--r--configmgr/source/misc/filehelper.cxx387
-rw-r--r--configmgr/source/misc/interactionrequest.cxx115
-rw-r--r--configmgr/source/misc/logger.cxx93
-rw-r--r--configmgr/source/misc/makefile.mk73
-rw-r--r--configmgr/source/misc/mergechange.cxx828
-rw-r--r--configmgr/source/misc/oslstream.cxx261
-rw-r--r--configmgr/source/misc/propertysethelper.cxx131
-rw-r--r--configmgr/source/misc/providerfactory.cxx241
-rw-r--r--configmgr/source/misc/providerfactory.hxx88
-rw-r--r--configmgr/source/misc/providerwrapper.cxx193
-rw-r--r--configmgr/source/misc/providerwrapper.hxx98
-rw-r--r--configmgr/source/misc/requestoptions.cxx104
-rw-r--r--configmgr/source/misc/serviceinfohelper.cxx189
-rw-r--r--configmgr/source/misc/simpleinteractionrequest.cxx97
-rw-r--r--configmgr/source/misc/strimpl.cxx60
-rw-r--r--configmgr/source/misc/tracer.cxx471
-rw-r--r--configmgr/source/modifications.cxx66
-rw-r--r--configmgr/source/modifications.hxx65
-rw-r--r--configmgr/source/node.cxx108
-rw-r--r--configmgr/source/node.hxx86
-rw-r--r--configmgr/source/nodemap.cxx50
-rw-r--r--configmgr/source/nodemap.hxx49
-rw-r--r--configmgr/source/pad.cxx91
-rw-r--r--configmgr/source/pad.hxx61
-rw-r--r--configmgr/source/parsemanager.cxx85
-rw-r--r--configmgr/source/parsemanager.hxx69
-rw-r--r--configmgr/source/parser.hxx62
-rw-r--r--configmgr/source/path.hxx43
-rw-r--r--configmgr/source/platformbe/componentdefn.cxx90
-rw-r--r--configmgr/source/platformbe/exports.dxp3
-rw-r--r--configmgr/source/platformbe/makefile.mk72
-rw-r--r--configmgr/source/platformbe/sysmgr1.uno.xml49
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.cxx366
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.hxx161
-rw-r--r--configmgr/source/propertynode.cxx110
-rw-r--r--configmgr/source/propertynode.hxx83
-rw-r--r--configmgr/source/registry/cfgregistrykey.cxx1479
-rw-r--r--configmgr/source/registry/cfgregistrykey.hxx244
-rw-r--r--configmgr/source/registry/configregistry.cxx376
-rw-r--r--configmgr/source/registry/configregistry.hxx118
-rw-r--r--configmgr/source/registry/makefile.mk48
-rw-r--r--configmgr/source/rootaccess.cxx319
-rw-r--r--configmgr/source/rootaccess.hxx155
-rw-r--r--configmgr/source/services.cxx118
-rw-r--r--configmgr/source/setnode.cxx126
-rw-r--r--configmgr/source/setnode.hxx84
-rw-r--r--configmgr/source/span.hxx64
-rw-r--r--configmgr/source/tree/builddata.cxx1134
-rw-r--r--configmgr/source/tree/changes.cxx244
-rw-r--r--configmgr/source/tree/cmtree.cxx378
-rw-r--r--configmgr/source/tree/cmtreemodel.cxx371
-rw-r--r--configmgr/source/tree/localizedtreeactions.cxx543
-rw-r--r--configmgr/source/tree/makefile.mk66
-rw-r--r--configmgr/source/tree/mergehelper.cxx456
-rw-r--r--configmgr/source/tree/node.cxx535
-rw-r--r--configmgr/source/tree/nodeconverter.cxx210
-rw-r--r--configmgr/source/tree/nodevisitor.cxx104
-rw-r--r--configmgr/source/tree/subtree.hxx110
-rw-r--r--configmgr/source/tree/treeactions.cxx64
-rw-r--r--configmgr/source/tree/treechangefactory.cxx123
-rw-r--r--configmgr/source/tree/treefragment.cxx130
-rw-r--r--configmgr/source/tree/treenodefactory.cxx110
-rw-r--r--configmgr/source/tree/treesegment.cxx88
-rw-r--r--configmgr/source/tree/updatehelper.cxx622
-rw-r--r--configmgr/source/treecache/cacheaccess.cxx352
-rw-r--r--configmgr/source/treecache/cacheaccess.hxx157
-rw-r--r--configmgr/source/treecache/cachecontroller.cxx716
-rw-r--r--configmgr/source/treecache/cachecontroller.hxx338
-rw-r--r--configmgr/source/treecache/cachedata.cxx495
-rw-r--r--configmgr/source/treecache/cachedata.hxx176
-rw-r--r--configmgr/source/treecache/cachefactory.cxx75
-rw-r--r--configmgr/source/treecache/cacheline.cxx353
-rw-r--r--configmgr/source/treecache/cacheline.hxx137
-rw-r--r--configmgr/source/treecache/cachemulticaster.cxx144
-rw-r--r--configmgr/source/treecache/cachemulticaster.hxx88
-rw-r--r--configmgr/source/treecache/cachewritescheduler.cxx213
-rw-r--r--configmgr/source/treecache/cachewritescheduler.hxx125
-rw-r--r--configmgr/source/treecache/disposetimer.cxx302
-rw-r--r--configmgr/source/treecache/disposetimer.hxx169
-rw-r--r--configmgr/source/treecache/invalidatetree.cxx173
-rw-r--r--configmgr/source/treecache/makefile.mk58
-rw-r--r--configmgr/source/treecache/timestamp.cxx60
-rw-r--r--configmgr/source/treecache/timestamp.hxx125
-rw-r--r--configmgr/source/treecache/treemanager.cxx512
-rw-r--r--configmgr/source/treemgr/collectchanges.cxx241
-rw-r--r--configmgr/source/treemgr/collectchanges.hxx121
-rw-r--r--configmgr/source/treemgr/configdefaultprovider.cxx150
-rw-r--r--configmgr/source/treemgr/configexcept.cxx181
-rw-r--r--configmgr/source/treemgr/configgroup.cxx404
-rw-r--r--configmgr/source/treemgr/configpath.cxx998
-rw-r--r--configmgr/source/treemgr/configset.cxx574
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.cxx91
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.hxx86
-rw-r--r--configmgr/source/treemgr/deferredview.cxx443
-rw-r--r--configmgr/source/treemgr/deferredview.hxx97
-rw-r--r--configmgr/source/treemgr/directview.cxx127
-rw-r--r--configmgr/source/treemgr/directview.hxx75
-rw-r--r--configmgr/source/treemgr/groupnodeimpl.hxx88
-rw-r--r--configmgr/source/treemgr/makefile.mk74
-rw-r--r--configmgr/source/treemgr/nodechange.cxx273
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.cxx785
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.hxx429
-rw-r--r--configmgr/source/treemgr/nodechangeinfo.cxx221
-rw-r--r--configmgr/source/treemgr/nodefactory.cxx133
-rw-r--r--configmgr/source/treemgr/nodefactory.hxx64
-rw-r--r--configmgr/source/treemgr/nodeimpl.cxx137
-rw-r--r--configmgr/source/treemgr/nodeimpl.hxx89
-rw-r--r--configmgr/source/treemgr/nodeimplobj.cxx1162
-rw-r--r--configmgr/source/treemgr/nodeimplobj.hxx198
-rw-r--r--configmgr/source/treemgr/noderef.cxx917
-rw-r--r--configmgr/source/treemgr/readonlyview.cxx105
-rw-r--r--configmgr/source/treemgr/readonlyview.hxx71
-rw-r--r--configmgr/source/treemgr/roottree.cxx171
-rw-r--r--configmgr/source/treemgr/roottreeimpl.hxx67
-rw-r--r--configmgr/source/treemgr/setnodeimpl.cxx994
-rw-r--r--configmgr/source/treemgr/setnodeimpl.hxx306
-rw-r--r--configmgr/source/treemgr/template.cxx124
-rw-r--r--configmgr/source/treemgr/templateimpl.cxx361
-rw-r--r--configmgr/source/treemgr/templateimpl.hxx172
-rw-r--r--configmgr/source/treemgr/treeimpl.cxx1370
-rw-r--r--configmgr/source/treemgr/valuemembernode.cxx333
-rw-r--r--configmgr/source/treemgr/valuemembernode.hxx114
-rw-r--r--configmgr/source/treemgr/valuenodeimpl.hxx69
-rw-r--r--configmgr/source/treemgr/viewaccess.hxx228
-rw-r--r--configmgr/source/treemgr/viewnode.cxx105
-rw-r--r--configmgr/source/treemgr/viewnode.hxx200
-rw-r--r--configmgr/source/treemgr/viewstrategy.cxx620
-rw-r--r--configmgr/source/treemgr/viewstrategy.hxx228
-rw-r--r--configmgr/source/type.cxx187
-rw-r--r--configmgr/source/type.hxx56
-rw-r--r--configmgr/source/update.cxx66
-rw-r--r--configmgr/source/valueparser.cxx476
-rw-r--r--configmgr/source/valueparser.hxx94
-rw-r--r--configmgr/source/writemodfile.cxx631
-rw-r--r--configmgr/source/writemodfile.hxx45
-rw-r--r--configmgr/source/xcdparser.cxx183
-rw-r--r--configmgr/source/xcdparser.hxx78
-rw-r--r--configmgr/source/xcsparser.cxx598
-rw-r--r--configmgr/source/xcsparser.hxx106
-rw-r--r--configmgr/source/xcuparser.cxx1077
-rw-r--r--configmgr/source/xcuparser.hxx142
-rw-r--r--configmgr/source/xml/basicparser.cxx533
-rw-r--r--configmgr/source/xml/basicparser.hxx175
-rw-r--r--configmgr/source/xml/elementformatter.cxx321
-rw-r--r--configmgr/source/xml/elementformatter.hxx115
-rw-r--r--configmgr/source/xml/elementinfo.hxx116
-rw-r--r--configmgr/source/xml/elementparser.cxx582
-rw-r--r--configmgr/source/xml/elementparser.hxx122
-rw-r--r--configmgr/source/xml/layerparser.cxx368
-rw-r--r--configmgr/source/xml/layerparser.hxx116
-rw-r--r--configmgr/source/xml/layerwriter.cxx541
-rw-r--r--configmgr/source/xml/layerwriter.hxx166
-rw-r--r--configmgr/source/xml/makefile.mk66
-rw-r--r--configmgr/source/xml/matchlocale.cxx384
-rw-r--r--configmgr/source/xml/parsersvc.cxx382
-rw-r--r--configmgr/source/xml/parsersvc.hxx114
-rw-r--r--configmgr/source/xml/schemaparser.cxx406
-rw-r--r--configmgr/source/xml/schemaparser.hxx132
-rw-r--r--configmgr/source/xml/simpletypehelper.cxx54
-rw-r--r--configmgr/source/xml/typeconverter.cxx351
-rw-r--r--configmgr/source/xml/valueconverter.cxx501
-rw-r--r--configmgr/source/xml/valueformatter.cxx495
-rw-r--r--configmgr/source/xml/valueformatter.hxx81
-rw-r--r--configmgr/source/xml/writersvc.cxx258
-rw-r--r--configmgr/source/xml/writersvc.hxx121
-rw-r--r--configmgr/source/xml/xmlstrings.cxx137
-rw-r--r--configmgr/source/xml/xmlstrings.hxx131
-rw-r--r--configmgr/source/xmldata.cxx204
-rw-r--r--configmgr/source/xmldata.hxx58
-rw-r--r--configmgr/source/xmlreader.cxx1054
-rw-r--r--configmgr/source/xmlreader.hxx186
-rw-r--r--configmgr/util/cfgmgr.mxp.map4
-rw-r--r--configmgr/util/configmgr.map8
-rw-r--r--configmgr/util/configmgr2.uno.xml582
-rw-r--r--configmgr/util/configmgrl.map8
-rw-r--r--configmgr/util/exports.dxp3
-rw-r--r--configmgr/util/makefile.mk78
-rw-r--r--configmgr/workben/apitest/cfgadduser.cxx355
-rw-r--r--configmgr/workben/apitest/cfgadmin.cxx517
-rw-r--r--configmgr/workben/apitest/cfgapi.cxx865
-rw-r--r--configmgr/workben/apitest/cfgapi_timetest.cxx957
-rw-r--r--configmgr/workben/apitest/cfgregistry.cxx169
-rw-r--r--configmgr/workben/apitest/cfgupdate.cxx432
-rw-r--r--configmgr/workben/apitest/makefile.mk124
-rw-r--r--configmgr/workben/apitest/sregistry8
-rw-r--r--configmgr/workben/local_io/cfgfile.cxx94
-rw-r--r--configmgr/workben/local_io/cfglocal.cxx620
-rw-r--r--configmgr/workben/local_io/com.sun.star.office.Setup.xml29
-rw-r--r--configmgr/workben/local_io/filetest.cxx90
-rw-r--r--configmgr/workben/local_io/makefile.mk110
-rw-r--r--configmgr/workben/local_io/org.openoffice.test.xml70
-rw-r--r--configmgr/workben/local_io/simpletest.cxx758
-rw-r--r--configmgr/workben/local_io/xmlexport.cxx236
-rw-r--r--configmgr/workben/local_io/xmlimport.cxx469
-rw-r--r--configmgr/workben/logger/exports.dxp3
-rw-r--r--configmgr/workben/logger/loggerdfn.cxx151
-rw-r--r--configmgr/workben/logger/makefile.mk69
-rw-r--r--configmgr/workben/logger/simplelogger.cxx174
-rw-r--r--configmgr/workben/logger/simplelogger.hxx86
-rw-r--r--configmgr/workben/memory/logmechanism.hxx102
-rw-r--r--configmgr/workben/memory/main.cxx77
-rw-r--r--configmgr/workben/memory/makefile.mk255
-rw-r--r--configmgr/workben/memory/memorymeasure.hxx225
-rw-r--r--configmgr/workben/memory/memorytests.cxx1241
-rw-r--r--configmgr/workben/memory/testmodules.cxx84
-rw-r--r--configmgr/workben/memory/treeload.cxx81
-rw-r--r--configmgr/workben/memory/treeload.hxx41
-rw-r--r--configure.in24
-rw-r--r--connectivity/prj/d.lst2
-rwxr-xr-xconnectivity/util/langfilter.xsl37
-rwxr-xr-xconnectivity/util/makefile.mk91
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx20
-rwxr-xr-xcpputools/source/regcomplazy/regcomplazy.cxx62
-rwxr-xr-xcrashrep/prj/build.lst1
-rwxr-xr-xcrashrep/source/unx/crash_report.sh (renamed from crashrep/scripts/crash_report.sh)0
-rwxr-xr-xcrashrep/source/unx/interface.cxx715
-rwxr-xr-xcrashrep/source/unx/interface.hxx189
-rwxr-xr-xcrashrep/source/unx/makefile.mk5
-rwxr-xr-xcrashrep/source/unx/res.cxx130
-rwxr-xr-xcrashrep/source/unx/res/unxcrashres.cxx101
-rw-r--r--cui/source/options/optsave.cxx12
-rw-r--r--desktop/prj/build.lst2
-rw-r--r--desktop/source/app/userinstall.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx18
-rw-r--r--desktop/source/deployment/makefile.mk3
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx12
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx170
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx583
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx6
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h14
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx8
-rw-r--r--desktop/source/pagein/makefile.mk2
-rw-r--r--extensions/source/config/ldap/componentdef.cxx51
-rw-r--r--extensions/source/config/ldap/ldapaccess.cxx76
-rw-r--r--extensions/source/config/ldap/ldapaccess.hxx37
-rw-r--r--extensions/source/config/ldap/ldapbe2.uno.xml45
-rw-r--r--extensions/source/config/ldap/ldapuserprof.cxx226
-rw-r--r--extensions/source/config/ldap/ldapuserprof.hxx163
-rw-r--r--extensions/source/config/ldap/ldapuserprofilebe.cxx321
-rw-r--r--extensions/source/config/ldap/ldapuserprofilebe.hxx112
-rw-r--r--extensions/source/config/ldap/ldapuserprofilelayer.cxx244
-rw-r--r--extensions/source/config/ldap/ldapuserprofilelayer.hxx121
-rw-r--r--extensions/source/config/ldap/makefile.mk4
-rw-r--r--extensions/source/config/ldap/propertysethelper.cxx150
-rw-r--r--extensions/source/config/ldap/propertysethelper.hxx134
-rw-r--r--extensions/source/oooimprovement/Jobs.xcu1
-rw-r--r--external/prj/build.lst2
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx180
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu2
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu2
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu2
-rw-r--r--filter/source/config/fragments/types/svm_StarView_Metafile.xcu2
-rwxr-xr-xfilter/source/config/tools/merge/pyAltFCFGMerge1
-rw-r--r--filter/source/msfilter/escherex.cxx298
-rw-r--r--filter/source/msfilter/eschesdo.cxx76
-rw-r--r--filter/source/msfilter/eschesdo.hxx3
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx5
-rw-r--r--framework/source/classes/addonmenu.cxx3
-rw-r--r--instsetoo_native/inc_ooolangpack/windows/msi_templates/codes.txt123
-rw-r--r--instsetoo_native/inc_ooolangpack/windows/msi_templates/codes_ooodev.txt123
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt123
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/InstallE.idt143
-rw-r--r--instsetoo_native/inc_openoffice/windows/msi_templates/upgradecode_remove_ooo.txt123
-rw-r--r--instsetoo_native/util/openoffice.lst4
-rw-r--r--jpeg/jpeg-6b.patch117
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx16
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx25
-rw-r--r--l10ntools/source/filter/utils/XMLHelper.java2
-rw-r--r--libxmlsec/makefile.mk1
-rw-r--r--linguistic/source/lngsvcmgr.cxx11
-rw-r--r--moz/makefile.mk2
-rw-r--r--odk/docs/images/sdk_head-1.gifbin10980 -> 10949 bytes
-rw-r--r--odk/docs/install.html4
-rw-r--r--odk/docs/notsupported.html2
-rw-r--r--odk/docs/tools.html5
-rw-r--r--odk/examples/DevelopersGuide/examples.html4
-rw-r--r--odk/examples/examples.html4
-rw-r--r--odk/index.html8
-rw-r--r--odk/pack/copying/apiref-autodoc.since27
-rw-r--r--odk/pack/copying/makefile.mk7
-rw-r--r--odk/util/makefile.pmk2
-rw-r--r--offapi/com/sun/star/configuration/ConfigurationRegistry.idl4
-rw-r--r--offapi/com/sun/star/text/RedlinePortion.idl4
-rw-r--r--offapi/com/sun/star/text/XFormField.idl36
-rw-r--r--offapi/type_reference/typelibrary_history.txt10
-rw-r--r--offapi/type_reference/types.rdbbin6717440 -> 7307264 bytes
-rw-r--r--officecfg/prj/d.lst6
-rw-r--r--officecfg/registry/component-schema.dtd151
-rw-r--r--officecfg/registry/component-schema.xsd224
-rw-r--r--officecfg/registry/component-types.xsd135
-rw-r--r--officecfg/registry/component-update.dtd144
-rw-r--r--officecfg/registry/component-update.xsd113
-rw-r--r--officecfg/registry/data.dtd40
-rw-r--r--officecfg/registry/data/org/openoffice/Inet.xcu64
-rw-r--r--officecfg/registry/data/org/openoffice/LDAP.xcu.sample70
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu125
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Labels.xcu4631
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Paths.xcu9
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Recovery.xcu42
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu23
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu14
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu74
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk7
-rw-r--r--officecfg/registry/data/org/openoffice/Setup.xcu17
-rw-r--r--officecfg/registry/data/org/openoffice/System.xcu45
-rw-r--r--officecfg/registry/data/org/openoffice/UserProfile.xcu7
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu9
-rw-r--r--officecfg/registry/data/org/openoffice/makefile.mk19
-rw-r--r--officecfg/registry/schema/oo-ad-ldap-attr.map50
-rw-r--r--officecfg/registry/schema/oo-ad-ldap.xcd.sample153
-rw-r--r--officecfg/registry/schema/oo-ldap-attr.map50
-rw-r--r--officecfg/registry/schema/oo-ldap.xcd.sample156
-rw-r--r--officecfg/registry/schema/org/openoffice/LDAP.xcs2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Chart.xcs3
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Writer.xcs8
-rw-r--r--officecfg/util/alllang.xsl3
-rw-r--r--officecfg/util/data_val.xsl3
-rw-r--r--oox/inc/oox/drawingml/chart/chartconverter.hxx34
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx126
-rw-r--r--oox/inc/oox/drawingml/chart/chartspaceconverter.hxx8
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacemodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx6
-rw-r--r--oox/inc/oox/drawingml/drawingmltypes.hxx31
-rw-r--r--oox/inc/oox/drawingml/graphicshapecontext.hxx9
-rw-r--r--oox/inc/oox/drawingml/shape.hxx9
-rw-r--r--oox/inc/oox/dump/dffdumper.hxx7
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx37
-rw-r--r--oox/inc/oox/ppt/pptshape.hxx2
-rw-r--r--oox/inc/oox/xls/drawingfragment.hxx18
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx2
-rw-r--r--oox/source/core/xmlfilterbase.cxx1
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx12
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx239
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx63
-rw-r--r--oox/source/drawingml/chart/chartspacefragment.cxx3
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx23
-rw-r--r--oox/source/drawingml/chart/makefile.mk1
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx33
-rw-r--r--oox/source/drawingml/shape.cxx28
-rw-r--r--oox/source/drawingml/shapegroupcontext.cxx2
-rw-r--r--oox/source/dump/biffdumper.ini7
-rw-r--r--oox/source/dump/dffdumper.cxx239
-rw-r--r--oox/source/dump/dffdumper.ini712
-rw-r--r--oox/source/dump/dumperbase.cxx180
-rw-r--r--oox/source/dump/dumperbase.ini40
-rw-r--r--oox/source/dump/oledumper.cxx10
-rw-r--r--oox/source/dump/oledumper.ini34
-rw-r--r--oox/source/ppt/pptshape.cxx6
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx2
-rw-r--r--oox/source/ppt/slidepersist.cxx4
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx4
-rw-r--r--oox/source/token/gennamespaces.pl1
-rw-r--r--oox/source/token/namespaces.txt1
-rw-r--r--oox/source/xls/drawingfragment.cxx60
-rw-r--r--oox/source/xls/workbookhelper.cxx7
-rw-r--r--postprocess/packregistry/makefile.mk531
-rw-r--r--postprocess/prj/build.lst1
-rw-r--r--postprocess/prj/d.lst3
-rw-r--r--qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.ConfigurationProvider.csv45
-rw-r--r--qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.DefaultProvider.csv (renamed from configmgr/source/api/makefile.mk)30
-rw-r--r--qadevOOo/runner/base/basic_fat.java3
-rw-r--r--qadevOOo/runner/base/java_cmp.java5
-rw-r--r--qadevOOo/runner/base/java_fat.java294
-rw-r--r--qadevOOo/runner/base/java_fat_service.java37
-rw-r--r--qadevOOo/runner/basicrunner/basichelper/Filter.java4
-rw-r--r--qadevOOo/runner/complexlib/ComplexTestCase.java100
-rw-r--r--qadevOOo/runner/convwatch/BuildID.java44
-rw-r--r--qadevOOo/runner/convwatch/IniFile.java28
-rw-r--r--qadevOOo/runner/convwatch/OfficePrint.java10
-rw-r--r--qadevOOo/runner/convwatch/PerformanceContainer.java27
-rw-r--r--qadevOOo/runner/convwatch/PixelCounter.java31
-rw-r--r--qadevOOo/runner/graphical/BuildID.java112
-rw-r--r--qadevOOo/runner/graphical/IniFile.java46
-rw-r--r--qadevOOo/runner/graphical/JPEGComparator.java52
-rw-r--r--qadevOOo/runner/graphical/JPEGCreator.java67
-rw-r--r--qadevOOo/runner/graphical/MSOfficePostscriptCreator.java8
-rw-r--r--qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java9
-rw-r--r--qadevOOo/runner/graphical/PostscriptCreator.java70
-rwxr-xr-xqadevOOo/runner/helper/PropertyHelper.java12
-rw-r--r--qadevOOo/runner/lib/MultiMethodTest.java21
-rw-r--r--qadevOOo/runner/lib/MultiPropertyTest.java3
-rw-r--r--qadevOOo/runner/org/openoffice/Runner.java2
-rw-r--r--qadevOOo/runner/stats/Summarizer.java65
-rw-r--r--qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/configuration_XTemplateContainer.xba58
-rw-r--r--qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/cfgmgr2_OInnerTreeSetUpdateAccess.xba127
-rw-r--r--qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/cfgmgr2_OInnerValueSetUpdateAccess.xba150
-rw-r--r--qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/script.xlb5
-rw-r--r--qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java4
-rw-r--r--qadevOOo/tests/java/ifc/io/_XOutputStream.java3
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XComponent.java4
-rw-r--r--qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java11
-rw-r--r--qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java2
-rw-r--r--qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java3
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/AdministrationProvider.java96
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/BootstrapContext.java72
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProvider.java96
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProviderWrapper.java106
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/CopyImporter.java72
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LayerParser.java89
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LayerUpdateMerger.java85
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LayerWriter.java108
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LocalDataImporter.java79
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LocalHierarchyBrowser.java88
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LocalSchemaSupplier.java59
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleBackend.java61
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleStratum.java89
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/MergeImporter.java69
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/MultiStratumBackend.java70
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OConfigurationRegistry.java79
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupInfoAccess.java142
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupUpdateAccess.java134
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OInnerSetInfoAccess.java130
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OInnerTreeSetUpdateAccess.java126
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OInnerValueSetUpdateAccess.java216
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupInfoAccess.java176
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupUpdateAccess.java180
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ORootElementSetInfoAccess.java127
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ORootElementTreeSetUpdateAccess.java128
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/ORootElementValueSetUpdateAccess.java193
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupInfoAccess.java234
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupUpdateAccess.java132
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OSetElementSetInfoAccess.java145
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/OSetElementTreeSetUpdateAccess.java135
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/SchemaParser.java75
-rw-r--r--qadevOOo/tests/java/mod/_cfgmgr2/SingleBackendAdapter.java80
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java57
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java54
-rw-r--r--qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java51
-rw-r--r--qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java1
-rw-r--r--qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java1
-rw-r--r--qadevOOo/tests/java/mod/_remotebridge.uno/various.java2
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java3
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java4
-rw-r--r--qadevOOo/tests/java/mod/_streams.uno/Pipe.java2
-rw-r--r--qadevOOo/tests/java/mod/_sysmgr1/SystemIntegration.java65
-rw-r--r--reportbuilder/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu46
-rw-r--r--sal/inc/osl/diagnose.hxx14
-rw-r--r--sal/inc/osl/file.h8
-rw-r--r--sal/osl/unx/file.cxx23
-rw-r--r--sal/osl/unx/signal.c11
-rw-r--r--sal/osl/unx/socket.c4
-rw-r--r--sal/osl/w32/file_dirvol.cxx217
-rw-r--r--sal/osl/w32/file_url.cxx325
-rw-r--r--sal/osl/w32/file_url.h6
-rw-r--r--sal/osl/w32/module.cxx (renamed from sal/osl/w32/module.c)71
-rw-r--r--sal/osl/w32/path_helper.hxx40
-rw-r--r--sal/osl/w32/process.cxx (renamed from sal/osl/w32/process.c)88
-rw-r--r--sal/osl/w32/profile.cxx (renamed from sal/osl/w32/profile.c)298
-rw-r--r--sal/osl/w32/signal.cxx (renamed from sal/osl/w32/signal.c)67
-rw-r--r--sal/osl/w32/system.h12
-rw-r--r--sal/osl/w32/tempfile.cxx28
-rw-r--r--sal/rtl/source/hash.cxx70
-rw-r--r--sal/rtl/source/hash.h10
-rw-r--r--sal/rtl/source/ustring.c16
-rw-r--r--sc/source/filter/excel/excdoc.cxx36
-rw-r--r--sc/source/filter/excel/excrecds.cxx5
-rw-r--r--sc/source/filter/excel/exctools.cxx3
-rw-r--r--sc/source/filter/excel/expop2.cxx7
-rw-r--r--sc/source/filter/excel/impop.cxx2
-rw-r--r--sc/source/filter/excel/read.cxx31
-rw-r--r--sc/source/filter/excel/xechart.cxx60
-rw-r--r--sc/source/filter/excel/xeescher.cxx367
-rw-r--r--sc/source/filter/excel/xerecord.cxx15
-rw-r--r--sc/source/filter/excel/xeroot.cxx13
-rw-r--r--sc/source/filter/excel/xichart.cxx177
-rw-r--r--sc/source/filter/excel/xicontent.cxx2
-rw-r--r--sc/source/filter/excel/xiescher.cxx1013
-rw-r--r--sc/source/filter/excel/xipage.cxx2
-rw-r--r--sc/source/filter/excel/xipivot.cxx2
-rw-r--r--sc/source/filter/excel/xiroot.cxx6
-rw-r--r--sc/source/filter/excel/xlchart.cxx10
-rw-r--r--sc/source/filter/excel/xlescher.cxx58
-rw-r--r--sc/source/filter/inc/root.hxx7
-rw-r--r--sc/source/filter/inc/xcl97esc.hxx205
-rw-r--r--sc/source/filter/inc/xcl97rec.hxx118
-rw-r--r--sc/source/filter/inc/xechart.hxx22
-rw-r--r--sc/source/filter/inc/xeescher.hxx206
-rw-r--r--sc/source/filter/inc/xerecord.hxx3
-rw-r--r--sc/source/filter/inc/xeroot.hxx5
-rw-r--r--sc/source/filter/inc/xichart.hxx44
-rw-r--r--sc/source/filter/inc/xiescher.hxx327
-rw-r--r--sc/source/filter/inc/xiroot.hxx3
-rw-r--r--sc/source/filter/inc/xlchart.hxx3
-rw-r--r--sc/source/filter/inc/xlescher.hxx13
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx354
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx291
-rw-r--r--scp2/macros/macro.pl20
-rw-r--r--scp2/source/base/file_base.scp35
-rw-r--r--scp2/source/base/module_base.scp5
-rw-r--r--scp2/source/binfilter/file_binfilter.scp120
-rw-r--r--scp2/source/binfilter/module_binfilter.scp17
-rw-r--r--scp2/source/calc/file_calc.scp77
-rw-r--r--scp2/source/calc/module_calc.scp6
-rw-r--r--scp2/source/canvas/canvascommons.scp13
-rw-r--r--scp2/source/crashrep/file_crashrep.scp (renamed from scp2/source/crashrep/file_crashrep_dynamic.scp)0
-rw-r--r--scp2/source/crashrep/file_crashrep_static.scp54
-rw-r--r--scp2/source/crashrep/makefile.mk2
-rw-r--r--scp2/source/draw/file_draw.scp56
-rw-r--r--scp2/source/draw/module_draw.scp6
-rw-r--r--scp2/source/gnome/file_gnome.scp9
-rw-r--r--scp2/source/gnome/makefile.mk4
-rw-r--r--scp2/source/gnome/module_gnome.scp14
-rw-r--r--scp2/source/graphicfilter/file_graphicfilter.scp27
-rw-r--r--scp2/source/graphicfilter/module_graphicfilter.scp3
-rw-r--r--scp2/source/impress/file_impress.scp69
-rw-r--r--scp2/source/impress/module_impress.scp6
-rw-r--r--scp2/source/impress/module_ogltrans.scp8
-rw-r--r--scp2/source/javafilter/file_javafilter.scp39
-rw-r--r--scp2/source/javafilter/module_javafilter.scp6
-rw-r--r--scp2/source/math/file_math.scp70
-rw-r--r--scp2/source/math/module_math.scp6
-rw-r--r--scp2/source/onlineupdate/file_onlineupdate.scp13
-rw-r--r--scp2/source/onlineupdate/module_onlineupdate.scp3
-rw-r--r--scp2/source/ooo/common_brand.scp162
-rw-r--r--scp2/source/ooo/directory_ooo.scp295
-rw-r--r--scp2/source/ooo/file_extra_ooo.scp22
-rw-r--r--scp2/source/ooo/file_improvement.scp15
-rwxr-xr-xscp2/source/ooo/file_library_ooo.scp119
-rw-r--r--scp2/source/ooo/file_ooo.scp1152
-rw-r--r--scp2/source/ooo/makefile.mk4
-rw-r--r--scp2/source/ooo/module_hidden_ooo.scp167
-rw-r--r--scp2/source/ooo/module_improvement.scp2
-rwxr-xr-xscp2/source/ooo/module_lang_template.scp3
-rw-r--r--scp2/source/ooo/profile_ooo.scp11
-rw-r--r--scp2/source/ooo/profileitem_ooo.scp256
-rw-r--r--scp2/source/python/file_python.scp6
-rw-r--r--scp2/source/python/module_python.scp2
-rw-r--r--scp2/source/writer/file_writer.scp167
-rw-r--r--scp2/source/writer/module_writer.scp16
-rw-r--r--scp2/source/xsltfilter/file_xsltfilter.scp13
-rw-r--r--scp2/source/xsltfilter/module_xsltfilter.scp3
-rw-r--r--scp2/util/makefile.mk4
-rw-r--r--sd/source/filter/eppt/eppt.cxx4
-rw-r--r--sd/source/filter/eppt/epptso.cxx20
-rw-r--r--sd/source/filter/eppt/escherex.cxx82
-rw-r--r--sd/source/filter/eppt/escherex.hxx7
-rw-r--r--setup_native/scripts/javaloader.sh4
-rw-r--r--setup_native/source/mac/macinstall.ulf2
-rw-r--r--sfx2/source/appl/appserv.cxx6
-rw-r--r--sfx2/source/appl/sfxhelp.cxx3
-rw-r--r--sfx2/source/bastyp/helper.cxx14
-rw-r--r--shell/source/backends/desktopbe/desktopbackend.cxx290
-rw-r--r--shell/source/backends/desktopbe/desktopbe.xml37
-rw-r--r--shell/source/backends/desktopbe/desktopbe1-ucd.txt3
-rw-r--r--shell/source/backends/desktopbe/desktopbecdef.cxx202
-rw-r--r--shell/source/backends/desktopbe/exports.map10
-rw-r--r--shell/source/backends/desktopbe/makefile.mk58
-rw-r--r--shell/source/backends/gconfbe/exports.map10
-rw-r--r--shell/source/backends/gconfbe/gconfaccess.cxx (renamed from shell/source/backends/gconfbe/gconflayer.cxx)586
-rw-r--r--shell/source/backends/gconfbe/gconfaccess.hxx119
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.cxx1178
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.hxx223
-rw-r--r--shell/source/backends/gconfbe/gconfbe.xml35
-rw-r--r--shell/source/backends/gconfbe/gconfbecdef.cxx148
-rw-r--r--shell/source/backends/gconfbe/gconflayer.hxx133
-rw-r--r--shell/source/backends/gconfbe/makefile.mk9
-rw-r--r--shell/source/backends/kde4be/exports.map10
-rw-r--r--shell/source/backends/kde4be/kde4access.cxx319
-rw-r--r--shell/source/backends/kde4be/kde4access.hxx47
-rw-r--r--shell/source/backends/kde4be/kde4backend.cxx337
-rw-r--r--shell/source/backends/kde4be/kde4backend.hxx120
-rw-r--r--shell/source/backends/kde4be/kde4be.xml35
-rw-r--r--shell/source/backends/kde4be/kde4becdef.cxx140
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.cxx154
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.hxx51
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.cxx252
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.hxx59
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.cxx121
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.hxx79
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.cxx112
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.hxx53
-rw-r--r--shell/source/backends/kde4be/makefile.mk17
-rw-r--r--shell/source/backends/kdebe/exports.map10
-rw-r--r--shell/source/backends/kdebe/kdeaccess.cxx315
-rw-r--r--shell/source/backends/kdebe/kdeaccess.hxx47
-rw-r--r--shell/source/backends/kdebe/kdebackend.cxx337
-rw-r--r--shell/source/backends/kdebe/kdebackend.hxx125
-rw-r--r--shell/source/backends/kdebe/kdebe.xml35
-rw-r--r--shell/source/backends/kdebe/kdebecdef.cxx140
-rw-r--r--shell/source/backends/kdebe/kdecommonlayer.cxx150
-rw-r--r--shell/source/backends/kdebe/kdecommonlayer.hxx56
-rw-r--r--shell/source/backends/kdebe/kdeinetlayer.cxx251
-rwxr-xr-xshell/source/backends/kdebe/kdeinetlayer.hxx62
-rw-r--r--shell/source/backends/kdebe/kdepathslayer.cxx118
-rw-r--r--shell/source/backends/kdebe/kdepathslayer.hxx83
-rw-r--r--shell/source/backends/kdebe/kdevcllayer.cxx113
-rw-r--r--shell/source/backends/kdebe/kdevcllayer.hxx56
-rw-r--r--shell/source/backends/kdebe/makefile.mk19
-rw-r--r--shell/source/backends/localebe/localebackend.cxx115
-rw-r--r--shell/source/backends/localebe/localebackend.hxx94
-rw-r--r--shell/source/backends/localebe/localebe.xml1
-rw-r--r--shell/source/backends/localebe/localebecdef.cxx44
-rw-r--r--shell/source/backends/localebe/localelayer.cxx85
-rw-r--r--shell/source/backends/localebe/localelayer.hxx64
-rw-r--r--shell/source/backends/localebe/makefile.mk5
-rw-r--r--shell/source/backends/macbe/macbackend.cxx447
-rw-r--r--shell/source/backends/macbe/macbackend.hxx86
-rw-r--r--shell/source/backends/macbe/macbe.xml1
-rw-r--r--shell/source/backends/macbe/macbecdef.cxx43
-rw-r--r--shell/source/backends/macbe/macbelayer.cxx440
-rw-r--r--shell/source/backends/macbe/macbelayer.hxx101
-rw-r--r--shell/source/backends/macbe/makefile.mk3
-rw-r--r--shell/source/backends/wininetbe/makefile.mk5
-rw-r--r--shell/source/backends/wininetbe/wininetbackend.cxx361
-rw-r--r--shell/source/backends/wininetbe/wininetbackend.hxx118
-rw-r--r--shell/source/backends/wininetbe/wininetbe.xml1
-rw-r--r--shell/source/backends/wininetbe/wininetbecdef.cxx43
-rw-r--r--shell/source/backends/wininetbe/wininetlayer.cxx374
-rw-r--r--shell/source/backends/wininetbe/wininetlayer.hxx73
-rwxr-xr-xsmoketestoo_native/config.pl186
-rw-r--r--smoketestoo_native/data/Common.xcu25
-rw-r--r--smoketestoo_native/data/Settings.xcu11
-rw-r--r--smoketestoo_native/data/Setup.xcu11
-rwxr-xr-xsmoketestoo_native/smoketest.pl2
-rwxr-xr-xsolenv/bin/deliver.pl86
-rwxr-xr-xsolenv/bin/linkoo5
-rw-r--r--solenv/bin/modules/installer/download.pm5
-rw-r--r--solenv/bin/modules/installer/environment.pm27
-rw-r--r--solenv/bin/modules/installer/systemactions.pm13
-rw-r--r--solenv/bin/modules/installer/windows/msiglobal.pm17
-rw-r--r--solenv/bin/modules/installer/worker.pm106
-rw-r--r--solenv/bin/packregistry.xslt81
-rw-r--r--solenv/config/sdev300.ini2
-rw-r--r--solenv/config/ssolar.cmn9
-rw-r--r--solenv/inc/libs.mk4
-rw-r--r--solenv/inc/minor.mk6
-rw-r--r--stoc/source/invocation_adapterfactory/iafactory.cxx25
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx45
-rw-r--r--svtools/source/filter.vcl/jpeg/jpegc.c44
-rw-r--r--svtools/source/filter.vcl/jpeg/makefile.mk4
-rw-r--r--sw/inc/IDocumentMarkAccess.hxx7
-rw-r--r--sw/inc/IMark.hxx7
-rw-r--r--sw/inc/crsrsh.hxx6
-rw-r--r--sw/inc/editsh.hxx4
-rw-r--r--sw/inc/hintids.hxx6
-rw-r--r--sw/inc/pam.hxx1
-rw-r--r--sw/inc/unobookmark.hxx44
-rw-r--r--sw/source/core/crsr/bookmrk.cxx73
-rw-r--r--sw/source/core/crsr/crossrefbookmark.cxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx11
-rw-r--r--sw/source/core/crsr/makefile.mk1
-rw-r--r--sw/source/core/crsr/pam.cxx40
-rw-r--r--sw/source/core/doc/docbm.cxx43
-rw-r--r--sw/source/core/edit/edtox.cxx22
-rw-r--r--sw/source/core/inc/MarkManager.hxx10
-rw-r--r--sw/source/core/inc/bookmrk.hxx60
-rw-r--r--sw/source/core/inc/crossrefbookmark.hxx6
-rw-r--r--sw/source/core/text/inftxt.cxx57
-rw-r--r--sw/source/core/text/portxt.cxx121
-rw-r--r--sw/source/core/unocore/unobkm.cxx137
-rw-r--r--sw/source/filter/ww8/escher.hxx21
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx82
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx112
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx149
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx34
-rw-r--r--sw/source/filter/ww8/ww8par.hxx60
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx171
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx105
-rw-r--r--sw/source/ui/docvw/edtwin.cxx41
-rw-r--r--sw/source/ui/inc/view.hxx4
-rw-r--r--sw/source/ui/inc/wrtsh.hxx4
-rw-r--r--sw/source/ui/uiview/viewling.cxx144
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx9
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx7
-rwxr-xr-xtestautomation/chart2/optional/ch2_lvl1.bas6
-rw-r--r--testautomation/chart2/optional/includes/ch2_lvl1a.inc117
-rw-r--r--[-rwxr-xr-x]testautomation/chart2/required/ch2_updt_calc.bas4
-rw-r--r--testautomation/chart2/required/includes/ch2_menu.inc6
-rw-r--r--testautomation/chart2/required/includes/ch2_toolbars.inc133
-rw-r--r--testautomation/chart2/tools/ch_tools_common.inc7
-rw-r--r--testautomation/framework/optional/includes/basic_delete_modules.inc28
-rw-r--r--testautomation/framework/optional/includes/basic_documents.inc59
-rw-r--r--testautomation/framework/optional/includes/f_usage_tracking.inc25
-rw-r--r--testautomation/framework/optional/includes/help_bookmarks.inc36
-rw-r--r--testautomation/framework/optional/includes/ole_1.inc74
-rw-r--r--testautomation/framework/optional/includes/security_recommend_password.inc1
-rw-r--r--testautomation/framework/required/includes/basic_macroassignment.inc36
-rw-r--r--testautomation/framework/tools/includes/help_tools.inc90
-rw-r--r--testautomation/framework/tools/includes/pbrowser_tools.inc54
-rwxr-xr-x[-rw-r--r--]testautomation/global/sid/e_all.sid3
-rw-r--r--testautomation/global/system/includes/iniinfo.inc98
-rw-r--r--testautomation/global/system/includes/master.inc2
-rw-r--r--testautomation/global/tools/includes/optional/t_filetools.inc4
-rw-r--r--testautomation/global/tools/includes/required/t_doc1.inc36
-rw-r--r--testautomation/global/tools/includes/required/t_doc2.inc18
-rw-r--r--testautomation/global/tools/includes/required/t_tools1.inc32
-rw-r--r--testautomation/global/tools/includes/required/t_tools2.inc46
-rwxr-xr-xtestautomation/global/win/bars.win3
-rw-r--r--testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc17
-rw-r--r--testautomation/spreadsheet/required/includes/c_upd_filemenu.inc2
-rw-r--r--ucb/source/core/ucbstore.cxx12
-rw-r--r--ucbhelper/source/client/content.cxx6
-rw-r--r--udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl3
-rw-r--r--unotools/source/config/configitem.cxx6
-rw-r--r--unotools/source/config/confignode.cxx3
-rw-r--r--unotools/source/config/fltrcfg.cxx2
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.java6
-rw-r--r--wizards/com/sun/star/wizards/table/CGCategory.java6
-rw-r--r--wizards/com/sun/star/wizards/table/FieldDescription.java3
-rw-r--r--wizards/com/sun/star/wizards/table/ScenarioSelector.java16
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx28
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx6
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx35
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx15
-rw-r--r--xmlhelp/source/treeview/tvread.cxx37
-rw-r--r--xmloff/inc/xmloff/odffields.hxx (renamed from configmgr/source/inc/simpletypehelper.hxx)43
-rw-r--r--xmloff/prj/d.lst1
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx46
-rw-r--r--xmloff/source/text/txtimp.cxx83
-rw-r--r--xmloff/source/text/txtparae.cxx110
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx34
-rwxr-xr-xxmlsecurity/test_docs/CAs/README.txt383
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_1/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_10/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt34
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem57
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem61
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_11/openssl.cfg295
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_2/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_3/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/README.txt4
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_4/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_5/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/README.txt5
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crlbin0 -> 316 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_6/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/README.txt10
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crlbin0 -> 353 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_7/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/README.txt9
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crlbin0 -> 353 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_8/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Root_9/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem58
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt19
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crtbin0 -> 781 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crlbin0 -> 326 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem67
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg293
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem11
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem11
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt4
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt5
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crlbin0 -> 325 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt3
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt13
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem58
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt4
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem60
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt12
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt13
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem66
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL0
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt2
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem62
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem18
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial1
-rwxr-xr-xxmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg292
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_1.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_10.crtbin0 -> 779 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_11.crtbin0 -> 779 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_2.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_3.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_4.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_5.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_6.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_7.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Root_8.crtbin0 -> 776 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crtbin0 -> 842 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crtbin0 -> 842 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crtbin0 -> 842 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crtbin0 -> 829 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crtbin0 -> 778 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crtbin0 -> 842 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crtbin0 -> 829 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Root_10.crlbin0 -> 317 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Root_11.crlbin0 -> 317 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Root_3.crlbin0 -> 316 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Root_4.crlbin0 -> 353 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Root_9.crlbin0 -> 316 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crlbin0 -> 325 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crlbin0 -> 325 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crlbin0 -> 362 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crtbin0 -> 739 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crtbin0 -> 733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crtbin0 -> 729 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crtbin0 -> 739 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crtbin0 -> 729 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crtbin0 -> 720 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crtbin0 -> 739 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crtbin0 -> 749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crtbin0 -> 714 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crtbin0 -> 710 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crtbin0 -> 699 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crtbin0 -> 706 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crtbin0 -> 828 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crtbin0 -> 726 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crtbin0 -> 673 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crtbin0 -> 726 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crtbin0 -> 710 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crtbin0 -> 727 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crtbin0 -> 739 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crtbin0 -> 733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crtbin0 -> 729 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crtbin0 -> 737 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crtbin0 -> 729 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crtbin0 -> 705 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crtbin0 -> 700 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crtbin0 -> 698 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crtbin0 -> 695 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crtbin0 -> 726 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crtbin0 -> 746 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crtbin0 -> 726 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crtbin0 -> 716 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crtbin0 -> 745 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crtbin0 -> 719 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crtbin0 -> 738 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crtbin0 -> 748 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crtbin0 -> 713 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crtbin0 -> 709 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crtbin0 -> 709 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crtbin0 -> 726 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_10_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_11_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_12_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_13_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_14_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_15_Root_11.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_16_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_17_Root_11.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_18_Root_11.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_19_Root_11.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Root_11.p12bin0 -> 1717 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12bin0 -> 1845 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12bin0 -> 1693 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_20_Root_11.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_21_Root_11.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_22_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_23_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_24_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_25_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_26_Root_11.p12bin0 -> 1749 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_27_Root_11.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_28_Root_11.p12bin0 -> 1717 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_29_Root_11.p12bin0 -> 1717 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Root_11.p12bin0 -> 1709 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_30_Root_11.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_31_Root_11.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_3_Root_11.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_4_Root_11.p12bin0 -> 1757 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_5_Root_11.p12bin0 -> 1765 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_6_Root_11.p12bin0 -> 1733 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_7_Root_11.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_8_Root_11.p12bin0 -> 1725 bytes
-rwxr-xr-xxmlsecurity/test_docs/certs/p12/User_9_Root_11.p12bin0 -> 1741 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/aia_ca_issuers.odtbin0 -> 9511 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/aia_ocsp.odtbin0 -> 9376 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odtbin0 -> 9370 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odtbin0 -> 9379 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odtbin0 -> 9378 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crl.odtbin0 -> 9354 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crl_revoked_chain.odtbin0 -> 9352 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crl_revoked_leaf.odtbin0 -> 9363 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odtbin0 -> 9351 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp.odtbin0 -> 9379 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odtbin0 -> 9382 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odtbin0 -> 9379 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp_revoked_chain.odtbin0 -> 9381 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp_revoked_leaf.odtbin0 -> 9380 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odtbin0 -> 9383 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odtbin0 -> 9392 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odtbin0 -> 9388 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/dn_quoting.odtbin0 -> 28429 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/incomplete_path.odtbin0 -> 9308 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odtbin0 -> 9550 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odtbin0 -> 6989 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odtbin0 -> 12911 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odtbin0 -> 12929 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odtbin0 -> 13043 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odtbin0 -> 13079 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odtbin0 -> 20336 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odtbin0 -> 9200 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odtbin0 -> 8908 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odtbin0 -> 8997 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odtbin0 -> 9199 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/ocsp_crl.odtbin0 -> 9444 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odtbin0 -> 9447 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/stateOrProvinceName.odtbin0 -> 10534 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_no_revocation.odtbin0 -> 9341 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_no_root_revocation_info.odtbin0 -> 9349 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odtbin0 -> 9352 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odtbin0 -> 9880 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odtbin0 -> 12425 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odtbin0 -> 10821 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odtbin0 -> 12565 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odtbin0 -> 15656 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odtbin0 -> 13975 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odtbin0 -> 12514 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odtbin0 -> 15579 bytes
-rwxr-xr-xxmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odtbin0 -> 13929 bytes
-rwxr-xr-xxmlsecurity/test_docs/test_description.odtbin0 -> 24746 bytes
-rwxr-xr-xxmlsecurity/test_docs/tools/README.txt23
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/build.xml74
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/dist/README.TXT33
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/dist/httpserv.jarbin0 -> 6994 bytes
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/manifest.mf3
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml700
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties8
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/nbproject/project.properties64
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/nbproject/project.xml15
-rwxr-xr-xxmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java213
1552 files changed, 51491 insertions, 127469 deletions
diff --git a/autodoc/source/display/html/cfrstd.cxx b/autodoc/source/display/html/cfrstd.cxx
index 1093932699ce..3bf56afb07cc 100644
--- a/autodoc/source/display/html/cfrstd.cxx
+++ b/autodoc/source/display/html/cfrstd.cxx
@@ -336,9 +336,9 @@ MakeCopyRight()
plt = localtime(&gt);
int year = 1900 + plt->tm_year;
- cr << "Copyright &copy; "
+ cr << "Copyright &copy; 1995, "
<< year
- << " Oracle";
+ << ", Oracle and/or its affiliates. All rights reserved.";
return String(cr.c_str());
}
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index f0cd1ed3f751..fd613a81673f 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -191,41 +191,6 @@ BOOL IsTTSignatureForUnicodeTextfile( String aLine )
BasicApp aBasicApp; // Application instance
-static const char * const components[] =
-{
- SAL_MODULENAME( "ucb1" ) // KSO, ABI
- , SAL_MODULENAME( "ucpfile1" )
- , "configmgr2.uno" SAL_DLLEXTENSION
- , "sax.uno" SAL_DLLEXTENSION
- , "stocservices.uno" SAL_DLLEXTENSION
- , SAL_MODULENAME( "fileacc" )
- , SAL_MODULENAME( "mcnttype" ) // Clipboard Ask Oliver Braun
- , "i18npool.uno" SAL_DLLEXTENSION
- // Reading of files in specific encodings like UTF-8 using
- // createUnoService( "com.sun.star.io.TextInputStream" ) and such
- , "textinstream.uno" SAL_DLLEXTENSION
- , "textoutstream.uno" SAL_DLLEXTENSION
- , "introspection.uno" SAL_DLLEXTENSION
- , "reflection.uno" SAL_DLLEXTENSION
- // RemoteUno
- , "connector.uno" SAL_DLLEXTENSION
- , "bridgefac.uno" SAL_DLLEXTENSION
- , "remotebridge.uno" SAL_DLLEXTENSION
-#ifdef SAL_UNX
-#ifdef QUARTZ
- , SVLIBRARY( "dtransaqua" ) // Mac OS X Aqua uses a dedicated libdtransaqua
-#else
- , SVLIBRARY( "dtransX11" ) // OBR
-#endif
-#endif
-#ifdef SAL_W32
- , SAL_MODULENAME( "sysdtrans" )
- , SAL_MODULENAME( "ftransl" )
- , SAL_MODULENAME( "dnd" )
-#endif
- , 0
-};
-
uno::Reference< XContentProviderManager > InitializeUCB( void )
{
uno::Reference< XMultiServiceFactory > xSMgr;
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/call.s b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
index f345e3a764ac..45d7c5308d30 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
@@ -9,7 +9,8 @@ privateSnippetExecutorGeneral:
.LCFIg0:
movl %esp,%ebp
.LCFIg1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -30,6 +31,7 @@ privateSnippetExecutorVoid:
.LCFIv0:
movl %esp,%ebp
.LCFIv1:
+ andl $0xFFFFFFF0,%esp # preserve potential 128bit stack alignment
pushl $0 # 32bit null pointer (returnValue not used)
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -49,7 +51,8 @@ privateSnippetExecutorHyper:
.LCFIh0:
movl %esp,%ebp
.LCFIh1:
- subl $0x8,%esp # 64bit returnValue
+ subl $0x8,%esp # 64bit returnValue (preserves potential 128bit
+ # stack alignment)
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -71,7 +74,8 @@ privateSnippetExecutorFloat:
.LCFIf0:
movl %esp,%ebp
.LCFIf1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -92,7 +96,8 @@ privateSnippetExecutorDouble:
.LCFId0:
movl %esp,%ebp
.LCFId1:
- subl $0x8,%esp # 64bit returnValue
+ subl $0x8,%esp # 64bit returnValue (preserves potential 128bit
+ # stack alignment)
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -113,7 +118,8 @@ privateSnippetExecutorClass:
.LCFIc0:
movl %esp,%ebp
.LCFIc1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
index afd202f683cf..4d1d3f2f8ca4 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
@@ -84,6 +84,13 @@ void callVirtualMethod(
void * stackptr;
asm volatile (
"mov %%esp, %6\n\t"
+ // preserve potential 128bit stack alignment
+ "and $0xfffffff0, %%esp\n\t"
+ "mov %0, %%eax\n\t"
+ "lea -4(,%%eax,4), %%eax\n\t"
+ "and $0xf, %%eax\n\t"
+ "sub $0xc, %%eax\n\t"
+ "add %%eax, %%esp\n\t"
// copy values
"mov %0, %%eax\n\t"
"mov %%eax, %%edx\n\t"
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst
index 8a76f4a0513b..3cdc9a26e3f5 100644
--- a/chart2/prj/build.lst
+++ b/chart2/prj/build.lst
@@ -14,7 +14,7 @@ ch chart2\source\view\axes nmake - all ch_source_view_axes ch_source_tools
ch chart2\source\view\charttypes nmake - all ch_source_view_charttypes ch_inc NULL
ch chart2\source\view\diagram nmake - all ch_source_view_diagram ch_inc NULL
ch chart2\source\view\main nmake - all ch_source_view_main ch_inc NULL
-ch chart2\source\controller nmake - all ch_source_controller ch_source_tools ch_source_view ch_source_controller_drawinglayer ch_source_controller_itemsetwrapper ch_source_controller_dialogs ch_source_controller_main ch_source_controller_chartapiwrapper ch_source_controller_accessibility ch_inc NULL
+ch chart2\source\controller nmake - all ch_source_controller ch_source_tools ch_source_view ch_source_controller_drawinglayer ch_source_controller_itemsetwrapper ch_source_controller_dialogs ch_source_controller_main ch_source_controller_chartapiwrapper ch_source_controller_accessibility ch_inc ch_source_controller_menus NULL
ch chart2\source\controller\inc get - all ch_source_controller_inc NULL
ch chart2\source\controller\accessibility nmake - all ch_source_controller_accessibility ch_inc NULL
ch chart2\source\controller\dialogs nmake - all ch_source_controller_dialogs ch_inc NULL
@@ -22,4 +22,5 @@ ch chart2\source\controller\drawinglayer nmake - all ch_source_controller_drawi
ch chart2\source\controller\itemsetwrapper nmake - all ch_source_controller_itemsetwrapper ch_inc NULL
ch chart2\source\controller\chartapiwrapper nmake - all ch_source_controller_chartapiwrapper ch_inc NULL
ch chart2\source\controller\main nmake - all ch_source_controller_main ch_inc NULL
+ch chart2\source\controller\menus nmake - all ch_source_controller_menus ch_inc NULL
ch chart2\prj get - all ch_prj NULL
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index cab7d3db0d62..00335eab296e 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -29,6 +29,7 @@
#include "precompiled_chart2.hxx"
#include "AccessibleBase.hxx"
+#include "AccessibleChartShape.hxx"
#include "ObjectHierarchy.hxx"
#include "ObjectIdentifier.hxx"
#include "chartview/ExplicitValueProvider.hxx"
@@ -269,15 +270,15 @@ bool AccessibleBase::ImplUpdateChildren()
{
ObjectHierarchy::tChildContainer aModelChildren(
m_aAccInfo.m_spObjectHierarchy->getChildren( GetId() ));
- ::std::vector< ChildCIDMap::key_type > aAccChildren;
+ ::std::vector< ChildOIDMap::key_type > aAccChildren;
aAccChildren.reserve( aModelChildren.size());
- ::std::transform( m_aChildCIDMap.begin(), m_aChildCIDMap.end(),
+ ::std::transform( m_aChildOIDMap.begin(), m_aChildOIDMap.end(),
::std::back_inserter( aAccChildren ),
- ::std::select1st< ChildCIDMap::value_type >());
+ ::std::select1st< ChildOIDMap::value_type >());
::std::sort( aModelChildren.begin(), aModelChildren.end());
- ::std::vector< OUString > aChildrenToRemove, aChildrenToAdd;
+ ::std::vector< ObjectHierarchy::tOID > aChildrenToRemove, aChildrenToAdd;
::std::set_difference( aModelChildren.begin(), aModelChildren.end(),
aAccChildren.begin(), aAccChildren.end(),
::std::back_inserter( aChildrenToAdd ));
@@ -285,10 +286,10 @@ bool AccessibleBase::ImplUpdateChildren()
aModelChildren.begin(), aModelChildren.end(),
::std::back_inserter( aChildrenToRemove ));
- ::std::vector< OUString >::const_iterator aIt( aChildrenToRemove.begin());
+ ::std::vector< ObjectHierarchy::tOID >::const_iterator aIt( aChildrenToRemove.begin());
for( ; aIt != aChildrenToRemove.end(); ++aIt )
{
- RemoveChildById( *aIt );
+ RemoveChildByOId( *aIt );
}
AccessibleElementInfo aAccInfo( GetInfo());
@@ -296,8 +297,15 @@ bool AccessibleBase::ImplUpdateChildren()
for( aIt = aChildrenToAdd.begin(); aIt != aChildrenToAdd.end(); ++aIt )
{
- aAccInfo.m_aCID = *aIt;
- AddChild( ChartElementFactory::CreateChartElement( aAccInfo ));
+ aAccInfo.m_aOID = *aIt;
+ if ( aIt->isAutoGeneratedObject() )
+ {
+ AddChild( ChartElementFactory::CreateChartElement( aAccInfo ) );
+ }
+ else if ( aIt->isAdditionalShape() )
+ {
+ AddChild( new AccessibleChartShape( aAccInfo, true, false ) );
+ }
}
bResult = true;
}
@@ -316,7 +324,7 @@ void AccessibleBase::AddChild( AccessibleBase * pChild )
Reference< XAccessible > xChild( pChild );
m_aChildList.push_back( xChild );
- m_aChildCIDMap[ pChild->GetId() ] = xChild;
+ m_aChildOIDMap[ pChild->GetId() ] = xChild;
// inform listeners of new child
if( m_bChildrenInitialized )
@@ -335,18 +343,18 @@ void AccessibleBase::AddChild( AccessibleBase * pChild )
/** in this method we imply that the Reference< XAccessible > elements in the
vector are AccessibleBase objects !
*/
-void AccessibleBase::RemoveChildById( const ::rtl::OUString & rId )
+void AccessibleBase::RemoveChildByOId( const ObjectIdentifier& rOId )
{
// /--
ClearableMutexGuard aGuard( GetMutex() );
- ChildCIDMap::iterator aIt( m_aChildCIDMap.find( rId ));
- if( aIt != m_aChildCIDMap.end())
+ ChildOIDMap::iterator aIt( m_aChildOIDMap.find( rOId ));
+ if( aIt != m_aChildOIDMap.end())
{
Reference< XAccessible > xChild( aIt->second );
// remove from map
- m_aChildCIDMap.erase( aIt );
+ m_aChildOIDMap.erase( aIt );
// search child in vector
ChildListVectorType::iterator aVecIter =
@@ -444,7 +452,7 @@ void AccessibleBase::KillAllChildren()
// remove all children
m_aChildList.clear();
- m_aChildCIDMap.clear();
+ m_aChildOIDMap.clear();
aGuard.clear();
// \--
@@ -485,7 +493,7 @@ void AccessibleBase::SetInfo( const AccessibleElementInfo & rNewInfo )
AccessibleUniqueId AccessibleBase::GetId() const
{
- return m_aAccInfo.m_aCID;
+ return m_aAccInfo.m_aOID;
}
// ____________________________________
@@ -662,14 +670,15 @@ Reference< XAccessibleStateSet > SAL_CALL AccessibleBase::getAccessibleStateSet(
{
if( ! m_bStateSetInitialized )
{
- OUString aSelCID;
Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
- if( xSelSupp.is() &&
- ( xSelSupp->getSelection() >>= aSelCID ) &&
- GetId().equals( aSelCID ) )
+ if ( xSelSupp.is() )
{
- AddState( AccessibleStateType::SELECTED );
- AddState( AccessibleStateType::FOCUSED );
+ ObjectIdentifier aOID( xSelSupp->getSelection() );
+ if ( aOID.isValid() && GetId() == aOID )
+ {
+ AddState( AccessibleStateType::SELECTED );
+ AddState( AccessibleStateType::FOCUSED );
+ }
}
m_bStateSetInitialized = true;
}
@@ -752,7 +761,7 @@ awt::Rectangle SAL_CALL AccessibleBase::getBounds()
if( pExplicitValueProvider )
{
Window* pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow ));
- awt::Rectangle aLogicRect( pExplicitValueProvider->getRectangleOfObject( m_aAccInfo.m_aCID ));
+ awt::Rectangle aLogicRect( pExplicitValueProvider->getRectangleOfObject( m_aAccInfo.m_aOID.getObjectCID() ));
if( pWindow )
{
Rectangle aRect( aLogicRect.X, aLogicRect.Y,
@@ -825,10 +834,11 @@ void SAL_CALL AccessibleBase::grabFocus()
{
CheckDisposeState();
- OUString aSelCID;
Reference< view::XSelectionSupplier > xSelSupp( GetInfo().m_xSelectionSupplier );
- if( xSelSupp.is())
- xSelSupp->select( uno::makeAny( GetId()));
+ if ( xSelSupp.is() )
+ {
+ xSelSupp->select( GetId().getAny() );
+ }
}
sal_Int32 SAL_CALL AccessibleBase::getForeground()
@@ -849,9 +859,10 @@ sal_Int32 AccessibleBase::getColor( eColorType eColType )
if( m_bAlwaysTransparent )
return nResult;
- ObjectType eType( ObjectIdentifier::getObjectType( m_aAccInfo.m_aCID ));
+ ObjectIdentifier aOID( m_aAccInfo.m_aOID );
+ ObjectType eType( aOID.getObjectType() );
Reference< beans::XPropertySet > xObjProp;
- OUString aObjectCID = m_aAccInfo.m_aCID;
+ OUString aObjectCID = aOID.getObjectCID();
if( eType == OBJECTTYPE_LEGEND_ENTRY )
{
// for colors get the data series/point properties
diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.cxx b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
index a2c7b7aa8261..2361cc62c389 100644
--- a/chart2/source/controller/accessibility/AccessibleChartElement.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartElement.cxx
@@ -101,7 +101,7 @@ bool AccessibleChartElement::ImplUpdateChildren()
bool bResult = false;
Reference< chart2::XTitle > xTitle(
ObjectIdentifier::getObjectPropertySet(
- GetInfo().m_aCID, Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument )),
+ GetInfo().m_aOID.getObjectCID(), Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument )),
uno::UNO_QUERY );
m_bHasText = xTitle.is();
@@ -136,7 +136,7 @@ void AccessibleChartElement::InitTextEdit()
{
Reference< lang::XInitialization > xInit( m_xTextHelper, uno::UNO_QUERY_THROW );
Sequence< uno::Any > aArgs( 3 );
- aArgs[0] <<= GetInfo().m_aCID;
+ aArgs[0] <<= GetInfo().m_aOID.getObjectCID();
aArgs[1] <<= Reference< XAccessible >( this );
aArgs[2] <<= Reference< awt::XWindow >( GetInfo().m_xWindow );
xInit->initialize( aArgs );
@@ -224,7 +224,7 @@ OUString SAL_CALL AccessibleChartElement::getAccessibleName()
throw (::com::sun::star::uno::RuntimeException)
{
return ObjectNameProvider::getNameForCID(
- GetInfo().m_aCID, GetInfo().m_xChartDocument );
+ GetInfo().m_aOID.getObjectCID(), GetInfo().m_xChartDocument );
}
// ________ AccessibleChartElement::XAccessibleContext (overloaded) ________
@@ -249,7 +249,7 @@ Reference< awt::XFont > SAL_CALL AccessibleChartElement::getFont()
{
Reference< beans::XMultiPropertySet > xObjProp(
ObjectIdentifier::getObjectPropertySet(
- GetInfo().m_aCID, Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument )), uno::UNO_QUERY );
+ GetInfo().m_aOID.getObjectCID(), Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument )), uno::UNO_QUERY );
awt::FontDescriptor aDescr(
CharacterProperties::createFontDescriptorFromPropertySet( xObjProp ));
xFont = xDevice->getFont( aDescr );
@@ -270,7 +270,7 @@ OUString SAL_CALL AccessibleChartElement::getToolTipText()
CheckDisposeState();
return ObjectNameProvider::getHelpText(
- GetInfo().m_aCID, Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument ));
+ GetInfo().m_aOID.getObjectCID(), Reference< chart2::XChartDocument >( GetInfo().m_xChartDocument ));
}
// ________ XAccessibleComponent ________
@@ -280,7 +280,7 @@ sal_Bool SAL_CALL AccessibleChartElement::containsPoint( const awt::Point& aPoin
return AccessibleBase::containsPoint( aPoint );
}
-Reference< accessibility::XAccessible > SAL_CALL AccessibleChartElement::getAccessibleAtPoint( const awt::Point& aPoint )
+Reference< XAccessible > SAL_CALL AccessibleChartElement::getAccessibleAtPoint( const awt::Point& aPoint )
throw (uno::RuntimeException)
{
return AccessibleBase::getAccessibleAtPoint( aPoint );
diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.cxx b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
new file mode 100644
index 000000000000..bbf6176641da
--- /dev/null
+++ b/chart2/source/controller/accessibility/AccessibleChartShape.cxx
@@ -0,0 +1,289 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "AccessibleChartShape.hxx"
+#include "ObjectHierarchy.hxx"
+#include "ObjectIdentifier.hxx"
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <svx/ShapeTypeHandler.hxx>
+#include <svx/AccessibleShape.hxx>
+#include <svx/AccessibleShapeInfo.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::accessibility;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::RuntimeException;
+
+
+namespace chart
+{
+
+AccessibleChartShape::AccessibleChartShape(
+ const AccessibleElementInfo& rAccInfo,
+ bool bMayHaveChildren, bool bAlwaysTransparent )
+ :impl::AccessibleChartShape_Base( rAccInfo, bMayHaveChildren, bAlwaysTransparent )
+ ,m_pAccShape( NULL )
+{
+ if ( rAccInfo.m_aOID.isAdditionalShape() )
+ {
+ Reference< drawing::XShape > xShape( rAccInfo.m_aOID.getAdditionalShape() );
+ Reference< XAccessible > xParent;
+ if ( rAccInfo.m_pParent )
+ {
+ xParent.set( rAccInfo.m_pParent );
+ }
+ sal_Int32 nIndex = -1;
+ if ( rAccInfo.m_spObjectHierarchy )
+ {
+ nIndex = rAccInfo.m_spObjectHierarchy->getIndexInParent( rAccInfo.m_aOID );
+ }
+ ::accessibility::AccessibleShapeInfo aShapeInfo( xShape, xParent, nIndex );
+
+ m_aShapeTreeInfo.SetSdrView( rAccInfo.m_pSdrView );
+ m_aShapeTreeInfo.SetController( NULL );
+ m_aShapeTreeInfo.SetWindow( VCLUnoHelper::GetWindow( rAccInfo.m_xWindow ) );
+ m_aShapeTreeInfo.SetViewForwarder( rAccInfo.m_pViewForwarder );
+
+ ::accessibility::ShapeTypeHandler& rShapeHandler = ::accessibility::ShapeTypeHandler::Instance();
+ m_pAccShape = rShapeHandler.CreateAccessibleObject( aShapeInfo, m_aShapeTreeInfo );
+ if ( m_pAccShape )
+ {
+ m_pAccShape->acquire();
+ m_pAccShape->Init();
+ }
+ }
+}
+
+AccessibleChartShape::~AccessibleChartShape()
+{
+ OSL_ASSERT( CheckDisposeState( false /* don't throw exceptions */ ) );
+
+ if ( m_pAccShape )
+ {
+ m_pAccShape->dispose();
+ m_pAccShape->release();
+ }
+}
+
+// ________ XServiceInfo ________
+::rtl::OUString AccessibleChartShape::getImplementationName()
+ throw (RuntimeException)
+{
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AccessibleChartShape" ) );
+}
+
+// ________ XAccessibleContext ________
+sal_Int32 AccessibleChartShape::getAccessibleChildCount()
+ throw (RuntimeException)
+{
+ sal_Int32 nCount(0);
+ if ( m_pAccShape )
+ {
+ nCount = m_pAccShape->getAccessibleChildCount();
+ }
+ return nCount;
+}
+
+Reference< XAccessible > AccessibleChartShape::getAccessibleChild( sal_Int32 i )
+ throw (lang::IndexOutOfBoundsException, RuntimeException)
+{
+ Reference< XAccessible > xChild;
+ if ( m_pAccShape )
+ {
+ xChild = m_pAccShape->getAccessibleChild( i );
+ }
+ return xChild;
+}
+
+sal_Int16 AccessibleChartShape::getAccessibleRole()
+ throw (RuntimeException)
+{
+ sal_Int16 nRole(0);
+ if ( m_pAccShape )
+ {
+ nRole = m_pAccShape->getAccessibleRole();
+ }
+ return nRole;
+}
+
+::rtl::OUString AccessibleChartShape::getAccessibleDescription()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::rtl::OUString aDescription;
+ if ( m_pAccShape )
+ {
+ aDescription = m_pAccShape->getAccessibleDescription();
+ }
+ return aDescription;
+}
+
+::rtl::OUString AccessibleChartShape::getAccessibleName()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::rtl::OUString aName;
+ if ( m_pAccShape )
+ {
+ aName = m_pAccShape->getAccessibleName();
+ }
+ return aName;
+}
+
+// ________ XAccessibleComponent ________
+sal_Bool AccessibleChartShape::containsPoint( const awt::Point& aPoint )
+ throw (uno::RuntimeException)
+{
+ sal_Bool bReturn = sal_False;
+ if ( m_pAccShape )
+ {
+ bReturn = m_pAccShape->containsPoint( aPoint );
+ }
+ return bReturn;
+}
+
+Reference< XAccessible > AccessibleChartShape::getAccessibleAtPoint( const awt::Point& aPoint )
+ throw (uno::RuntimeException)
+{
+ Reference< XAccessible > xResult;
+ if ( m_pAccShape )
+ {
+ xResult.set( m_pAccShape->getAccessibleAtPoint( aPoint ) );
+ }
+ return xResult;
+}
+
+awt::Rectangle AccessibleChartShape::getBounds()
+ throw (uno::RuntimeException)
+{
+ awt::Rectangle aBounds;
+ if ( m_pAccShape )
+ {
+ aBounds = m_pAccShape->getBounds();
+ }
+ return aBounds;
+}
+
+awt::Point AccessibleChartShape::getLocation()
+ throw (uno::RuntimeException)
+{
+ awt::Point aLocation;
+ if ( m_pAccShape )
+ {
+ aLocation = m_pAccShape->getLocation();
+ }
+ return aLocation;
+}
+
+awt::Point AccessibleChartShape::getLocationOnScreen()
+ throw (uno::RuntimeException)
+{
+ awt::Point aLocation;
+ if ( m_pAccShape )
+ {
+ aLocation = m_pAccShape->getLocationOnScreen();
+ }
+ return aLocation;
+}
+
+awt::Size AccessibleChartShape::getSize()
+ throw (uno::RuntimeException)
+{
+ awt::Size aSize;
+ if ( m_pAccShape )
+ {
+ aSize = m_pAccShape->getSize();
+ }
+ return aSize;
+}
+
+void AccessibleChartShape::grabFocus()
+ throw (uno::RuntimeException)
+{
+ return AccessibleBase::grabFocus();
+}
+
+sal_Int32 AccessibleChartShape::getForeground()
+ throw (uno::RuntimeException)
+{
+ sal_Int32 nColor(0);
+ if ( m_pAccShape )
+ {
+ nColor = m_pAccShape->getForeground();
+ }
+ return nColor;
+}
+
+sal_Int32 AccessibleChartShape::getBackground()
+ throw (uno::RuntimeException)
+{
+ sal_Int32 nColor(0);
+ if ( m_pAccShape )
+ {
+ nColor = m_pAccShape->getBackground();
+ }
+ return nColor;
+}
+
+// ________ XAccessibleExtendedComponent ________
+Reference< awt::XFont > AccessibleChartShape::getFont()
+ throw (uno::RuntimeException)
+{
+ Reference< awt::XFont > xFont;
+ if ( m_pAccShape )
+ {
+ xFont.set( m_pAccShape->getFont() );
+ }
+ return xFont;
+}
+
+::rtl::OUString AccessibleChartShape::getTitledBorderText()
+ throw (uno::RuntimeException)
+{
+ ::rtl::OUString aText;
+ if ( m_pAccShape )
+ {
+ aText = m_pAccShape->getTitledBorderText();
+ }
+ return aText;
+}
+
+::rtl::OUString AccessibleChartShape::getToolTipText()
+ throw (::com::sun::star::uno::RuntimeException)
+{
+ ::rtl::OUString aText;
+ if ( m_pAccShape )
+ {
+ aText = m_pAccShape->getToolTipText();
+ }
+ return aText;
+}
+
+} // namespace chart
diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.hxx b/chart2/source/controller/accessibility/AccessibleChartShape.hxx
new file mode 100644
index 000000000000..a1236b697a69
--- /dev/null
+++ b/chart2/source/controller/accessibility/AccessibleChartShape.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_ACCESSIBLECHARTSHAPE_HXX_
+#define _CHART2_ACCESSIBLECHARTSHAPE_HXX_
+
+#include "AccessibleBase.hxx"
+
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <svx/AccessibleShapeTreeInfo.hxx>
+
+
+namespace accessibility
+{
+class AccessibleShape;
+}
+
+namespace chart
+{
+
+namespace impl
+{
+typedef ::cppu::ImplInheritanceHelper1<
+ AccessibleBase,
+ ::com::sun::star::accessibility::XAccessibleExtendedComponent > AccessibleChartShape_Base;
+}
+
+class AccessibleChartShape :
+ public impl::AccessibleChartShape_Base
+{
+public:
+ AccessibleChartShape( const AccessibleElementInfo& rAccInfo,
+ bool bMayHaveChildren, bool bAlwaysTransparent = false );
+ virtual ~AccessibleChartShape();
+
+ // ________ XServiceInfo ________
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ________ XAccessibleContext ________
+ virtual sal_Int32 SAL_CALL getAccessibleChildCount()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
+ getAccessibleChild( sal_Int32 i )
+ throw (::com::sun::star::lang::IndexOutOfBoundsException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int16 SAL_CALL getAccessibleRole()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleDescription()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ________ XAccessibleComponent ________
+ virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocation() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getForeground() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getBackground() throw (::com::sun::star::uno::RuntimeException);
+
+ // ________ XAccessibleExtendedComponent ________
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getTitledBorderText()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getToolTipText()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ ::accessibility::AccessibleShape* m_pAccShape;
+ ::accessibility::AccessibleShapeTreeInfo m_aShapeTreeInfo;
+};
+
+} // namespace chart
+
+#endif
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx
index 611d75992832..4833991ad7cc 100644
--- a/chart2/source/controller/accessibility/AccessibleChartView.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx
@@ -36,6 +36,7 @@
#include "ObjectIdentifier.hxx"
#include "ResId.hxx"
#include "Strings.hrc"
+#include "AccessibleViewForwarder.hxx"
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -66,19 +67,22 @@ namespace chart
//.............................................................................
AccessibleChartView::AccessibleChartView(
- const Reference<uno::XComponentContext> & xContext ) :
+ const Reference< uno::XComponentContext >& xContext, SdrView* pView ) :
impl::AccessibleChartView_Base(
AccessibleElementInfo(), // empty for now
true, // has children
true // always transparent
),
- m_xContext( xContext )
+ m_xContext( xContext ),
+ m_pSdrView( pView ),
+ m_pViewForwarder( NULL )
{
AddState( AccessibleStateType::OPAQUE );
}
AccessibleChartView::~AccessibleChartView()
{
+ delete m_pViewForwarder;
}
@@ -187,20 +191,6 @@ awt::Point SAL_CALL AccessibleChartView::getLocationOnScreen()
}
//-----------------------------------------------------------------
-// lang::XServiceInfo
-//-----------------------------------------------------------------
-
-APPHELPER_XSERVICEINFO_IMPL( AccessibleChartView, CHART2_ACCESSIBLE_SERVICE_IMPLEMENTATION_NAME )
-
-uno::Sequence< rtl::OUString > AccessibleChartView::getSupportedServiceNames_Static()
-{
- uno::Sequence< rtl::OUString > aSNS( 2 );
- aSNS.getArray()[ 0 ] = C2U("com.sun.star.accessibility.Accessible");
- aSNS.getArray()[ 1 ] = CHART2_ACCESSIBLE_SERVICE_NAME;
- return aSNS;
-}
-
-//-----------------------------------------------------------------
// lang::XInitialization
//-----------------------------------------------------------------
@@ -350,7 +340,7 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
{
AccessibleElementInfo aAccInfo;
- aAccInfo.m_aCID = C2U("ROOT");
+ aAccInfo.m_aOID = ObjectIdentifier( C2U( "ROOT" ) );
aAccInfo.m_xChartDocument = uno::WeakReference< chart2::XChartDocument >(
uno::Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY ));
aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier;
@@ -358,6 +348,14 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
aAccInfo.m_xWindow = m_xWindow;
aAccInfo.m_pParent = 0;
aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy;
+ aAccInfo.m_pSdrView = m_pSdrView;
+ Window* pWindow = VCLUnoHelper::GetWindow( m_xWindow );
+ if ( m_pViewForwarder )
+ {
+ delete m_pViewForwarder;
+ }
+ m_pViewForwarder = new AccessibleViewForwarder( this, pWindow );
+ aAccInfo.m_pViewForwarder = m_pViewForwarder;
// broadcasts an INVALIDATE_ALL_CHILDREN event globally
SetInfo( aAccInfo );
}
@@ -384,16 +382,16 @@ void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /*
if( xSelectionSupplier.is() )
{
- rtl::OUString aSelectedObjectCID;
- Any aSelection = xSelectionSupplier->getSelection();
- if(aSelection>>=aSelectedObjectCID)
+ ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() );
+ if ( m_aCurrentSelectionOID.isValid() )
+ {
+ NotifyEvent( LOST_SELECTION, m_aCurrentSelectionOID );
+ }
+ if( aSelectedOID.isValid() )
{
- if( m_aCurrentSelectionCID.getLength())
- NotifyEvent( LOST_SELECTION, m_aCurrentSelectionCID );
- if( aSelectedObjectCID.getLength())
- NotifyEvent( GOT_SELECTION, aSelectedObjectCID );
- m_aCurrentSelectionCID = aSelectedObjectCID;
+ NotifyEvent( GOT_SELECTION, aSelectedOID );
}
+ m_aCurrentSelectionOID = aSelectedOID;
}
}
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
new file mode 100644
index 000000000000..5014198761f8
--- /dev/null
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "AccessibleViewForwarder.hxx"
+#include "AccessibleChartView.hxx"
+
+#include <vcl/window.hxx>
+
+using namespace ::com::sun::star;
+
+
+namespace chart
+{
+
+AccessibleViewForwarder::AccessibleViewForwarder( AccessibleChartView* pAccChartView, Window* pWindow )
+ :m_pAccChartView( pAccChartView )
+ ,m_pWindow( pWindow )
+ ,m_aMapMode( MAP_100TH_MM )
+{
+}
+
+AccessibleViewForwarder::~AccessibleViewForwarder()
+{
+}
+
+// ________ IAccessibleViewforwarder ________
+
+BOOL AccessibleViewForwarder::IsValid() const
+{
+ return sal_True;
+}
+
+Rectangle AccessibleViewForwarder::GetVisibleArea() const
+{
+ Rectangle aVisibleArea;
+ if ( m_pWindow )
+ {
+ aVisibleArea.SetPos( Point( 0, 0 ) );
+ aVisibleArea.SetSize( m_pWindow->GetOutputSizePixel() );
+ aVisibleArea = m_pWindow->PixelToLogic( aVisibleArea, m_aMapMode );
+ }
+ return aVisibleArea;
+}
+
+Point AccessibleViewForwarder::LogicToPixel( const Point& rPoint ) const
+{
+ Point aPoint;
+ if ( m_pAccChartView && m_pWindow )
+ {
+ awt::Point aLocation = m_pAccChartView->getLocationOnScreen();
+ Point aTopLeft( aLocation.X, aLocation.Y );
+ aPoint = m_pWindow->LogicToPixel( rPoint, m_aMapMode ) + aTopLeft;
+ }
+ return aPoint;
+}
+
+Size AccessibleViewForwarder::LogicToPixel( const Size& rSize ) const
+{
+ Size aSize;
+ if ( m_pWindow )
+ {
+ aSize = m_pWindow->LogicToPixel( rSize, m_aMapMode );
+ }
+ return aSize;
+}
+
+Point AccessibleViewForwarder::PixelToLogic( const Point& rPoint ) const
+{
+ Point aPoint;
+ if ( m_pAccChartView && m_pWindow )
+ {
+ awt::Point aLocation = m_pAccChartView->getLocationOnScreen();
+ Point aTopLeft( aLocation.X, aLocation.Y );
+ aPoint = m_pWindow->PixelToLogic( rPoint - aTopLeft, m_aMapMode );
+ }
+ return aPoint;
+}
+
+Size AccessibleViewForwarder::PixelToLogic( const Size& rSize ) const
+{
+ Size aSize;
+ if ( m_pWindow )
+ {
+ aSize = m_pWindow->PixelToLogic( rSize, m_aMapMode );
+ }
+ return aSize;
+}
+
+} // namespace chart
diff --git a/configmgr/source/inc/nodevisitor.hxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
index 9578a59067ef..e70aa58b8df7 100644
--- a/configmgr/source/inc/nodevisitor.hxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
@@ -24,54 +24,42 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _CHART2_ACCESSIBLEVIEWFORWARDER_HXX_
+#define _CHART2_ACCESSIBLEVIEWFORWARDER_HXX_
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_NODEVISITOR_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_NODEVISITOR_HXX
+#include <vcl/mapmod.hxx>
+#include <svx/IAccessibleViewForwarder.hxx>
-#include "sal/config.h"
+class Window;
-namespace configmgr { namespace sharable {
- struct GroupNode;
- struct SetNode;
- struct TreeFragment;
- struct ValueNode;
- union Node;
-} }
+namespace chart
+{
-namespace configmgr { namespace data {
+class AccessibleChartView;
-class NodeVisitor {
+class AccessibleViewForwarder : public ::accessibility::IAccessibleViewForwarder
+{
public:
- virtual ~NodeVisitor() = 0;
-
- bool visitNode(sharable::Node * node);
-
- bool visitChildren(sharable::GroupNode * node);
-
-protected:
- virtual bool handle(sharable::Node * node);
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::GroupNode * node);
-
- virtual bool handle(sharable::SetNode * node);
-};
-
-class SetVisitor: public NodeVisitor {
-public:
- virtual ~SetVisitor() = 0;
-
- bool visitTree(sharable::TreeFragment * tree);
-
- bool visitElements(sharable::SetNode * node);
-
-protected:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::TreeFragment * tree);
+ AccessibleViewForwarder( AccessibleChartView* pAccChartView, Window* pWindow );
+ virtual ~AccessibleViewForwarder();
+
+ // ________ IAccessibleViewforwarder ________
+ virtual BOOL IsValid() const;
+ virtual Rectangle GetVisibleArea() const;
+ virtual Point LogicToPixel( const Point& rPoint ) const;
+ virtual Size LogicToPixel( const Size& rSize ) const;
+ virtual Point PixelToLogic( const Point& rPoint ) const;
+ virtual Size PixelToLogic( const Size& rSize ) const;
+
+private:
+ AccessibleViewForwarder( AccessibleViewForwarder& );
+ AccessibleViewForwarder& operator=( AccessibleViewForwarder& );
+
+ AccessibleChartView* m_pAccChartView;
+ Window* m_pWindow;
+ MapMode m_aMapMode;
};
-} }
+} // namespace chart
#endif
diff --git a/chart2/source/controller/accessibility/ChartElementFactory.cxx b/chart2/source/controller/accessibility/ChartElementFactory.cxx
index 43535a0d7fc5..b2599fec0c74 100644
--- a/chart2/source/controller/accessibility/ChartElementFactory.cxx
+++ b/chart2/source/controller/accessibility/ChartElementFactory.cxx
@@ -30,7 +30,6 @@
#include "ChartElementFactory.hxx"
#include "ObjectIdentifier.hxx"
-
#include "AccessibleChartElement.hxx"
namespace chart
@@ -38,8 +37,8 @@ namespace chart
AccessibleBase* ChartElementFactory::CreateChartElement( const AccessibleElementInfo& rAccInfo )
{
- ObjectType eType(
- ObjectIdentifier::getObjectType( rAccInfo.m_aCID ));
+ ObjectIdentifier aOID( rAccInfo.m_aOID );
+ ObjectType eType( aOID.getObjectType() );
switch( eType )
{
@@ -72,6 +71,8 @@ AccessibleBase* ChartElementFactory::CreateChartElement( const AccessibleElement
return new AccessibleChartElement( rAccInfo, true, false );
case OBJECTTYPE_UNKNOWN:
break;
+ default:
+ break;
}
return 0;
diff --git a/chart2/source/controller/accessibility/makefile.mk b/chart2/source/controller/accessibility/makefile.mk
index e79019ba8602..44c816d90d0e 100644
--- a/chart2/source/controller/accessibility/makefile.mk
+++ b/chart2/source/controller/accessibility/makefile.mk
@@ -44,7 +44,9 @@ SLOFILES= $(SLO)$/AccessibleChartView.obj \
$(SLO)$/ChartElementFactory.obj \
$(SLO)$/AccessibleBase.obj \
$(SLO)$/AccessibleChartElement.obj \
- $(SLO)$/AccessibleTextHelper.obj
+ $(SLO)$/AccessibleChartShape.obj \
+ $(SLO)$/AccessibleTextHelper.obj \
+ $(SLO)$/AccessibleViewForwarder.obj
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index 138a54a43036..da0c9b4e8167 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -54,6 +54,7 @@
#include "WrappedAddInProperty.hxx"
#include "WrappedIgnoreProperty.hxx"
#include "ChartRenderer.hxx"
+#include "UndoManager.hxx"
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -1489,6 +1490,12 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
xResult.set( m_xChartView );
bServiceFound = true;
}
+ else if ( aServiceSpecifier.equals( CHART_UNDOMANAGER_SERVICE_NAME ) )
+ {
+ Reference< chart2::XUndoManager > xUndoManager( new UndoManager() );
+ xResult.set( xUndoManager );
+ bServiceFound = true;
+ }
else
{
// try to create a shape
diff --git a/chart2/source/controller/dialogs/ResourceIds.hrc b/chart2/source/controller/dialogs/ResourceIds.hrc
index 02edc1a6bd96..2ab544c77ab1 100644
--- a/chart2/source/controller/dialogs/ResourceIds.hrc
+++ b/chart2/source/controller/dialogs/ResourceIds.hrc
@@ -48,6 +48,8 @@
#define DLG_SPLINE_PROPERTIES 904
#define DLG_DATA_TRENDLINE 841
#define DLG_DATA_YERRORBAR 842
+#define DLG_SHAPE_FONT 921
+#define DLG_SHAPE_PARAGRAPH 922
//-----------------------------------------------------------------------------
//TabPage Ids:
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index 2d6fd9c04a66..4b4cec65426e 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -348,6 +348,11 @@ String STR_OBJECT_DIAGRAM_FLOOR
Text [ en-US ] = "Chart Floor" ;
};
+String STR_OBJECT_SHAPE
+{
+ Text [ en-US ] = "Drawing Object" ;
+};
+
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index ec5f102bdaab..285464dc90ff 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -488,6 +488,8 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
SchAlignmentTabPage::CreateWithoutRotation can be deleted. */
AddTabPage(TP_ALIGNMENT, String(SchResId(STR_PAGE_ALIGNMENT)), SchAlignmentTabPage::CreateWithoutRotation, NULL);
break;
+ default:
+ break;
}
// used to find out if user left the dialog with OK. When OK is pressed but
diff --git a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
new file mode 100644
index 000000000000..280a1adecba2
--- /dev/null
+++ b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "dlg_ShapeFont.hxx"
+#include "ViewElementListProvider.hxx"
+#include "ResId.hxx"
+#include "ResourceIds.hrc"
+
+#include <svl/intitem.hxx>
+#include <sfx2/objsh.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/flagsdef.hxx>
+#include <editeng/flstitem.hxx>
+
+using ::com::sun::star::uno::Reference;
+using namespace ::com::sun::star;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+ShapeFontDialog::ShapeFontDialog( Window* pParent, const SfxItemSet* pAttr,
+ const ViewElementListProvider* pViewElementListProvider )
+ :SfxTabDialog( pParent, SchResId( DLG_SHAPE_FONT ), pAttr )
+ ,m_pViewElementListProvider( pViewElementListProvider )
+{
+ FreeResource();
+
+ AddTabPage( RID_SVXPAGE_CHAR_NAME );
+ AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
+ AddTabPage( RID_SVXPAGE_CHAR_POSITION );
+}
+
+ShapeFontDialog::~ShapeFontDialog()
+{
+}
+
+void ShapeFontDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+{
+ SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
+ switch ( nId )
+ {
+ case RID_SVXPAGE_CHAR_NAME:
+ {
+ aSet.Put( SvxFontListItem( m_pViewElementListProvider->getFontList(), SID_ATTR_CHAR_FONTLIST ) );
+ rPage.PageCreated( aSet );
+ }
+ break;
+ case RID_SVXPAGE_CHAR_EFFECTS:
+ {
+ aSet.Put( SfxUInt16Item( SID_DISABLE_CTL, DISABLE_CASEMAP ) );
+ rPage.PageCreated( aSet );
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/configmgr/source/api2/committer.hxx b/chart2/source/controller/dialogs/dlg_ShapeFont.src
index 895321235ddf..2065bd940988 100644
--- a/configmgr/source/api2/committer.hxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeFont.src
@@ -24,34 +24,39 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include "ResourceIds.hrc"
+#include <svx/dialogs.hrc>
-#ifndef CONFIGMGR_API_COMMITTER_HXX_
-#define CONFIGMGR_API_COMMITTER_HXX_
-
-namespace configmgr
+TabDialog DLG_SHAPE_FONT
{
- class OProviderImpl;
-//-----------------------------------------------------------------------------
- namespace configapi
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ en-US ] = "Character" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
{
-//-----------------------------------------------------------------------------
-
- class ApiRootTreeImpl;
-//-----------------------------------------------------------------------------
-
- /// allows to update values of a simple type within a <type>NodeRef</type> that refers to a Group
- class Committer
+ OutputSize = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 3 ) ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ PageList =
{
- ApiRootTreeImpl& m_rTree;
- public:
- Committer(ApiRootTreeImpl& rTree);
-
- void commit();
- private:
- OProviderImpl * getUpdateProvider();
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_CHAR_NAME ;
+ Text [ en-US ] = "Font";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_CHAR_EFFECTS ;
+ Text [ en-US ] = "Font Effects";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_CHAR_POSITION ;
+ Text [ en-US ] = "Font Position";
+ };
};
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_COMMITTER_HXX_
+ };
+};
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
new file mode 100644
index 000000000000..2f0173fc8408
--- /dev/null
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "dlg_ShapeParagraph.hxx"
+#include "ResId.hxx"
+#include "ResourceIds.hrc"
+
+#include <svl/cjkoptions.hxx>
+#include <svl/intitem.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/flagsdef.hxx>
+
+using ::com::sun::star::uno::Reference;
+using namespace ::com::sun::star;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+ShapeParagraphDialog::ShapeParagraphDialog( Window* pParent, const SfxItemSet* pAttr )
+ :SfxTabDialog( pParent, SchResId( DLG_SHAPE_PARAGRAPH ), pAttr )
+{
+ FreeResource();
+
+ SvtCJKOptions aCJKOptions;
+
+ AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
+ AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
+ if ( aCJKOptions.IsAsianTypographyEnabled() )
+ {
+ AddTabPage( RID_SVXPAGE_PARA_ASIAN );
+ }
+ else
+ {
+ RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
+ }
+ AddTabPage( RID_SVXPAGE_TABULATOR );
+}
+
+ShapeParagraphDialog::~ShapeParagraphDialog()
+{
+}
+
+void ShapeParagraphDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+{
+ SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
+ switch ( nId )
+ {
+ case RID_SVXPAGE_TABULATOR:
+ {
+ aSet.Put( SfxUInt16Item( SID_SVXTABULATORTABPAGE_CONTROLFLAGS,
+ ( TABTYPE_ALL &~TABTYPE_LEFT ) | ( TABFILL_ALL &~TABFILL_NONE ) ) );
+ rPage.PageCreated( aSet );
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/configmgr/source/backend/backendstratalistener.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.src
index c1f763b8d650..ff74fc1eef80 100644
--- a/configmgr/source/backend/backendstratalistener.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.src
@@ -24,33 +24,44 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include "ResourceIds.hrc"
+#include <svx/dialogs.hrc>
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendstratalistener.hxx"
-namespace configmgr
+TabDialog DLG_SHAPE_PARAGRAPH
{
-// -----------------------------------------------------------------------------
- namespace backend
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ en-US ] = "Paragraph" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
{
- // -----------------------------------------------------------------------------
- BackendStrataListener::BackendStrataListener(const MultiStratumBackend& aBackend)
- :mBackend(aBackend)
- {}
- BackendStrataListener:: ~BackendStrataListener(){}
-
- void SAL_CALL BackendStrataListener::componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException)
+ OutputSize = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 3 ) ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ PageList =
{
-
- mBackend.notifyListeners(aEvent);
-
- }
- // -----------------------------------------------------------------------------
- void SAL_CALL BackendStrataListener::disposing( lang::EventObject const & /*rSource*/ )
- throw (uno::RuntimeException)
- {
-
- }
- }
-}
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
+ Text [ en-US ] = "Indents & Spacing";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
+ Text [ en-US ] = "Alignment";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PARA_ASIAN ;
+ Text [ en-US ] = "Asian Typography";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_TABULATOR ;
+ Text [ en-US ] = "Tab";
+ };
+ };
+ };
+};
diff --git a/chart2/source/controller/dialogs/makefile.mk b/chart2/source/controller/dialogs/makefile.mk
index 955c1764b5aa..d22f5c83b081 100644
--- a/chart2/source/controller/dialogs/makefile.mk
+++ b/chart2/source/controller/dialogs/makefile.mk
@@ -98,6 +98,8 @@ SLOFILES= \
$(SLO)$/dlg_ChartType_UNO.obj \
$(SLO)$/dlg_ChartType.obj \
$(SLO)$/dlg_NumberFormat.obj \
+ $(SLO)$/dlg_ShapeFont.obj \
+ $(SLO)$/dlg_ShapeParagraph.obj \
$(SLO)$/RangeSelectionButton.obj \
$(SLO)$/RangeSelectionHelper.obj \
$(SLO)$/RangeSelectionListener.obj \
@@ -150,7 +152,9 @@ SRC1FILES= \
dlg_InsertErrorBars.src \
dlg_InsertTitle.src \
dlg_ChartType.src \
- dlg_CreationWizard.src
+ dlg_CreationWizard.src \
+ dlg_ShapeFont.src \
+ dlg_ShapeParagraph.src
SRS1NAME=$(TARGET)
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 299cd9efe859..fbcca6a26bde 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -31,6 +31,8 @@
#include "chartview/DrawModelWrapper.hxx"
#include "ConfigurationAccess.hxx"
+#include <unotools/lingucfg.hxx>
+#include <editeng/langitem.hxx>
// header for class SdrPage
#include <svx/svdpage.hxx>
//header for class SdrPageView
@@ -51,6 +53,7 @@
// header for class SvxShape
#include <svx/unoshape.hxx>
+#include <editeng/fhgtitem.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
@@ -162,6 +165,24 @@ DrawViewWrapper::DrawViewWrapper( SdrModel* pSdrModel, OutputDevice* pOut, bool
SetPagePaintingAllowed(bPaintPageForEditMode);
+ // #i12587# support for shapes in chart
+ SdrOutliner* pOutliner = getOutliner();
+ SfxItemPool* pOutlinerPool = ( pOutliner ? pOutliner->GetEditTextObjectPool() : NULL );
+ if ( pOutlinerPool )
+ {
+ SvtLinguConfig aLinguConfig;
+ SvtLinguOptions aLinguOptions;
+ if ( aLinguConfig.GetOptions( aLinguOptions ) )
+ {
+ pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage, EE_CHAR_LANGUAGE ) );
+ pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CJK, EE_CHAR_LANGUAGE_CJK ) );
+ pOutlinerPool->SetPoolDefaultItem( SvxLanguageItem( aLinguOptions.nDefaultLanguage_CTL, EE_CHAR_LANGUAGE_CTL ) );
+ }
+
+ // set font height without changing SdrEngineDefaults
+ pOutlinerPool->SetPoolDefaultItem( SvxFontHeightItem( 423, 100, EE_CHAR_FONTHEIGHT ) ); // 12pt
+ }
+
ReInit();
}
diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx
index 46d63927a9d7..ea52a29c614b 100644
--- a/chart2/source/controller/inc/AccessibleBase.hxx
+++ b/chart2/source/controller/inc/AccessibleBase.hxx
@@ -27,6 +27,8 @@
#ifndef _CHART2_ACCESSIBLEBASE_HXX_
#define _CHART2_ACCESSIBLEBASE_HXX_
+#include "ObjectIdentifier.hxx"
+
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
@@ -50,6 +52,12 @@
class SfxItemSet;
class SdrObject;
+class SdrView;
+
+namespace accessibility
+{
+class IAccessibleViewForwarder;
+}
namespace chart
{
@@ -57,11 +65,11 @@ namespace chart
class AccessibleBase;
class ObjectHierarchy;
-typedef rtl::OUString AccessibleUniqueId;
+typedef ObjectIdentifier AccessibleUniqueId;
struct AccessibleElementInfo
{
- AccessibleUniqueId m_aCID;
+ AccessibleUniqueId m_aOID;
::com::sun::star::uno::WeakReference<
::com::sun::star::chart2::XChartDocument > m_xChartDocument;
@@ -75,6 +83,8 @@ struct AccessibleElementInfo
::boost::shared_ptr< ObjectHierarchy > m_spObjectHierarchy;
AccessibleBase * m_pParent;
+ SdrView* m_pSdrView;
+ ::accessibility::IAccessibleViewForwarder* m_pViewForwarder;
};
@@ -173,7 +183,7 @@ protected:
greater than the index of the removed element get an index one less than
before.
*/
- void RemoveChildById( const ::rtl::OUString & rId );
+ void RemoveChildByOId( const ObjectIdentifier& rOId );
/** Retrieve the pixel coordinates of logical coordinates (0,0) of the
current logic coordinate system. This can be used for
@@ -325,14 +335,14 @@ private:
/** type of the hash containing a vector index for every AccessibleUniqueId
of the object in the child list
*/
- typedef ::std::map< ::rtl::OUString, tAccessible > ChildCIDMap;
+ typedef ::std::map< ObjectIdentifier, tAccessible > ChildOIDMap;
bool m_bIsDisposed;
const bool m_bMayHaveChildren;
bool m_bChildrenInitialized;
ChildListVectorType m_aChildList;
- ChildCIDMap m_aChildCIDMap;
+ ChildOIDMap m_aChildOIDMap;
::comphelper::AccessibleEventNotifier::TClientId m_nEventNotifierId;
diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx
index 435871dbf55a..2cc46825a5aa 100644
--- a/chart2/source/controller/inc/AccessibleChartView.hxx
+++ b/chart2/source/controller/inc/AccessibleChartView.hxx
@@ -44,13 +44,17 @@
#include <boost/shared_ptr.hpp>
+namespace accessibility
+{
+class IAccessibleViewForwarder;
+}
+
//.............................................................................
namespace chart
{
//.............................................................................
class ExplicitValueProvider;
-class ObjectHierarchy;
namespace impl
{
@@ -67,14 +71,9 @@ class AccessibleChartView :
public:
AccessibleChartView(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext > & xContext );
+ ::com::sun::star::uno::XComponentContext >& xContext, SdrView* pView );
virtual ~AccessibleChartView();
- // ____ lang::XServiceInfo ____
- APPHELPER_XSERVICEINFO_DECL()
- APPHELPER_SERVICE_FACTORY_HELPER( AccessibleChartView )
-
-protected:
// ____ WeakComponentHelper (called from XComponent::dispose()) ____
virtual void SAL_CALL disposing();
@@ -112,6 +111,7 @@ protected:
virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException);
+protected:
// ________ AccessibleChartElement ________
virtual ::com::sun::star::awt::Point GetUpperLeftOnScreen() const;
@@ -141,7 +141,9 @@ private: // members
::com::sun::star::accessibility::XAccessible > m_xParent;
::boost::shared_ptr< ObjectHierarchy > m_spObjectHierarchy;
- AccessibleUniqueId m_aCurrentSelectionCID;
+ AccessibleUniqueId m_aCurrentSelectionOID;
+ SdrView* m_pSdrView;
+ ::accessibility::IAccessibleViewForwarder* m_pViewForwarder;
//no default constructor
AccessibleChartView();
diff --git a/configmgr/workben/memory/testmodules.hxx b/chart2/source/controller/inc/MenuResIds.hrc
index 96d6becf775d..38a09ad35ded 100644
--- a/configmgr/workben/memory/testmodules.hxx
+++ b/chart2/source/controller/inc/MenuResIds.hrc
@@ -24,15 +24,18 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef CHART_MENURESIDS_HRC
+#define CHART_MENURESIDS_HRC
-#ifndef CONFIGMGR_WORKBEN_TESTMODULES_
-#include <vector>
+#ifndef _SOLAR_HRC
+#include <svl/solar.hrc>
+#endif
-namespace configtest
-{
- extern char const * const s_aTestModules[];
- extern unsigned int const s_nTestModules;
- extern std::vector<char const *> listTestModules(int argc, char* argv[]);
-}
-#endif // CONFIGMGR_WORKBEN_TESTMODULES_
+//-----------------------------------------------------------------------------
+// context menus
+#define RID_CONTEXTMENU_SHAPE (RID_APP_START + 1)
+#define RID_CONTEXTMENU_SHAPEEDIT (RID_APP_START + 2)
+
+// CHART_MENURESIDS_HRC
+#endif
diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx
index f012fb500416..857b576fe6ef 100644
--- a/chart2/source/controller/inc/ObjectHierarchy.hxx
+++ b/chart2/source/controller/inc/ObjectHierarchy.hxx
@@ -27,6 +27,8 @@
#ifndef CHART2_OBJECTHIERARCHY_HXX
#define CHART2_OBJECTHIERARCHY_HXX
+#include "ObjectIdentifier.hxx"
+
#include <rtl/ustring.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
@@ -47,8 +49,8 @@ class ImplObjectHierarchy;
class ObjectHierarchy
{
public:
- typedef ::rtl::OUString tCID;
- typedef ::std::vector< tCID > tChildContainer;
+ typedef ObjectIdentifier tOID;
+ typedef ::std::vector< tOID > tChildContainer;
/** @param bFlattenDiagram
If <TRUE/>, the content of the diaram (data series, wall, floor,
@@ -63,20 +65,20 @@ public:
bool bOrderingForElementSelector = false );
~ObjectHierarchy();
- static tCID getRootNodeCID();
- static bool isRootNode( const tCID & rCID );
+ static tOID getRootNodeOID();
+ static bool isRootNode( const tOID& rOID );
- /// equal to getChildren( getRootNodeCID())
+ /// equal to getChildren( getRootNodeOID())
tChildContainer getTopLevelChildren() const;
- bool hasChildren( const tCID & rParent ) const;
- tChildContainer getChildren( const tCID & rParent ) const;
+ bool hasChildren( const tOID& rParent ) const;
+ tChildContainer getChildren( const tOID& rParent ) const;
- tChildContainer getSiblings( const tCID & rNode ) const;
+ tChildContainer getSiblings( const tOID& rNode ) const;
/// The result is empty, if the node cannot be found in the tree
- tCID getParent( const tCID & rNode ) const;
+ tOID getParent( const tOID& rNode ) const;
/// @returns -1, if no parent can be determined
- sal_Int32 getIndexInParent( const tCID & rNode ) const;
+ sal_Int32 getIndexInParent( const tOID& rNode ) const;
private:
@@ -86,16 +88,16 @@ private:
class ObjectKeyNavigation
{
public:
- explicit ObjectKeyNavigation( const ObjectHierarchy::tCID & rCurrentCID,
+ explicit ObjectKeyNavigation( const ObjectHierarchy::tOID & rCurrentOID,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider = 0 );
bool handleKeyEvent( const ::com::sun::star::awt::KeyEvent & rEvent );
- ObjectHierarchy::tCID getCurrentSelection() const;
+ ObjectHierarchy::tOID getCurrentSelection() const;
private:
- void setCurrentSelection( const ObjectHierarchy::tCID & rCID );
+ void setCurrentSelection( const ObjectHierarchy::tOID& rOID );
bool first();
bool last();
bool next();
@@ -105,7 +107,7 @@ private:
bool veryFirst();
bool veryLast();
- ObjectHierarchy::tCID m_aCurrentCID;
+ ObjectHierarchy::tOID m_aCurrentOID;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartDocument;
ExplicitValueProvider * m_pExplicitValueProvider;
diff --git a/configmgr/source/treemgr/viewaccess.cxx b/chart2/source/controller/inc/ShapeController.hrc
index 63c1804c03be..6c7b43526d22 100644
--- a/configmgr/source/treemgr/viewaccess.cxx
+++ b/chart2/source/controller/inc/ShapeController.hrc
@@ -24,33 +24,27 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "viewaccess.hxx"
-#include "tree.hxx"
-#include "noderef.hxx"
-
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
-configuration::NodeData* ViewTreeAccess::nodeData(configuration::NodeRef const& _aNodeArg) const
-{
- return this->nodeData(_aNodeArg.getOffset());
-}
-
-//-----------------------------------------------------------------------------
-configuration::NodeData* ViewTreeAccess::nodeData(unsigned int _aNodePos) const
-{
- return m_tree->nodeData(_aNodePos);
-}
+#ifndef CHART_SHAPECONTROLLER_HRC
+#define CHART_SHAPECONTROLLER_HRC
//-----------------------------------------------------------------------------
- }
-}
+//Command Ids:
+#define COMMAND_ID_FORMAT_LINE 1
+#define COMMAND_ID_FORMAT_AREA 2
+#define COMMAND_ID_TEXT_ATTRIBUTES 3
+#define COMMAND_ID_TRANSFORM_DIALOG 4
+#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5
+#define COMMAND_ID_RENAME_OBJECT 6
+#define COMMAND_ID_ARRANGE_ROW 7
+#define COMMAND_ID_BRING_TO_FRONT 8
+#define COMMAND_ID_FORWARD 9
+#define COMMAND_ID_BACKWARD 10
+#define COMMAND_ID_SEND_TO_BACK 11
+#define COMMAND_ID_CUT 12
+#define COMMAND_ID_COPY 13
+#define COMMAND_ID_PASTE 14
+#define COMMAND_ID_FONT_DIALOG 15
+#define COMMAND_ID_PARAGRAPH_DIALOG 16
+// CHART_SHAPECONTROLLER_HRC
+#endif
diff --git a/configmgr/source/inc/localizedtreeactions.hxx b/chart2/source/controller/inc/dlg_ShapeFont.hxx
index 3a3b4511284c..ec1b6553bd64 100644
--- a/configmgr/source/inc/localizedtreeactions.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeFont.hxx
@@ -24,29 +24,36 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef CHART2_DLG_SHAPEFONT_HXX
+#define CHART2_DLG_SHAPEFONT_HXX
-#ifndef CONFIGMGR_LOCALIZEDTREEACTIONS_HXX
-#define CONFIGMGR_LOCALIZEDTREEACTIONS_HXX
+#include <sfx2/tabdlg.hxx>
-#include "valuenode.hxx"
-#include "treesegment.hxx"
-//..........................................................................
-namespace configmgr
+//.............................................................................
+namespace chart
{
-class SubtreeChange;
+//.............................................................................
-//==========================================================================
-// Helper function to invoke the previous ones properly
+class ViewElementListProvider;
-// convert to the given locale format, assuming the original representation was expanded
-rtl::Reference< data::TreeSegment > cloneExpandedForLocale(sharable::TreeFragment * tree, rtl::OUString const& _sLocale);
-// convert to the given locale format, assuming the original representation was expanded
-std::auto_ptr<INode> reduceExpandedForLocale(std::auto_ptr<ISubtree> _pNode, rtl::OUString const& _sLocale);
+/** dialog for font properties of shapes
+ */
+class ShapeFontDialog : public SfxTabDialog
+{
+public:
+ ShapeFontDialog( Window* pParent, const SfxItemSet* pAttr,
+ const ViewElementListProvider* pViewElementListProvider );
+ virtual ~ShapeFontDialog();
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
+private:
+ virtual void PageCreated( USHORT nId, SfxTabPage& rPage );
-#endif // CONFIGMGR_LOCALIZEDTREEACTIONS_HXX
+ const ViewElementListProvider* m_pViewElementListProvider;
+};
+//.............................................................................
+} // namespace chart
+//.............................................................................
+// CHART2_DLG_SHAPEFONT_HXX
+#endif
diff --git a/configmgr/source/inc/nodeconverter.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
index 276b29f99979..2bc57bfcffc2 100644
--- a/configmgr/source/inc/nodeconverter.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
@@ -24,38 +24,31 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef CHART2_DLG_SHAPEPARAGRAPH_HXX
+#define CHART2_DLG_SHAPEPARAGRAPH_HXX
-#ifndef CONFIGMGR_NODECONVERTER_HXX
-#define CONFIGMGR_NODECONVERTER_HXX
+#include <sfx2/tabdlg.hxx>
-#include "change.hxx"
-
-//..........................................................................
-namespace configmgr
+//.............................................................................
+namespace chart
{
-//..........................................................................
- class OTreeNodeFactory;
-//..........................................................................
- class OTreeNodeConverter
- {
- OTreeNodeFactory& m_rFactory;
- public:
- OTreeNodeConverter();
- OTreeNodeConverter(OTreeNodeFactory& _rFactory)
- : m_rFactory(_rFactory) {}
-
- OTreeNodeFactory& nodeFactory() const { return m_rFactory; }
- // node conversion functions
- std::auto_ptr<ISubtree> createCorrespondingNode(SubtreeChange const& _rChange);
- std::auto_ptr<ValueNode> createCorrespondingNode(ValueChange const& _rChange);
+//.............................................................................
- std::auto_ptr<ISubtree> createCorrespondingTree(SubtreeChange& _rChange);
- };
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
+/** dialog for paragraph properties of shapes
+ */
+class ShapeParagraphDialog : public SfxTabDialog
+{
+public:
+ ShapeParagraphDialog( Window* pParent, const SfxItemSet* pAttr );
+ virtual ~ShapeParagraphDialog();
-#endif // CONFIGMGR_NODECONVERTER_HXX
+private:
+ virtual void PageCreated( USHORT nId, SfxTabPage& rPage );
+};
+//.............................................................................
+} // namespace chart
+//.............................................................................
+// CHART2_DLG_SHAPEPARAGRAPH_HXX
+#endif
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index c2202b031a17..4c0c7dc38ae3 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -50,6 +50,10 @@
#include "dlg_CreationWizard.hxx"
#include "dlg_ChartType.hxx"
//#include "svx/ActionDescriptionProvider.hxx"
+#include "AccessibleChartView.hxx"
+#include "DrawCommandDispatch.hxx"
+#include "ShapeController.hxx"
+#include "UndoManager.hxx"
#include <comphelper/InlineContainer.hxx>
@@ -97,6 +101,7 @@ namespace chart
//.............................................................................
using namespace ::com::sun::star;
+using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Reference;
@@ -124,7 +129,8 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const &
, m_bWaitingForMouseUp(false)
, m_bConnectingToView(false)
, m_xUndoManager( 0 )
- , m_aDispatchContainer( m_xCC )
+ , m_aDispatchContainer( m_xCC, this )
+ , m_eDrawMode( CHARTDRAW_SELECT )
{
DBG_CTOR(ChartController,NULL);
// m_aDispatchContainer.setUndoManager( m_xUndoManager );
@@ -438,6 +444,11 @@ APPHELPER_XSERVICEINFO_IMPL(ChartController,CHART_CONTROLLER_SERVICE_IMPLEMENTAT
//@todo: createElement should become unnecessary, remove when #i79198# is fixed
xLayoutManager->createElement( C2U( "private:resource/toolbar/toolbar" ) );
xLayoutManager->requestElement( C2U( "private:resource/toolbar/toolbar" ) );
+
+ // #i12587# support for shapes in chart
+ xLayoutManager->createElement( C2U( "private:resource/toolbar/drawbar" ) );
+ xLayoutManager->requestElement( C2U( "private:resource/toolbar/drawbar" ) );
+
xLayoutManager->requestElement( C2U( "private:resource/statusbar/statusbar" ) );
xLayoutManager->unlock();
@@ -559,13 +570,27 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
// set new model at dispatchers
m_aDispatchContainer.setModel( aNewModelRef->getModel());
- ControllerCommandDispatch * pDispatch = new ControllerCommandDispatch( m_xCC, this );
+ ControllerCommandDispatch * pDispatch = new ControllerCommandDispatch( m_xCC, this, &m_aDispatchContainer );
pDispatch->initialize();
// the dispatch container will return "this" for all commands returned by
// impl_getAvailableCommands(). That means, for those commands dispatch()
// is called here at the ChartController.
- m_aDispatchContainer.setFallbackDispatch( pDispatch, impl_getAvailableCommands() );
+ m_aDispatchContainer.setChartDispatch( pDispatch, impl_getAvailableCommands() );
+
+ DrawCommandDispatch* pDrawDispatch = new DrawCommandDispatch( m_xCC, this );
+ if ( pDrawDispatch )
+ {
+ pDrawDispatch->initialize();
+ m_aDispatchContainer.setDrawCommandDispatch( pDrawDispatch );
+ }
+
+ ShapeController* pShapeController = new ShapeController( m_xCC, this );
+ if ( pShapeController )
+ {
+ pShapeController->initialize();
+ m_aDispatchContainer.setShapeController( pShapeController );
+ }
#ifdef TEST_ENABLE_MODIFY_LISTENER
uno::Reference< util::XModifyBroadcaster > xMBroadcaster( aNewModelRef->getModel(),uno::UNO_QUERY );
@@ -1061,7 +1086,7 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
void SAL_CALL ChartController
::dispatch( const util::URL& rURL
- , const uno::Sequence< beans::PropertyValue >& /* rArgs */ )
+ , const uno::Sequence< beans::PropertyValue >& rArgs )
throw (uno::RuntimeException)
{
//@todo avoid OString (see Mathias mail on bug #104387#)
@@ -1161,7 +1186,16 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
else if( aCommand.equals("FormatSelection") )
this->executeDispatch_ObjectProperties();
else if( aCommand.equals("TransformDialog"))
- this->executeDispatch_PositionAndSize();
+ {
+ if ( isShapeContext() )
+ {
+ this->impl_ShapeControllerDispatch( rURL, rArgs );
+ }
+ else
+ {
+ this->executeDispatch_PositionAndSize();
+ }
+ }
else if( lcl_isFormatObjectCommand(aCommand) )
this->executeDispatch_FormatObject(rURL.Path);
//more format
@@ -1171,10 +1205,28 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
this->executeDispatch_ChartType();
else if( aCommand.equals("View3D"))
this->executeDispatch_View3D();
- else if( aCommand.equals("Forward"))
- this->executeDispatch_MoveSeries( sal_True );
- else if( aCommand.equals("Backward"))
- this->executeDispatch_MoveSeries( sal_False );
+ else if ( aCommand.equals( "Forward" ) )
+ {
+ if ( isShapeContext() )
+ {
+ this->impl_ShapeControllerDispatch( rURL, rArgs );
+ }
+ else
+ {
+ this->executeDispatch_MoveSeries( sal_True );
+ }
+ }
+ else if ( aCommand.equals( "Backward" ) )
+ {
+ if ( isShapeContext() )
+ {
+ this->impl_ShapeControllerDispatch( rURL, rArgs );
+ }
+ else
+ {
+ this->executeDispatch_MoveSeries( sal_False );
+ }
+ }
else if( aCommand.equals("NewArrangement"))
this->executeDispatch_NewArrangement();
else if( aCommand.equals("ToggleLegend"))
@@ -1390,6 +1442,20 @@ void SAL_CALL ChartController::modified( const lang::EventObject& /* aEvent */ )
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+IMPL_LINK( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction )
+{
+ ::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
+ if ( aObjectCID.getLength() == 0 )
+ {
+ UndoManager* pUndoManager = UndoManager::getImplementation( m_xUndoManager );
+ if ( pUndoManager )
+ {
+ pUndoManager->addShapeUndoAction( pUndoAction );
+ }
+ }
+ return 0L;
+}
+
DrawModelWrapper* ChartController::GetDrawModelWrapper()
{
if( !m_pDrawModelWrapper.get() )
@@ -1397,16 +1463,26 @@ DrawModelWrapper* ChartController::GetDrawModelWrapper()
ExplicitValueProvider* pProvider = ExplicitValueProvider::getExplicitValueProvider( m_xChartView );
if( pProvider )
m_pDrawModelWrapper = pProvider->getDrawModelWrapper();
+ if ( m_pDrawModelWrapper.get() )
+ {
+ m_pDrawModelWrapper->getSdrModel().SetNotifyUndoActionHdl( LINK( this, ChartController, NotifyUndoActionHdl ) );
+ }
}
return m_pDrawModelWrapper.get();
}
-uno::Reference< accessibility::XAccessible > ChartController::CreateAccessible()
+DrawViewWrapper* ChartController::GetDrawViewWrapper()
{
- uno::Reference< accessibility::XAccessible > xResult(
- m_xCC->getServiceManager()->createInstanceWithContext(
- CHART2_ACCESSIBLE_SERVICE_NAME, m_xCC ), uno::UNO_QUERY );
+ if ( !m_pDrawViewWrapper )
+ {
+ impl_createDrawViewController();
+ }
+ return m_pDrawViewWrapper;
+}
+uno::Reference< XAccessible > ChartController::CreateAccessible()
+{
+ uno::Reference< XAccessible > xResult = new AccessibleChartView( m_xCC, GetDrawViewWrapper() );
impl_initializeAccessible( uno::Reference< lang::XInitialization >( xResult, uno::UNO_QUERY ) );
return xResult;
}
@@ -1438,7 +1514,7 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
uno::Reference<frame::XModel> xModel(m_aModel->getModel());
aArguments[1]=uno::makeAny(xModel);
aArguments[2]=uno::makeAny(m_xChartView);
- uno::Reference< accessibility::XAccessible > xParent;
+ uno::Reference< XAccessible > xParent;
if( m_pChartWindow )
{
Window* pParentWin( m_pChartWindow->GetAccessibleParentWindow());
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index 130e40cb6828..8deffe47396f 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -57,6 +57,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/util/XModeChangeListener.hpp>
+#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/XLayoutManagerListener.hpp>
@@ -88,6 +89,8 @@ namespace chart
{
//.............................................................................
+enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT };
+
class WindowController
{
public:
@@ -155,6 +158,9 @@ class ChartController : public ::cppu::WeakImplHelper12 <
>
, public WindowController
{
+ friend class DrawCommandDispatch;
+ friend class ShapeController;
+
public:
//no default constructor
ChartController(::com::sun::star::uno::Reference<
@@ -463,6 +469,13 @@ public:
static bool isObjectDeleteable( const ::com::sun::star::uno::Any& rSelection );
+ void setDrawMode( ChartDrawMode eMode ) { m_eDrawMode = eMode; }
+ ChartDrawMode getDrawMode() const { return m_eDrawMode; }
+
+ bool isShapeContext() const;
+
+ DECL_LINK( NotifyUndoActionHdl, SdrUndoAction* );
+
public:
//-----------------------------------------------------------------
//-----------------------------------------------------------------
@@ -477,6 +490,7 @@ public:
private:
DrawModelWrapper* GetDrawModelWrapper();
+ DrawViewWrapper* GetDrawViewWrapper();
private:
class TheModelRef;
@@ -577,6 +591,8 @@ private:
::com::sun::star::frame::XLayoutManagerEventBroadcaster >
m_xLayoutManagerEventBroadcaster;
+ ChartDrawMode m_eDrawMode;
+
private:
//private methods
@@ -637,11 +653,11 @@ private:
void executeDispatch_DeleteMinorGrid();
void SAL_CALL executeDispatch_InsertSpecialCharacter();
- void SAL_CALL executeDispatch_EditText();
+ void SAL_CALL executeDispatch_EditText( const Point* pMousePixel = NULL );
void SAL_CALL executeDispatch_SourceData();
void SAL_CALL executeDispatch_MoveSeries( sal_Bool bForward );
- void StartTextEdit();
+ void StartTextEdit( const Point* pMousePixel = NULL );
bool EndTextEdit();
void SAL_CALL executeDispatch_View3D();
@@ -659,9 +675,12 @@ private:
void executeDispatch_ToggleLegend();
void executeDispatch_ToggleGridHorizontal();
+ void impl_ShapeControllerDispatch( const ::com::sun::star::util::URL& rURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+
//
DECL_LINK( DoubleClickWaitingHdl, void* );
- void execute_DoubleClick();
+ void execute_DoubleClick( const Point* pMousePixel = NULL );
void startDoubleClickWaiting();
void stopDoubleClickWaiting();
@@ -701,6 +720,8 @@ private:
void impl_PasteGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > & xGraphic,
const ::Point & aPosition );
+ void impl_PasteShapes( SdrModel* pModel );
+ void impl_PasteStringAsTextShape( const ::rtl::OUString& rString, const ::com::sun::star::awt::Point& rPosition );
void impl_SetMousePointer( const MouseEvent & rEvent );
void impl_ClearSelection();
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 4778f67f7bde..4df362ee80d2 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -64,15 +64,15 @@ using namespace ::com::sun::star;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void SAL_CALL ChartController::executeDispatch_EditText()
+void SAL_CALL ChartController::executeDispatch_EditText( const Point* pMousePixel )
{
- this->StartTextEdit();
+ this->StartTextEdit( pMousePixel );
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void ChartController::StartTextEdit()
+void ChartController::StartTextEdit( const Point* pMousePixel )
{
//the first marked object will be edited
@@ -111,6 +111,18 @@ void ChartController::StartTextEdit()
*/
m_pDrawViewWrapper->SetEditMode();
+ // #i12587# support for shapes in chart
+ if ( pMousePixel )
+ {
+ OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
+ if ( pOutlinerView )
+ {
+ MouseEvent aEditEvt( *pMousePixel, 1, MOUSE_SYNTHETIC, MOUSE_LEFT, 0 );
+ pOutlinerView->MouseButtonDown( aEditEvt );
+ pOutlinerView->MouseButtonUp( aEditEvt );
+ }
+ }
+
//we invalidate the outliner region because the outliner has some
//paint problems (some characters are painted twice a little bit shifted)
m_pChartWindow->Invalidate( m_pDrawViewWrapper->GetMarkedObjBoundRect() );
@@ -139,22 +151,38 @@ bool ChartController::EndTextEdit()
String aString = pOutliner->GetText(
pOutliner->GetParagraph( 0 ),
pOutliner->GetParagraphCount() );
- uno::Reference< beans::XPropertySet > xPropSet =
- ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getModel() );
-
- // lock controllers till end of block
- ControllerLockGuard aCLGuard( m_aModel->getModel());
- //Paragraph* pPara =
- TitleHelper::setCompleteString( aString, uno::Reference<
- ::com::sun::star::chart2::XTitle >::query( xPropSet ), m_xCC );
- try
+ ::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
+ if ( aObjectCID.getLength() > 0 )
{
- m_xUndoManager->postAction( C2U("Edit Text") );
+ uno::Reference< beans::XPropertySet > xPropSet =
+ ObjectIdentifier::getObjectPropertySet( aObjectCID, getModel() );
+
+ // lock controllers till end of block
+ ControllerLockGuard aCLGuard( m_aModel->getModel());
+
+ TitleHelper::setCompleteString( aString, uno::Reference<
+ ::com::sun::star::chart2::XTitle >::query( xPropSet ), m_xCC );
+
+ try
+ {
+ m_xUndoManager->postAction( C2U("Edit Text") );
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
}
- catch( uno::RuntimeException& e)
+ else
{
- ASSERT_EXCEPTION( e );
+ try
+ {
+ m_xUndoManager->cancelAction();
+ }
+ catch ( uno::RuntimeException& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
}
}
return true;
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 9edd2963aca4..352a7e1279cc 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -48,6 +48,7 @@
#include "LegendHelper.hxx"
#include "AxisHelper.hxx"
#include "RegressionCurveHelper.hxx"
+#include "ShapeController.hxx"
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
@@ -59,8 +60,6 @@
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-// #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-
#include <svx/ActionDescriptionProvider.hxx>
// for TransferableDataHelper/TransferableHelper
#include <svtools/transfer.hxx>
@@ -77,8 +76,17 @@
// for SolarMutex
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
// for OutlinerView
#include <editeng/outliner.hxx>
+#include <svx/svditer.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svdundo.hxx>
+#include <svx/unoapi.hxx>
+#include <svx/unopage.hxx>
+
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -184,50 +192,6 @@ bool lcl_deleteDataCurve(
} // anonymous namespace
-namespace
-{
-void lcl_InsertStringAsTextShapeIntoDrawPage(
- const Reference< lang::XMultiServiceFactory > & xShapeFactory,
- const Reference< drawing::XDrawPage > & xDrawPage,
- OUString & rString,
- const awt::Point & aPosition )
-{
- OSL_ASSERT( xShapeFactory.is() && xDrawPage.is());
- if( ! (xShapeFactory.is() && xDrawPage.is()))
- return;
-
- try
- {
- Reference< drawing::XShape > xTextShape(
- xShapeFactory->createInstance( C2U("com.sun.star.drawing.TextShape")), uno::UNO_QUERY_THROW );
- xDrawPage->add( xTextShape );
-
- Reference< text::XTextRange > xRange( xTextShape, uno::UNO_QUERY_THROW );
- xRange->setString( rString );
-
- float fCharHeight = 10.0;
- Reference< beans::XPropertySet > xProperties( xTextShape, uno::UNO_QUERY_THROW );
- xProperties->setPropertyValue( C2U("TextAutoGrowHeight"), uno::makeAny( true ));
- xProperties->setPropertyValue( C2U("TextAutoGrowWidth"), uno::makeAny( true ));
- xProperties->setPropertyValue( C2U("CharHeight"), uno::makeAny( fCharHeight ));
- xProperties->setPropertyValue( C2U("CharHeightAsian"), uno::makeAny( fCharHeight ));
- xProperties->setPropertyValue( C2U("CharHeightComplex"), uno::makeAny( fCharHeight ));
- xProperties->setPropertyValue( C2U("TextVerticalAdjust"), uno::makeAny( drawing::TextVerticalAdjust_CENTER ));
- xProperties->setPropertyValue( C2U("TextHorizontalAdjust"), uno::makeAny( drawing::TextHorizontalAdjust_CENTER ));
- xProperties->setPropertyValue( C2U("CharFontName"), uno::makeAny( C2U( "Albany" )));
-
- awt::Point aAdaptedPos( aPosition );
- aAdaptedPos.Y -= (xTextShape->getSize().Height / 2);
- aAdaptedPos.X -= (xTextShape->getSize().Width / 2);
- xTextShape->setPosition( aAdaptedPos );
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-}
-
-} // anonymous namespace
namespace chart
{
@@ -334,22 +298,21 @@ void ChartController::executeDispatch_Paste()
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( m_pChartWindow ));
if( aDataHelper.GetTransferable().is())
{
-// if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ))
-// {
-// SotStorageStreamRef xStm;
-// if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ))
-// {
-// xStm->Seek( 0 );
-// uno::Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ));
-// SdrModel * pModel = new SdrModel();
-// DrawModelWrapper * pDrawModelWrapper( this->GetDrawModelWrapper());
-// if( SvxDrawingLayerImport( pModel, xInputStream ))
-// lcl_CopyShapesToChart( *pModel, m_pDrawModelWrapper->getSdrModel());
-// delete pModel;
-// }
-// }
-// else
- if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ))
+ if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) )
+ {
+ SotStorageStreamRef xStm;
+ if ( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ) )
+ {
+ xStm->Seek( 0 );
+ Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ) );
+ ::boost::scoped_ptr< SdrModel > spModel( new SdrModel() );
+ if ( SvxDrawingLayerImport( spModel.get(), xInputStream ) )
+ {
+ impl_PasteShapes( spModel.get() );
+ }
+ }
+ }
+ else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) )
{
// graphic exchange format (graphic manager bitmap format?)
SotStorageStreamRef xStm;
@@ -382,14 +345,7 @@ void ChartController::executeDispatch_Paste()
pOutlinerView->InsertText( aString );
else
{
- awt::Point aTextPos;
- awt::Size aPageSize( ChartModelHelper::getPageSize( m_aModel->getModel()));
- aTextPos.X = (aPageSize.Width / 2);
- aTextPos.Y = (aPageSize.Height / 2);
- lcl_InsertStringAsTextShapeIntoDrawPage(
- m_pDrawModelWrapper->getShapeFactory(),
- m_pDrawModelWrapper->getMainDrawPage(),
- aString, aTextPos );
+ impl_PasteStringAsTextShape( aString, awt::Point( 0, 0 ) );
}
}
}
@@ -441,7 +397,6 @@ void ChartController::impl_PasteGraphic(
uno::Reference< beans::XPropertySet > xGraphicProp( xGraphic, uno::UNO_QUERY );
awt::Size aGraphicSize( 1000, 1000 );
- awt::Point aShapePos( 100,100 );
// first try size in 100th mm, then pixel size
if( ! ( xGraphicProp->getPropertyValue( C2U("Size100thMM")) >>= aGraphicSize ) &&
( ( xGraphicProp->getPropertyValue( C2U("SizePixel")) >>= aGraphicSize ) && m_pChartWindow ))
@@ -451,41 +406,158 @@ void ChartController::impl_PasteGraphic(
aGraphicSize.Height = aVCLSize.getHeight();
}
xGraphicShape->setSize( aGraphicSize );
-
- awt::Size aPageSize( ChartModelHelper::getPageSize( m_aModel->getModel()));
- aShapePos.X = (aPageSize.Width / 2) - (aGraphicSize.Width / 2);
- aShapePos.Y = (aPageSize.Height / 2) - (aGraphicSize.Height / 2);
- xGraphicShape->setPosition( aShapePos );
+ xGraphicShape->setPosition( awt::Point( 0, 0 ) );
}
}
-void ChartController::executeDispatch_Copy()
+void ChartController::impl_PasteShapes( SdrModel* pModel )
{
+ DrawModelWrapper* pDrawModelWrapper( this->GetDrawModelWrapper() );
+ if ( pDrawModelWrapper && m_pDrawViewWrapper )
+ {
+ Reference< drawing::XDrawPage > xDestPage( pDrawModelWrapper->getMainDrawPage() );
+ SdrPage* pDestPage = GetSdrPageFromXDrawPage( xDestPage );
+ if ( pDestPage )
+ {
+ Reference< drawing::XShape > xSelShape;
+ m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) );
+ sal_uInt16 nCount = pModel->GetPageCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ const SdrPage* pPage = pModel->GetPage( i );
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pObj = aIter.Next();
+ SdrObject* pNewObj = ( pObj ? pObj->Clone() : NULL );
+ if ( pNewObj )
+ {
+ pNewObj->SetModel( &pDrawModelWrapper->getSdrModel() );
+ pNewObj->SetPage( pDestPage );
+
+ // set position
+ Reference< drawing::XShape > xShape( pNewObj->getUnoShape(), uno::UNO_QUERY );
+ if ( xShape.is() )
+ {
+ xShape->setPosition( awt::Point( 0, 0 ) );
+ }
+
+ pDestPage->InsertObject( pNewObj );
+ m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pNewObj ) );
+ xSelShape = xShape;
+ }
+ }
+ }
+
+ Reference< util::XModifiable > xModifiable( m_aModel->getModel(), uno::UNO_QUERY );
+ if ( xModifiable.is() )
+ {
+ xModifiable->setModified( true );
+ }
- Reference< datatransfer::XTransferable > xTransferable;
+ // select last inserted shape
+ m_aSelection.setSelection( xSelShape );
+ m_aSelection.applySelection( m_pDrawViewWrapper );
+
+ m_pDrawViewWrapper->EndUndo();
+ }
+ }
+}
+void ChartController::impl_PasteStringAsTextShape( const OUString& rString, const awt::Point& rPosition )
+{
+ DrawModelWrapper* pDrawModelWrapper( this->GetDrawModelWrapper() );
+ if ( pDrawModelWrapper && m_pDrawViewWrapper )
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- SdrObject * pSelectedObj = 0;
- if( m_pDrawViewWrapper && m_pDrawModelWrapper )
- {
- if( m_aSelection.getSelectedCID().getLength() )
- pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( m_aSelection.getSelectedCID() );
- else
- pSelectedObj = DrawViewWrapper::getSdrObject( m_aSelection.getSelectedAdditionalShape() );
+ const Reference< lang::XMultiServiceFactory >& xShapeFactory( pDrawModelWrapper->getShapeFactory() );
+ const Reference< drawing::XDrawPage >& xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ OSL_ASSERT( xShapeFactory.is() && xDrawPage.is() );
- if( pSelectedObj )
+ if ( xShapeFactory.is() && xDrawPage.is() )
+ {
+ try
{
- xTransferable = Reference< datatransfer::XTransferable >( new ChartTransferable(
- & m_pDrawModelWrapper->getSdrModel(), pSelectedObj ));
+ Reference< drawing::XShape > xTextShape(
+ xShapeFactory->createInstance( C2U( "com.sun.star.drawing.TextShape" ) ), uno::UNO_QUERY_THROW );
+ xDrawPage->add( xTextShape );
+
+ Reference< text::XTextRange > xRange( xTextShape, uno::UNO_QUERY_THROW );
+ xRange->setString( rString );
+
+ float fCharHeight = 10.0;
+ Reference< beans::XPropertySet > xProperties( xTextShape, uno::UNO_QUERY_THROW );
+ xProperties->setPropertyValue( C2U( "TextAutoGrowHeight" ), uno::makeAny( true ) );
+ xProperties->setPropertyValue( C2U( "TextAutoGrowWidth" ), uno::makeAny( true ) );
+ xProperties->setPropertyValue( C2U( "CharHeight" ), uno::makeAny( fCharHeight ) );
+ xProperties->setPropertyValue( C2U( "CharHeightAsian" ), uno::makeAny( fCharHeight ) );
+ xProperties->setPropertyValue( C2U( "CharHeightComplex" ), uno::makeAny( fCharHeight ) );
+ xProperties->setPropertyValue( C2U( "TextVerticalAdjust" ), uno::makeAny( drawing::TextVerticalAdjust_CENTER ) );
+ xProperties->setPropertyValue( C2U( "TextHorizontalAdjust" ), uno::makeAny( drawing::TextHorizontalAdjust_CENTER ) );
+ xProperties->setPropertyValue( C2U( "CharFontName" ), uno::makeAny( C2U( "Albany" ) ) );
+
+ xTextShape->setPosition( rPosition );
+
+ m_aSelection.setSelection( xTextShape );
+ m_aSelection.applySelection( m_pDrawViewWrapper );
+
+ SdrObject* pObj = DrawViewWrapper::getSdrObject( xTextShape );
+ if ( pObj )
+ {
+ m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) );
+ m_pDrawViewWrapper->AddUndo( new SdrUndoInsertObj( *pObj ) );
+ m_pDrawViewWrapper->EndUndo();
+ }
+ }
+ catch ( const uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
}
}
}
- if( xTransferable.is() )
+}
+
+void ChartController::executeDispatch_Copy()
+{
+ if ( m_pDrawViewWrapper )
{
- Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard());
- if( xClipboard.is())
- xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
+ OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
+ if ( pOutlinerView )
+ {
+ pOutlinerView->Copy();
+ }
+ else
+ {
+ Reference< datatransfer::XTransferable > xTransferable;
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SdrObject* pSelectedObj = 0;
+ if ( m_pDrawModelWrapper )
+ {
+ ObjectIdentifier aSelOID( m_aSelection.getSelectedOID() );
+ if ( aSelOID.isAutoGeneratedObject() )
+ {
+ pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( aSelOID.getObjectCID() );
+ }
+ else if ( aSelOID.isAdditionalShape() )
+ {
+ pSelectedObj = DrawViewWrapper::getSdrObject( aSelOID.getAdditionalShape() );
+ }
+ if ( pSelectedObj )
+ {
+ xTransferable = Reference< datatransfer::XTransferable >( new ChartTransferable(
+ &m_pDrawModelWrapper->getSdrModel(), pSelectedObj, aSelOID.isAdditionalShape() ) );
+ }
+ }
+ }
+ if ( xTransferable.is() )
+ {
+ Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard() );
+ if ( xClipboard.is() )
+ {
+ xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
+ }
+ }
+ }
}
}
@@ -498,9 +570,10 @@ void ChartController::executeDispatch_Cut()
//static
bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
{
- OUString aSelObjCID;
- if( (rSelection >>= aSelObjCID) && aSelObjCID.getLength() > 0 )
+ ObjectIdentifier aSelOID( rSelection );
+ if ( aSelOID.isAutoGeneratedObject() )
{
+ OUString aSelObjCID( aSelOID.getObjectCID() );
ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
if( (OBJECTTYPE_TITLE == aObjectType) || (OBJECTTYPE_LEGEND == aObjectType)
|| (OBJECTTYPE_DATA_SERIES == aObjectType) )
@@ -513,6 +586,22 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
if( (OBJECTTYPE_DATA_LABELS == aObjectType) || (OBJECTTYPE_DATA_LABEL == aObjectType) )
return true;
}
+ else if ( aSelOID.isAdditionalShape() )
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool ChartController::isShapeContext() const
+{
+ if ( m_aSelection.isAdditionalShapeSelected() ||
+ ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() &&
+ ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ) )
+ {
+ return true;
+ }
return false;
}
@@ -779,4 +868,13 @@ void ChartController::executeDispatch_ToggleGridHorizontal()
}
}
+void ChartController::impl_ShapeControllerDispatch( const util::URL& rURL, const Sequence< beans::PropertyValue >& rArgs )
+{
+ Reference< frame::XDispatch > xDispatch( m_aDispatchContainer.getShapeController() );
+ if ( xDispatch.is() )
+ {
+ xDispatch->dispatch( rURL, rArgs );
+ }
+}
+
} // namespace chart
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index f66352d5870b..7822c8c1cc21 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -55,6 +55,8 @@
#include "AxisHelper.hxx"
#include "LegendHelper.hxx"
#include "servicenames_charttypes.hxx"
+#include "MenuResIds.hrc"
+#include "DrawCommandDispatch.hxx"
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
@@ -623,7 +625,10 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
if( pDrawViewWrapper->IsTextEdit() )
{
- if( pDrawViewWrapper->IsTextEditHit( aMPos, HITPIX) )
+ SdrViewEvent aVEvt;
+ if ( pDrawViewWrapper->IsTextEditHit( aMPos, HITPIX ) ||
+ // #i12587# support for shapes in chart
+ ( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt ) == SDRHIT_MARKEDOBJECT ) )
{
pDrawViewWrapper->MouseButtonDown(rMEvt,m_pChartWindow);
return;
@@ -652,6 +657,39 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
//only change selection if no selection handles are hit
if( !pHitSelectionHdl )
{
+ // #i12587# support for shapes in chart
+ if ( m_eDrawMode == CHARTDRAW_INSERT &&
+ ( !pDrawViewWrapper->IsMarkedHit( aMPos ) || !m_aSelection.isDragableObjectSelected() ) )
+ {
+ if ( m_aSelection.hasSelection() )
+ {
+ m_aSelection.clearSelection();
+ }
+ if ( !pDrawViewWrapper->IsAction() )
+ {
+ if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CAPTION )
+ {
+ Size aCaptionSize( 2268, 1134 );
+ pDrawViewWrapper->BegCreateCaptionObj( aMPos, aCaptionSize );
+ }
+ else
+ {
+ pDrawViewWrapper->BegCreateObj( aMPos);
+ }
+ SdrObject* pObj = pDrawViewWrapper->GetCreateObj();
+ DrawCommandDispatch* pDrawCommandDispatch = m_aDispatchContainer.getDrawCommandDispatch();
+ if ( pObj && m_pDrawModelWrapper && pDrawCommandDispatch )
+ {
+ SfxItemSet aSet( m_pDrawModelWrapper->GetItemPool() );
+ pDrawCommandDispatch->setAttributes( pObj );
+ pDrawCommandDispatch->setLineEnds( aSet );
+ pObj->SetMergedItemSet( aSet );
+ }
+ }
+ impl_SetMousePointer( rMEvt );
+ return;
+ }
+
m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper
, rMEvt.IsRight(), m_bWaitingForDoubleClick );
@@ -754,7 +792,38 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
return;
}
- if(pDrawViewWrapper->IsDragObj())
+ // #i12587# support for shapes in chart
+ if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() )
+ {
+ pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND );
+ if ( pDrawViewWrapper->AreObjectsMarked() )
+ {
+ if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT )
+ {
+ executeDispatch_EditText();
+ }
+ else
+ {
+ SdrObject* pObj = pDrawViewWrapper->getSelectedObject();
+ if ( pObj )
+ {
+ uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
+ if ( xShape.is() )
+ {
+ m_aSelection.setSelection( xShape );
+ m_aSelection.applySelection( pDrawViewWrapper );
+ }
+ }
+ }
+ }
+ else
+ {
+ m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper, rMEvt.IsRight(), m_bWaitingForDoubleClick );
+ m_aSelection.applySelection( pDrawViewWrapper );
+ setDrawMode( CHARTDRAW_SELECT );
+ }
+ }
+ else if ( pDrawViewWrapper->IsDragObj() )
{
bool bDraggingDone = false;
SdrDragMethod* pDragMethod = pDrawViewWrapper->SdrView::GetDragMethod();
@@ -839,7 +908,11 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
m_aSelection.resetPossibleSelectionAfterSingleClickWasEnsured();
}
else if( isDoubleClick(rMEvt) )
- execute_DoubleClick();
+ {
+ // #i12587# support for shapes in chart
+ Point aMousePixel = rMEvt.GetPosPixel();
+ execute_DoubleClick( &aMousePixel );
+ }
//@todo ForcePointer(&rMEvt);
pWindow->ReleaseMouse();
@@ -854,13 +927,39 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
impl_notifySelectionChangeListeners();
}
-void ChartController::execute_DoubleClick()
+void ChartController::execute_DoubleClick( const Point* pMousePixel )
{
- ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
- if( OBJECTTYPE_TITLE==eObjectType )
- executeDispatch_EditText();
+ bool bEditText = false;
+ if ( m_aSelection.hasSelection() )
+ {
+ ::rtl::OUString aCID( m_aSelection.getSelectedCID() );
+ if ( aCID.getLength() )
+ {
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
+ if ( OBJECTTYPE_TITLE == eObjectType )
+ {
+ bEditText = true;
+ }
+ }
+ else
+ {
+ // #i12587# support for shapes in chart
+ SdrObject* pObj = DrawViewWrapper::getSdrObject( m_aSelection.getSelectedAdditionalShape() );
+ if ( pObj && pObj->ISA( SdrTextObj ) )
+ {
+ bEditText = true;
+ }
+ }
+ }
+
+ if ( bEditText )
+ {
+ executeDispatch_EditText( pMousePixel );
+ }
else
+ {
executeDispatch_ObjectProperties();
+ }
}
void ChartController::execute_Resize()
@@ -907,272 +1006,288 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
impl_notifySelectionChangeListeners();
- // todo: the context menu should be specified by an xml file in uiconfig
- uno::Reference< awt::XPopupMenu > xPopupMenu(
- m_xCC->getServiceManager()->createInstanceWithContext(
- C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
- uno::Reference< awt::XMenuExtended > xMenuEx( xPopupMenu, uno::UNO_QUERY );
- if( xPopupMenu.is() && xMenuEx.is())
+ if ( isShapeContext() )
+ {
+ // #i12587# support for shapes in chart
+ PopupMenu aContextMenu( SchResId( m_pDrawViewWrapper->IsTextEdit() ?
+ RID_CONTEXTMENU_SHAPEEDIT : RID_CONTEXTMENU_SHAPE ) );
+ ::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
+ Point aPos( rCEvt.GetMousePosPixel() );
+ if( !rCEvt.IsMouseEvent() )
+ {
+ aPos = m_pChartWindow->GetPointerState().maPos;
+ }
+ aContextMenuHelper.completeAndExecute( aPos, aContextMenu );
+ }
+ else
{
- sal_Int16 nUniqueId = 1;
- ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
- Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( m_aModel->getModel() );
+ // todo: the context menu should be specified by an xml file in uiconfig
+ uno::Reference< awt::XPopupMenu > xPopupMenu(
+ m_xCC->getServiceManager()->createInstanceWithContext(
+ C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
+ uno::Reference< awt::XMenuExtended > xMenuEx( xPopupMenu, uno::UNO_QUERY );
+ if( xPopupMenu.is() && xMenuEx.is())
+ {
+ sal_Int16 nUniqueId = 1;
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
+ Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( m_aModel->getModel() );
- OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, aFormatCommand );
+ OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, aFormatCommand );
- //some commands for dataseries and points:
- //-----
- if( OBJECTTYPE_DATA_SERIES == eObjectType || OBJECTTYPE_DATA_POINT == eObjectType )
- {
- bool bIsPoint = ( OBJECTTYPE_DATA_POINT == eObjectType );
- uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
- uno::Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
- Reference< chart2::XRegressionCurve > xTrendline( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xCurveCnt ) );
- bool bHasEquation = RegressionCurveHelper::hasEquation( xTrendline );
- Reference< chart2::XRegressionCurve > xMeanValue( RegressionCurveHelper::getMeanValueLine( xCurveCnt ) );
- bool bHasYErrorBars = StatisticsHelper::hasErrorBars( xSeries, true );
- bool bHasDataLabelsAtSeries = DataSeriesHelper::hasDataLabelsAtSeries( xSeries );
- bool bHasDataLabelsAtPoints = DataSeriesHelper::hasDataLabelsAtPoints( xSeries );
- bool bHasDataLabelAtPoint = false;
- sal_Int32 nPointIndex = -1;
- if( bIsPoint )
+ //some commands for dataseries and points:
+ //-----
+ if( OBJECTTYPE_DATA_SERIES == eObjectType || OBJECTTYPE_DATA_POINT == eObjectType )
{
- nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
- bHasDataLabelAtPoint = DataSeriesHelper::hasDataLabelAtPoint( xSeries, nPointIndex );
- }
- bool bSelectedPointIsFormatted = false;
- bool bHasFormattedDataPointsOtherThanSelected = false;
+ bool bIsPoint = ( OBJECTTYPE_DATA_POINT == eObjectType );
+ uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ uno::Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ Reference< chart2::XRegressionCurve > xTrendline( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xCurveCnt ) );
+ bool bHasEquation = RegressionCurveHelper::hasEquation( xTrendline );
+ Reference< chart2::XRegressionCurve > xMeanValue( RegressionCurveHelper::getMeanValueLine( xCurveCnt ) );
+ bool bHasYErrorBars = StatisticsHelper::hasErrorBars( xSeries, true );
+ bool bHasDataLabelsAtSeries = DataSeriesHelper::hasDataLabelsAtSeries( xSeries );
+ bool bHasDataLabelsAtPoints = DataSeriesHelper::hasDataLabelsAtPoints( xSeries );
+ bool bHasDataLabelAtPoint = false;
+ sal_Int32 nPointIndex = -1;
+ if( bIsPoint )
+ {
+ nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
+ bHasDataLabelAtPoint = DataSeriesHelper::hasDataLabelAtPoint( xSeries, nPointIndex );
+ }
+ bool bSelectedPointIsFormatted = false;
+ bool bHasFormattedDataPointsOtherThanSelected = false;
- Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
- if( xSeriesProperties.is() )
- {
- uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
+ Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
+ if( xSeriesProperties.is() )
{
- if( aAttributedDataPointIndexList.hasElements() )
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
{
- if( bIsPoint )
+ if( aAttributedDataPointIndexList.hasElements() )
{
- ::std::vector< sal_Int32 > aIndices( ContainerHelper::SequenceToVector( aAttributedDataPointIndexList ) );
- ::std::vector< sal_Int32 >::iterator aIt = ::std::find( aIndices.begin(), aIndices.end(), nPointIndex );
- if( aIt != aIndices.end())
- bSelectedPointIsFormatted = true;
+ if( bIsPoint )
+ {
+ ::std::vector< sal_Int32 > aIndices( ContainerHelper::SequenceToVector( aAttributedDataPointIndexList ) );
+ ::std::vector< sal_Int32 >::iterator aIt = ::std::find( aIndices.begin(), aIndices.end(), nPointIndex );
+ if( aIt != aIndices.end())
+ bSelectedPointIsFormatted = true;
+ else
+ bHasFormattedDataPointsOtherThanSelected = true;
+ }
else
bHasFormattedDataPointsOtherThanSelected = true;
}
- else
- bHasFormattedDataPointsOtherThanSelected = true;
}
}
- }
- //const sal_Int32 nIdBeforeFormat = nUniqueId;
- if( bIsPoint )
- {
- if( bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabel") );
- if( !bHasDataLabelAtPoint )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabel") );
- else
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabel") );
- if( bSelectedPointIsFormatted )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetDataPoint"));
-
- xPopupMenu->insertSeparator( -1 );
-
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataSeries") );
- }
+ //const sal_Int32 nIdBeforeFormat = nUniqueId;
+ if( bIsPoint )
+ {
+ if( bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabel") );
+ if( !bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabel") );
+ else
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabel") );
+ if( bSelectedPointIsFormatted )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetDataPoint"));
+
+ xPopupMenu->insertSeparator( -1 );
+
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataSeries") );
+ }
- Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
- if( xChartType->getChartType().equals(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
- {
- try
+ Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
+ if( xChartType->getChartType().equals(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
{
- Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY );
- if( xChartTypeProp.is() )
+ try
{
- bool bJapaneseStyle = false;
- xChartTypeProp->getPropertyValue( C2U( "Japanese" ) ) >>= bJapaneseStyle;
-
- if( bJapaneseStyle )
+ Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY );
+ if( xChartTypeProp.is() )
{
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
+ bool bJapaneseStyle = false;
+ xChartTypeProp->getPropertyValue( C2U( "Japanese" ) ) >>= bJapaneseStyle;
+
+ if( bJapaneseStyle )
+ {
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
+ }
}
}
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
}
- catch( const uno::Exception & ex )
+
+ if( bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabels") );
+ if( xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendline") );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendlineEquation") );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMeanValue") );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatYErrorBars") );
+
+ //if( nIdBeforeFormat != nUniqueId )
+ xPopupMenu->insertSeparator( -1 );
+
+ //const sal_Int32 nIdBeforeInsert = nUniqueId;
+
+ if( !bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabels") );
+ if( !xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendline") );
+ else if( !bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation") );
+ if( !xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMeanValue") );
+ if( !bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertYErrorBars") );
+
+ //if( nIdBeforeInsert != nUniqueId )
+ // xPopupMenu->insertSeparator( -1 );
+
+ //const sal_Int32 nIdBeforeDelete = nUniqueId;
+
+ if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabels") );
+ if( xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendline") );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendlineEquation") );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMeanValue") );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteYErrorBars") );
+
+ if( bHasFormattedDataPointsOtherThanSelected )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetAllDataPoints"));
+
+ //if( nIdBeforeDelete != nUniqueId )
+ xPopupMenu->insertSeparator( -1 );
+
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId, C2U(".uno:ArrangeRow"));
+ uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
+ m_xCC->getServiceManager()->createInstanceWithContext(
+ C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
+ uno::Reference< awt::XMenuExtended > xArrangeMenuEx( xArrangePopupMenu, uno::UNO_QUERY );
+ if( xArrangePopupMenu.is() && xArrangeMenuEx.is())
{
- ASSERT_EXCEPTION( ex );
+ sal_Int16 nSubId = nUniqueId + 1;
+ lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId++, C2U(".uno:Forward") );
+ lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId, C2U(".uno:Backward") );
+ xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
+ nUniqueId = nSubId;
}
+ ++nUniqueId;
}
-
- if( bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabels") );
- if( xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendline") );
- if( bHasEquation )
+ else if( OBJECTTYPE_DATA_CURVE == eObjectType )
+ {
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendlineEquation") );
- if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMeanValue") );
- if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatYErrorBars") );
-
- //if( nIdBeforeFormat != nUniqueId )
- xPopupMenu->insertSeparator( -1 );
-
- //const sal_Int32 nIdBeforeInsert = nUniqueId;
-
- if( !bHasDataLabelsAtSeries )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabels") );
- if( !xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendline") );
- else if( !bHasEquation )
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation") );
- if( !xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMeanValue") );
- if( !bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertYErrorBars") );
-
- //if( nIdBeforeInsert != nUniqueId )
- // xPopupMenu->insertSeparator( -1 );
-
- //const sal_Int32 nIdBeforeDelete = nUniqueId;
-
- if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabels") );
- if( xTrendline.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendline") );
- if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquationAndR2") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendlineEquation") );
- if( xMeanValue.is() )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMeanValue") );
- if( bHasYErrorBars )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteYErrorBars") );
-
- if( bHasFormattedDataPointsOtherThanSelected )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetAllDataPoints"));
-
- //if( nIdBeforeDelete != nUniqueId )
- xPopupMenu->insertSeparator( -1 );
-
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId, C2U(".uno:ArrangeRow"));
- uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
- m_xCC->getServiceManager()->createInstanceWithContext(
- C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
- uno::Reference< awt::XMenuExtended > xArrangeMenuEx( xArrangePopupMenu, uno::UNO_QUERY );
- if( xArrangePopupMenu.is() && xArrangeMenuEx.is())
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
+ }
+ else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
{
- sal_Int16 nSubId = nUniqueId + 1;
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId++, C2U(".uno:Forward") );
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId, C2U(".uno:Backward") );
- xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
- nUniqueId = nSubId;
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
}
- ++nUniqueId;
- }
- else if( OBJECTTYPE_DATA_CURVE == eObjectType )
- {
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendlineEquation") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquationAndR2") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendlineEquation") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
- }
- else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
- {
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
- }
- //some commands for axes: and grids
- //-----
- else if( OBJECTTYPE_AXIS == eObjectType || OBJECTTYPE_GRID == eObjectType || OBJECTTYPE_SUBGRID == eObjectType )
- {
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
- if( xAxis.is() && xDiagram.is() )
+ //some commands for axes: and grids
+ //-----
+ else if( OBJECTTYPE_AXIS == eObjectType || OBJECTTYPE_GRID == eObjectType || OBJECTTYPE_SUBGRID == eObjectType )
{
- sal_Int32 nDimensionIndex = -1;
- sal_Int32 nCooSysIndex = -1;
- sal_Int32 nAxisIndex = -1;
- AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
- bool bIsSecondaryAxis = nAxisIndex!=0;
- bool bIsAxisVisible = AxisHelper::isAxisVisible( xAxis );
- bool bIsMajorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true /*bMainGrid*/, xDiagram );
- bool bIsMinorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false /*bMainGrid*/, xDiagram );
- bool bHasTitle = false;
- uno::Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY );
- if( xTitled.is())
- bHasTitle = TitleHelper::getCompleteString( xTitled->getTitleObject() ).getLength()>0;
-
- if( OBJECTTYPE_AXIS != eObjectType && bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatAxis") );
- if( OBJECTTYPE_GRID != eObjectType && bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMajorGrid") );
- if( OBJECTTYPE_SUBGRID != eObjectType && bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMinorGrid") );
-
- xPopupMenu->insertSeparator( -1 );
-
- if( OBJECTTYPE_AXIS != eObjectType && !bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxis") );
- if( OBJECTTYPE_GRID != eObjectType && !bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMajorGrid") );
- if( OBJECTTYPE_SUBGRID != eObjectType && !bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMinorGrid") );
- if( !bHasTitle )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxisTitle") );
-
- if( bIsAxisVisible )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteAxis") );
- if( bIsMajorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMajorGrid") );
- if( bIsMinorGridVisible && !bIsSecondaryAxis )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMinorGrid") );
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() && xDiagram.is() )
+ {
+ sal_Int32 nDimensionIndex = -1;
+ sal_Int32 nCooSysIndex = -1;
+ sal_Int32 nAxisIndex = -1;
+ AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
+ bool bIsSecondaryAxis = nAxisIndex!=0;
+ bool bIsAxisVisible = AxisHelper::isAxisVisible( xAxis );
+ bool bIsMajorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true /*bMainGrid*/, xDiagram );
+ bool bIsMinorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false /*bMainGrid*/, xDiagram );
+ bool bHasTitle = false;
+ uno::Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY );
+ if( xTitled.is())
+ bHasTitle = TitleHelper::getCompleteString( xTitled->getTitleObject() ).getLength()>0;
+
+ if( OBJECTTYPE_AXIS != eObjectType && bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatAxis") );
+ if( OBJECTTYPE_GRID != eObjectType && bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMajorGrid") );
+ if( OBJECTTYPE_SUBGRID != eObjectType && bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMinorGrid") );
+
+ xPopupMenu->insertSeparator( -1 );
+
+ if( OBJECTTYPE_AXIS != eObjectType && !bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxis") );
+ if( OBJECTTYPE_GRID != eObjectType && !bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMajorGrid") );
+ if( OBJECTTYPE_SUBGRID != eObjectType && !bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMinorGrid") );
+ if( !bHasTitle )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxisTitle") );
+
+ if( bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteAxis") );
+ if( bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMajorGrid") );
+ if( bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMinorGrid") );
+ }
}
- }
- if( OBJECTTYPE_DATA_STOCK_LOSS == eObjectType )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
- else if( OBJECTTYPE_DATA_STOCK_GAIN == eObjectType )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
+ if( OBJECTTYPE_DATA_STOCK_LOSS == eObjectType )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
+ else if( OBJECTTYPE_DATA_STOCK_GAIN == eObjectType )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:TransformDialog"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:TransformDialog"));
- if( OBJECTTYPE_PAGE == eObjectType || OBJECTTYPE_DIAGRAM == eObjectType
- || OBJECTTYPE_DIAGRAM_WALL == eObjectType
- || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType
- || OBJECTTYPE_UNKNOWN == eObjectType )
- {
- if( OBJECTTYPE_UNKNOWN != eObjectType )
- xPopupMenu->insertSeparator( -1 );
- bool bHasLegend = LegendHelper::hasLegend( xDiagram );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTitles") );
- if( !bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertLegend") );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertRemoveAxes") );
- if( bHasLegend )
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteLegend") );
+ if( OBJECTTYPE_PAGE == eObjectType || OBJECTTYPE_DIAGRAM == eObjectType
+ || OBJECTTYPE_DIAGRAM_WALL == eObjectType
+ || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType
+ || OBJECTTYPE_UNKNOWN == eObjectType )
+ {
+ if( OBJECTTYPE_UNKNOWN != eObjectType )
+ xPopupMenu->insertSeparator( -1 );
+ bool bHasLegend = LegendHelper::hasLegend( xDiagram );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTitles") );
+ if( !bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertLegend") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertRemoveAxes") );
+ if( bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteLegend") );
+ }
+ //-----
+
+ xPopupMenu->insertSeparator( -1 );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramType"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DataRanges"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramData"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:View3D"));
+ xPopupMenu->insertSeparator( -1 );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Cut"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Copy"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Paste"));
+
+ ::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
+ Point aPos( rCEvt.GetMousePosPixel() );
+ if( !rCEvt.IsMouseEvent() )
+ aPos = m_pChartWindow->GetPointerState().maPos;
+ aContextMenuHelper.completeAndExecute( aPos, xPopupMenu );
}
- //-----
-
- xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramType"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DataRanges"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramData"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:View3D"));
- xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Cut"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Copy"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Paste"));
-
- ::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
- Point aPos( rCEvt.GetMousePosPixel() );
- if( !rCEvt.IsMouseEvent() )
- aPos = m_pChartWindow->GetPointerState().maPos;
- aContextMenuHelper.completeAndExecute( aPos, xPopupMenu );
}
}
else if( ( rCEvt.GetCommand() == COMMAND_STARTEXTTEXTINPUT ) ||
@@ -1235,17 +1350,21 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
{
// Natvigation (Tab/F3/Home/End)
uno::Reference< XChartDocument > xChartDoc( m_aModel->getModel(), uno::UNO_QUERY );
- ObjectKeyNavigation aObjNav( m_aSelection.getSelectedCID(), xChartDoc, ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
+ ObjectKeyNavigation aObjNav( m_aSelection.getSelectedOID(), xChartDoc, ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
awt::KeyEvent aKeyEvent( ::svt::AcceleratorExecute::st_VCLKey2AWTKey( aKeyCode ));
bReturn = aObjNav.handleKeyEvent( aKeyEvent );
if( bReturn )
{
- ::rtl::OUString aNewCID = aObjNav.getCurrentSelection();
+ ObjectIdentifier aNewOID = aObjNav.getCurrentSelection();
uno::Any aNewSelection;
- if( aNewCID.getLength()>0 && !ObjectHierarchy::isRootNode( aNewCID ))
- aNewSelection <<= aNewCID;
- if( m_eDragMode == SDRDRAG_ROTATE && !SelectionHelper::isRotateableObject( aNewCID, m_aModel->getModel() ) )
+ if ( aNewOID.isValid() && !ObjectHierarchy::isRootNode( aNewOID ) )
+ {
+ aNewSelection = aNewOID.getAny();
+ }
+ if ( m_eDragMode == SDRDRAG_ROTATE && !SelectionHelper::isRotateableObject( aNewOID.getObjectCID(), m_aModel->getModel() ) )
+ {
m_eDragMode = SDRDRAG_MOVE;
+ }
bReturn = select( aNewSelection );
}
}
@@ -1498,24 +1617,64 @@ bool ChartController::requestQuickHelp(
::select( const uno::Any& rSelection )
throw( lang::IllegalArgumentException )
{
- rtl::OUString aNewCID;
- if( rSelection.hasValue() &&
- ! (rSelection >>= aNewCID))
- return sal_False;
+ bool bSuccess = false;
+ if ( rSelection.hasValue() )
+ {
+ const uno::Type& rType = rSelection.getValueType();
+ if ( rType == ::getCppuType( static_cast< const ::rtl::OUString* >( 0 ) ) )
+ {
+ ::rtl::OUString aNewCID;
+ if ( ( rSelection >>= aNewCID ) && m_aSelection.setSelection( aNewCID ) )
+ {
+ bSuccess = true;
+ }
+ }
+ else if ( rType == ::getCppuType( static_cast< const uno::Reference< drawing::XShape >* >( 0 ) ) )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ if ( ( rSelection >>= xShape ) && m_aSelection.setSelection( xShape ) )
+ {
+ bSuccess = true;
+ }
+ }
+ }
+ else
+ {
+ if ( m_aSelection.hasSelection() )
+ {
+ m_aSelection.clearSelection();
+ bSuccess = true;
+ }
+ }
- if( m_aSelection.setSelection( aNewCID ) )
+ if ( bSuccess )
{
this->impl_selectObjectAndNotiy();
return sal_True;
}
+
return sal_False;
}
uno::Any SAL_CALL ChartController
::getSelection() throw(uno::RuntimeException)
{
- return uno::makeAny(m_aSelection.getSelectedCID());
+ uno::Any aReturn;
+ if ( m_aSelection.hasSelection() )
+ {
+ ::rtl::OUString aCID( m_aSelection.getSelectedCID() );
+ if ( aCID.getLength() )
+ {
+ aReturn = uno::makeAny( aCID );
+ }
+ else
+ {
+ // #i12587# support for shapes in chart
+ aReturn = uno::makeAny( m_aSelection.getSelectedAdditionalShape() );
+ }
+ }
+ return aReturn;
}
void SAL_CALL ChartController
@@ -1701,7 +1860,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
sal_uInt16 nModifier = rEvent.GetModifier();
BOOL bLeftDown = rEvent.IsLeft();
- if( m_pDrawViewWrapper->IsTextEdit() )
+ if ( m_pDrawViewWrapper->IsTextEdit() )
{
if( m_pDrawViewWrapper->IsTextEditHit( aMousePos, HITPIX) )
{
@@ -1726,7 +1885,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
aMousePos, pWindow, nModifier, bLeftDown );
bool bForceArrowPointer = false;
- ::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
+ ObjectIdentifier aOID( m_aSelection.getSelectedOID() );
switch( aPointer.GetStyle())
{
@@ -1742,7 +1901,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
bForceArrowPointer = true;
break;
case POINTER_MOVE:
- if( ! ObjectIdentifier::isDragableObject( aObjectCID ))
+ if ( !aOID.isDragableObject() )
bForceArrowPointer = true;
break;
case POINTER_MOVEPOINT:
@@ -1762,6 +1921,55 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
}
else
{
+ // #i12587# support for shapes in chart
+ if ( m_eDrawMode == CHARTDRAW_INSERT &&
+ ( !m_pDrawViewWrapper->IsMarkedHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) )
+ {
+ PointerStyle ePointerStyle = POINTER_DRAW_RECT;
+ SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() );
+ switch ( eKind )
+ {
+ case OBJ_LINE:
+ {
+ ePointerStyle = POINTER_DRAW_LINE;
+ }
+ break;
+ case OBJ_RECT:
+ case OBJ_CUSTOMSHAPE:
+ {
+ ePointerStyle = POINTER_DRAW_RECT;
+ }
+ break;
+ case OBJ_CIRC:
+ {
+ ePointerStyle = POINTER_DRAW_ELLIPSE;
+ }
+ break;
+ case OBJ_FREELINE:
+ {
+ ePointerStyle = POINTER_DRAW_POLYGON;
+ }
+ break;
+ case OBJ_TEXT:
+ {
+ ePointerStyle = POINTER_DRAW_TEXT;
+ }
+ break;
+ case OBJ_CAPTION:
+ {
+ ePointerStyle = POINTER_DRAW_CAPTION;
+ }
+ break;
+ default:
+ {
+ ePointerStyle = POINTER_DRAW_RECT;
+ }
+ break;
+ }
+ pWindow->SetPointer( Pointer( ePointerStyle ) );
+ return;
+ }
+
::rtl::OUString aHitObjectCID(
SelectionHelper::getHitObjectCID(
aMousePos, *m_pDrawViewWrapper, true /*bGetDiagramInsteadOf_Wall*/ ));
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index d64f163f634c..80041d4c3818 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -30,12 +30,21 @@
#include "ChartTransferable.hxx"
+#include <unotools/streamwrap.hxx>
#include <vcl/graph.hxx>
+#include <svl/itempool.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <svx/svditer.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unomodel.hxx>
// header for class SdrView
#include <svx/svdview.hxx>
+#define CHARTTRANSFER_OBJECTTYPE_DRAWMODEL 1
+
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -45,7 +54,9 @@ using ::rtl::OUString;
namespace chart
{
-ChartTransferable::ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelectedObj )
+ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing )
+ :m_pMarkedObjModel( NULL )
+ ,m_bDrawing( bDrawing )
{
SdrExchangeView * pExchgView( new SdrView( pDrawModel ));
SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 ));
@@ -55,6 +66,10 @@ ChartTransferable::ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelect
pExchgView->MarkAllObj( pPv );
Graphic aGraphic( pExchgView->GetMarkedObjMetaFile( TRUE ));
m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
+ if ( m_bDrawing )
+ {
+ m_pMarkedObjModel = ( pExchgView ? pExchgView->GetAllMarkedModel() : NULL );
+ }
delete pExchgView;
}
@@ -63,6 +78,10 @@ ChartTransferable::~ChartTransferable()
void ChartTransferable::AddSupportedFormats()
{
+ if ( m_bDrawing )
+ {
+ AddFormat( SOT_FORMATSTR_ID_DRAWING );
+ }
AddFormat( SOT_FORMAT_GDIMETAFILE );
AddFormat( SOT_FORMAT_BITMAP );
}
@@ -74,7 +93,11 @@ sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataF
if( HasFormat( nFormat ))
{
- if( nFormat == FORMAT_GDIMETAFILE )
+ if ( nFormat == SOT_FORMATSTR_ID_DRAWING )
+ {
+ bResult = SetObject( m_pMarkedObjModel, CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
+ }
+ else if ( nFormat == FORMAT_GDIMETAFILE )
{
Graphic aGraphic( m_xMetaFileGraphic );
bResult = SetGDIMetaFile( aGraphic.GetGDIMetaFile(), rFlavor );
@@ -89,5 +112,61 @@ sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataF
return bResult;
}
+sal_Bool ChartTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+ const datatransfer::DataFlavor& /* rFlavor */ )
+{
+ // called from SetObject, put data into stream
+
+ sal_Bool bRet = sal_False;
+ switch ( nUserObjectId )
+ {
+ case CHARTTRANSFER_OBJECTTYPE_DRAWMODEL:
+ {
+ SdrModel* pMarkedObjModel = reinterpret_cast< SdrModel* >( pUserObject );
+ if ( pMarkedObjModel )
+ {
+ rxOStm->SetBufferSize( 0xff00 );
+
+ // #108584#
+ // for the changed pool defaults from drawing layer pool set those
+ // attributes as hard attributes to preserve them for saving
+ const SfxItemPool& rItemPool = pMarkedObjModel->GetItemPool();
+ const SvxFontHeightItem& rDefaultFontHeight = static_cast< const SvxFontHeightItem& >(
+ rItemPool.GetDefaultItem( EE_CHAR_FONTHEIGHT ) );
+ sal_uInt16 nCount = pMarkedObjModel->GetPageCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ const SdrPage* pPage = pMarkedObjModel->GetPage( i );
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pObj = aIter.Next();
+ const SvxFontHeightItem& rItem = static_cast< const SvxFontHeightItem& >(
+ pObj->GetMergedItem( EE_CHAR_FONTHEIGHT ) );
+ if ( rItem.GetHeight() == rDefaultFontHeight.GetHeight() )
+ {
+ pObj->SetMergedItem( rDefaultFontHeight );
+ }
+ }
+ }
+
+ Reference< io::XOutputStream > xDocOut( new utl::OOutputStreamWrapper( *rxOStm ) );
+ if ( SvxDrawingLayerExport( pMarkedObjModel, xDocOut ) )
+ {
+ rxOStm->Commit();
+ }
+
+ bRet = ( rxOStm->GetError() == ERRCODE_NONE );
+ }
+ }
+ break;
+ default:
+ {
+ DBG_ERROR( "ChartTransferable::WriteObject: unknown object id" );
+ }
+ break;
+ }
+ return bRet;
+}
} // namespace chart
diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx
index 2ce4e811d809..401f43c6d1ae 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -44,7 +44,7 @@ namespace chart
class ChartTransferable : public TransferableHelper
{
public:
- explicit ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelectedObj );
+ explicit ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing = false );
virtual ~ChartTransferable();
protected:
@@ -52,9 +52,13 @@ protected:
// implementation of TransferableHelper methods
virtual void AddSupportedFormats();
virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
private:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xMetaFileGraphic;
+ SdrModel* m_pMarkedObjModel;
+ bool m_bDrawing;
};
} // namespace chart
diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx
index 09da97b45014..3761d0c33ce0 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.cxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.cxx
@@ -33,6 +33,9 @@
#include "StatusBarCommandDispatch.hxx"
#include "DisposeHelper.hxx"
#include "macros.hxx"
+#include "ChartController.hxx"
+#include "DrawCommandDispatch.hxx"
+#include "ShapeController.hxx"
#include <comphelper/InlineContainer.hxx>
@@ -48,8 +51,11 @@ namespace chart
{
CommandDispatchContainer::CommandDispatchContainer(
- const Reference< uno::XComponentContext > & xContext ) :
- m_xContext( xContext )
+ const Reference< uno::XComponentContext > & xContext, ChartController* pController )
+ :m_xContext( xContext )
+ ,m_pChartController( pController )
+ ,m_pDrawCommandDispatch( NULL )
+ ,m_pShapeController( NULL )
{
m_aContainerDocumentCommands =
::comphelper::MakeSet< OUString >
@@ -75,21 +81,20 @@ void CommandDispatchContainer::setModel(
// m_xUndoManager = xUndoManager;
// }
-void CommandDispatchContainer::setFallbackDispatch(
- const Reference< frame::XDispatch > xFallbackDispatch,
- const ::std::set< OUString > & rFallbackCommands )
+void CommandDispatchContainer::setChartDispatch(
+ const Reference< frame::XDispatch > xChartDispatch,
+ const ::std::set< OUString > & rChartCommands )
{
- OSL_ENSURE(xFallbackDispatch.is(),"Invalid fall back dispatcher!");
- m_xFallbackDispatcher.set( xFallbackDispatch );
- m_aFallbackCommands = rFallbackCommands;
- m_aToBeDisposedDispatches.push_back( m_xFallbackDispatcher );
+ OSL_ENSURE(xChartDispatch.is(),"Invalid fall back dispatcher!");
+ m_xChartDispatcher.set( xChartDispatch );
+ m_aChartCommands = rChartCommands;
+ m_aToBeDisposedDispatches.push_back( m_xChartDispatcher );
}
Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL(
const util::URL & rURL )
{
Reference< frame::XDispatch > xResult;
-
tDispatchMap::const_iterator aIt( m_aCachedDispatches.find( rURL.Complete ));
if( aIt != m_aCachedDispatches.end())
{
@@ -127,10 +132,24 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL(
// ToDo: can those dispatches be cached?
m_aCachedDispatches[ rURL.Complete ].set( xResult );
}
- else if( m_xFallbackDispatcher.is() &&
- (m_aFallbackCommands.find( rURL.Path ) != m_aFallbackCommands.end()) )
+ else if( m_xChartDispatcher.is() &&
+ (m_aChartCommands.find( rURL.Path ) != m_aChartCommands.end()) )
+ {
+ xResult.set( m_xChartDispatcher );
+ m_aCachedDispatches[ rURL.Complete ].set( xResult );
+ }
+ // #i12587# support for shapes in chart
+ // Note, that the chart dispatcher must be queried first, because
+ // the chart dispatcher is the default dispatcher for all context
+ // sensitive commands.
+ else if ( m_pDrawCommandDispatch && m_pDrawCommandDispatch->isFeatureSupported( rURL.Complete ) )
+ {
+ xResult.set( m_pDrawCommandDispatch );
+ m_aCachedDispatches[ rURL.Complete ].set( xResult );
+ }
+ else if ( m_pShapeController && m_pShapeController->isFeatureSupported( rURL.Complete ) )
{
- xResult.set( m_xFallbackDispatcher );
+ xResult.set( m_pShapeController );
m_aCachedDispatches[ rURL.Complete ].set( xResult );
}
}
@@ -157,8 +176,11 @@ void CommandDispatchContainer::DisposeAndClear()
m_aCachedDispatches.clear();
DisposeHelper::DisposeAllElements( m_aToBeDisposedDispatches );
m_aToBeDisposedDispatches.clear();
- m_xFallbackDispatcher.clear();
- m_aFallbackCommands.clear();
+ m_xChartDispatcher.clear();
+ m_aChartCommands.clear();
+ m_pChartController = NULL;
+ m_pDrawCommandDispatch = NULL;
+ m_pShapeController = NULL;
}
Reference< frame::XDispatch > CommandDispatchContainer::getContainerDispatchForURL(
@@ -179,4 +201,16 @@ Reference< frame::XDispatch > CommandDispatchContainer::getContainerDispatchForU
return xResult;
}
+void CommandDispatchContainer::setDrawCommandDispatch( DrawCommandDispatch* pDispatch )
+{
+ m_pDrawCommandDispatch = pDispatch;
+ m_aToBeDisposedDispatches.push_back( Reference< frame::XDispatch >( pDispatch ) );
+}
+
+void CommandDispatchContainer::setShapeController( ShapeController* pController )
+{
+ m_pShapeController = pController;
+ m_aToBeDisposedDispatches.push_back( Reference< frame::XDispatch >( pController ) );
+}
+
} // namespace chart
diff --git a/chart2/source/controller/main/CommandDispatchContainer.hxx b/chart2/source/controller/main/CommandDispatchContainer.hxx
index 379e86481db1..2cee65405ef4 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.hxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.hxx
@@ -41,6 +41,10 @@
namespace chart
{
+class ChartController;
+class DrawCommandDispatch;
+class ShapeController;
+
/** @HTML
Helper class for implementing the <code>XDispatchProvider</code> interface
@@ -53,9 +57,9 @@ namespace chart
<li>Check if the command is handled by this class, e.g. Undo. If so,
return a corresponding <code>XDispatch</code> implementation, and cache
this implementation for later use</li>
- <li>Otherwise send the command to the fallback dispatch provider, if it
+ <li>Otherwise send the command to the chart dispatch provider, if it
can handle this dispatch (determined by the list of commands given in
- <code>setFallbackDispatch()</code>).</li>
+ <code>setChartDispatch()</code>).</li>
</ul>
<p>The <code>XDispatch</code>Provider is designed to return different
@@ -65,17 +69,18 @@ namespace chart
<p>As most commands need much information of the controller and are
implemented there, the controller handles most of the commands itself (it
also implements <code>XDispatch</code>). Therefore it is set here as
- fallback dispatch.</p>
+ chart dispatch.</p>
*/
class CommandDispatchContainer
{
public:
- // note: the fallback dispatcher should be removed when all commands are
- // handled by other dispatchers. (Fallback is currently the controller
+ // note: the chart dispatcher should be removed when all commands are
+ // handled by other dispatchers. (Chart is currently the controller
// itself)
explicit CommandDispatchContainer(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext > & xContext );
+ ::com::sun::star::uno::XComponentContext > & xContext,
+ ChartController* pController );
void setModel(
const ::com::sun::star::uno::Reference<
@@ -84,18 +89,18 @@ public:
// const ::com::sun::star::uno::Reference<
// ::com::sun::star::chart2::XUndoManager > & xUndoManager );
- /** Set a fallback dispatcher that is used for all commands contained in
- rFallbackCommands
+ /** Set a chart dispatcher that is used for all commands contained in
+ rChartCommands
*/
- void setFallbackDispatch(
+ void setChartDispatch(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XDispatch > xFallbackDispatch,
- const ::std::set< ::rtl::OUString > & rFallbackCommands );
+ ::com::sun::star::frame::XDispatch > xChartDispatch,
+ const ::std::set< ::rtl::OUString > & rChartCommands );
/** Returns the dispatch that is able to do the command given in rURL, if
implemented here. If the URL is not implemented here, it should be
- checked whether the command is one of the commands given as fallback via
- the setFallbackDispatch() method. If so, call the fallback dispatch.
+ checked whether the command is one of the commands given via
+ the setChartDispatch() method. If so, call the chart dispatch.
<p>If all this fails, return an empty dispatch.</p>
*/
@@ -116,6 +121,11 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > & xChartController,
const ::com::sun::star::util::URL & rURL );
+ void setDrawCommandDispatch( DrawCommandDispatch* pDispatch );
+ DrawCommandDispatch* getDrawCommandDispatch() { return m_pDrawCommandDispatch; }
+ void setShapeController( ShapeController* pController );
+ ShapeController* getShapeController() { return m_pShapeController; }
+
private:
typedef
::std::map< ::rtl::OUString,
@@ -133,10 +143,14 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xFallbackDispatcher;
- ::std::set< ::rtl::OUString > m_aFallbackCommands;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xChartDispatcher;
+ ::std::set< ::rtl::OUString > m_aChartCommands;
::std::set< ::rtl::OUString > m_aContainerDocumentCommands;
+
+ ChartController* m_pChartController;
+ DrawCommandDispatch* m_pDrawCommandDispatch;
+ ShapeController* m_pShapeController;
};
} // namespace chart
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 5fc58307b7a0..2652aadfdb32 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -42,6 +42,7 @@
#include "RegressionCurveHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "StatisticsHelper.hxx"
+#include "ShapeController.hxx"
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/frame/XStorable.hpp>
@@ -178,22 +179,22 @@ void ControllerState::update(
Reference< view::XSelectionSupplier > xSelectionSupplier(
xController, uno::UNO_QUERY );
- OUString aSelObjCID;
-
// Update ControllerState variables.
if( xSelectionSupplier.is())
{
uno::Any aSelObj( xSelectionSupplier->getSelection() );
+ ObjectIdentifier aSelOID( aSelObj );
+ OUString aSelObjCID( aSelOID.getObjectCID() );
- bHasSelectedObject = ((aSelObj >>= aSelObjCID) && aSelObjCID.getLength() > 0);
+ bHasSelectedObject = aSelOID.isValid();
ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
- bIsPositionableObject = (OBJECTTYPE_DATA_POINT != aObjectType) && ObjectIdentifier::isDragableObject( aSelObjCID );
+ bIsPositionableObject = (OBJECTTYPE_DATA_POINT != aObjectType) && aSelOID.isDragableObject();
bIsTextObject = OBJECTTYPE_TITLE == aObjectType;
uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ));
- bIsFormateableObjectSelected = bHasSelectedObject;
+ bIsFormateableObjectSelected = bHasSelectedObject && aSelOID.isAutoGeneratedObject();
if( OBJECTTYPE_DIAGRAM==aObjectType || OBJECTTYPE_DIAGRAM_WALL==aObjectType || OBJECTTYPE_DIAGRAM_FLOOR==aObjectType )
bIsFormateableObjectSelected = DiagramHelper::isSupportingFloorAndWall( xDiagram );
@@ -457,13 +458,15 @@ DBG_NAME(ControllerCommandDispatch)
ControllerCommandDispatch::ControllerCommandDispatch(
const Reference< uno::XComponentContext > & xContext,
- const Reference< frame::XController > & xController ) :
+ ChartController* pController, CommandDispatchContainer* pContainer ) :
impl::ControllerCommandDispatch_Base( xContext ),
- m_xController( xController ),
- m_xSelectionSupplier( xController, uno::UNO_QUERY ),
- m_xDispatch( xController, uno::UNO_QUERY ),
+ m_pChartController( pController ),
+ m_xController( Reference< frame::XController >( pController ) ),
+ m_xSelectionSupplier( Reference< view::XSelectionSupplier >( pController ) ),
+ m_xDispatch( Reference< frame::XDispatch >( pController ) ),
m_apModelState( new impl::ModelState() ),
- m_apControllerState( new impl::ControllerState() )
+ m_apControllerState( new impl::ControllerState() ),
+ m_pDispatchContainer( pContainer )
{
DBG_CTOR(ControllerCommandDispatch,NULL);
}
@@ -523,6 +526,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
// @todo: determine correctly
bool bHasSuitableClipboardContent = true;
+ bool bShapeContext = ( m_pChartController ? m_pChartController->isShapeContext() : false );
+
// edit commands
m_aCommandAvailability[ C2U(".uno:Cut")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
m_aCommandAvailability[ C2U(".uno:Copy")] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
@@ -540,7 +545,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:DefaultColors")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:BarWidth")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:NumberOfLines")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:ArrangeRow")] = m_apControllerState->bMayMoveSeriesForward || m_apControllerState->bMayMoveSeriesBackward;
+ m_aCommandAvailability[ C2U(".uno:ArrangeRow")] =
+ bShapeContext || ( bIsWritable && bControllerStateIsValid && ( m_apControllerState->bMayMoveSeriesForward || m_apControllerState->bMayMoveSeriesBackward ) );
// insert objects
m_aCommandAvailability[ C2U(".uno:InsertTitles")] = m_aCommandAvailability[ C2U(".uno:InsertMenuTitles")] = bIsWritable;
@@ -574,6 +580,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:Legend")] = bIsWritable && m_apModelState->bHasLegend;
m_aCommandAvailability[ C2U(".uno:DiagramWall")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasWall;
m_aCommandAvailability[ C2U(".uno:DiagramArea")] = bIsWritable;
+
m_aCommandAvailability[ C2U(".uno:TransformDialog")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsPositionableObject;
// 3d commands
@@ -623,8 +630,10 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:DiagramGridAll")] = bIsWritable && bModelStateIsValid && m_apModelState->HasAnyGrid();
// series arrangement
- m_aCommandAvailability[ C2U(".uno:Forward")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward;
- m_aCommandAvailability[ C2U(".uno:Backward")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward;
+ m_aCommandAvailability[ C2U(".uno:Forward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Forward" ) ) :
+ ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward ) );
+ m_aCommandAvailability[ C2U(".uno:Backward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Backward" ) ) :
+ ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward ) );
m_aCommandAvailability[ C2U(".uno:InsertDataLabels")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:InsertDataLabel")] = bIsWritable;
@@ -667,6 +676,17 @@ bool ControllerCommandDispatch::commandAvailable( const OUString & rCommand )
return false;
}
+bool ControllerCommandDispatch::isShapeControllerCommandAvailable( const ::rtl::OUString& rCommand )
+{
+ ShapeController* pShapeController = ( m_pDispatchContainer ? m_pDispatchContainer->getShapeController() : NULL );
+ if ( pShapeController )
+ {
+ FeatureState aState( pShapeController->getState( rCommand ) );
+ return aState.bEnabled;
+ }
+ return false;
+}
+
void ControllerCommandDispatch::fireStatusEvent(
const OUString & rURL,
const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ )
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.hxx b/chart2/source/controller/main/ControllerCommandDispatch.hxx
index a37d8b059b57..08d57a0d6cbf 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.hxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.hxx
@@ -38,6 +38,9 @@
namespace chart
{
+class ChartController;
+class CommandDispatchContainer;
+
namespace impl
{
struct ModelState;
@@ -64,8 +67,7 @@ public:
explicit ControllerCommandDispatch(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XController > & xController );
+ ChartController* pController, CommandDispatchContainer* pContainer );
virtual ~ControllerCommandDispatch();
// late initialisation, especially for adding as listener
@@ -109,6 +111,9 @@ private:
bool commandAvailable( const ::rtl::OUString & rCommand );
void updateCommandAvailability();
+ bool isShapeControllerCommandAvailable( const ::rtl::OUString& rCommand );
+
+ ChartController* m_pChartController;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XController > m_xController;
::com::sun::star::uno::Reference<
@@ -121,6 +126,8 @@ private:
mutable ::std::map< ::rtl::OUString, bool > m_aCommandAvailability;
mutable ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any > m_aCommandArguments;
+
+ CommandDispatchContainer* m_pDispatchContainer;
};
} // namespace chart
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
new file mode 100644
index 000000000000..aa28028c4861
--- /dev/null
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -0,0 +1,674 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "DrawCommandDispatch.hxx"
+#include "DrawCommandDispatch.hrc"
+#include "ChartController.hxx"
+#include "DrawViewWrapper.hxx"
+#include "chartview/DrawModelWrapper.hxx"
+#include "macros.hxx"
+
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+#include <svl/itempool.hxx>
+#include <editeng/adjitem.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/dialmgr.hxx>
+#include <svx/fmmodel.hxx>
+#include <svx/gallery.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/svdocapt.hxx>
+#include <svx/svdopath.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unoapi.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xlnedwit.hxx>
+#include <svx/xlnwtit.hxx>
+#include <svx/xtable.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+#include <boost/bind.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::frame;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+
+//.............................................................................
+namespace
+{
+//.............................................................................
+
+ // comparing two PropertyValue instances
+ struct PropertyValueCompare : public ::std::binary_function< beans::PropertyValue, ::rtl::OUString, bool >
+ {
+ bool operator() ( const beans::PropertyValue& rPropValue, const ::rtl::OUString& rName ) const
+ {
+ return rPropValue.Name.equals( rName );
+ }
+ bool operator() ( const ::rtl::OUString& rName, const beans::PropertyValue& rPropValue ) const
+ {
+ return rName.equals( rPropValue.Name );
+ }
+ };
+
+//.............................................................................
+} // anonymous namespace
+//.............................................................................
+
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+DrawCommandDispatch::DrawCommandDispatch( const Reference< uno::XComponentContext >& rxContext,
+ ChartController* pController )
+ :FeatureCommandDispatchBase( rxContext )
+ ,m_pChartController( pController )
+{
+}
+
+DrawCommandDispatch::~DrawCommandDispatch()
+{
+}
+
+void DrawCommandDispatch::initialize()
+{
+ FeatureCommandDispatchBase::initialize();
+}
+
+bool DrawCommandDispatch::isFeatureSupported( const ::rtl::OUString& rCommandURL )
+{
+ sal_uInt16 nFeatureId = 0;
+ ::rtl::OUString aBaseCommand;
+ ::rtl::OUString aCustomShapeType;
+ return parseCommandURL( rCommandURL, &nFeatureId, &aBaseCommand, &aCustomShapeType );
+}
+
+::basegfx::B2DPolyPolygon getPolygon( sal_uInt16 nResId, SdrModel& rModel )
+{
+ ::basegfx::B2DPolyPolygon aReturn;
+ XLineEndList* pLineEndList = rModel.GetLineEndList();
+ if ( pLineEndList )
+ {
+ String aName( SVX_RES( nResId ) );
+ long nCount = pLineEndList->Count();
+ for ( long nIndex = 0; nIndex < nCount; ++nIndex )
+ {
+ XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nIndex );
+ if ( pEntry->GetName() == aName )
+ {
+ aReturn = pEntry->GetLineEnd();
+ break;
+ }
+ }
+ }
+ return aReturn;
+}
+
+void DrawCommandDispatch::setAttributes( SdrObject* pObj )
+{
+ if ( m_pChartController )
+ {
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawModelWrapper && pDrawViewWrapper && pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CUSTOMSHAPE )
+ {
+ sal_Bool bAttributesAppliedFromGallery = sal_False;
+ if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
+ {
+ ::std::vector< ::rtl::OUString > aObjList;
+ if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
+ {
+ for ( sal_uInt16 i = 0; i < aObjList.size(); ++i )
+ {
+ if ( aObjList[ i ].equalsIgnoreAsciiCase( m_aCustomShapeType ) )
+ {
+ FmFormModel aModel;
+ SfxItemPool& rPool = aModel.GetItemPool();
+ rPool.FreezeIdRanges();
+ if ( GalleryExplorer::GetSdrObj( GALLERY_THEME_POWERPOINT, i, &aModel ) )
+ {
+ const SdrObject* pSourceObj = aModel.GetPage( 0 )->GetObj( 0 );
+ if ( pSourceObj )
+ {
+ const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
+ SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SDRATTR_START, SDRATTR_SHADOW_LAST,
+ SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
+ SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
+ // Graphic Attributes
+ SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST,
+ // 3d Properties
+ SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
+ // CustomShape properties
+ SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
+ // range from SdrTextObj
+ EE_ITEMS_START, EE_ITEMS_END,
+ // end
+ 0, 0);
+ aDest.Set( rSource );
+ pObj->SetMergedItemSet( aDest );
+ sal_Int32 nAngle = pSourceObj->GetRotateAngle();
+ if ( nAngle )
+ {
+ double a = nAngle * F_PI18000;
+ pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ }
+ bAttributesAppliedFromGallery = sal_True;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ if ( !bAttributesAppliedFromGallery )
+ {
+ pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, 0 ) );
+ pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
+ pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
+ pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ ( dynamic_cast< SdrObjCustomShape* >( pObj ) )->MergeDefaultAttributes( &m_aCustomShapeType );
+ }
+ }
+ }
+}
+
+void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
+{
+ if ( m_nFeatureId == COMMAND_ID_LINE_ARROW_END && m_pChartController )
+ {
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawModelWrapper && pDrawViewWrapper )
+ {
+ ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, pDrawModelWrapper->getSdrModel() ) );
+ if ( !aArrow.count() )
+ {
+ ::basegfx::B2DPolygon aNewArrow;
+ aNewArrow.append( ::basegfx::B2DPoint( 10.0, 0.0 ) );
+ aNewArrow.append( ::basegfx::B2DPoint( 0.0, 30.0) );
+ aNewArrow.append( ::basegfx::B2DPoint( 20.0, 30.0 ) );
+ aNewArrow.setClosed( true );
+ aArrow.append( aNewArrow );
+ }
+
+ SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
+ pDrawViewWrapper->GetAttributes( aSet );
+
+ long nWidth = 300; // (1/100th mm)
+ if ( aSet.GetItemState( XATTR_LINEWIDTH ) != SFX_ITEM_DONTCARE )
+ {
+ long nValue = ( ( const XLineWidthItem& ) aSet.Get( XATTR_LINEWIDTH ) ).GetValue();
+ if ( nValue > 0 )
+ {
+ nWidth = nValue * 3;
+ }
+ }
+
+ rAttr.Put( XLineEndItem( SVX_RESSTR( RID_SVXSTR_ARROW ), aArrow ) );
+ rAttr.Put( XLineEndWidthItem( nWidth ) );
+ }
+ }
+}
+
+// WeakComponentImplHelperBase
+void DrawCommandDispatch::disposing()
+{
+}
+
+// XEventListener
+void DrawCommandDispatch::disposing( const lang::EventObject& /* Source */ )
+ throw (uno::RuntimeException)
+{
+}
+
+FeatureState DrawCommandDispatch::getState( const ::rtl::OUString& rCommand )
+{
+ FeatureState aReturn;
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+
+ sal_uInt16 nFeatureId = 0;
+ ::rtl::OUString aBaseCommand;
+ ::rtl::OUString aCustomShapeType;
+ if ( parseCommandURL( rCommand, &nFeatureId, &aBaseCommand, &aCustomShapeType ) )
+ {
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_OBJECT_SELECT:
+ case COMMAND_ID_DRAW_LINE:
+ case COMMAND_ID_LINE_ARROW_END:
+ case COMMAND_ID_DRAW_RECT:
+ case COMMAND_ID_DRAW_ELLIPSE:
+ case COMMAND_ID_DRAW_FREELINE_NOFILL:
+ case COMMAND_ID_DRAW_TEXT:
+ case COMMAND_ID_DRAW_CAPTION:
+ case COMMAND_ID_DRAWTBX_CS_BASIC:
+ case COMMAND_ID_DRAWTBX_CS_SYMBOL:
+ case COMMAND_ID_DRAWTBX_CS_ARROW:
+ case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
+ case COMMAND_ID_DRAWTBX_CS_CALLOUT:
+ case COMMAND_ID_DRAWTBX_CS_STAR:
+ {
+ aReturn.bEnabled = true;
+ aReturn.aState <<= false;
+ }
+ break;
+ default:
+ {
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+ }
+ break;
+ }
+ }
+
+ return aReturn;
+}
+
+void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequence< beans::PropertyValue>& rArgs )
+{
+ (void)rArgs;
+
+ ChartDrawMode eDrawMode = CHARTDRAW_SELECT;
+ SdrObjKind eKind = OBJ_NONE;
+ bool bCreate = false;
+
+ sal_uInt16 nFeatureId = 0;
+ ::rtl::OUString aBaseCommand;
+ ::rtl::OUString aCustomShapeType;
+ if ( parseCommandURL( rCommand, &nFeatureId, &aBaseCommand, &aCustomShapeType ) )
+ {
+ m_nFeatureId = nFeatureId;
+ m_aCustomShapeType = aCustomShapeType;
+
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_OBJECT_SELECT:
+ {
+ eDrawMode = CHARTDRAW_SELECT;
+ eKind = OBJ_NONE;
+ }
+ break;
+ case COMMAND_ID_DRAW_LINE:
+ case COMMAND_ID_LINE_ARROW_END:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_LINE;
+ }
+ break;
+ case COMMAND_ID_DRAW_RECT:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_RECT;
+ }
+ break;
+ case COMMAND_ID_DRAW_ELLIPSE:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_CIRC;
+ }
+ break;
+ case COMMAND_ID_DRAW_FREELINE_NOFILL:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_FREELINE;
+ }
+ break;
+ case COMMAND_ID_DRAW_TEXT:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_TEXT;
+ bCreate = true;
+ }
+ break;
+ case COMMAND_ID_DRAW_CAPTION:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_CAPTION;
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_BASIC:
+ case COMMAND_ID_DRAWTBX_CS_SYMBOL:
+ case COMMAND_ID_DRAWTBX_CS_ARROW:
+ case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
+ case COMMAND_ID_DRAWTBX_CS_CALLOUT:
+ case COMMAND_ID_DRAWTBX_CS_STAR:
+ {
+ eDrawMode = CHARTDRAW_INSERT;
+ eKind = OBJ_CUSTOMSHAPE;
+ }
+ break;
+ default:
+ {
+ eDrawMode = CHARTDRAW_SELECT;
+ eKind = OBJ_NONE;
+ }
+ break;
+ }
+
+ if ( m_pChartController )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_pChartController->setDrawMode( eDrawMode );
+ setInsertObj( sal::static_int_cast< USHORT >( eKind ) );
+ if ( bCreate )
+ {
+ pDrawViewWrapper->SetCreateMode();
+ }
+
+ const ::rtl::OUString sKeyModifier( C2U( "KeyModifier" ) );
+ const beans::PropertyValue* pIter = rArgs.getConstArray();
+ const beans::PropertyValue* pEnd = pIter + rArgs.getLength();
+ const beans::PropertyValue* pKeyModifier = ::std::find_if(
+ pIter, pEnd, ::std::bind2nd( PropertyValueCompare(), boost::cref( sKeyModifier ) ) );
+ sal_Int16 nKeyModifier = 0;
+ if ( pKeyModifier && ( pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1 )
+ {
+ if ( eDrawMode == CHARTDRAW_INSERT )
+ {
+ SdrObject* pObj = createDefaultObject( nFeatureId );
+ if ( pObj )
+ {
+ SdrPageView* pPageView = pDrawViewWrapper->GetSdrPageView();
+ pDrawViewWrapper->InsertObjectAtView( pObj, *pPageView );
+ Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY );
+ if ( xShape.is() )
+ {
+ m_pChartController->m_aSelection.setSelection( xShape );
+ m_pChartController->m_aSelection.applySelection( pDrawViewWrapper );
+ }
+ if ( nFeatureId == SID_DRAW_TEXT )
+ {
+ m_pChartController->StartTextEdit();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void DrawCommandDispatch::describeSupportedFeatures()
+{
+ implDescribeSupportedFeature( ".uno:SelectObject", COMMAND_ID_OBJECT_SELECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Line", COMMAND_ID_DRAW_LINE, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:LineArrowEnd", COMMAND_ID_LINE_ARROW_END, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Rect", COMMAND_ID_DRAW_RECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Ellipse", COMMAND_ID_DRAW_ELLIPSE, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Freeline_Unfilled", COMMAND_ID_DRAW_FREELINE_NOFILL, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:DrawText", COMMAND_ID_DRAW_TEXT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:DrawCaption", COMMAND_ID_DRAW_CAPTION, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes", COMMAND_ID_DRAWTBX_CS_BASIC, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes", COMMAND_ID_DRAWTBX_CS_SYMBOL, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes", COMMAND_ID_DRAWTBX_CS_ARROW, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes", COMMAND_ID_DRAWTBX_CS_FLOWCHART, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes", COMMAND_ID_DRAWTBX_CS_CALLOUT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
+}
+
+void DrawCommandDispatch::setInsertObj( USHORT eObj )
+{
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ if ( pDrawViewWrapper )
+ {
+ pDrawViewWrapper->SetCurrentObj( eObj /*, Inventor */);
+ }
+}
+
+SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
+{
+ SdrObject* pObj = NULL;
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
+
+ if ( pDrawViewWrapper && pDrawModelWrapper )
+ {
+ Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ SdrPage* pPage = GetSdrPageFromXDrawPage( xDrawPage );
+ if ( pPage )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ pObj = SdrObjFactory::MakeNewObject( pDrawViewWrapper->GetCurrentObjInventor(),
+ pDrawViewWrapper->GetCurrentObjIdentifier(), pPage );
+ if ( pObj )
+ {
+ long nDefaultObjectSizeWidth = 4000;
+ long nDefaultObjectSizeHeight = 2500;
+ Size aObjectSize( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight );
+ Rectangle aPageRect( Rectangle( Point( 0, 0 ), pPage->GetSize() ) );
+ Point aObjectPos = aPageRect.Center();
+ aObjectPos.X() -= aObjectSize.Width() / 2;
+ aObjectPos.Y() -= aObjectSize.Height() / 2;
+ Rectangle aRect( aObjectPos, aObjectSize );
+
+ switch ( nID )
+ {
+ case COMMAND_ID_DRAW_LINE:
+ case COMMAND_ID_LINE_ARROW_END:
+ {
+ if ( pObj->ISA( SdrPathObj ) )
+ {
+ Point aStart = aRect.TopLeft();
+ Point aEnd = aRect.BottomRight();
+ sal_Int32 nYMiddle( ( aRect.Top() + aRect.Bottom() ) / 2 );
+ basegfx::B2DPolygon aPoly;
+ aPoly.append( basegfx::B2DPoint( aStart.X(), nYMiddle ) );
+ aPoly.append( basegfx::B2DPoint( aEnd.X(), nYMiddle ) );
+ ( dynamic_cast< SdrPathObj* >( pObj ) )->SetPathPoly( basegfx::B2DPolyPolygon( aPoly ) );
+ SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
+ setLineEnds( aSet );
+ pObj->SetMergedItemSet( aSet );
+ }
+ }
+ break;
+ case COMMAND_ID_DRAW_FREELINE_NOFILL:
+ {
+ if ( pObj->ISA( SdrPathObj ) )
+ {
+ basegfx::B2DPolygon aInnerPoly;
+ aInnerPoly.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom() ) );
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint( aRect.Left(), aRect.Top() ),
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Top() ),
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Center().Y() ) );
+ aInnerPoly.appendBezierSegment(
+ basegfx::B2DPoint( aRect.Center().X(), aRect.Bottom() ),
+ basegfx::B2DPoint( aRect.Right(), aRect.Bottom() ),
+ basegfx::B2DPoint( aRect.Right(), aRect.Top() ) );
+ basegfx::B2DPolyPolygon aPoly;
+ aPoly.append( aInnerPoly );
+ ( dynamic_cast< SdrPathObj* >( pObj ) )->SetPathPoly( aPoly );
+ }
+ }
+ break;
+ case COMMAND_ID_DRAW_TEXT:
+ case COMMAND_ID_DRAW_TEXT_VERTICAL:
+ {
+ if ( pObj->ISA( SdrTextObj ) )
+ {
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+ if ( pTextObj )
+ {
+ pTextObj->SetLogicRect( aRect );
+ BOOL bVertical = ( nID == SID_DRAW_TEXT_VERTICAL );
+ pTextObj->SetVerticalWriting( bVertical );
+ if ( bVertical )
+ {
+ SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
+ aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ aSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_TOP ) );
+ aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_RIGHT ) );
+ pTextObj->SetMergedItemSet( aSet );
+ }
+ }
+ }
+ }
+ break;
+ case COMMAND_ID_DRAW_CAPTION:
+ case COMMAND_ID_DRAW_CAPTION_VERTICAL:
+ {
+ if ( pObj->ISA( SdrCaptionObj ) )
+ {
+ sal_Bool bIsVertical( SID_DRAW_CAPTION_VERTICAL == nID );
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj );
+ if ( pTextObj )
+ {
+ pTextObj->SetVerticalWriting( bIsVertical );
+ }
+ if ( bIsVertical )
+ {
+ SfxItemSet aSet( pObj->GetMergedItemSet() );
+ aSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
+ aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_RIGHT ) );
+ pObj->SetMergedItemSet( aSet );
+ }
+ SdrCaptionObj* pCaptionObj = dynamic_cast< SdrCaptionObj* >( pObj );
+ if ( pCaptionObj )
+ {
+ pCaptionObj->SetLogicRect( aRect );
+ pCaptionObj->SetTailPos(
+ aRect.TopLeft() - Point( aRect.GetWidth() / 2, aRect.GetHeight() / 2 ) );
+ }
+ }
+ }
+ break;
+ default:
+ {
+ pObj->SetLogicRect( aRect );
+ SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
+ setAttributes( pObj );
+ pObj->SetMergedItemSet( aSet );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return pObj;
+}
+
+bool DrawCommandDispatch::parseCommandURL( const ::rtl::OUString& rCommandURL, sal_uInt16* pnFeatureId,
+ ::rtl::OUString* pBaseCommand, ::rtl::OUString* pCustomShapeType )
+{
+ bool bFound = true;
+ sal_uInt16 nFeatureId = 0;
+ ::rtl::OUString aBaseCommand;
+ ::rtl::OUString aType;
+
+ sal_Int32 nIndex = 1;
+ ::rtl::OUString aToken = rCommandURL.getToken( 0, '.', nIndex );
+ if ( nIndex == -1 || !aToken.getLength() )
+ {
+ aBaseCommand = rCommandURL;
+ SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( aBaseCommand );
+ if ( aIter != m_aSupportedFeatures.end() )
+ {
+ nFeatureId = aIter->second.nFeatureId;
+
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_DRAWTBX_CS_BASIC:
+ {
+ aType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "diamond" ) );
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_SYMBOL:
+ {
+ aType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "smiley" ) );
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_ARROW:
+ {
+ aType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "left-right-arrow" ) );
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_FLOWCHART:
+ {
+ aType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "flowchart-internal-storage" ) );
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_CALLOUT:
+ {
+ aType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "round-rectangular-callout" ) );
+ }
+ break;
+ case COMMAND_ID_DRAWTBX_CS_STAR:
+ {
+ aType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "star5" ) );
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+ }
+ else
+ {
+ bFound = false;
+ }
+ }
+ else
+ {
+ aBaseCommand = rCommandURL.copy( 0, nIndex - 1 );
+ SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( aBaseCommand );
+ if ( aIter != m_aSupportedFeatures.end() )
+ {
+ nFeatureId = aIter->second.nFeatureId;
+ aType = rCommandURL.getToken( 0, '.', nIndex );
+ }
+ else
+ {
+ bFound = false;
+ }
+ }
+
+ *pnFeatureId = nFeatureId;
+ *pBaseCommand = aBaseCommand;
+ *pCustomShapeType = aType;
+
+ return bFound;
+}
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
diff --git a/configmgr/source/treemgr/viewfactory.hxx b/chart2/source/controller/main/DrawCommandDispatch.hrc
index 626cfcc4a8c4..4e31fafaaf63 100644
--- a/configmgr/source/treemgr/viewfactory.hxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.hrc
@@ -24,30 +24,27 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef CHART_DRAWCOMMANDDISPATCH_HRC
+#define CHART_DRAWCOMMANDDISPATCH_HRC
-#ifndef CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
-#define CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
-
-namespace configmgr
-{
//-----------------------------------------------------------------------------
- namespace data { class TreeSegment; }
-
- namespace view
- {
- // Different standard (static) strategies
- //---------------------------------------------------------------------
- /// provides a factory for read-only node implementations
- rtl::Reference<ViewStrategy> createReadOnlyStrategy();
- /// provides a factory for nodes that cache changes temporarily
- rtl::Reference<ViewStrategy> createDeferredChangeStrategy();
- /// provides a factory for immediately commiting node implementations
- rtl::Reference<ViewStrategy> createDirectAccessStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment);
- //---------------------------------------------------------------------
- }
-
-//-----------------------------------------------------------------------------
-
-}
+//Command Ids:
+#define COMMAND_ID_OBJECT_SELECT 1
+#define COMMAND_ID_DRAW_LINE 2
+#define COMMAND_ID_LINE_ARROW_END 3
+#define COMMAND_ID_DRAW_RECT 4
+#define COMMAND_ID_DRAW_ELLIPSE 5
+#define COMMAND_ID_DRAW_FREELINE_NOFILL 6
+#define COMMAND_ID_DRAW_TEXT 7
+#define COMMAND_ID_DRAW_TEXT_VERTICAL 8
+#define COMMAND_ID_DRAW_CAPTION 9
+#define COMMAND_ID_DRAW_CAPTION_VERTICAL 10
+#define COMMAND_ID_DRAWTBX_CS_BASIC 11
+#define COMMAND_ID_DRAWTBX_CS_SYMBOL 12
+#define COMMAND_ID_DRAWTBX_CS_ARROW 13
+#define COMMAND_ID_DRAWTBX_CS_FLOWCHART 14
+#define COMMAND_ID_DRAWTBX_CS_CALLOUT 15
+#define COMMAND_ID_DRAWTBX_CS_STAR 16
-#endif // CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
+// CHART_DRAWCOMMANDDISPATCH_HRC
+#endif
diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx
new file mode 100644
index 000000000000..38c886e29abb
--- /dev/null
+++ b/chart2/source/controller/main/DrawCommandDispatch.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_DRAWCOMMANDDISPATCH_HXX
+#define CHART2_DRAWCOMMANDDISPATCH_HXX
+
+#include "FeatureCommandDispatchBase.hxx"
+
+#include <tools/solar.h>
+
+class SfxItemSet;
+class SdrObject;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class ChartController;
+
+/** This is a CommandDispatch implementation for drawing objects.
+ */
+class DrawCommandDispatch: public FeatureCommandDispatchBase
+{
+public:
+ DrawCommandDispatch( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
+ virtual ~DrawCommandDispatch();
+
+ // late initialisation, especially for adding as listener
+ virtual void initialize();
+
+ virtual bool isFeatureSupported( const ::rtl::OUString& rCommandURL );
+
+ void setAttributes( SdrObject* pObj );
+ void setLineEnds( SfxItemSet& rAttr );
+
+protected:
+ // WeakComponentImplHelperBase
+ virtual void SAL_CALL disposing();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // state of a feature
+ virtual FeatureState getState( const ::rtl::OUString& rCommand );
+
+ // execute a feature
+ virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs );
+
+ // all the features which should be handled by this class
+ virtual void describeSupportedFeatures();
+
+private:
+ void setInsertObj( USHORT eObj );
+ SdrObject* createDefaultObject( const sal_uInt16 nID );
+
+ bool parseCommandURL( const ::rtl::OUString& rCommandURL, sal_uInt16* pnFeatureId, ::rtl::OUString* pBaseCommand, ::rtl::OUString* pCustomShapeType );
+
+ ChartController* m_pChartController;
+ ::rtl::OUString m_aCustomShapeType;
+};
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
+
+// CHART2_DRAWCOMMANDDISPATCH_HXX
+#endif
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index 49a8736bb11b..3b41fd1b6b66 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -34,6 +34,9 @@
#include "ObjectHierarchy.hxx"
#include "servicenames.hxx"
#include <chartview/ExplicitValueProvider.hxx>
+#include "DrawViewWrapper.hxx"
+#include "ResId.hxx"
+#include "Strings.hrc"
#include <toolkit/helper/vclunohelper.hxx>
#include <vos/mutex.hxx>
@@ -71,20 +74,21 @@ SelectorListBox::~SelectorListBox()
{
}
-void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectHierarchy::tCID & rParent, std::vector< ListBoxEntryData >& rEntries
+void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectHierarchy::tOID & rParent, std::vector< ListBoxEntryData >& rEntries
, const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc )
{
ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
ObjectHierarchy::tChildContainer::const_iterator aIt( aChildren.begin());
while( aIt != aChildren.end() )
{
- ::rtl::OUString aCID = *aIt;
+ ObjectHierarchy::tOID aOID = *aIt;
+ ::rtl::OUString aCID = aOID.getObjectCID();
ListBoxEntryData aEntry;
- aEntry.CID = aCID;
+ aEntry.OID = aOID;
aEntry.UIName += ObjectNameProvider::getNameForCID( aCID, xChartDoc );
aEntry.nHierarchyDepth = nHierarchyDepth;
rEntries.push_back(aEntry);
- lcl_addObjectsToList( rHierarchy, aCID, rEntries, nHierarchyDepth+1, xChartDoc );
+ lcl_addObjectsToList( rHierarchy, aOID, rEntries, nHierarchyDepth+1, xChartDoc );
++aIt;
}
}
@@ -103,14 +107,18 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
if( xChartController.is() )
{
Reference< view::XSelectionSupplier > xSelectionSupplier( xChartController, uno::UNO_QUERY);
+ ObjectHierarchy::tOID aSelectedOID;
rtl::OUString aSelectedCID;
if( xSelectionSupplier.is() )
- xSelectionSupplier->getSelection() >>= aSelectedCID;
+ {
+ aSelectedOID = ObjectIdentifier( xSelectionSupplier->getSelection() );
+ aSelectedCID = aSelectedOID.getObjectCID();
+ }
Reference< chart2::XChartDocument > xChartDoc( xChartController->getModel(), uno::UNO_QUERY );
- ObjectType eType( ObjectIdentifier::getObjectType( aSelectedCID ));
+ ObjectType eType( aSelectedOID.getObjectType() );
bool bAddSelectionToList = false;
- if( eType == OBJECTTYPE_DATA_POINT || eType == OBJECTTYPE_DATA_LABEL )
+ if ( eType == OBJECTTYPE_DATA_POINT || eType == OBJECTTYPE_DATA_LABEL || eType == OBJECTTYPE_SHAPE )
bAddSelectionToList = true;
Reference< uno::XInterface > xChartView;
@@ -119,27 +127,39 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
xChartView = xFact->createInstance( CHART_VIEW_SERVICE_NAME );
ExplicitValueProvider* pExplicitValueProvider = 0;//ExplicitValueProvider::getExplicitValueProvider(xChartView); dies erzeugt alle sichtbaren datenpinkte, das ist zu viel
ObjectHierarchy aHierarchy( xChartDoc, pExplicitValueProvider, true /*bFlattenDiagram*/, true /*bOrderingForElementSelector*/ );
- lcl_addObjectsToList( aHierarchy, aHierarchy.getRootNodeCID(), m_aEntries, 0, xChartDoc );
+ lcl_addObjectsToList( aHierarchy, aHierarchy.getRootNodeOID(), m_aEntries, 0, xChartDoc );
std::vector< ListBoxEntryData >::iterator aIt( m_aEntries.begin() );
if( bAddSelectionToList )
{
- rtl::OUString aSeriesCID = ObjectIdentifier::createClassifiedIdentifierForParticle( ObjectIdentifier::getSeriesParticleFromCID( aSelectedCID ) );
- for( aIt = m_aEntries.begin(); aIt != m_aEntries.end(); ++aIt )
+ if ( aSelectedOID.isAutoGeneratedObject() )
{
- if( aIt->CID.match( aSeriesCID ) )
+ rtl::OUString aSeriesCID = ObjectIdentifier::createClassifiedIdentifierForParticle( ObjectIdentifier::getSeriesParticleFromCID( aSelectedCID ) );
+ for( aIt = m_aEntries.begin(); aIt != m_aEntries.end(); ++aIt )
{
- ListBoxEntryData aEntry;
- aEntry.UIName = ObjectNameProvider::getNameForCID( aSelectedCID, xChartDoc );
- aEntry.CID = aSelectedCID;
- ++aIt;
- if( aIt != m_aEntries.end() )
- m_aEntries.insert(aIt, aEntry);
- else
- m_aEntries.push_back( aEntry );
- break;
+ if( aIt->OID.getObjectCID().match( aSeriesCID ) )
+ {
+ ListBoxEntryData aEntry;
+ aEntry.UIName = ObjectNameProvider::getNameForCID( aSelectedCID, xChartDoc );
+ aEntry.OID = aSelectedOID;
+ ++aIt;
+ if( aIt != m_aEntries.end() )
+ m_aEntries.insert(aIt, aEntry);
+ else
+ m_aEntries.push_back( aEntry );
+ break;
+ }
}
}
+ else if ( aSelectedOID.isAdditionalShape() )
+ {
+ ListBoxEntryData aEntry;
+ SdrObject* pSelectedObj = DrawViewWrapper::getSdrObject( aSelectedOID.getAdditionalShape() );
+ ::rtl::OUString aName( pSelectedObj ? pSelectedObj->GetName() : String() );
+ aEntry.UIName = ( aName.getLength() > 0 ? aName : ::rtl::OUString( String( SchResId( STR_OBJECT_SHAPE ) ) ) );
+ aEntry.OID = aSelectedOID;
+ m_aEntries.push_back( aEntry );
+ }
}
USHORT nEntryPosToSelect = 0; bool bSelectionFound = false;
@@ -147,7 +167,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
for( USHORT nN=0; aIt != m_aEntries.end(); ++aIt, ++nN )
{
InsertEntry( aIt->UIName );
- if( !bSelectionFound && aSelectedCID.equals( aIt->CID ) )
+ if ( !bSelectionFound && aSelectedOID == aIt->OID )
{
nEntryPosToSelect = nN;
bSelectionFound = true;
@@ -188,11 +208,10 @@ void SelectorListBox::Select()
USHORT nPos = GetSelectEntryPos();
if( nPos < m_aEntries.size() )
{
- rtl::OUString aCID = m_aEntries[nPos].CID;
- uno::Any aASelection( uno::makeAny(aCID) );
+ ObjectHierarchy::tOID aOID = m_aEntries[nPos].OID;
Reference< view::XSelectionSupplier > xSelectionSupplier( m_xChartController.get(), uno::UNO_QUERY );
if( xSelectionSupplier.is() )
- xSelectionSupplier->select(aASelection);
+ xSelectionSupplier->select( aOID.getAny() );
}
ReleaseFocus_Impl();
}
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
index 6f51c1df0ce6..d85415d614e2 100644
--- a/chart2/source/controller/main/ElementSelector.hxx
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -28,6 +28,7 @@
#define _CHART_ELEMENTSELECTOR_HXX
#include "ServiceMacros.hxx"
+#include "ObjectHierarchy.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase1.hxx>
#include <svtools/toolboxcontroller.hxx>
@@ -45,7 +46,7 @@ namespace chart
struct ListBoxEntryData
{
rtl::OUString UIName;
- rtl::OUString CID;
+ ObjectHierarchy::tOID OID;
sal_Int32 nHierarchyDepth;
ListBoxEntryData() : nHierarchyDepth(0)
diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
new file mode 100644
index 000000000000..39b4e1d4a171
--- /dev/null
+++ b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "FeatureCommandDispatchBase.hxx"
+
+using namespace ::com::sun::star;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+namespace chart
+{
+
+FeatureCommandDispatchBase::FeatureCommandDispatchBase( const Reference< uno::XComponentContext >& rxContext )
+ :CommandDispatch( rxContext )
+ ,m_nFeatureId( 0 )
+{
+}
+
+FeatureCommandDispatchBase::~FeatureCommandDispatchBase()
+{
+}
+
+void FeatureCommandDispatchBase::initialize()
+{
+ CommandDispatch::initialize();
+ fillSupportedFeatures();
+}
+
+bool FeatureCommandDispatchBase::isFeatureSupported( const ::rtl::OUString& rCommandURL )
+{
+ SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommandURL );
+ if ( aIter != m_aSupportedFeatures.end() )
+ {
+ return true;
+ }
+ return false;
+}
+
+void FeatureCommandDispatchBase::fireStatusEvent( const ::rtl::OUString& rURL,
+ const Reference< frame::XStatusListener >& xSingleListener /* = 0 */ )
+{
+ if ( rURL.getLength() == 0 )
+ {
+ SupportedFeatures::const_iterator aEnd( m_aSupportedFeatures.end() );
+ for ( SupportedFeatures::const_iterator aIter( m_aSupportedFeatures.begin() ); aIter != aEnd; ++aIter )
+ {
+ FeatureState aFeatureState( getState( aIter->first ) );
+ fireStatusEventForURL( aIter->first, aFeatureState.aState, aFeatureState.bEnabled, xSingleListener );
+ }
+ }
+ else
+ {
+ FeatureState aFeatureState( getState( rURL ) );
+ fireStatusEventForURL( rURL, aFeatureState.aState, aFeatureState.bEnabled, xSingleListener );
+ }
+}
+
+// XDispatch
+void FeatureCommandDispatchBase::dispatch( const util::URL& URL,
+ const Sequence< beans::PropertyValue >& Arguments )
+ throw (uno::RuntimeException)
+{
+ ::rtl::OUString aCommand( URL.Complete );
+ if ( getState( aCommand ).bEnabled )
+ {
+ execute( aCommand, Arguments );
+ }
+}
+
+void FeatureCommandDispatchBase::implDescribeSupportedFeature( const sal_Char* pAsciiCommandURL,
+ sal_uInt16 nId, sal_Int16 nGroup )
+{
+ ControllerFeature aFeature;
+ aFeature.Command = ::rtl::OUString::createFromAscii( pAsciiCommandURL );
+ aFeature.nFeatureId = nId;
+ aFeature.GroupId = nGroup;
+
+ m_aSupportedFeatures[ aFeature.Command ] = aFeature;
+}
+
+void FeatureCommandDispatchBase::fillSupportedFeatures()
+{
+ describeSupportedFeatures();
+}
+
+} // namespace chart
diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.hxx b/chart2/source/controller/main/FeatureCommandDispatchBase.hxx
new file mode 100644
index 000000000000..b3e2a568d3b9
--- /dev/null
+++ b/chart2/source/controller/main/FeatureCommandDispatchBase.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_FEATURECOMMANDDISPATCHBASE_HXX
+#define CHART2_FEATURECOMMANDDISPATCHBASE_HXX
+
+#include "CommandDispatch.hxx"
+
+#include <com/sun/star/frame/CommandGroup.hpp>
+#include <com/sun/star/frame/DispatchInformation.hpp>
+#include <com/sun/star/util/URL.hpp>
+
+namespace chart
+{
+
+struct ControllerFeature: public ::com::sun::star::frame::DispatchInformation
+{
+ sal_uInt16 nFeatureId;
+};
+
+typedef ::std::map< ::rtl::OUString,
+ ControllerFeature,
+ ::std::less< ::rtl::OUString > > SupportedFeatures;
+
+struct FeatureState
+{
+ bool bEnabled;
+ ::com::sun::star::uno::Any aState;
+
+ FeatureState() : bEnabled( false ) { }
+};
+
+/** This is a base class for CommandDispatch implementations with feature support.
+ */
+class FeatureCommandDispatchBase: public CommandDispatch
+{
+public:
+ FeatureCommandDispatchBase( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext );
+ virtual ~FeatureCommandDispatchBase();
+
+ // late initialisation, especially for adding as listener
+ virtual void initialize();
+
+ virtual bool isFeatureSupported( const ::rtl::OUString& rCommandURL );
+
+protected:
+ // XDispatch
+ virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& URL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void fireStatusEvent( const ::rtl::OUString& rURL,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xSingleListener );
+
+ // state of a feature
+ virtual FeatureState getState( const ::rtl::OUString& rCommand ) = 0;
+
+ // execute a feature
+ virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs ) = 0;
+
+ // all the features which should be handled by this class
+ virtual void describeSupportedFeatures() = 0;
+
+ /** describes a feature supported by the controller
+
+ Must not be called outside <member>describeSupportedFeatures</member>.
+
+ @param pAsciiCommandURL
+ the URL of the feature command
+ @param nId
+ the id of the feature. Later references to this feature usually happen by id, not by
+ URL.
+ @param nGroup
+ the command group of the feature. This is important for configuring the controller UI
+ by the user, see also <type scope="com::sun::star::frame">CommandGroup</type>.
+ */
+ void implDescribeSupportedFeature( const sal_Char* pAsciiCommandURL, sal_uInt16 nId,
+ sal_Int16 nGroup = ::com::sun::star::frame::CommandGroup::INTERNAL );
+
+ mutable SupportedFeatures m_aSupportedFeatures;
+
+ sal_uInt16 m_nFeatureId;
+
+private:
+ void fillSupportedFeatures();
+};
+
+} // namespace chart
+
+// CHART2_FEATURECOMMANDDISPATCHBASE_HXX
+#endif
diff --git a/chart2/source/tools/ImplUndoManager.cxx b/chart2/source/controller/main/ImplUndoManager.cxx
index 7d128bd2a9d1..5af76f2bd781 100644
--- a/chart2/source/tools/ImplUndoManager.cxx
+++ b/chart2/source/controller/main/ImplUndoManager.cxx
@@ -107,7 +107,10 @@ UndoElement::~UndoElement()
void UndoElement::initialize( const Reference< frame::XModel > & xModel )
{
- m_xModel.set( UndoElement::cloneModel( xModel ));
+ if ( xModel.is() )
+ {
+ m_xModel.set( UndoElement::cloneModel( xModel ) );
+ }
}
void UndoElement::dispose()
@@ -353,6 +356,29 @@ UndoElement * UndoElementWithSelection::createFromModel(
return new UndoElementWithSelection( getActionString(), xModel );
}
+// ----------------------------------------
+
+ShapeUndoElement::ShapeUndoElement( const OUString& rActionString, SdrUndoAction* pAction )
+ :UndoElement( rActionString, Reference< frame::XModel >() )
+ ,m_pAction( pAction )
+{
+}
+
+ShapeUndoElement::ShapeUndoElement( const ShapeUndoElement& rOther )
+ :UndoElement( rOther )
+ ,m_pAction( rOther.m_pAction )
+{
+}
+
+ShapeUndoElement::~ShapeUndoElement()
+{
+}
+
+SdrUndoAction* ShapeUndoElement::getSdrUndoAction()
+{
+ return m_pAction;
+}
+
// ========================================
UndoStack::UndoStack() :
diff --git a/chart2/source/tools/ImplUndoManager.hxx b/chart2/source/controller/main/ImplUndoManager.hxx
index 8c6cfa48979f..4dde0bc65719 100644
--- a/chart2/source/tools/ImplUndoManager.hxx
+++ b/chart2/source/controller/main/ImplUndoManager.hxx
@@ -38,6 +38,9 @@
#include <utility>
#include <deque>
+
+class SdrUndoAction;
+
namespace com { namespace sun { namespace star {
namespace chart2 {
class XInternalDataProvider;
@@ -146,6 +149,19 @@ private:
::com::sun::star::uno::Any m_aSelection;
};
+class ShapeUndoElement : public UndoElement
+{
+public:
+ ShapeUndoElement( const ::rtl::OUString& rActionString, SdrUndoAction* pAction );
+ ShapeUndoElement( const ShapeUndoElement& rOther );
+ virtual ~ShapeUndoElement();
+
+ SdrUndoAction* getSdrUndoAction();
+
+private:
+ SdrUndoAction* m_pAction;
+};
+
/** Note that all models that are put into this container are at some point
disposed of inside this class. (At least in the destructor). That means
the models retrieved here should never be used, but instead their content
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index bb290425090c..0fefa3d52310 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -40,6 +40,7 @@
#include "ChartTypeHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "LegendHelper.hxx"
+#include "chartview/DrawModelWrapper.hxx"
#include <map>
#include <algorithm>
@@ -63,24 +64,25 @@ using ::rtl::OUString;
namespace
{
-struct lcl_ObjectToCID : public ::std::unary_function< Reference< uno::XInterface >, OUString >
+
+struct lcl_ObjectToOID : public ::std::unary_function< Reference< uno::XInterface >, ::chart::ObjectIdentifier >
{
- explicit lcl_ObjectToCID( const Reference< chart2::XChartDocument > & xChartDoc ) :
+ explicit lcl_ObjectToOID( const Reference< chart2::XChartDocument > & xChartDoc ) :
m_xModel( xChartDoc, uno::UNO_QUERY )
{}
- OUString operator() ( const Reference< uno::XInterface > & xObj )
+ ::chart::ObjectIdentifier operator() ( const Reference< uno::XInterface > & xObj )
{
- return ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xObj, m_xModel );
+ return ::chart::ObjectIdentifier( ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xObj, m_xModel ) );
}
private:
Reference< frame::XModel > m_xModel;
};
-void lcl_getChildCIDs(
- ::chart::ObjectHierarchy::tChildContainer & rOutChildren,
- const Reference< container::XIndexAccess > & xShapes )
+void lcl_getChildOIDs(
+ ::chart::ObjectHierarchy::tChildContainer& rOutChildren,
+ const Reference< container::XIndexAccess >& xShapes )
{
if( xShapes.is())
{
@@ -98,11 +100,11 @@ void lcl_getChildCIDs(
aName.getLength() > 0 &&
::chart::ObjectIdentifier::isCID( aName ))
{
- rOutChildren.push_back( aName );
+ rOutChildren.push_back( ::chart::ObjectIdentifier( aName ) );
}
Reference< container::XIndexAccess > xNewShapes( xShapeProp, uno::UNO_QUERY );
if( xNewShapes.is())
- lcl_getChildCIDs( rOutChildren, xNewShapes );
+ lcl_getChildOIDs( rOutChildren, xNewShapes );
}
}
}
@@ -116,31 +118,31 @@ void lcl_addAxisTitle( const Reference< XAxis >& xAxis, ::chart::ObjectHierarchy
Reference< XTitle > xAxisTitle( xAxisTitled->getTitleObject());
if( xAxisTitle.is())
rContainer.push_back(
- ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xChartModel ));
+ ::chart::ObjectIdentifier( ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xChartModel ) ) );
}
}
} // anonymous namespace
-
namespace chart
{
namespace impl
{
+
class ImplObjectHierarchy
{
public:
explicit ImplObjectHierarchy(
- const Reference< XChartDocument > & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider,
+ const Reference< XChartDocument >& xChartDocument,
+ ExplicitValueProvider* pExplicitValueProvider,
bool bFlattenDiagram, bool bOrderingForElementSelector );
- bool hasChildren( const OUString & rParent );
- ObjectHierarchy::tChildContainer getChildren( const OUString & rParent );
- ObjectHierarchy::tChildContainer getSiblings( const OUString & rNode );
+ bool hasChildren( const ObjectHierarchy::tOID& rParent );
+ ObjectHierarchy::tChildContainer getChildren( const ObjectHierarchy::tOID& rParent );
+ ObjectHierarchy::tChildContainer getSiblings( const ObjectHierarchy::tOID& rNode );
- ObjectHierarchy::tCID getParent( const ObjectHierarchy::tCID & rCID );
+ ObjectHierarchy::tOID getParent( const ObjectHierarchy::tOID& rOID );
private:
void createTree( const Reference< XChartDocument > & xChartDocument );
@@ -149,9 +151,9 @@ private:
const Reference< XChartDocument > & xChartDoc,
const Reference< XDiagram > & xDiagram );
void createDiagramTree(
- ObjectHierarchy::tChildContainer & rContainer,
- const Reference< XChartDocument > & xChartDoc,
- const Reference< XDiagram > & xDiagram );
+ ObjectHierarchy::tChildContainer& rContainer,
+ const Reference< XChartDocument >& xChartDoc,
+ const Reference< XDiagram >& xDiagram );
void createDataSeriesTree(
ObjectHierarchy::tChildContainer & rOutDiagramSubContainer,
const Reference< XDiagram > & xDiagram );
@@ -162,22 +164,23 @@ private:
ObjectHierarchy::tChildContainer & rContainer,
const Reference< XChartDocument > & xChartDoc,
const Reference< XDiagram > & xDiagram );
+ void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer );
- ObjectHierarchy::tCID getParentImpl(
- const ObjectHierarchy::tCID & rParentCID,
- const ObjectHierarchy::tCID & rCID );
+ ObjectHierarchy::tOID getParentImpl(
+ const ObjectHierarchy::tOID& rParentOID,
+ const ObjectHierarchy::tOID& rOID );
- typedef ::std::map< OUString, ObjectHierarchy::tChildContainer >
+ typedef ::std::map< ObjectHierarchy::tOID, ObjectHierarchy::tChildContainer >
tChildMap;
tChildMap m_aChildMap;
- ExplicitValueProvider * m_pExplicitValueProvider;
+ ExplicitValueProvider* m_pExplicitValueProvider;
bool m_bFlattenDiagram;
bool m_bOrderingForElementSelector;
};
ImplObjectHierarchy::ImplObjectHierarchy(
- const Reference< XChartDocument > & xChartDocument,
- ExplicitValueProvider * pExplicitValueProvider,
+ const Reference< XChartDocument >& xChartDocument,
+ ExplicitValueProvider* pExplicitValueProvider,
bool bFlattenDiagram,
bool bOrderingForElementSelector ) :
m_pExplicitValueProvider( pExplicitValueProvider ),
@@ -189,15 +192,15 @@ ImplObjectHierarchy::ImplObjectHierarchy(
m_pExplicitValueProvider = 0;
}
-void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChartDocument )
+void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocument )
{
- if( !xChartDocument.is())
+ if( !xChartDocument.is() )
return;
//@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
Reference< frame::XModel > xModel( xChartDocument, uno::UNO_QUERY );
Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) );
- OUString aDiaCID( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ));
+ ObjectHierarchy::tOID aDiaOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ) ) );
ObjectHierarchy::tChildContainer aTopLevelContainer;
// First Level
@@ -205,8 +208,8 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
// Chart Area
if( m_bOrderingForElementSelector )
{
- aTopLevelContainer.push_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
- aTopLevelContainer.push_back( aDiaCID );
+ aTopLevelContainer.push_back( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) );
+ aTopLevelContainer.push_back( aDiaOID );
createWallAndFloor( aTopLevelContainer, xDiagram );
createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
}
@@ -218,7 +221,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
Reference< XTitle > xMainTitle( xDocTitled->getTitleObject());
if( xMainTitle.is())
aTopLevelContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForObject( xMainTitle, xModel ));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xMainTitle, xModel ) ) );
}
if( xDiagram.is())
@@ -230,7 +233,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
Reference< XTitle > xSubTitle( xDiaTitled->getTitleObject());
if( xSubTitle.is())
aTopLevelContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForObject( xSubTitle, xModel ));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xSubTitle, xModel ) ) );
}
if( !m_bOrderingForElementSelector )
@@ -241,7 +244,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
lcl_addAxisTitle( aAxes[i], aTopLevelContainer, xModel );
// Diagram
- aTopLevelContainer.push_back( aDiaCID );
+ aTopLevelContainer.push_back( aDiaOID );
}
if( m_bFlattenDiagram )
@@ -250,21 +253,27 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
{
ObjectHierarchy::tChildContainer aSubContainer;
createDiagramTree( aSubContainer, xChartDocument, xDiagram );
- if( ! aSubContainer.empty())
- m_aChildMap[ aDiaCID ] = aSubContainer;
+ if( !aSubContainer.empty() )
+ m_aChildMap[ aDiaOID ] = aSubContainer;
}
if( !m_bOrderingForElementSelector )
createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
}
+ // #i12587# support for shapes in chart
+ if ( !m_bOrderingForElementSelector )
+ {
+ createAdditionalShapesTree( aTopLevelContainer );
+ }
+
// Chart Area
if( !m_bOrderingForElementSelector )
aTopLevelContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) );
if( ! aTopLevelContainer.empty())
- m_aChildMap[ ObjectHierarchy::getRootNodeCID() ] = aTopLevelContainer;
+ m_aChildMap[ ObjectHierarchy::getRootNodeOID() ] = aTopLevelContainer;
}
void ImplObjectHierarchy::createLegendTree(
@@ -274,18 +283,18 @@ void ImplObjectHierarchy::createLegendTree(
{
if( xDiagram.is() && LegendHelper::hasLegend( xDiagram ) )
{
- OUString aLegendCID( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ));
- rContainer.push_back( aLegendCID );
+ ObjectHierarchy::tOID aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) ) );
+ rContainer.push_back( aLegendOID );
// iterate over child shapes of legend and search for matching CIDs
if( m_pExplicitValueProvider )
{
Reference< container::XIndexAccess > xLegendShapeContainer(
- m_pExplicitValueProvider->getShapeForCID( aLegendCID ), uno::UNO_QUERY );
- ObjectHierarchy::tChildContainer aLegendEntryCIDs;
- lcl_getChildCIDs( aLegendEntryCIDs, xLegendShapeContainer );
+ m_pExplicitValueProvider->getShapeForCID( aLegendOID.getObjectCID() ), uno::UNO_QUERY );
+ ObjectHierarchy::tChildContainer aLegendEntryOIDs;
+ lcl_getChildOIDs( aLegendEntryOIDs, xLegendShapeContainer );
- m_aChildMap[ aLegendCID ] = aLegendEntryCIDs;
+ m_aChildMap[ aLegendOID ] = aLegendEntryOIDs;
}
}
}
@@ -305,7 +314,7 @@ void ImplObjectHierarchy::createAxesTree(
if( !m_bOrderingForElementSelector )
::std::transform( aAxes.getConstArray(), aAxes.getConstArray() + aAxes.getLength(),
::std::back_inserter( rContainer ),
- lcl_ObjectToCID( xChartDoc ));
+ lcl_ObjectToOID( xChartDoc ));
// get all axes, also invisible ones
aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ false );
@@ -329,7 +338,7 @@ void ImplObjectHierarchy::createAxesTree(
// axis
if( AxisHelper::isAxisVisible( xAxis ) )
rContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel ) );
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel ) ) );
// axis title
lcl_addAxisTitle( aAxes[nA], rContainer, xChartModel );
@@ -340,7 +349,7 @@ void ImplObjectHierarchy::createAxesTree(
{
//main grid
rContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel ) );
+ ObjectIdentifier( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel ) ) ) );
}
Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );;
@@ -352,7 +361,7 @@ void ImplObjectHierarchy::createAxesTree(
{
//sub grid
rContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGrid ) );
+ ObjectIdentifier( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGrid ) ) ) );
}
}
}
@@ -369,12 +378,12 @@ void ImplObjectHierarchy::createWallAndFloor(
if( bHasWall && bIsThreeD )
{
rContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString()));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() ) ) );
Reference< beans::XPropertySet > xFloor( xDiagram->getFloor());
if( xFloor.is())
rContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, rtl::OUString()));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, rtl::OUString() ) ) );
}
}
@@ -426,9 +435,9 @@ void ImplObjectHierarchy::createDataSeriesTree(
OUString aSeriesParticle(
ObjectIdentifier::createParticleForSeries(
nDiagramIndex, nCooSysIdx, nCTIdx, nSeriesIdx ));
- ObjectHierarchy::tCID aSeriesCID(
- ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ));
- rOutDiagramSubContainer.push_back( aSeriesCID );
+ ObjectHierarchy::tOID aSeriesOID(
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ) ) );
+ rOutDiagramSubContainer.push_back( aSeriesOID );
ObjectHierarchy::tChildContainer aSeriesSubContainer;
@@ -440,7 +449,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
rtl::OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
aChildParticle+=(C2U("="));
aSeriesSubContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ) ) );
}
// Statistics
@@ -454,11 +463,11 @@ void ImplObjectHierarchy::createDataSeriesTree(
{
bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[nCurveIdx] );
aSeriesSubContainer.push_back(
- ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ));
+ ObjectIdentifier( ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ) ) );
if( RegressionCurveHelper::hasEquation( aCurves[nCurveIdx] ) )
{
aSeriesSubContainer.push_back(
- ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ));
+ ObjectIdentifier( ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ) ) );
}
}
Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
@@ -472,8 +481,8 @@ void ImplObjectHierarchy::createDataSeriesTree(
( nStyle != ::com::sun::star::chart::ErrorBarStyle::NONE ) )
{
aSeriesSubContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierWithParent(
- OBJECTTYPE_DATA_ERRORS, OUString(), aSeriesParticle ));
+ ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_ERRORS, OUString(), aSeriesParticle ) ) );
}
}
}
@@ -484,12 +493,12 @@ void ImplObjectHierarchy::createDataSeriesTree(
if( m_pExplicitValueProvider )
{
Reference< container::XIndexAccess > xSeriesShapeContainer(
- m_pExplicitValueProvider->getShapeForCID( aSeriesCID ), uno::UNO_QUERY );
- lcl_getChildCIDs( aSeriesSubContainer, xSeriesShapeContainer );
+ m_pExplicitValueProvider->getShapeForCID( aSeriesOID.getObjectCID() ), uno::UNO_QUERY );
+ lcl_getChildOIDs( aSeriesSubContainer, xSeriesShapeContainer );
}
if( ! aSeriesSubContainer.empty())
- m_aChildMap[ aSeriesCID ] = aSeriesSubContainer;
+ m_aChildMap[ aSeriesOID ] = aSeriesSubContainer;
}
}
}
@@ -500,9 +509,38 @@ void ImplObjectHierarchy::createDataSeriesTree(
}
}
-bool ImplObjectHierarchy::hasChildren( const OUString & rParent )
+void ImplObjectHierarchy::createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer )
{
- if( rParent.getLength())
+ try
+ {
+ if ( m_pExplicitValueProvider )
+ {
+ Reference< drawing::XDrawPage > xDrawPage( m_pExplicitValueProvider->getDrawModelWrapper()->getMainDrawPage() );
+ Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
+ Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
+ sal_Int32 nCount = xDrawPageShapes->getCount();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() && xShape != xChartRoot )
+ {
+ rContainer.push_back( ObjectIdentifier( xShape ) );
+ }
+ }
+ }
+ }
+ }
+ catch ( uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+}
+
+bool ImplObjectHierarchy::hasChildren( const ObjectHierarchy::tOID& rParent )
+{
+ if ( rParent.isValid() )
{
tChildMap::const_iterator aIt( m_aChildMap.find( rParent ));
if( aIt != m_aChildMap.end())
@@ -511,9 +549,9 @@ bool ImplObjectHierarchy::hasChildren( const OUString & rParent )
return false;
}
-ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const OUString & rParent )
+ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const ObjectHierarchy::tOID& rParent )
{
- if( rParent.getLength())
+ if ( rParent.isValid() )
{
tChildMap::const_iterator aIt( m_aChildMap.find( rParent ));
if( aIt != m_aChildMap.end())
@@ -522,9 +560,9 @@ ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const OUStrin
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const OUString & rNode )
+ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const ObjectHierarchy::tOID& rNode )
{
- if( rNode.getLength() && !ObjectHierarchy::isRootNode( rNode ))
+ if ( rNode.isValid() && !ObjectHierarchy::isRootNode( rNode ) )
{
for( tChildMap::const_iterator aIt( m_aChildMap.begin());
aIt != m_aChildMap.end(); ++aIt )
@@ -538,23 +576,23 @@ ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const OUStrin
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tCID ImplObjectHierarchy::getParentImpl(
- const ObjectHierarchy::tCID & rParentCID,
- const ObjectHierarchy::tCID & rCID )
+ObjectHierarchy::tOID ImplObjectHierarchy::getParentImpl(
+ const ObjectHierarchy::tOID & rParentOID,
+ const ObjectHierarchy::tOID & rOID )
{
// search children
- ObjectHierarchy::tChildContainer aChildren( getChildren( rParentCID ));
+ ObjectHierarchy::tChildContainer aChildren( getChildren( rParentOID ));
ObjectHierarchy::tChildContainer::const_iterator aIt(
- ::std::find( aChildren.begin(), aChildren.end(), rCID ));
+ ::std::find( aChildren.begin(), aChildren.end(), rOID ));
// recursion end
if( aIt != aChildren.end())
- return rParentCID;
+ return rParentOID;
for( aIt = aChildren.begin(); aIt != aChildren.end(); ++aIt )
{
// recursion
- ObjectHierarchy::tCID aTempParent( getParentImpl( *aIt, rCID ));
- if( aTempParent.getLength())
+ ObjectHierarchy::tOID aTempParent( getParentImpl( *aIt, rOID ));
+ if ( aTempParent.isValid() )
{
// exit on success
return aTempParent;
@@ -562,17 +600,18 @@ ObjectHierarchy::tCID ImplObjectHierarchy::getParentImpl(
}
// exit on fail
- return ObjectHierarchy::tCID();
+ return ObjectHierarchy::tOID();
}
-ObjectHierarchy::tCID ImplObjectHierarchy::getParent(
- const ObjectHierarchy::tCID & rCID )
+ObjectHierarchy::tOID ImplObjectHierarchy::getParent(
+ const ObjectHierarchy::tOID & rOID )
{
- return getParentImpl( ObjectHierarchy::getRootNodeCID(), rCID );
+ return getParentImpl( ObjectHierarchy::getRootNodeOID(), rOID );
}
} // namespace impl
+
ObjectHierarchy::ObjectHierarchy(
const Reference< XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider /* = 0 */,
@@ -585,60 +624,60 @@ ObjectHierarchy::~ObjectHierarchy()
{}
// static
-ObjectHierarchy::tCID ObjectHierarchy::getRootNodeCID()
+ObjectHierarchy::tOID ObjectHierarchy::getRootNodeOID()
{
- return C2U("ROOT");
+ return ObjectIdentifier( C2U( "ROOT" ) );
}
// static
-bool ObjectHierarchy::isRootNode( const ObjectHierarchy::tCID & rCID )
+bool ObjectHierarchy::isRootNode( const ObjectHierarchy::tOID& rOID )
{
- return rCID.equals( ObjectHierarchy::getRootNodeCID());
+ return ( rOID == ObjectHierarchy::getRootNodeOID() );
}
ObjectHierarchy::tChildContainer ObjectHierarchy::getTopLevelChildren() const
{
- return m_apImpl->getChildren( ObjectHierarchy::getRootNodeCID());
+ return m_apImpl->getChildren( ObjectHierarchy::getRootNodeOID());
}
-bool ObjectHierarchy::hasChildren( const tCID & rParent ) const
+bool ObjectHierarchy::hasChildren( const tOID& rParent ) const
{
return m_apImpl->hasChildren( rParent );
}
ObjectHierarchy::tChildContainer ObjectHierarchy::getChildren(
- const ObjectHierarchy::tCID & rParent ) const
+ const ObjectHierarchy::tOID& rParent ) const
{
- if( rParent.getLength())
+ if ( rParent.isValid() )
return m_apImpl->getChildren( rParent );
return ObjectHierarchy::tChildContainer();
}
ObjectHierarchy::tChildContainer ObjectHierarchy::getSiblings(
- const ObjectHierarchy::tCID & rNode ) const
+ const ObjectHierarchy::tOID& rNode ) const
{
- if( rNode.getLength() && !isRootNode( rNode ))
+ if ( rNode.isValid() && !isRootNode( rNode ) )
return m_apImpl->getSiblings( rNode );
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tCID ObjectHierarchy::getParent(
- const ObjectHierarchy::tCID & rNode ) const
+ObjectHierarchy::tOID ObjectHierarchy::getParent(
+ const ObjectHierarchy::tOID& rNode ) const
{
return m_apImpl->getParent( rNode );
}
sal_Int32 ObjectHierarchy::getIndexInParent(
- const ObjectHierarchy::tCID & rNode ) const
+ const ObjectHierarchy::tOID& rNode ) const
{
- tCID aParentCID( m_apImpl->getParent( rNode ));
- tChildContainer aChildren( m_apImpl->getChildren( aParentCID ));
- tChildContainer::const_iterator aIt( aChildren.begin());
+ tOID aParentOID( m_apImpl->getParent( rNode ));
+ tChildContainer aChildren( m_apImpl->getChildren( aParentOID ) );
+ tChildContainer::const_iterator aIt( aChildren.begin() );
for( sal_Int32 nIndex = 0; aIt != aChildren.end(); ++nIndex, ++aIt )
{
- if( aIt->equals( rNode ))
+ if ( *aIt == rNode )
return nIndex;
}
return -1;
@@ -647,16 +686,18 @@ sal_Int32 ObjectHierarchy::getIndexInParent(
// ================================================================================
ObjectKeyNavigation::ObjectKeyNavigation(
- const ObjectHierarchy::tCID & rCurrentCID,
+ const ObjectHierarchy::tOID & rCurrentOID,
const Reference< chart2::XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider /* = 0 */ ) :
- m_aCurrentCID( rCurrentCID ),
+ m_aCurrentOID( rCurrentOID ),
m_xChartDocument( xChartDocument ),
m_pExplicitValueProvider( pExplicitValueProvider ),
m_bStepDownInDiagram( true )
{
- if( m_aCurrentCID.getLength() == 0 )
- setCurrentSelection( ObjectHierarchy::getRootNodeCID());
+ if ( !m_aCurrentOID.isValid() )
+ {
+ setCurrentSelection( ObjectHierarchy::getRootNodeOID() );
+ }
}
bool ObjectKeyNavigation::handleKeyEvent(
@@ -685,7 +726,7 @@ bool ObjectKeyNavigation::handleKeyEvent(
bResult = down();
break;
case awt::Key::ESCAPE:
- setCurrentSelection( OUString());
+ setCurrentSelection( ObjectIdentifier() );
bResult = true;
break;
default:
@@ -695,20 +736,20 @@ bool ObjectKeyNavigation::handleKeyEvent(
return bResult;
}
-void ObjectKeyNavigation::setCurrentSelection( const ObjectHierarchy::tCID & rCID )
+void ObjectKeyNavigation::setCurrentSelection( const ObjectHierarchy::tOID& rOID )
{
- m_aCurrentCID = rCID;
+ m_aCurrentOID = rOID;
}
-ObjectHierarchy::tCID ObjectKeyNavigation::getCurrentSelection() const
+ObjectHierarchy::tOID ObjectKeyNavigation::getCurrentSelection() const
{
- return m_aCurrentCID;
+ return m_aCurrentOID;
}
bool ObjectKeyNavigation::first()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider, m_bStepDownInDiagram );
- ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection()));
+ ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
bool bResult = !aSiblings.empty();
if( bResult )
setCurrentSelection( aSiblings.front());
@@ -720,7 +761,7 @@ bool ObjectKeyNavigation::first()
bool ObjectKeyNavigation::last()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider, m_bStepDownInDiagram );
- ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection()));
+ ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
bool bResult = !aSiblings.empty();
if( bResult )
setCurrentSelection( aSiblings.back());
@@ -732,7 +773,7 @@ bool ObjectKeyNavigation::last()
bool ObjectKeyNavigation::next()
{
ObjectHierarchy aHierarchy( m_xChartDocument, m_pExplicitValueProvider, m_bStepDownInDiagram );
- ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection()));
+ ObjectHierarchy::tChildContainer aSiblings( aHierarchy.getSiblings( getCurrentSelection() ) );
bool bResult = !aSiblings.empty();
if( bResult )
{
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index 0d0dddef169d..567a36473a5b 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -80,25 +80,29 @@ void impl_selectObject( SdrObject* pObjectToSelect, DrawViewWrapper& rDrawViewWr
bool Selection::hasSelection()
{
- return m_aSelectedObjectCID.getLength() || m_xSelectAdditionalShape.is();
+ return m_aSelectedOID.isValid();
}
rtl::OUString Selection::getSelectedCID()
{
- return m_aSelectedObjectCID;
+ return m_aSelectedOID.getObjectCID();
}
uno::Reference< drawing::XShape > Selection::getSelectedAdditionalShape()
{
- return m_xSelectAdditionalShape;
+ return m_aSelectedOID.getAdditionalShape();
+}
+
+ObjectIdentifier Selection::getSelectedOID() const
+{
+ return m_aSelectedOID;
}
bool Selection::setSelection( const ::rtl::OUString& rCID )
{
- if( !rCID.equals( m_aSelectedObjectCID ) )
+ if ( !rCID.equals( m_aSelectedOID.getObjectCID() ) )
{
- m_aSelectedObjectCID = rCID;
- m_xSelectAdditionalShape.set(0);
+ m_aSelectedOID = ObjectIdentifier( rCID );
return true;
}
return false;
@@ -106,10 +110,10 @@ bool Selection::setSelection( const ::rtl::OUString& rCID )
bool Selection::setSelection( const uno::Reference< drawing::XShape >& xShape )
{
- if( !(m_xSelectAdditionalShape==xShape) )
+ if ( !( xShape == m_aSelectedOID.getAdditionalShape() ) )
{
clearSelection();
- m_xSelectAdditionalShape = xShape;
+ m_aSelectedOID = ObjectIdentifier( xShape );
return true;
}
return false;
@@ -117,18 +121,18 @@ bool Selection::setSelection( const uno::Reference< drawing::XShape >& xShape )
void Selection::clearSelection()
{
- m_aSelectedObjectCID = m_aSelectedObjectCID_beforeMouseDown
- = m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = rtl::OUString();
- m_xSelectAdditionalShape.set(0);
+ m_aSelectedOID = ObjectIdentifier();
+ m_aSelectedOID_beforeMouseDown = ObjectIdentifier();
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = ObjectIdentifier();
}
bool Selection::maybeSwitchSelectionAfterSingleClickWasEnsured()
{
- if( m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing.getLength()
- && !m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing.equals(m_aSelectedObjectCID) )
+ if ( m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing.isValid()
+ && m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing != m_aSelectedOID )
{
- m_aSelectedObjectCID = m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing;
- m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = C2U("");
+ m_aSelectedOID = m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing;
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = ObjectIdentifier();
return true;
}
return false;
@@ -136,18 +140,20 @@ bool Selection::maybeSwitchSelectionAfterSingleClickWasEnsured()
void Selection::resetPossibleSelectionAfterSingleClickWasEnsured()
{
- if( m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing.getLength() )
- m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = C2U("");
+ if ( m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing.isValid() )
+ {
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = ObjectIdentifier();
+ }
}
void Selection::remindSelectionBeforeMouseDown()
{
- m_aSelectedObjectCID_beforeMouseDown = m_aSelectedObjectCID;
+ m_aSelectedOID_beforeMouseDown = m_aSelectedOID;
}
bool Selection::isSelectionDifferentFromBeforeMouseDown()
{
- return !ObjectIdentifier::areIdenticalObjects( m_aSelectedObjectCID, m_aSelectedObjectCID_beforeMouseDown );
+ return ( m_aSelectedOID != m_aSelectedOID_beforeMouseDown );
}
void Selection::applySelection( DrawViewWrapper* pDrawViewWrapper )
@@ -159,10 +165,14 @@ void Selection::applySelection( DrawViewWrapper* pDrawViewWrapper )
pDrawViewWrapper->UnmarkAll();
}
SdrObject* pObjectToSelect = 0;
- if( m_aSelectedObjectCID.getLength() )
- pObjectToSelect = pDrawViewWrapper->getNamedSdrObject( m_aSelectedObjectCID );
- else if( m_xSelectAdditionalShape.is() )
- pObjectToSelect = DrawViewWrapper::getSdrObject( m_xSelectAdditionalShape );
+ if ( m_aSelectedOID.isAutoGeneratedObject() )
+ {
+ pObjectToSelect = pDrawViewWrapper->getNamedSdrObject( m_aSelectedOID.getObjectCID() );
+ }
+ else if( m_aSelectedOID.isAdditionalShape() )
+ {
+ pObjectToSelect = DrawViewWrapper::getSdrObject( m_aSelectedOID.getAdditionalShape() );
+ }
impl_selectObject( pObjectToSelect, *pDrawViewWrapper );
}
@@ -176,7 +186,7 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
//do not toggel multiclick selection if right clicked on the selected object or waiting for double click
bool bAllowMultiClickSelectionChange = !bIsRightMouse && !bWaitingForDoubleClick;
- const rtl::OUString aNameOfLastSelectedObject( m_aSelectedObjectCID );
+ ObjectIdentifier aLastSelectedObject( m_aSelectedOID );
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
@@ -185,86 +195,89 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
//get object to select:
SdrObject* pNewObj = 0;
{
- m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = C2U("");
- m_xSelectAdditionalShape.set(0);
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = ObjectIdentifier();
//the search for the object to select starts with the hit object deepest in the grouping hierarchy (a leaf in the tree)
//further we travel along the grouping hierarchy from child to parent
pNewObj = pDrawViewWrapper->getHitObject(rMousePos);
- m_aSelectedObjectCID = lcl_getObjectName( pNewObj );//name of pNewObj
- rtl::OUString aTestFirstHit = m_aSelectedObjectCID;
+ m_aSelectedOID = ObjectIdentifier( lcl_getObjectName( pNewObj ) );//name of pNewObj
//ignore handle only objects for hit test
- while( pNewObj && m_aSelectedObjectCID.match(C2U("HandlesOnly")) )
+ while( pNewObj && m_aSelectedOID.getObjectCID().match( C2U( "HandlesOnly" ) ) )
{
pNewObj->SetMarkProtect(true);
pNewObj = pDrawViewWrapper->getHitObject(rMousePos);
- m_aSelectedObjectCID = lcl_getObjectName( pNewObj );
+ m_aSelectedOID = ObjectIdentifier( lcl_getObjectName( pNewObj ) );
}
//accept only named objects while searching for the object to select
- //this call may change m_aSelectedObjectCID
- if( SelectionHelper::findNamedParent( pNewObj, m_aSelectedObjectCID, true ) )
+ //this call may change m_aSelectedOID
+ if ( SelectionHelper::findNamedParent( pNewObj, m_aSelectedOID, true ) )
{
//if the so far found object is a multi click object further steps are necessary
- while( ObjectIdentifier::isMultiClickObject( m_aSelectedObjectCID ) )
+ while( ObjectIdentifier::isMultiClickObject( m_aSelectedOID.getObjectCID() ) )
{
- bool bSameObjectAsLastSelected = ObjectIdentifier::areIdenticalObjects( aNameOfLastSelectedObject, m_aSelectedObjectCID );
+ bool bSameObjectAsLastSelected = ( aLastSelectedObject == m_aSelectedOID );
if( bSameObjectAsLastSelected )
{
//if the same child is clicked again don't go up further
break;
}
- if( ObjectIdentifier::areSiblings(aNameOfLastSelectedObject,m_aSelectedObjectCID) )
+ if ( ObjectIdentifier::areSiblings( aLastSelectedObject.getObjectCID(), m_aSelectedOID.getObjectCID() ) )
{
//if a sibling of the last selected object is clicked don't go up further
break;
}
SdrObject* pLastChild = pNewObj;
- rtl::OUString aLastChildName = m_aSelectedObjectCID;
- if(!SelectionHelper::findNamedParent( pNewObj, m_aSelectedObjectCID, false ))
+ ObjectIdentifier aLastChild = m_aSelectedOID;
+ if ( !SelectionHelper::findNamedParent( pNewObj, m_aSelectedOID, false ) )
{
//take the one found so far
break;
}
//if the last selected object is found don't go up further
//but take the last child if selection change is allowed
- if( ObjectIdentifier::areIdenticalObjects( aNameOfLastSelectedObject, m_aSelectedObjectCID ) )
+ if ( aLastSelectedObject == m_aSelectedOID )
{
if( bAllowMultiClickSelectionChange )
{
pNewObj = pLastChild;
- m_aSelectedObjectCID = aLastChildName;
+ m_aSelectedOID = aLastChild;
}
else
- m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = aLastChildName;
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = aLastChild;
break;
}
}
- DBG_ASSERT(pNewObj && m_aSelectedObjectCID.getLength(),"somehow lost selected object");
+ DBG_ASSERT( pNewObj && m_aSelectedOID.isValid(), "somehow lost selected object" );
}
else
{
//maybe an additional shape was hit
- m_aSelectedObjectCID = rtl::OUString();
- if( pNewObj )
+ if ( pNewObj )
+ {
+ m_aSelectedOID = ObjectIdentifier( uno::Reference< drawing::XShape >( pNewObj->getUnoShape(), uno::UNO_QUERY ) );
+ }
+ else
{
- m_xSelectAdditionalShape = uno::Reference< drawing::XShape >( pNewObj->getUnoShape(), uno::UNO_QUERY);
+ m_aSelectedOID = ObjectIdentifier();
}
}
- if(!m_xSelectAdditionalShape.is())
+ if ( !m_aSelectedOID.isAdditionalShape() )
{
rtl::OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, rtl::OUString() ) );//@todo read CID from model
- if( !m_aSelectedObjectCID.getLength() )
- m_aSelectedObjectCID = aPageCID;
+ if ( !m_aSelectedOID.isAutoGeneratedObject() )
+ {
+ m_aSelectedOID = ObjectIdentifier( aPageCID );
+ }
//check wether the diagram was hit but not selected (e.g. because it has no filling):
rtl::OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() ) );//@todo read CID from model
- if( m_aSelectedObjectCID.equals( aPageCID ) || m_aSelectedObjectCID.equals( aWallCID ) || !m_aSelectedObjectCID.getLength() )
+ if ( m_aSelectedOID.getObjectCID().equals( aPageCID ) || m_aSelectedOID.getObjectCID().equals( aWallCID ) || !m_aSelectedOID.isAutoGeneratedObject() )
{
rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
//todo: if more than one diagram is available in future do chack the list of all diagrams here
@@ -273,7 +286,7 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
{
if( pDrawViewWrapper->IsObjectHit( pDiagram, rMousePos ) )
{
- m_aSelectedObjectCID = aDiagramCID;
+ m_aSelectedOID = ObjectIdentifier( aDiagramCID );
pNewObj = pDiagram;
}
}
@@ -281,18 +294,21 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
}
}
- if( bIsRightMouse && m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing.getLength() )
- m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing = C2U("");
+ if ( bIsRightMouse && m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing.isValid() )
+ {
+ m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing = ObjectIdentifier();
+ }
}
}
bool Selection::isResizeableObjectSelected()
{
- ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelectedObjectCID );
+ ObjectType eObjectType = m_aSelectedOID.getObjectType();
switch( eObjectType )
{
case OBJECTTYPE_DIAGRAM:
case OBJECTTYPE_DIAGRAM_WALL:
+ case OBJECTTYPE_SHAPE:
return true;
default:
return false;
@@ -302,14 +318,17 @@ bool Selection::isResizeableObjectSelected()
bool Selection::isRotateableObjectSelected( const uno::Reference< frame::XModel >& xChartModel )
{
- return SelectionHelper::isRotateableObject( m_aSelectedObjectCID, xChartModel );
+ return SelectionHelper::isRotateableObject( m_aSelectedOID.getObjectCID(), xChartModel );
}
bool Selection::isDragableObjectSelected()
{
- if( m_aSelectedObjectCID.getLength() )
- return ObjectIdentifier::isDragableObject( m_aSelectedObjectCID );
- return m_xSelectAdditionalShape.is();
+ return m_aSelectedOID.isDragableObject();
+}
+
+bool Selection::isAdditionalShapeSelected() const
+{
+ return m_aSelectedOID.isAdditionalShape();
}
//-----------------------------------------------------------------------------
@@ -351,6 +370,20 @@ bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
}
//static
+bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject
+ , ObjectIdentifier& rOutObject
+ , bool bGivenObjectMayBeResult )
+{
+ rtl::OUString aName;
+ if ( findNamedParent( pInOutObject, aName, bGivenObjectMayBeResult ) )
+ {
+ rOutObject = ObjectIdentifier( aName );
+ return true;
+ }
+ return false;
+}
+
+//static
bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
, const rtl::OUString& rNameOfSelectedObject
, const DrawViewWrapper& rDrawViewWrapper )
@@ -366,107 +399,6 @@ bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos
return true;
}
-/*
-rtl::OUString lcl_getObjectCIDToSelect( const Point& rMPos
- , const rtl::OUString& rNameOfLastSelectedObject
- , DrawViewWrapper& rDrawViewWrapper
- , bool bAllowMultiClickSelectionChange
- , rtl::OUString& rObjectToSelectIfNoDoubleClickIsFollowing //out parameter only
- )
-{
- rtl::OUString aRet;
-
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
-
- //bAllowMultiClickSelectionChange==true -> a second click on the same object can lead to a changed selection (e.g. series -> single data point)
-
- //get object to select:
- SdrObject* pNewObj = 0;
- {
- rObjectToSelectIfNoDoubleClickIsFollowing = C2U("");
-
- //the search for the object to select starts with the hit object deepest in the grouping hierarchy (a leaf in the tree)
- //further we travel along the grouping hierarchy from child to parent
- pNewObj = rDrawViewWrapper.getHitObject(rMPos);
- aRet = lcl_getObjectName( pNewObj );//name of pNewObj
- rtl::OUString aTestFirstHit = aRet;
-
- //ignore handle only objects for hit test
- while( pNewObj && aRet.match(C2U("HandlesOnly")) )
- {
- pNewObj->SetMarkProtect(true);
- pNewObj = rDrawViewWrapper.getHitObject(rMPos);
- aRet = lcl_getObjectName( pNewObj );
- }
-
- //accept only named objects while searching for the object to select
- //this call may change aRet
- if( !findNamedParent( pNewObj, aRet, true ) )
- {
- return C2U("");
- }
- //if the so far found object is a multi click object further steps are necessary
- while( ObjectIdentifier::isMultiClickObject( aRet ) )
- {
- bool bSameObjectAsLastSelected = ObjectIdentifier::areIdenticalObjects( rNameOfLastSelectedObject, aRet );
- if( bSameObjectAsLastSelected )
- {
- //if the same child is clicked again don't go up further
- break;
- }
- if( ObjectIdentifier::areSiblings(rNameOfLastSelectedObject,aRet) )
- {
- //if a sibling of the last selected object is clicked don't go up further
- break;
- }
- SdrObject* pLastChild = pNewObj;
- rtl::OUString aLastChildName = aRet;
- if(!findNamedParent( pNewObj, aRet, false ))
- {
- //take the one found so far
- break;
- }
- //if the last selected object is found don't go up further
- //but take the last child if selection change is allowed
- if( ObjectIdentifier::areIdenticalObjects( rNameOfLastSelectedObject, aRet ) )
- {
- if( bAllowMultiClickSelectionChange )
- {
- pNewObj = pLastChild;
- aRet = aLastChildName;
- }
- else
- rObjectToSelectIfNoDoubleClickIsFollowing = aLastChildName;
-
- break;
- }
- }
-
- //check wether the diagram was hit but not selected:
- rtl::OUString aPageCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, rtl::OUString() ) );//@todo read CID from model
- rtl::OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() ) );//@todo read CID from model
- if( aRet.equals( aPageCID ) || aRet.equals( aWallCID ) || !aRet.getLength() )
- {
- rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
- //todo: if more than one diagram is available in future do chack the list of all diagrams here
- SdrObject* pDiagram = rDrawViewWrapper.getNamedSdrObject( aDiagramCID );
- if( pDiagram )
- {
- if( rDrawViewWrapper.IsObjectHit( pDiagram, rMPos ) )
- {
- aRet = aDiagramCID;
- pNewObj = pDiagram;
- }
- }
- }
-
- DBG_ASSERT(pNewObj && aRet.getLength(),"somehow lost selected object");
- }
-
- return aRet;
-}
-*/
-
// static
::rtl::OUString SelectionHelper::getHitObjectCID(
const Point& rMPos,
diff --git a/chart2/source/controller/main/SelectionHelper.hxx b/chart2/source/controller/main/SelectionHelper.hxx
index 12b3ef9948ac..b3516e2326a4 100644
--- a/chart2/source/controller/main/SelectionHelper.hxx
+++ b/chart2/source/controller/main/SelectionHelper.hxx
@@ -28,6 +28,7 @@
#define _CHART2_SELECTIONHELPER_HXX
#include "DrawViewWrapper.hxx"
+#include "ObjectIdentifier.hxx"
class SdrObject;
// header for enum SdrDragMode
@@ -39,6 +40,8 @@ namespace chart
{
//.............................................................................
+class ObjectIdentifier;
+
//-----------------------------------------------------------------------------
/**
*/
@@ -50,12 +53,15 @@ public: //methods
rtl::OUString getSelectedCID();
::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > getSelectedAdditionalShape();
+ ObjectIdentifier getSelectedOID() const;
bool isResizeableObjectSelected();
bool isRotateableObjectSelected( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
bool isDragableObjectSelected();
+ bool isAdditionalShapeSelected() const;
+
//returns true if selection has changed
bool setSelection( const ::rtl::OUString& rCID );
bool setSelection( const ::com::sun::star::uno::Reference<
@@ -81,12 +87,9 @@ private: //member
//the content of m_xSelectedShape is ignored in that case
//the strings are used for autogenerated chart specific objects
//the shape reference is used for additional shapes
- ::rtl::OUString m_aSelectedObjectCID;//only single object selection so far
- ::rtl::OUString m_aSelectedObjectCID_beforeMouseDown;
- ::rtl::OUString m_aSelectedObjectCID_selectOnlyIfNoDoubleClickIsFollowing;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > m_xSelectAdditionalShape;
+ ObjectIdentifier m_aSelectedOID; //only single object selection so far
+ ObjectIdentifier m_aSelectedOID_beforeMouseDown;
+ ObjectIdentifier m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing;
};
class SelectionHelper : public MarkHandleProvider
@@ -95,6 +98,9 @@ public:
static bool findNamedParent( SdrObject*& pInOutObject
, rtl::OUString& rOutName
, bool bGivenObjectMayBeResult );
+ static bool findNamedParent( SdrObject*& pInOutObject
+ , ObjectIdentifier& rOutObject
+ , bool bGivenObjectMayBeResult );
static SdrObject* getMarkHandlesObject( SdrObject* pObj );
static E3dScene* getSceneToRotate( SdrObject* pObj );
static bool isDragableObjectHitTwice( const Point& rMPos
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
new file mode 100644
index 000000000000..b6adf9bf7477
--- /dev/null
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -0,0 +1,738 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "ShapeController.hxx"
+#include "ShapeController.hrc"
+#include "ChartController.hxx"
+#include "ChartWindow.hxx"
+#include "ViewElementListProvider.hxx"
+#include "dlg_ShapeFont.hxx"
+#include "dlg_ShapeParagraph.hxx"
+#include "chartview/DrawModelWrapper.hxx"
+#include "macros.hxx"
+
+#include <com/sun/star/frame/XStorable.hpp>
+
+#include <vos/mutex.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+#include <editeng/brkitem.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/drawitem.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/hyznitem.hxx>
+#include <editeng/orphitem.hxx>
+#include <editeng/spltitem.hxx>
+#include <svx/svxdlg.hxx>
+#include <editeng/widwitem.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::frame;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+ShapeController::ShapeController( const Reference< uno::XComponentContext >& rxContext,
+ ChartController* pController )
+ :FeatureCommandDispatchBase( rxContext )
+ ,m_pChartController( pController )
+{
+}
+
+ShapeController::~ShapeController()
+{
+}
+
+void ShapeController::initialize()
+{
+ FeatureCommandDispatchBase::initialize();
+}
+
+// WeakComponentImplHelperBase
+void ShapeController::disposing()
+{
+}
+
+// XEventListener
+void ShapeController::disposing( const lang::EventObject& /* Source */ )
+ throw (uno::RuntimeException)
+{
+}
+
+FeatureState ShapeController::getState( const ::rtl::OUString& rCommand )
+{
+ FeatureState aReturn;
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+
+ bool bWritable = false;
+ if ( m_pChartController )
+ {
+ Reference< frame::XStorable > xStorable( m_pChartController->getModel(), uno::UNO_QUERY );
+ if ( xStorable.is() )
+ {
+ bWritable = !xStorable->isReadonly();
+ }
+ }
+
+ SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommand );
+ if ( aIter != m_aSupportedFeatures.end() )
+ {
+ sal_uInt16 nFeatureId = aIter->second.nFeatureId;
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_FORMAT_LINE:
+ case COMMAND_ID_FORMAT_AREA:
+ case COMMAND_ID_TEXT_ATTRIBUTES:
+ case COMMAND_ID_TRANSFORM_DIALOG:
+ case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
+ case COMMAND_ID_RENAME_OBJECT:
+ {
+ aReturn.bEnabled = bWritable;
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_BRING_TO_FRONT:
+ case COMMAND_ID_FORWARD:
+ {
+ aReturn.bEnabled = ( bWritable && isForwardPossible() );
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_BACKWARD:
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+
+ aReturn.bEnabled = ( bWritable && isBackwardPossible() );
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_FONT_DIALOG:
+ case COMMAND_ID_PARAGRAPH_DIALOG:
+ {
+ aReturn.bEnabled = bWritable;
+ aReturn.aState <<= false;
+ }
+ break;
+ default:
+ {
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+ }
+ break;
+ }
+ }
+
+ return aReturn;
+}
+
+void ShapeController::execute( const ::rtl::OUString& rCommand, const Sequence< beans::PropertyValue>& rArgs )
+{
+ (void)rArgs;
+
+ SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommand );
+ if ( aIter != m_aSupportedFeatures.end() )
+ {
+ sal_uInt16 nFeatureId = aIter->second.nFeatureId;
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_FORMAT_LINE:
+ {
+ executeDispatch_FormatLine();
+ }
+ break;
+ case COMMAND_ID_FORMAT_AREA:
+ {
+ executeDispatch_FormatArea();
+ }
+ break;
+ case COMMAND_ID_TEXT_ATTRIBUTES:
+ {
+ executeDispatch_TextAttributes();
+ }
+ break;
+ case COMMAND_ID_TRANSFORM_DIALOG:
+ {
+ executeDispatch_TransformDialog();
+ }
+ break;
+ case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
+ {
+ executeDispatch_ObjectTitleDescription();
+ }
+ break;
+ case COMMAND_ID_RENAME_OBJECT:
+ {
+ executeDispatch_RenameObject();
+ }
+ break;
+ case COMMAND_ID_BRING_TO_FRONT:
+ case COMMAND_ID_FORWARD:
+ case COMMAND_ID_BACKWARD:
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+ executeDispatch_ChangeZOrder( nFeatureId );
+ }
+ break;
+ case COMMAND_ID_FONT_DIALOG:
+ {
+ executeDispatch_FontDialog();
+ }
+ break;
+ case COMMAND_ID_PARAGRAPH_DIALOG:
+ {
+ executeDispatch_ParagraphDialog();
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+ }
+}
+
+void ShapeController::describeSupportedFeatures()
+{
+ implDescribeSupportedFeature( ".uno:FormatLine", COMMAND_ID_FORMAT_LINE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FormatArea", COMMAND_ID_FORMAT_AREA, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:TextAttributes", COMMAND_ID_TEXT_ATTRIBUTES, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:TransformDialog", COMMAND_ID_TRANSFORM_DIALOG, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectTitleDescription", COMMAND_ID_OBJECT_TITLE_DESCRIPTION, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:RenameObject", COMMAND_ID_RENAME_OBJECT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:BringToFront", COMMAND_ID_BRING_TO_FRONT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Forward", COMMAND_ID_FORWARD, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Backward", COMMAND_ID_BACKWARD, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SendToBack", COMMAND_ID_SEND_TO_BACK, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FontDialog", COMMAND_ID_FONT_DIALOG, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:ParagraphDialog", COMMAND_ID_PARAGRAPH_DIALOG, CommandGroup::EDIT );
+}
+
+IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
+{
+ String aName;
+ if ( pDialog )
+ {
+ pDialog->GetName( aName );
+ }
+ if ( aName.Len() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ if ( pDrawViewWrapper && pDrawViewWrapper->getNamedSdrObject( aName ) )
+ {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+void ShapeController::executeDispatch_FormatLine()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateSvxLineTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
+ pSelectedObj, bHasMarked ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_FormatArea()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxAreaTabDialog > pDlg(
+ pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
+ pDrawViewWrapper ) );
+ if ( pDlg.get() )
+ {
+ SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
+ const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
+ if ( pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable() )
+ {
+ pDlg->DontDeleteColorTable();
+ }
+ if ( pDlg->Execute() == RET_OK )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_TextAttributes()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateTextTabDialog( pParent, &aAttr, pDrawViewWrapper ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_TransformDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == OBJ_CAPTION )
+ {
+ // item set for caption
+ SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ pDrawViewWrapper->GetAttributes( aAttr );
+ // item set for position and size
+ SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateCaptionDialog( pParent, pDrawViewWrapper ) );
+ if ( pDlg.get() )
+ {
+ const USHORT* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
+ SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
+ aCombAttr.Put( aAttr );
+ aCombAttr.Put( aGeoAttr );
+ pDlg->SetInputSet( &aCombAttr );
+ if ( pDlg->Execute() == RET_OK )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
+ }
+ }
+ }
+ }
+ else
+ {
+ SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateSvxTransformTabDialog( pParent, &aGeoAttr, pDrawViewWrapper ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ObjectTitleDescription()
+{
+ if ( m_pChartController )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj )
+ {
+ String aTitle( pSelectedObj->GetTitle() );
+ String aDescription( pSelectedObj->GetDescription() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxObjectTitleDescDialog > pDlg(
+ pFact->CreateSvxObjectTitleDescDialog( NULL, aTitle, aDescription ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ pDlg->GetTitle( aTitle );
+ pDlg->GetDescription( aDescription );
+ pSelectedObj->SetTitle( aTitle );
+ pSelectedObj->SetDescription( aDescription );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_RenameObject()
+{
+ if ( m_pChartController )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj )
+ {
+ String aName( pSelectedObj->GetName() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxObjectNameDialog > pDlg(
+ pFact->CreateSvxObjectNameDialog( NULL, aName ) );
+ pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ pDlg->GetName( aName );
+ if ( aName != pSelectedObj->GetName() )
+ {
+ pSelectedObj->SetName( aName );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
+{
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ if ( pDrawViewWrapper )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ switch ( nId )
+ {
+ case COMMAND_ID_BRING_TO_FRONT:
+ {
+ if ( isForwardPossible() )
+ {
+ pDrawViewWrapper->PutMarkedToTop();
+ }
+ }
+ break;
+ case COMMAND_ID_FORWARD:
+ {
+ if ( isForwardPossible() )
+ {
+ pDrawViewWrapper->MovMarkedToTop();
+ }
+ }
+ break;
+ case COMMAND_ID_BACKWARD:
+ {
+ if ( isBackwardPossible() )
+ {
+ pDrawViewWrapper->MovMarkedToBtm();
+ }
+ }
+ break;
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+ if ( isBackwardPossible() )
+ {
+ SdrObject* pFirstObj = getFirstAdditionalShape();
+ pDrawViewWrapper->PutMarkedBehindObj( pFirstObj );
+ }
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+ }
+}
+
+void ShapeController::executeDispatch_FontDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ pDrawViewWrapper->GetAttributes( aAttr );
+ ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ParagraphDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SfxItemPool& rPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemSet aAttr( rPool );
+ pDrawViewWrapper->GetAttributes( aAttr );
+
+ SfxItemSet aNewAttr( rPool,
+ EE_ITEMS_START, EE_ITEMS_END,
+ SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
+ SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
+ SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
+ SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
+ SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
+ 0 );
+ aNewAttr.Put( aAttr );
+ aNewAttr.Put( SvxHyphenZoneItem( sal_False, SID_ATTR_PARA_HYPHENZONE ) );
+ aNewAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, SID_ATTR_PARA_PAGEBREAK ) );
+ aNewAttr.Put( SvxFmtSplitItem( sal_True, SID_ATTR_PARA_SPLIT) );
+ aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
+ aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
+
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::boost::scoped_ptr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ }
+ }
+}
+
+SdrObject* ShapeController::getFirstAdditionalShape()
+{
+ SdrObject* pFirstObj = NULL;
+
+ try
+ {
+ DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
+ if ( pDrawModelWrapper )
+ {
+ Reference< drawing::XShape > xFirstShape;
+ Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
+ Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
+ sal_Int32 nCount = xDrawPageShapes->getCount();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() && xShape != xChartRoot )
+ {
+ xFirstShape = xShape;
+ break;
+ }
+ }
+ }
+ if ( xFirstShape.is() )
+ {
+ pFirstObj = DrawViewWrapper::getSdrObject( xFirstShape );
+ }
+ }
+ }
+ catch ( uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return pFirstObj;
+}
+
+SdrObject* ShapeController::getLastAdditionalShape()
+{
+ SdrObject* pLastObj = NULL;
+
+ try
+ {
+ DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
+ if ( pDrawModelWrapper )
+ {
+ Reference< drawing::XShape > xLastShape;
+ Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
+ Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
+ sal_Int32 nCount = xDrawPageShapes->getCount();
+ for ( sal_Int32 i = nCount - 1; i >= 0; --i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() && xShape != xChartRoot )
+ {
+ xLastShape = xShape;
+ break;
+ }
+ }
+ }
+ if ( xLastShape.is() )
+ {
+ pLastObj = DrawViewWrapper::getSdrObject( xLastShape );
+ }
+ }
+ }
+ catch ( uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return pLastObj;
+}
+
+bool ShapeController::isBackwardPossible()
+{
+ if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pFirstObj = getFirstAdditionalShape();
+ if ( pSelectedObj && pFirstObj && pSelectedObj != pFirstObj )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool ShapeController::isForwardPossible()
+{
+ if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pLastObj = getLastAdditionalShape();
+ if ( pSelectedObj && pLastObj && pSelectedObj != pLastObj )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
diff --git a/chart2/source/controller/main/ShapeController.hxx b/chart2/source/controller/main/ShapeController.hxx
new file mode 100644
index 000000000000..aea01d6c478d
--- /dev/null
+++ b/chart2/source/controller/main/ShapeController.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_SHAPECONTROLLER_HXX
+#define CHART2_SHAPECONTROLLER_HXX
+
+#include "FeatureCommandDispatchBase.hxx"
+#include <tools/link.hxx>
+
+class AbstractSvxNameDialog;
+class SdrObject;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class ChartController;
+
+/** This is a CommandDispatch implementation for shapes.
+ */
+class ShapeController: public FeatureCommandDispatchBase
+{
+ friend class ControllerCommandDispatch;
+
+public:
+ ShapeController( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
+ virtual ~ShapeController();
+
+ // late initialisation, especially for adding as listener
+ virtual void initialize();
+
+protected:
+ // WeakComponentImplHelperBase
+ virtual void SAL_CALL disposing();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // state of a feature
+ virtual FeatureState getState( const ::rtl::OUString& rCommand );
+
+ // execute a feature
+ virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs );
+
+ // all the features which should be handled by this class
+ virtual void describeSupportedFeatures();
+
+private:
+ DECL_LINK( CheckNameHdl, AbstractSvxNameDialog* );
+
+ void executeDispatch_FormatLine();
+ void executeDispatch_FormatArea();
+ void executeDispatch_TextAttributes();
+ void executeDispatch_TransformDialog();
+ void executeDispatch_ObjectTitleDescription();
+ void executeDispatch_RenameObject();
+ void executeDispatch_ChangeZOrder( sal_uInt16 nId );
+ void executeDispatch_FontDialog();
+ void executeDispatch_ParagraphDialog();
+
+ SdrObject* getFirstAdditionalShape();
+ SdrObject* getLastAdditionalShape();
+ bool isBackwardPossible();
+ bool isForwardPossible();
+
+ ChartController* m_pChartController;
+};
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
+
+// CHART2_SHAPECONTROLLER_HXX
+#endif
diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx
new file mode 100644
index 000000000000..a8a6cfba20ff
--- /dev/null
+++ b/chart2/source/controller/main/ShapeToolbarController.cxx
@@ -0,0 +1,298 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "ShapeToolbarController.hxx"
+
+#include <vos/mutex.hxx>
+#include <comphelper/sequence.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/toolbox.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <svx/svxids.hrc>
+#include <svx/tbxcustomshapes.hxx>
+
+
+using namespace com::sun::star;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+::rtl::OUString ShapeToolbarController::getImplementationName() throw (uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+::rtl::OUString ShapeToolbarController::getImplementationName_Static() throw (uno::RuntimeException)
+{
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.comp.ShapeToolbarController" ) );
+}
+
+Sequence< ::rtl::OUString > ShapeToolbarController::getSupportedServiceNames_Static() throw (uno::RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.ShapeToolbarController" ) );
+ return aSupported;
+}
+
+::sal_Bool ShapeToolbarController::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException)
+{
+ return ::comphelper::existsValue( ServiceName, getSupportedServiceNames_Static() );
+}
+
+Sequence< ::rtl::OUString> ShapeToolbarController::getSupportedServiceNames() throw (uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+
+Reference< uno::XInterface > ShapeToolbarController::create( const Reference< uno::XComponentContext >& xContext )
+{
+ return *( new ShapeToolbarController( Reference< lang::XMultiServiceFactory >( xContext->getServiceManager(), uno::UNO_QUERY ) ) );
+}
+
+ShapeToolbarController::ShapeToolbarController( const Reference< lang::XMultiServiceFactory >& rxFact )
+ :m_pToolbarController( NULL )
+ ,m_nToolBoxId( 1 )
+ ,m_nSlotId( 0 )
+{
+ osl_incrementInterlockedCount( &m_refCount );
+ m_xServiceManager = rxFact;
+ osl_decrementInterlockedCount( &m_refCount );
+}
+
+ShapeToolbarController::~ShapeToolbarController()
+{
+}
+
+// ::com::sun::star::uno::XInterface
+uno::Any ShapeToolbarController::queryInterface( const uno::Type& rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ToolboxController::queryInterface( rType );
+ if ( !aReturn.hasValue() )
+ {
+ aReturn = ShapeToolbarController_Base::queryInterface( rType );
+ }
+ return aReturn;
+}
+
+void ShapeToolbarController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+void ShapeToolbarController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// ::com::sun::star::lang::XInitialization
+void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments ) throw (uno::Exception, uno::RuntimeException)
+{
+ ToolboxController::initialize( rArguments );
+ ::vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ if ( pToolBox )
+ {
+ const USHORT nCount = pToolBox->GetItemCount();
+ for ( USHORT nPos = 0; nPos < nCount; ++nPos )
+ {
+ const USHORT nItemId = pToolBox->GetItemId( nPos );
+ if ( pToolBox->GetItemCommand( nItemId ) == String( m_aCommandURL ) )
+ {
+ m_nToolBoxId = nItemId;
+ break;
+ }
+ }
+ if ( m_aCommandURL.equalsAscii( ".uno:BasicShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:BasicShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_BASIC;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) );
+ }
+ else if ( m_aCommandURL.equalsAscii( ".uno:SymbolShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:SymbolShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_SYMBOL;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) );
+ }
+ else if ( m_aCommandURL.equalsAscii( ".uno:ArrowShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ArrowShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_ARROW;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox) );
+ }
+ else if ( m_aCommandURL.equalsAscii( ".uno:FlowChartShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FlowChartShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_FLOWCHART;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) );
+ }
+ else if ( m_aCommandURL.equalsAscii( ".uno:CalloutShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CalloutShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_CALLOUT;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) );
+ }
+ else if ( m_aCommandURL.equalsAscii( ".uno:StarShapes" ) )
+ {
+ m_aStates.insert( TCommandState::value_type( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:StarShapes" ) ), sal_True ) );
+ m_nSlotId = SID_DRAWTBX_CS_STAR;
+ m_pToolbarController = TToolbarHelper::createFromQuery( new SvxTbxCtlCustomShapes( m_nSlotId, m_nToolBoxId, *pToolBox ) );
+ }
+
+ for ( TCommandState::iterator aIter( m_aStates.begin() ); aIter != m_aStates.end(); ++aIter )
+ {
+ addStatusListener( aIter->first );
+ }
+
+ if ( m_pToolbarController.is() )
+ {
+ m_pToolbarController->initialize( rArguments );
+ }
+
+ // check if paste special is allowed, when not don't add DROPDOWN
+ pToolBox->SetItemBits( m_nToolBoxId, pToolBox->GetItemBits( m_nToolBoxId ) | TIB_DROPDOWN );
+ }
+}
+
+// ::com::sun::star::frame::XStatusListener
+void ShapeToolbarController::statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ TCommandState::iterator aFind = m_aStates.find( Event.FeatureURL.Complete );
+ if ( aFind != m_aStates.end() )
+ {
+ aFind->second = Event.IsEnabled;
+ if ( m_pToolbarController.is() )
+ {
+ sal_Bool bCheckmark = sal_False;
+ ToolBox& rTb = m_pToolbarController->GetToolBox();
+
+ for ( USHORT i = 0; i < rTb.GetItemCount(); ++i )
+ {
+ USHORT nId = rTb.GetItemId( i );
+ if ( nId == 0 )
+ {
+ continue;
+ }
+ ::rtl::OUString aCmd = rTb.GetItemCommand( nId );
+ if ( aCmd == Event.FeatureURL.Complete )
+ {
+ rTb.EnableItem( nId, Event.IsEnabled );
+ if ( Event.State >>= bCheckmark )
+ {
+ rTb.CheckItem( nId, bCheckmark );
+ }
+ else
+ {
+ ::rtl::OUString aItemText;
+ if ( Event.State >>= aItemText )
+ {
+ rTb.SetItemText( nId, aItemText );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// ::com::sun::star::frame::XToolbarController
+Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Reference< awt::XWindow > xRet;
+ if ( m_pToolbarController.is() )
+ {
+ xRet = m_pToolbarController.getRef()->createPopupWindow();
+ }
+
+ return xRet;
+}
+
+// ::com::sun::star::frame::XSubToolbarController
+::sal_Bool ShapeToolbarController::opensSubToolbar() throw (uno::RuntimeException)
+{
+ return ( m_nSlotId == SID_DRAWTBX_CS_BASIC ||
+ m_nSlotId == SID_DRAWTBX_CS_SYMBOL ||
+ m_nSlotId == SID_DRAWTBX_CS_ARROW ||
+ m_nSlotId == SID_DRAWTBX_CS_FLOWCHART ||
+ m_nSlotId == SID_DRAWTBX_CS_CALLOUT ||
+ m_nSlotId == SID_DRAWTBX_CS_STAR );
+}
+
+::rtl::OUString ShapeToolbarController::getSubToolbarName() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< frame::XSubToolbarController > xSub( m_pToolbarController.getRef(), uno::UNO_QUERY );
+ if ( xSub.is() )
+ {
+ return xSub->getSubToolbarName();
+ }
+ return ::rtl::OUString();
+}
+
+void ShapeToolbarController::functionSelected( const ::rtl::OUString& rCommand ) throw (uno::RuntimeException)
+{
+ ::vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ uno::Reference< frame::XSubToolbarController > xSub( m_pToolbarController.getRef(), uno::UNO_QUERY );
+ if ( xSub.is() )
+ {
+ m_aCommandURL = rCommand;
+ xSub->functionSelected( rCommand );
+ }
+}
+
+void ShapeToolbarController::updateImage() throw (uno::RuntimeException)
+{
+ ::vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ uno::Reference< frame::XSubToolbarController > xSub( m_pToolbarController.getRef(), uno::UNO_QUERY );
+ if ( xSub.is() )
+ {
+ xSub->updateImage();
+ }
+}
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
diff --git a/chart2/source/controller/main/ShapeToolbarController.hxx b/chart2/source/controller/main/ShapeToolbarController.hxx
new file mode 100644
index 000000000000..544cac7f9831
--- /dev/null
+++ b/chart2/source/controller/main/ShapeToolbarController.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_SHAPETOOLBARCONTROLLER_HXX
+#define CHART2_SHAPETOOLBARCONTROLLER_HXX
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/XSubToolbarController.hpp>
+
+#include <cppuhelper/implbase2.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <comphelper/stl_types.hxx>
+#include <svtools/toolboxcontroller.hxx>
+
+class SfxToolBoxControl;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::frame::XSubToolbarController> ShapeToolbarController_Base;
+
+typedef ::comphelper::ImplementationReference< SfxToolBoxControl, ::com::sun::star::frame::XToolbarController > TToolbarHelper;
+
+class ShapeToolbarController : public ::svt::ToolboxController
+ ,public ShapeToolbarController_Base
+{
+ DECLARE_STL_USTRINGACCESS_MAP( sal_Bool, TCommandState );
+ TCommandState m_aStates;
+ TToolbarHelper m_pToolbarController;
+ sal_uInt16 m_nToolBoxId;
+ sal_uInt16 m_nSlotId;
+ ShapeToolbarController( const ShapeToolbarController& );
+ void operator =( const ShapeToolbarController& );
+
+public:
+ ShapeToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFact );
+ virtual ~ShapeToolbarController();
+
+ // ::com::sun::star::uno::XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+
+ // needed by registration
+ static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::frame::XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::frame::XToolbarController
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::frame::XSubToolbarController
+ virtual ::sal_Bool SAL_CALL opensSubToolbar() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getSubToolbarName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL functionSelected( const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException);
+};
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
+
+#endif //CHART2_SHAPETOOLBARCONTROLLER_HXX
+
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
index 8522d96191e8..d80d37eff7da 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
@@ -95,7 +95,7 @@ void StatusBarCommandDispatch::fireStatusEvent(
{
uno::Any aArg;
Reference< chart2::XChartDocument > xDoc( m_xModifiable, uno::UNO_QUERY );
- aArg <<= ObjectNameProvider::getSelectedObjectText( m_aSelectedCID, xDoc );
+ aArg <<= ObjectNameProvider::getSelectedObjectText( m_aSelectedOID.getObjectCID(), xDoc );
fireStatusEventForURL( C2U(".uno:Context"), aArg, true, xSingleListener );
}
if( bFireModified )
@@ -147,9 +147,9 @@ void SAL_CALL StatusBarCommandDispatch::selectionChanged( const lang::EventObjec
throw (uno::RuntimeException)
{
if( m_xSelectionSupplier.is())
- m_xSelectionSupplier->getSelection() >>= m_aSelectedCID;
+ m_aSelectedOID = ObjectIdentifier( m_xSelectionSupplier->getSelection() );
else
- m_aSelectedCID = OUString();
+ m_aSelectedOID = ObjectIdentifier();
fireAllStatusEvents( 0 );
}
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.hxx b/chart2/source/controller/main/StatusBarCommandDispatch.hxx
index 23a394ecad6e..c84f81f83258 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.hxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.hxx
@@ -28,6 +28,7 @@
#define CHART2_STATUSBARCOMMANDDISPATCH_HXX
#include "CommandDispatch.hxx"
+#include "ObjectIdentifier.hxx"
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
@@ -100,7 +101,7 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::view::XSelectionSupplier > m_xSelectionSupplier;
bool m_bIsModified;
- ::rtl::OUString m_aSelectedCID;
+ ObjectIdentifier m_aSelectedOID;
};
} // namespace chart
diff --git a/chart2/source/tools/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index 61bed4029db5..61bed4029db5 100644
--- a/chart2/source/tools/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
diff --git a/chart2/source/tools/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx
index 8c6f191a1a19..34157503e629 100644
--- a/chart2/source/tools/UndoManager.cxx
+++ b/chart2/source/controller/main/UndoManager.cxx
@@ -41,6 +41,8 @@
#include <unotools/configitem.hxx>
#include <cppuhelper/compbase1.hxx>
+#include <rtl/uuid.h>
+#include <svx/svdundo.hxx>
#include <functional>
@@ -131,10 +133,31 @@ UndoManager::~UndoManager()
m_pLastRemeberedUndoElement = 0;
}
+void UndoManager::addShapeUndoAction( SdrUndoAction* pAction )
+{
+ if ( !pAction )
+ {
+ return;
+ }
+
+ impl::ShapeUndoElement* pShapeUndoElement = new impl::ShapeUndoElement( pAction->GetComment(), pAction );
+ if ( pShapeUndoElement )
+ {
+ m_apUndoStack->push( pShapeUndoElement );
+ m_apRedoStack->disposeAndClear();
+ if ( !m_apUndoStepsConfigItem.get() )
+ {
+ retrieveConfigUndoSteps();
+ }
+ fireModifyEvent();
+ }
+}
+
void UndoManager::impl_undoRedo(
Reference< frame::XModel > & xCurrentModel,
impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo )
+ impl::UndoStack * pStackToAddTo,
+ bool bUndo )
{
if( pStackToRemoveFrom && ! pStackToRemoveFrom->empty() )
{
@@ -142,11 +165,32 @@ void UndoManager::impl_undoRedo(
impl::UndoElement * pTop( pStackToRemoveFrom->top());
if( pTop )
{
- // put a clone of current model into redo/undo stack with the same
- // action string as the undo/redo
- pStackToAddTo->push( pTop->createFromModel( xCurrentModel ));
- // change current model by properties of the model from undo
- pTop->applyToModel( xCurrentModel );
+ impl::ShapeUndoElement* pShapeUndoElement = dynamic_cast< impl::ShapeUndoElement* >( pTop );
+ if ( pShapeUndoElement )
+ {
+ impl::ShapeUndoElement* pNewShapeUndoElement = new impl::ShapeUndoElement( *pShapeUndoElement );
+ pStackToAddTo->push( pNewShapeUndoElement );
+ SdrUndoAction* pAction = pNewShapeUndoElement->getSdrUndoAction();
+ if ( pAction )
+ {
+ if ( bUndo )
+ {
+ pAction->Undo();
+ }
+ else
+ {
+ pAction->Redo();
+ }
+ }
+ }
+ else
+ {
+ // put a clone of current model into redo/undo stack with the same
+ // action string as the undo/redo
+ pStackToAddTo->push( pTop->createFromModel( xCurrentModel ));
+ // change current model by properties of the model from undo
+ pTop->applyToModel( xCurrentModel );
+ }
// remove the top undo element
pStackToRemoveFrom->pop(), pTop = 0;
ChartViewHelper::setViewToDirtyState( xCurrentModel );
@@ -287,14 +331,14 @@ void SAL_CALL UndoManager::undo( Reference< frame::XModel >& xCurrentModel )
throw (uno::RuntimeException)
{
OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apUndoStack.get(), m_apRedoStack.get());
+ impl_undoRedo( xCurrentModel, m_apUndoStack.get(), m_apRedoStack.get(), true );
}
void SAL_CALL UndoManager::redo( Reference< frame::XModel >& xCurrentModel )
throw (uno::RuntimeException)
{
OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apRedoStack.get(), m_apUndoStack.get());
+ impl_undoRedo( xCurrentModel, m_apRedoStack.get(), m_apUndoStack.get(), false );
}
::sal_Bool SAL_CALL UndoManager::undoPossible()
@@ -349,4 +393,44 @@ void SAL_CALL UndoManager::applyModelContent(
impl::UndoElement::applyModelContentToModel( xModelToChange, xModelToCopyFrom );
}
+// ____ XUnoTunnel ____
+sal_Int64 UndoManager::getSomething( const Sequence< sal_Int8 >& rId )
+ throw (uno::RuntimeException)
+{
+ if ( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
+ {
+ return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
+ }
+ return 0;
+}
+
+// static
+const Sequence< sal_Int8 >& UndoManager::getUnoTunnelId()
+{
+ static Sequence< sal_Int8 >* pSeq = 0;
+ if( !pSeq )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if( !pSeq )
+ {
+ static Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
+ }
+ }
+ return *pSeq;
+}
+
+// static
+UndoManager* UndoManager::getImplementation( const Reference< uno::XInterface > xObj )
+{
+ UndoManager* pRet = NULL;
+ Reference< lang::XUnoTunnel > xUT( xObj, uno::UNO_QUERY );
+ if ( xUT.is() )
+ {
+ pRet = reinterpret_cast< UndoManager* >( sal::static_int_cast< sal_IntPtr >( xUT->getSomething( getUnoTunnelId() ) ) );
+ }
+ return pRet;
+}
+
} // namespace chart
diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx
index 904c642c8a20..cf8f5525e624 100644
--- a/chart2/source/controller/main/_serviceregistration_controller.cxx
+++ b/chart2/source/controller/main/_serviceregistration_controller.cxx
@@ -34,6 +34,7 @@
#include "ChartDocumentWrapper.hxx"
#include "AccessibleChartView.hxx"
#include "ElementSelector.hxx"
+#include "ShapeToolbarController.hxx"
#include <cppuhelper/implementationentry.hxx>
static struct ::cppu::ImplementationEntry g_entries_chart2_controller[] =
@@ -79,17 +80,17 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_controller[] =
, 0
}
,{
- ::chart::AccessibleChartView::create
- , ::chart::AccessibleChartView::getImplementationName_Static
- , ::chart::AccessibleChartView::getSupportedServiceNames_Static
+ ::chart::ElementSelectorToolbarController::create
+ , ::chart::ElementSelectorToolbarController::getImplementationName_Static
+ , ::chart::ElementSelectorToolbarController::getSupportedServiceNames_Static
, ::cppu::createSingleComponentFactory
, 0
, 0
}
,{
- ::chart::ElementSelectorToolbarController::create
- , ::chart::ElementSelectorToolbarController::getImplementationName_Static
- , ::chart::ElementSelectorToolbarController::getSupportedServiceNames_Static
+ ::chart::ShapeToolbarController::create
+ , ::chart::ShapeToolbarController::getImplementationName_Static
+ , ::chart::ShapeToolbarController::getSupportedServiceNames_Static
, ::cppu::createSingleComponentFactory
, 0
, 0
diff --git a/chart2/source/controller/main/makefile.mk b/chart2/source/controller/main/makefile.mk
index 8fe7cc8f783d..729276d5bd0e 100644
--- a/chart2/source/controller/main/makefile.mk
+++ b/chart2/source/controller/main/makefile.mk
@@ -67,7 +67,14 @@ SLOFILES = \
$(SLO)$/_serviceregistration_controller.obj \
$(SLO)$/ChartDropTargetHelper.obj \
$(SLO)$/StatusBarCommandDispatch.obj \
- $(SLO)$/ChartTransferable.obj
+ $(SLO)$/ChartTransferable.obj \
+ $(SLO)$/FeatureCommandDispatchBase.obj \
+ $(SLO)$/DrawCommandDispatch.obj \
+ $(SLO)$/ShapeController.obj \
+ $(SLO)$/ShapeToolbarController.obj \
+ $(SLO)$/ImplUndoManager.obj \
+ $(SLO)$/UndoManager.obj \
+ $(SLO)$/UndoGuard.obj
# $(SLO)$/CommonConverters.obj \
# $(SLO)$/Scaling.obj \
diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk
index b5a5975a2d03..8fdd6000fbe1 100644
--- a/chart2/source/controller/makefile.mk
+++ b/chart2/source/controller/makefile.mk
@@ -112,6 +112,7 @@ DEF1NAME= $(SHL1TARGET)
# sfx.srs is needed for the strings for UNDO and REDO in the UndoCommandDispatch
RESLIB1LIST=\
$(SRS)$/chcdialogs.srs \
+ $(SRS)$/chcmenus.srs \
$(SOLARCOMMONRESDIR)$/sfx.srs
RESLIB1NAME= $(TARGET)
diff --git a/chart2/source/controller/menus/ShapeContextMenu.src b/chart2/source/controller/menus/ShapeContextMenu.src
new file mode 100644
index 000000000000..79e424707807
--- /dev/null
+++ b/chart2/source/controller/menus/ShapeContextMenu.src
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "MenuResIds.hrc"
+#include "ShapeController.hrc"
+
+
+Menu RID_CONTEXTMENU_SHAPE
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = COMMAND_ID_FORMAT_LINE;
+ Command = ".uno:FormatLine";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_FORMAT_AREA;
+ Command = ".uno:FormatArea";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_TEXT_ATTRIBUTES;
+ Command = ".uno:TextAttributes";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_TRANSFORM_DIALOG;
+ Command = ".uno:TransformDialog";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_OBJECT_TITLE_DESCRIPTION;
+ Command = ".uno:ObjectTitleDescription";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_RENAME_OBJECT;
+ Command = ".uno:RenameObject";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_ARRANGE_ROW;
+ Command = ".uno:ArrangeRow";
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = COMMAND_ID_BRING_TO_FRONT;
+ Command = ".uno:BringToFront";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_FORWARD;
+ Command = ".uno:Forward";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_BACKWARD;
+ Command = ".uno:Backward";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_SEND_TO_BACK;
+ Command = ".uno:SendToBack";
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_CUT;
+ Command = ".uno:Cut";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_COPY;
+ Command = ".uno:Copy";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_PASTE;
+ Command = ".uno:Paste";
+ };
+ };
+};
diff --git a/configmgr/source/inc/cachefactory.hxx b/chart2/source/controller/menus/ShapeEditContextMenu.src
index 15b02877bf71..60f5d4eab5af 100644
--- a/configmgr/source/inc/cachefactory.hxx
+++ b/chart2/source/controller/menus/ShapeEditContextMenu.src
@@ -24,28 +24,42 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#include "MenuResIds.hrc"
+#include "ShapeController.hrc"
-#ifndef CONFIGMGR_CACHEFACTORY_HXX_
-#define CONFIGMGR_CACHEFACTORY_HXX_
-#include <rtl/ref.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
+Menu RID_CONTEXTMENU_SHAPEEDIT
{
-//-----------------------------------------------------------------------------
- class TreeManager;
-//-----------------------------------------------------------------------------
- struct CacheFactory
+ ItemList =
{
- rtl::Reference<TreeManager>
- createCacheManager(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
-
- static CacheFactory & instance();
+ MenuItem
+ {
+ Identifier = COMMAND_ID_FONT_DIALOG;
+ Command = ".uno:FontDialog";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_PARAGRAPH_DIALOG;
+ Command = ".uno:ParagraphDialog";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_CUT;
+ Command = ".uno:Cut";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_COPY;
+ Command = ".uno:Copy";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_PASTE;
+ Command = ".uno:Paste";
+ };
};
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // CONFIGMGR_CACHEFACTORY_HXX_
-
+};
diff --git a/crashrep/source/unx/res/makefile.mk b/chart2/source/controller/menus/makefile.mk
index 9e738bf08629..f97548963e38 100755..100644
--- a/crashrep/source/unx/res/makefile.mk
+++ b/chart2/source/controller/menus/makefile.mk
@@ -25,35 +25,39 @@
#
#*************************************************************************
-PRJ=..$/..$/..
+PRJ= ..$/..$/..
+PRJINC= $(PRJ)$/source
+PRJNAME= chart2
+TARGET= chcmenus
-PRJNAME=crashrep
-TARGET=unxcrashres
-LIBTARGET=NO
-TARGETTYPE=CUI
+ENABLE_EXCEPTIONS= TRUE
+VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
+.INCLUDE: settings.mk
-.IF "$(OS)"=="MACOSX"
+# i26518 the gcc-3.0.4 requires to enhance the template-depth
+# this seems to be a compiler issue, so we recommend not to use 3.0.x anymore
+.IF "$(COM)"=="GCC"
+ CFLAGS+=-ftemplate-depth-128
+.ENDIF
-dummy:
- @echo "Nothing to build for OS $(OS)"
+# --- Resources ---------------------------------------------------------------
-.ELSE # "$(OS)"=="MACOSX"
+SRC1FILES= \
+ ShapeContextMenu.src \
+ ShapeEditContextMenu.src
-# --- Files --------------------------------------------------------
+SRS1NAME=$(TARGET)
-SOLARLIB!:=$(SOLARLIB:s/jre/jnore/)
+# --- Targets -----------------------------------------------------------------
-APP1TARGET=$(TARGET)
-APP1OBJS=$(OBJ)$/unxcrashres.obj
-APP1STDLIBS=$(TOOLSLIB) $(SALLIB)
+.INCLUDE: target.mk
-.ENDIF "$(OS)"=="MACOSX"
+#dependencies:
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
+$(SRS)$/chcmenus.srs: \
+ ..$/inc$/MenuResIds.hrc
+#$(SRS)$/$(TARGET).srs: $(SOLARINCDIR)$/svx$/globlmn.hrc
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index a5c5085ff626..bdeab6736044 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -55,8 +55,6 @@ namespace chart
class OOO_DLLPUBLIC_CHARTTOOLS ChartModelHelper
{
public:
- static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > createUndoManager();
-
static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeHighlighter > createRangeHighlighter(
const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier >& xSelectionSupplier );
diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx
index c122f4b872d8..0765c9acf94a 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -40,6 +40,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
//.............................................................................
namespace chart
@@ -76,6 +77,7 @@ enum ObjectType
OBJECTTYPE_DATA_STOCK_RANGE,
OBJECTTYPE_DATA_STOCK_LOSS,
OBJECTTYPE_DATA_STOCK_GAIN,
+ OBJECTTYPE_SHAPE,
OBJECTTYPE_UNKNOWN
};
@@ -99,6 +101,18 @@ class OOO_DLLPUBLIC_CHARTTOOLS ObjectIdentifier
//where Type: getStringForType( ObjectType eType ) or other string
public:
+ ObjectIdentifier();
+ ObjectIdentifier( const ::rtl::OUString& rObjectCID );
+ ObjectIdentifier( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape );
+ ObjectIdentifier( const ::com::sun::star::uno::Any& rAny );
+ virtual ~ObjectIdentifier();
+
+ ObjectIdentifier( const ObjectIdentifier& rOID );
+ ObjectIdentifier& operator=( const ObjectIdentifier& rOID );
+ bool operator==( const ObjectIdentifier& rOID ) const;
+ bool operator!=( const ObjectIdentifier& rOID ) const;
+ bool operator<( const ObjectIdentifier& rOID ) const;
+
static rtl::OUString createClassifiedIdentifierForObject(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface >& xObject
@@ -169,6 +183,7 @@ public:
static rtl::OUString getDragMethodServiceName( const rtl::OUString& rClassifiedIdentifier );
static rtl::OUString getDragParameterString( const rtl::OUString& rCID );
static bool isDragableObject( const rtl::OUString& rClassifiedIdentifier );
+ bool isDragableObject();
static bool isRotateableObject( const rtl::OUString& rClassifiedIdentifier );
static bool isMultiClickObject( const rtl::OUString& rClassifiedIdentifier );
static bool areSiblings( const rtl::OUString& rCID1, const rtl::OUString& rCID2 );//identical object is no sibling
@@ -176,6 +191,7 @@ public:
static rtl::OUString getStringForType( ObjectType eObjectType );
static ObjectType getObjectType( const rtl::OUString& rCID );
+ ObjectType getObjectType();
static rtl::OUString createSeriesSubObjectStub( ObjectType eSubObjectType
, const rtl::OUString& rSeriesParticle
@@ -238,6 +254,22 @@ public:
static TitleHelper::eTitleType getTitleTypeForCID( const ::rtl::OUString& rCID );
static ::rtl::OUString getMovedSeriesCID( const ::rtl::OUString& rObjectCID, sal_Bool bForward );
+
+ bool isValid() const;
+ bool isAutoGeneratedObject() const;
+ bool isAdditionalShape() const;
+ ::rtl::OUString getObjectCID() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getAdditionalShape() const;
+ ::com::sun::star::uno::Any getAny() const;
+
+private:
+ // #i12587# support for shapes in chart
+ // For autogenerated chart objects a CID is specified in m_aObjectCID,
+ // for all other objects m_xAdditionalShape is set.
+ // Note, that if m_aObjectCID is set, m_xAdditionalShape must be empty
+ // and vice versa.
+ ::rtl::OUString m_aObjectCID;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xAdditionalShape;
};
//.............................................................................
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index 870f1b9fd6c4..47ed75e80a9a 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -30,7 +30,7 @@
// this includes no link dependency
#include <svl/solar.hrc>
-//next free is 290
+//next free is 291
//single free is: 134
//#define RID_APP_START 30000
@@ -264,6 +264,8 @@
#define STR_OBJECT_CURVE_EQUATION (RID_APP_START + 268)
#define STR_STATISTICS_IN_LEGEND (RID_APP_START + 180)
+#define STR_OBJECT_SHAPE (RID_APP_START + 290)
+
//-----------------------------------------------------------------------------
//Titles for tabpages and dialogs
diff --git a/chart2/source/inc/UndoGuard.hxx b/chart2/source/inc/UndoGuard.hxx
index 247f2d3f559f..864d5ccff994 100644
--- a/chart2/source/inc/UndoGuard.hxx
+++ b/chart2/source/inc/UndoGuard.hxx
@@ -29,7 +29,6 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/chart2/XUndoManager.hpp>
-#include "charttoolsdllapi.hxx"
// header for class OUString
#include <rtl/ustring.hxx>
@@ -48,7 +47,7 @@ public:
::com::sun::star::frame::XModel > & xModel );
virtual ~UndoGuard_Base();
-OOO_DLLPUBLIC_CHARTTOOLS void commitAction();
+ void commitAction();
protected:
::com::sun::star::uno::Reference<
@@ -64,7 +63,7 @@ protected:
cancelAction in the DTOR if no other method is called.
If commitAction is called the destructor does nothin anymore.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS UndoGuard : public UndoGuard_Base
+class UndoGuard : public UndoGuard_Base
{
public:
explicit UndoGuard( const rtl::OUString& rUndoMessage
@@ -79,7 +78,7 @@ public:
cancelActionUndo in the DTOR if no other method is called.
If commitAction is called the destructor does nothin anymore.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS UndoLiveUpdateGuard : public UndoGuard_Base
+class UndoLiveUpdateGuard : public UndoGuard_Base
{
public:
explicit UndoLiveUpdateGuard( const rtl::OUString& rUndoMessage
@@ -93,7 +92,7 @@ public:
/** Same as UndoLiveUpdateGuard but with additional storage of the chart's data.
Only use this if the data has internal data.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS UndoLiveUpdateGuardWithData :
+class UndoLiveUpdateGuardWithData :
public UndoGuard_Base
{
public:
@@ -105,7 +104,7 @@ public:
virtual ~UndoLiveUpdateGuardWithData();
};
-class OOO_DLLPUBLIC_CHARTTOOLS UndoGuardWithSelection : public UndoGuard_Base
+class UndoGuardWithSelection : public UndoGuard_Base
{
public:
explicit UndoGuardWithSelection( const rtl::OUString& rUndoMessage
diff --git a/chart2/source/inc/UndoManager.hxx b/chart2/source/inc/UndoManager.hxx
index b5481715ad43..a28a0d78c470 100644
--- a/chart2/source/inc/UndoManager.hxx
+++ b/chart2/source/inc/UndoManager.hxx
@@ -36,8 +36,9 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/chart2/XUndoManager.hpp>
#include <com/sun/star/chart2/XUndoHelper.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/compbase4.hxx>
#include <rtl/ustring.hxx>
// for pair
@@ -45,6 +46,8 @@
// for auto_ptr
#include <memory>
+class SdrUndoAction;
+
namespace com { namespace sun { namespace star {
namespace frame {
class XModel;
@@ -62,10 +65,11 @@ class UndoElement;
class UndoStack;
class ModifyBroadcaster;
-typedef ::cppu::WeakComponentImplHelper3<
+typedef ::cppu::WeakComponentImplHelper4<
::com::sun::star::util::XModifyBroadcaster,
::com::sun::star::chart2::XUndoManager,
- ::com::sun::star::chart2::XUndoHelper >
+ ::com::sun::star::chart2::XUndoHelper,
+ ::com::sun::star::lang::XUnoTunnel >
UndoManager_Base;
} // namespace impl
@@ -87,6 +91,15 @@ public:
explicit UndoManager();
virtual ~UndoManager();
+ void addShapeUndoAction( SdrUndoAction* pAction );
+
+ // ____ XUnoTunnel ____
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+ static UndoManager* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xObj );
+
protected:
// ____ ConfigItemListener ____
virtual void notify( const ::rtl::OUString & rPropertyName );
@@ -145,7 +158,8 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > & xCurrentModel,
impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo );
+ impl::UndoStack * pStackToAddTo,
+ bool bUndo = true );
::std::auto_ptr< impl::UndoStack > m_apUndoStack;
::std::auto_ptr< impl::UndoStack > m_apRedoStack;
diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx
index b2f4f412610e..5bcf67a8592b 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -95,8 +95,6 @@ public:
getUnoModel();
SdrModel& getSdrModel();
- SAL_DLLPRIVATE void updateTablesFromChartModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
-
XColorTable* GetColorTable() const;
XDashList* GetDashList() const;
XLineEndList* GetLineEndList() const;
diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx
index b6dbec2c76f0..d1af0edb3335 100644
--- a/chart2/source/inc/servicenames.hxx
+++ b/chart2/source/inc/servicenames.hxx
@@ -57,14 +57,13 @@ namespace chart
#define CHART_CHARTAPIWRAPPER_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.ChartDocumentWrapper")
// accessibility
-#define CHART2_ACCESSIBLE_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.AccessibleChartView")
-#define CHART2_ACCESSIBLE_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.AccessibleChartView")
-
#define CHART_ACCESSIBLE_TEXT_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.AccessibleTextComponent")
#define CHART_ACCESSIBLE_TEXT_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.accessibility.AccessibleTextComponent")
#define CHART_RENDERER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartRenderer")
+#define CHART_UNDOMANAGER_SERVICE_NAME ::rtl::OUString::createFromAscii( "com.sun.star.chart2.UndoManager" )
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index ae3f85a3be40..4eedac67f713 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
#include <map>
#include <algorithm>
@@ -105,6 +106,9 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
// attention: passing this as reference to ImplChartModel
m_pImplChartModel.reset( new impl::ImplChartModel( xContext, this ));
+
+ m_xUndoManager = Reference< chart2::XUndoManager >(
+ this->createInstance( CHART_UNDOMANAGER_SERVICE_NAME ), uno::UNO_QUERY );
}
ChartModel::ChartModel( const ChartModel & rOther )
@@ -125,6 +129,7 @@ ChartModel::ChartModel( const ChartModel & rOther )
, m_xStorage( 0 ) //rOther.m_xStorage )
, m_aVisualAreaSize( rOther.m_aVisualAreaSize )
, m_aGraphicObjectVector( rOther.m_aGraphicObjectVector )
+ , m_xUndoManager( rOther.m_xUndoManager )
{
OSL_TRACE( "ChartModel: Copy-CTOR called" );
@@ -211,6 +216,43 @@ ChartModel::~ChartModel()
}
}
+void ChartModel::impl_adjustAdditionalShapesPositionAndSize( const awt::Size& aVisualAreaSize )
+{
+ uno::Reference< beans::XPropertySet > xProperties( static_cast< ::cppu::OWeakObject* >( this ), uno::UNO_QUERY );
+ if ( xProperties.is() )
+ {
+ uno::Reference< drawing::XShapes > xShapes;
+ xProperties->getPropertyValue( C2U( "AdditionalShapes" ) ) >>= xShapes;
+ if ( xShapes.is() )
+ {
+ sal_Int32 nCount = xShapes->getCount();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() )
+ {
+ awt::Point aPos( xShape->getPosition() );
+ awt::Size aSize( xShape->getSize() );
+
+ double fWidth = static_cast< double >( aVisualAreaSize.Width ) / m_aVisualAreaSize.Width;
+ double fHeight = static_cast< double >( aVisualAreaSize.Height ) / m_aVisualAreaSize.Height;
+
+ aPos.X = static_cast< long >( aPos.X * fWidth );
+ aPos.Y = static_cast< long >( aPos.Y * fHeight );
+ aSize.Width = static_cast< long >( aSize.Width * fWidth );
+ aSize.Height = static_cast< long >( aSize.Height * fHeight );
+
+ xShape->setPosition( aPos );
+ xShape->setSize( aSize );
+ }
+ }
+ }
+ }
+ }
+}
+
//-----------------------------------------------------------------
// lang::XServiceInfo
//-----------------------------------------------------------------
@@ -904,6 +946,13 @@ void SAL_CALL ChartModel::setVisualAreaSize( ::sal_Int64 nAspect, const awt::Siz
bool bChanged =
(m_aVisualAreaSize.Width != aSize.Width ||
m_aVisualAreaSize.Height != aSize.Height);
+
+ // #i12587# support for shapes in chart
+ if ( bChanged )
+ {
+ impl_adjustAdditionalShapesPositionAndSize( aSize );
+ }
+
m_aVisualAreaSize = aSize;
if( bChanged )
setModified( sal_True );
@@ -1086,18 +1135,20 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
switch( (*aIt).second )
{
case SERVICE_DASH_TABLE:
- return m_pImplChartModel->GetDashTable();
case SERVICE_GARDIENT_TABLE:
- return m_pImplChartModel->GetGradientTable();
case SERVICE_HATCH_TABLE:
- return m_pImplChartModel->GetHatchTable();
case SERVICE_BITMAP_TABLE:
- return m_pImplChartModel->GetBitmapTable();
case SERVICE_TRANSP_GRADIENT_TABLE:
- return m_pImplChartModel->GetTransparencyGradientTable();
case SERVICE_MARKER_TABLE:
- // not supported
- return 0;
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFact(
+ this->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ if ( xFact.is() )
+ {
+ return xFact->createInstance( rServiceSpecifier );
+ }
+ }
+ break;
case SERVICE_NAMESPACE_MAP:
// not yet supported, @todo
// return 0;
@@ -1212,7 +1263,7 @@ void SAL_CALL ChartModel::setParent( const Reference< uno::XInterface >& Parent
Reference< chart2::XUndoManager > SAL_CALL ChartModel::getUndoManager()
throw (uno::RuntimeException)
{
- return m_pImplChartModel->GetUndoManager();
+ return m_xUndoManager;
}
// ____ XDataSource ____
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 7ca8ce34e7c3..ab30e40f85fc 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -147,6 +147,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xParent;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeHighlighter > m_xRangeHighlighter;
::std::vector< GraphicObject > m_aGraphicObjectVector;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
private:
//private methods
@@ -192,6 +193,9 @@ private:
impl_createFilter( const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue > & rMediaDescriptor );
+ void impl_adjustAdditionalShapesPositionAndSize(
+ const ::com::sun::star::awt::Size& aVisualAreaSize );
+
public:
//no default constructor
ChartModel(::com::sun::star::uno::Reference<
diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx
index 2e84d2b4508f..77b78f16c861 100644..100755
--- a/chart2/source/model/main/ImplChartModel.cxx
+++ b/chart2/source/model/main/ImplChartModel.cxx
@@ -109,17 +109,6 @@ ImplChartModel::ImplChartModel(
m_spChartData( new ChartData( m_xContext )),
m_bIsDisposed( false ),
m_xPageBackground( new PageBackground( m_xContext )),
- m_xUndoManager( ChartModelHelper::createUndoManager() ),
- m_xDashTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
- C2U( "com.sun.star.drawing.DashTable" ), C2U( "com.sun.star.comp.chart.DashTable" ) )),
- m_xGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
- C2U( "com.sun.star.drawing.GradientTable" ), C2U( "com.sun.star.comp.chart.GradientTable" ) )),
- m_xHatchTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
- C2U( "com.sun.star.drawing.HatchTable" ), C2U( "com.sun.star.comp.chart.HatchTable" ) )),
- m_xBitmapTable( createNameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL
- C2U( "com.sun.star.drawing.BitmapTable" ), C2U( "com.sun.star.comp.chart.BitmapTable" ) )),
- m_xTransparencyGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
- C2U( "com.sun.star.drawing.TransparencyGradientTable" ), C2U( "com.sun.star.comp.chart.TransparencyGradientTable" ) )),
m_xXMLNamespaceMap( createNameContainer( ::getCppuType( (const OUString*) 0 ),
C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY),
m_xModifyListener( xListener )
@@ -148,12 +137,6 @@ ImplChartModel::ImplChartModel( const ImplChartModel & rOther, const Reference<
m_xPageBackground.set( CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground ));
ModifyListenerHelper::addListener( m_xPageBackground, m_xModifyListener );
- m_xDashTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xDashTable ));
- m_xGradientTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xGradientTable ));
- m_xHatchTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xHatchTable ));
- m_xBitmapTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xBitmapTable ));
- m_xTransparencyGradientTable.set( CreateRefClone< Reference< container::XNameContainer > >()( rOther.m_xTransparencyGradientTable ));
-
m_xXMLNamespaceMap.set( CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap ));
CloneRefVector< Reference< chart2::XDiagram > >( rOther.m_aDiagrams, m_aDiagrams );
@@ -440,12 +423,6 @@ void ImplChartModel::dispose()
m_aDiagrams.clear();
DisposeHelper::DisposeAndClear( m_xTitle );
DisposeHelper::DisposeAndClear( m_xPageBackground );
- DisposeHelper::DisposeAndClear( m_xDashTable );
- DisposeHelper::DisposeAndClear( m_xGradientTable );
- DisposeHelper::DisposeAndClear( m_xHatchTable );
- DisposeHelper::DisposeAndClear( m_xBitmapTable );
- DisposeHelper::DisposeAndClear( m_xTransparencyGradientTable );
-
DisposeHelper::DisposeAndClear( m_xXMLNamespaceMap );
// note: m_xModifyListener is the ChartModel, so don't call dispose()
@@ -459,11 +436,6 @@ Reference< beans::XPropertySet > ImplChartModel::GetPageBackground()
return m_xPageBackground;
}
-Reference< chart2::XUndoManager > ImplChartModel::GetUndoManager()
-{
- return m_xUndoManager;
-}
-
void ImplChartModel::SetNewData( const Reference< chart2::data::XDataSource > & xDataSource,
const Sequence< beans::PropertyValue > & rArgs )
{
@@ -515,27 +487,6 @@ void ImplChartModel::CreateDefaultChartTypeTemplate()
}
}
-Reference< uno::XInterface > ImplChartModel::GetDashTable() const
-{
- return Reference< uno::XInterface >( m_xDashTable );
-}
-Reference< uno::XInterface > ImplChartModel::GetGradientTable() const
-{
- return Reference< uno::XInterface >( m_xGradientTable );
-}
-Reference< uno::XInterface > ImplChartModel::GetHatchTable() const
-{
- return Reference< uno::XInterface >( m_xHatchTable );
-}
-Reference< uno::XInterface > ImplChartModel::GetBitmapTable() const
-{
- return Reference< uno::XInterface >( m_xBitmapTable );
-}
-Reference< uno::XInterface > ImplChartModel::GetTransparencyGradientTable() const
-{
- return Reference< uno::XInterface >( m_xTransparencyGradientTable );
-}
-
Reference< uno::XInterface > ImplChartModel::GetXMLNameSpaceMap() const
{
return Reference< uno::XInterface >( m_xXMLNamespaceMap );
diff --git a/chart2/source/model/main/ImplChartModel.hxx b/chart2/source/model/main/ImplChartModel.hxx
index aa56565176e3..1e0a0bf2c35a 100644
--- a/chart2/source/model/main/ImplChartModel.hxx
+++ b/chart2/source/model/main/ImplChartModel.hxx
@@ -154,23 +154,9 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
GetPageBackground();
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager >
- GetUndoManager();
-
void CreateDefaultChart();
::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > GetDashTable() const;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > GetGradientTable() const;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > GetHatchTable() const;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > GetBitmapTable() const;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface > GetTransparencyGradientTable() const;
-
- ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > GetXMLNameSpaceMap() const;
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
@@ -229,14 +215,6 @@ private:
bool m_bIsDisposed;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xPageBackground;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager >
- m_xUndoManager;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xDashTable;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xGradientTable;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xHatchTable;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xBitmapTable;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xTransparencyGradientTable;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xXMLNamespaceMap;
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
index 109b2d644433..8ce45e85038d 100644
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
@@ -32,7 +32,6 @@
#include "DiagramHelper.hxx"
#include "DataSourceHelper.hxx"
#include "ControllerLockGuard.hxx"
-#include "UndoManager.hxx"
#include "RangeHighlighter.hxx"
#include "InternalDataProvider.hxx"
@@ -56,12 +55,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
//static
-uno::Reference< chart2::XUndoManager > ChartModelHelper::createUndoManager()
-{
- return new UndoManager();
-}
-
-//static
uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter(
const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier )
{
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 59e608248167..0599f9317aed 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -59,6 +59,7 @@ using namespace ::com::sun::star::chart2;
using rtl::OUString;
using rtl::OUStringBuffer;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
static OUString m_aMultiClick( C2U("MultiClick") );
static OUString m_aDragMethodEquals( C2U("DragMethod=") );
@@ -251,6 +252,94 @@ void lcl_getDiagramAndCooSys( const OUString& rObjectCID
} //anonymous namespace
+ObjectIdentifier::ObjectIdentifier()
+ :m_aObjectCID( OUString() )
+ ,m_xAdditionalShape( 0 )
+{
+}
+
+ObjectIdentifier::ObjectIdentifier( const OUString& rObjectCID )
+ :m_aObjectCID( rObjectCID )
+ ,m_xAdditionalShape( 0 )
+{
+}
+
+ObjectIdentifier::ObjectIdentifier( const Reference< drawing::XShape >& rxShape )
+ :m_aObjectCID( OUString() )
+ ,m_xAdditionalShape( rxShape )
+{
+}
+
+ObjectIdentifier::ObjectIdentifier( const Any& rAny )
+ :m_aObjectCID( OUString() )
+ ,m_xAdditionalShape( 0 )
+{
+ const uno::Type& rType = rAny.getValueType();
+ if ( rType == ::getCppuType( static_cast< const OUString* >( 0 ) ) )
+ {
+ rAny >>= m_aObjectCID;
+ }
+ else if ( rType == ::getCppuType( static_cast< const Reference< drawing::XShape >* >( 0 ) ) )
+ {
+ rAny >>= m_xAdditionalShape;
+ }
+}
+
+ObjectIdentifier::~ObjectIdentifier()
+{
+}
+
+ObjectIdentifier::ObjectIdentifier( const ObjectIdentifier& rOID )
+ :m_aObjectCID( rOID.m_aObjectCID )
+ ,m_xAdditionalShape( rOID.m_xAdditionalShape )
+{
+
+}
+
+ObjectIdentifier& ObjectIdentifier::operator=( const ObjectIdentifier& rOID )
+{
+ m_aObjectCID = rOID.m_aObjectCID;
+ m_xAdditionalShape = rOID.m_xAdditionalShape;
+ return *this;
+}
+
+bool ObjectIdentifier::operator==( const ObjectIdentifier& rOID ) const
+{
+ if ( areIdenticalObjects( m_aObjectCID, rOID.m_aObjectCID ) &&
+ ( m_xAdditionalShape == rOID.m_xAdditionalShape ) )
+ {
+ return true;
+ }
+ return false;
+}
+
+bool ObjectIdentifier::operator!=( const ObjectIdentifier& rOID ) const
+{
+ return !operator==( rOID );
+}
+
+bool ObjectIdentifier::operator<( const ObjectIdentifier& rOID ) const
+{
+ bool bReturn = false;
+ if ( m_aObjectCID.getLength() && rOID.m_aObjectCID.getLength() )
+ {
+ bReturn = ( m_aObjectCID.compareTo( rOID.m_aObjectCID ) < 0 );
+ }
+ else if ( m_aObjectCID.getLength() )
+ {
+ bReturn = true;
+ }
+ else if ( rOID.m_aObjectCID.getLength() )
+ {
+ bReturn = false;
+ }
+ else if ( m_xAdditionalShape.is() && rOID.m_xAdditionalShape.is() )
+ {
+ bReturn = ( m_xAdditionalShape < rOID.m_xAdditionalShape );
+ }
+ return bReturn;
+}
+
//static
OUString ObjectIdentifier::createClassifiedIdentifierForObject(
const Reference< uno::XInterface >& xObject
@@ -665,6 +754,20 @@ bool ObjectIdentifier::isDragableObject( const OUString& rClassifiedIdentifier )
return false;
}
+bool ObjectIdentifier::isDragableObject()
+{
+ bool bReturn = false;
+ if ( isAutoGeneratedObject() )
+ {
+ bReturn = isDragableObject( m_aObjectCID );
+ }
+ else if ( isAdditionalShape() )
+ {
+ bReturn = true;
+ }
+ return bReturn;
+}
+
//static
bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier )
{
@@ -903,6 +1006,20 @@ ObjectType ObjectIdentifier::getObjectType( const OUString& rCID )
return eRet;
}
+ObjectType ObjectIdentifier::getObjectType()
+{
+ ObjectType eObjectType( OBJECTTYPE_UNKNOWN );
+ if ( isAutoGeneratedObject() )
+ {
+ eObjectType = getObjectType( m_aObjectCID );
+ }
+ else if ( isAdditionalShape() )
+ {
+ eObjectType = OBJECTTYPE_SHAPE;
+ }
+ return eObjectType;
+}
+
//static
OUString ObjectIdentifier::createDataCurveCID(
const OUString& rSeriesParticle
@@ -1329,7 +1446,46 @@ OUString ObjectIdentifier::getMovedSeriesCID( const ::rtl::OUString& rObjectCID,
OUString aRet = ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex );
return ObjectIdentifier::createClassifiedIdentifierForParticle( aRet );
}
-//static
+
+bool ObjectIdentifier::isValid() const
+{
+ return ( isAutoGeneratedObject() || isAdditionalShape() );
+}
+
+bool ObjectIdentifier::isAutoGeneratedObject() const
+{
+ return ( m_aObjectCID.getLength() > 0 );
+}
+
+bool ObjectIdentifier::isAdditionalShape() const
+{
+ return m_xAdditionalShape.is();
+}
+
+OUString ObjectIdentifier::getObjectCID() const
+{
+ return m_aObjectCID;
+}
+
+Reference< drawing::XShape > ObjectIdentifier::getAdditionalShape() const
+{
+ return m_xAdditionalShape;
+}
+
+Any ObjectIdentifier::getAny() const
+{
+ Any aAny;
+ if ( isAutoGeneratedObject() )
+ {
+ aAny = uno::makeAny( getObjectCID() );
+ }
+ else if ( isAdditionalShape() )
+ {
+ aAny = uno::makeAny( getAdditionalShape() );
+ }
+ return aAny;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 73c8f064faf0..20359bfa6b4c 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#define PREFERED_DEFAULT_COLOR 0x0000ff
@@ -106,66 +107,81 @@ void RangeHighlighter::determineRanges()
m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
uno::Any aSelection( m_xSelectionSupplier->getSelection());
- OUString aCID;
- if(( aSelection >>= aCID ) &&
- aCID.getLength() > 0 )
+ const uno::Type& rType = aSelection.getValueType();
+
+ if ( rType == ::getCppuType( static_cast< const OUString* >( 0 ) ) )
{
// @todo??: maybe getSelection() should return a model object rather than a CID
- ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
- sal_Int32 nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aCID );
- Reference< chart2::XDataSeries > xDataSeries( ObjectIdentifier::getDataSeriesForCID( aCID, xChartModel ) );
- if( OBJECTTYPE_LEGEND_ENTRY == eObjectType )
+ OUString aCID;
+ aSelection >>= aCID;
+ if ( aCID.getLength() > 0 )
{
- OUString aParentParticel( ObjectIdentifier::getFullParentParticle( aCID ) );
- ObjectType eParentObjectType = ObjectIdentifier::getObjectType( aParentParticel );
- eObjectType = eParentObjectType;
- if( OBJECTTYPE_DATA_POINT == eObjectType )
- nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aParentParticel );
- }
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
+ sal_Int32 nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aCID );
+ Reference< chart2::XDataSeries > xDataSeries( ObjectIdentifier::getDataSeriesForCID( aCID, xChartModel ) );
+ if( OBJECTTYPE_LEGEND_ENTRY == eObjectType )
+ {
+ OUString aParentParticel( ObjectIdentifier::getFullParentParticle( aCID ) );
+ ObjectType eParentObjectType = ObjectIdentifier::getObjectType( aParentParticel );
+ eObjectType = eParentObjectType;
+ if( OBJECTTYPE_DATA_POINT == eObjectType )
+ nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aParentParticel );
+ }
- if( OBJECTTYPE_DATA_POINT == eObjectType || OBJECTTYPE_DATA_LABEL == eObjectType )
- {
- // Data Point
- fillRangesForDataPoint( xDataSeries, nIndex );
- return;
- }
- else if( OBJECTTYPE_DATA_ERRORS == eObjectType )
- {
- // select error bar ranges, or data series, if the style is
- // not set to FROM_DATA
- fillRangesForErrorBars( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), xDataSeries );
- return;
- }
- else if( xDataSeries.is() )
- {
- // Data Series
- fillRangesForDataSeries( xDataSeries );
- return;
- }
- else if( OBJECTTYPE_AXIS == eObjectType )
- {
- // Axis (Categories)
- Reference< chart2::XAxis > xAxis( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), uno::UNO_QUERY );
- if( xAxis.is())
+ if( OBJECTTYPE_DATA_POINT == eObjectType || OBJECTTYPE_DATA_LABEL == eObjectType )
{
- fillRangesForCategories( xAxis );
+ // Data Point
+ fillRangesForDataPoint( xDataSeries, nIndex );
return;
}
- }
- else if( OBJECTTYPE_PAGE == eObjectType
- || OBJECTTYPE_DIAGRAM == eObjectType
- || OBJECTTYPE_DIAGRAM_WALL == eObjectType
- || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType
- )
- {
- // Diagram
- Reference< chart2::XDiagram > xDia( ObjectIdentifier::getDiagramForCID( aCID, xChartModel ) );
- if( xDia.is())
+ else if( OBJECTTYPE_DATA_ERRORS == eObjectType )
{
- fillRangesForDiagram( xDia );
+ // select error bar ranges, or data series, if the style is
+ // not set to FROM_DATA
+ fillRangesForErrorBars( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), xDataSeries );
return;
}
+ else if( xDataSeries.is() )
+ {
+ // Data Series
+ fillRangesForDataSeries( xDataSeries );
+ return;
+ }
+ else if( OBJECTTYPE_AXIS == eObjectType )
+ {
+ // Axis (Categories)
+ Reference< chart2::XAxis > xAxis( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), uno::UNO_QUERY );
+ if( xAxis.is())
+ {
+ fillRangesForCategories( xAxis );
+ return;
+ }
+ }
+ else if( OBJECTTYPE_PAGE == eObjectType
+ || OBJECTTYPE_DIAGRAM == eObjectType
+ || OBJECTTYPE_DIAGRAM_WALL == eObjectType
+ || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType
+ )
+ {
+ // Diagram
+ Reference< chart2::XDiagram > xDia( ObjectIdentifier::getDiagramForCID( aCID, xChartModel ) );
+ if( xDia.is())
+ {
+ fillRangesForDiagram( xDia );
+ return;
+ }
+ }
+ }
+ }
+ else if ( rType == ::getCppuType( static_cast< const Reference< drawing::XShape >* >( 0 ) ) )
+ {
+ // #i12587# support for shapes in chart
+ Reference< drawing::XShape > xShape;
+ aSelection >>= xShape;
+ if ( xShape.is() )
+ {
+ return;
}
}
else
diff --git a/chart2/source/tools/makefile.mk b/chart2/source/tools/makefile.mk
index b459d489e773..2b6e0cf518c1 100644
--- a/chart2/source/tools/makefile.mk
+++ b/chart2/source/tools/makefile.mk
@@ -101,9 +101,6 @@ SLOFILES= \
$(SLO)$/ChartDebugTrace.obj \
$(SLO)$/_serviceregistration_tools.obj \
$(SLO)$/UncachedDataSequence.obj \
- $(SLO)$/UndoManager.obj \
- $(SLO)$/UndoGuard.obj \
- $(SLO)$/ImplUndoManager.obj \
$(SLO)$/XMLRangeHelper.obj \
$(SLO)$/ModifyListenerHelper.obj \
$(SLO)$/ModifyListenerCallBack.obj \
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 51504db2a396..0e954b7c7a85 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -71,6 +71,7 @@
// header for class Application
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
+#include <svx/unofill.hxx>
#include <time.h>
@@ -100,6 +101,7 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <svl/languageoptions.hxx>
#include <sot/clsids.hxx>
@@ -2423,6 +2425,8 @@ void ChartView::createShapes()
{
// /--
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
+ // #i12587# support for shapes in chart
+ m_pDrawModelWrapper->getSdrModel().EnableUndo( FALSE );
m_pDrawModelWrapper->clearMainDrawPage();
// \--
}
@@ -2575,6 +2579,13 @@ void ChartView::createShapes()
lcl_removeEmptyGroupShapes( xPageShapes );
}
+ // #i12587# support for shapes in chart
+ if ( m_pDrawModelWrapper )
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ m_pDrawModelWrapper->getSdrModel().EnableUndo( TRUE );
+ }
+
#if OSL_DEBUG_LEVEL > 0
clock_t nEnd = clock();
double fDuration =(double(nEnd-nStart)*1000.0)/double(CLOCKS_PER_SEC);
@@ -2597,6 +2608,12 @@ void ChartView::impl_updateView()
if( !m_xChartModel.is() || !m_pDrawModelWrapper )
return;
+ // #i12587# support for shapes in chart
+ if ( m_bSdrViewIsInEditMode )
+ {
+ return;
+ }
+
if( m_bViewDirty && !m_bInViewUpdate )
{
m_bInViewUpdate = true;
@@ -2611,7 +2628,6 @@ void ChartView::impl_updateView()
// /--
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
m_pDrawModelWrapper->lockControllers();
- m_pDrawModelWrapper->updateTablesFromChartModel( m_xChartModel );
// \--
}
@@ -2686,8 +2702,22 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
//#i77362 change notification for changes on additional shapes are missing
if( m_bInViewUpdate )
return;
- if( m_bSdrViewIsInEditMode )
- return;
+
+ // #i12587# support for shapes in chart
+ if ( m_bSdrViewIsInEditMode && m_xChartModel.is() )
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier( m_xChartModel->getCurrentController(), uno::UNO_QUERY );
+ if ( xSelectionSupplier.is() )
+ {
+ ::rtl::OUString aSelObjCID;
+ uno::Any aSelObj( xSelectionSupplier->getSelection() );
+ aSelObj >>= aSelObjCID;
+ if ( aSelObjCID.getLength() > 0 )
+ {
+ return;
+ }
+ }
+ }
const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >(&rHint);
if( !pSdrHint )
@@ -2708,6 +2738,9 @@ void ChartView::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case HINT_MODELCLEARED:
bShapeChanged = true;
break;
+ case HINT_ENDEDIT:
+ bShapeChanged = true;
+ break;
default:
break;
}
@@ -2879,6 +2912,88 @@ void SAL_CALL ChartView::removeVetoableChangeListener( const ::rtl::OUString& /*
OSL_ENSURE(false,"not implemented");
}
+// ____ XMultiServiceFactory ____
+
+Reference< uno::XInterface > ChartView::createInstance( const ::rtl::OUString& aServiceSpecifier )
+ throw (uno::Exception, uno::RuntimeException)
+{
+ SdrModel* pModel = ( m_pDrawModelWrapper ? &m_pDrawModelWrapper->getSdrModel() : NULL );
+ if ( pModel )
+ {
+ if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DashTable" ) ) == 0 )
+ {
+ if ( !m_xDashTable.is() )
+ {
+ m_xDashTable = SvxUnoDashTable_createInstance( pModel );
+ }
+ return m_xDashTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.GradientTable" ) ) == 0 )
+ {
+ if ( !m_xGradientTable.is() )
+ {
+ m_xGradientTable = SvxUnoGradientTable_createInstance( pModel );
+ }
+ return m_xGradientTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.HatchTable" ) ) == 0 )
+ {
+ if ( !m_xHatchTable.is() )
+ {
+ m_xHatchTable = SvxUnoHatchTable_createInstance( pModel );
+ }
+ return m_xHatchTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.BitmapTable" ) ) == 0 )
+ {
+ if ( !m_xBitmapTable.is() )
+ {
+ m_xBitmapTable = SvxUnoBitmapTable_createInstance( pModel );
+ }
+ return m_xBitmapTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.TransparencyGradientTable" ) ) == 0 )
+ {
+ if ( !m_xTransGradientTable.is() )
+ {
+ m_xTransGradientTable = SvxUnoTransGradientTable_createInstance( pModel );
+ }
+ return m_xTransGradientTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.MarkerTable" ) ) == 0 )
+ {
+ if ( !m_xMarkerTable.is() )
+ {
+ m_xMarkerTable = SvxUnoMarkerTable_createInstance( pModel );
+ }
+ return m_xMarkerTable;
+ }
+ }
+
+ return 0;
+}
+
+Reference< uno::XInterface > ChartView::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
+ throw (uno::Exception, uno::RuntimeException)
+{
+ OSL_ENSURE( Arguments.getLength(), "ChartView::createInstanceWithArguments: arguments are ignored" );
+ (void) Arguments; // avoid warning
+ return createInstance( ServiceSpecifier );
+}
+
+uno::Sequence< ::rtl::OUString > ChartView::getAvailableServiceNames() throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServiceNames( 6 );
+
+ aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.DashTable" ) );
+ aServiceNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GradientTable" ) );
+ aServiceNames[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.HatchTable" ) );
+ aServiceNames[3] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.BitmapTable" ) );
+ aServiceNames[4] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.TransparencyGradientTable" ) );
+ aServiceNames[5] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.MarkerTable" ) );
+
+ return aServiceNames;
+}
//.............................................................................
} //namespace chart
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx
index 706dd4548940..f56da298c5df 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/source/view/main/ChartView.hxx
@@ -29,7 +29,7 @@
#include "chartview/ExplicitValueProvider.hxx"
#include "ServiceMacros.hxx"
-#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <cppuhelper/interfacecontainer.hxx>
// header for class SfxListener
@@ -69,7 +69,7 @@ The view than changes to state dirty. The view can be updated with call 'update'
The View is not responsible to handle single user events (that is instead done by the ChartWindow).
*/
-class ChartView : public ::cppu::WeakImplHelper8<
+class ChartView : public ::cppu::WeakImplHelper9<
::com::sun::star::lang::XInitialization
, ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::datatransfer::XTransferable
@@ -82,6 +82,7 @@ class ChartView : public ::cppu::WeakImplHelper8<
,::com::sun::star::util::XModeChangeBroadcaster
,::com::sun::star::util::XUpdatable
,::com::sun::star::beans::XPropertySet
+ ,::com::sun::star::lang::XMultiServiceFactory
>
, public ExplicitValueProvider
, private SfxListener
@@ -163,6 +164,15 @@ public:
virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ //-----------------------------------------------------------------
+ // ::com::sun::star::lang::XMultiServiceFactory
+ //-----------------------------------------------------------------
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(
+ const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
// for ExplicitValueProvider
// ____ XUnoTunnel ___
@@ -206,6 +216,13 @@ private: //member
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>
m_xDrawPage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xDashTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xGradientTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xHatchTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xBitmapTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xTransGradientTable;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xMarkerTable;
+
::boost::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
std::vector< VCoordinateSystem* > m_aVCooSysList;
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 81e0e94736ce..577f450172b5 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -131,7 +131,7 @@ DrawModelWrapper::DrawModelWrapper(
SetScaleUnit(MAP_100TH_MM);
SetScaleFraction(Fraction(1, 1));
- SetDefaultFontHeight(847); // 24pt
+ SetDefaultFontHeight(423); // 12pt
SfxItemPool* pMasterPool = &GetItemPool();
pMasterPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
@@ -390,77 +390,6 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const String& rObjectCID, SdrObj
return 0;
}
-namespace
-{
- void impl_addOrExchangeElements( const uno::Reference< uno::XInterface >& xSource
- , const uno::Reference< uno::XInterface >& xTarget )
- {
- uno::Reference< container::XNameContainer > xSourceContainer( xSource, uno::UNO_QUERY );
- uno::Reference< container::XNameContainer > xTargetContainer( xTarget, uno::UNO_QUERY );
-
- if(!xSourceContainer.is()||!xTargetContainer.is())
- return;
-
- try
- {
- //put each element of xSourceContainer to xTargetContainer
- uno::Sequence< rtl::OUString > aNames( xSourceContainer->getElementNames() );
- for( sal_Int32 nN = aNames.getLength(); nN--; )
- {
- rtl::OUString aName(aNames[nN]);
- uno::Any aNewValue( xSourceContainer->getByName( aName ) );
- if( xTargetContainer->hasByName(aName) )
- {
- uno::Any aOldValue( xTargetContainer->getByName( aName ) );
- if( aOldValue != aNewValue )
- xTargetContainer->replaceByName(aName,aNewValue);
- }
- else
- xTargetContainer->insertByName( aName, aNewValue );
- }
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- }
-}
-
-void DrawModelWrapper::updateTablesFromChartModel( const uno::Reference< frame::XModel >& xChartModel )
-{
- //all gradients, etc contained in the model need to be offered fot the view and GUI also:
-
- DBG_ASSERT( xChartModel.is(),"need a chart model for updateTablesFromChartModel");
- if( !xChartModel.is() )
- return;
-
- uno::Reference< lang::XMultiServiceFactory > xTableFactory( xChartModel, uno::UNO_QUERY );
- DBG_ASSERT( xTableFactory.is(), "new model is expected to implement service factory for gradient table etc" );
- if( !xTableFactory.is() )
- return;
-
- //todo? colorTable...
- //impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.XXX") )
- // , SvxUnoXColorTable_createInstance( this->GetColorTable() ) );
- impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.DashTable") )
- , SvxUnoXDashTable_createInstance( this->GetDashList() ) );
- impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.MarkerTable") )
- , SvxUnoXLineEndTable_createInstance( this->GetLineEndList() ) );
- impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.GradientTable") )
- , SvxUnoXGradientTable_createInstance( this->GetGradientList() ) );
- impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.HatchTable") )
- , SvxUnoXHatchTable_createInstance( this->GetHatchList() ) );
- impl_addOrExchangeElements( xTableFactory->createInstance( C2U("com.sun.star.drawing.BitmapTable") )
- , SvxUnoXBitmapTable_createInstance( this->GetBitmapList() ) );
-
- // transparency gradients
- uno::Reference< uno::XInterface > xSource(
- xTableFactory->createInstance( C2U("com.sun.star.drawing.TransparencyGradientTable")));
- uno::Reference< uno::XInterface > xTarget(
- this->getShapeFactory()->createInstance( C2U("com.sun.star.drawing.TransparencyGradientTable")));
- impl_addOrExchangeElements( xSource, xTarget );
-}
-
//static
bool DrawModelWrapper::removeShape( const uno::Reference< drawing::XShape >& xShape )
{
diff --git a/chart2/uiconfig/toolbar/arrowshapes.xml b/chart2/uiconfig/toolbar/arrowshapes.xml
new file mode 100644
index 000000000000..4a53519494ea
--- /dev/null
+++ b/chart2/uiconfig/toolbar/arrowshapes.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.corner-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.striped-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.notched-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.pentagon-right" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.chevron" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.circular-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-round-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.s-sharped-arrow" toolbar:helpid="helpid:11004" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/basicshapes.xml b/chart2/uiconfig/toolbar/basicshapes.xml
new file mode 100644
index 000000000000..e65778305788
--- /dev/null
+++ b/chart2/uiconfig/toolbar/basicshapes.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-quadrat" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle-pie" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.isosceles-triangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.right-triangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.trapezoid" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.diamond" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.parallelogram" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.pentagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.hexagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.octagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cross" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ring" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.block-arc" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.can" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cube" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.paper" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.frame" toolbar:helpid="helpid:11002" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/calloutshapes.xml b/chart2/uiconfig/toolbar/calloutshapes.xml
new file mode 100644
index 000000000000..91b957fa697a
--- /dev/null
+++ b/chart2/uiconfig/toolbar/calloutshapes.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.rectangular-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.round-rectangular-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.round-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.cloud-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-1" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-2" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-3" toolbar:helpid="helpid:11006" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/drawbar.xml b/chart2/uiconfig/toolbar/drawbar.xml
new file mode 100644
index 000000000000..f4017835635c
--- /dev/null
+++ b/chart2/uiconfig/toolbar/drawbar.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <toolbar:toolbaritem xlink:href=".uno:SelectObject" toolbar:helpid="10128"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Line" toolbar:helpid="10102"/>
+ <toolbar:toolbaritem xlink:href=".uno:LineArrowEnd" toolbar:helpid="27173"/>
+ <toolbar:toolbaritem xlink:href=".uno:Rect" toolbar:helpid="10104"/>
+ <toolbar:toolbaritem xlink:href=".uno:Ellipse" toolbar:helpid="10110"/>
+ <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled" toolbar:helpid="10464"/>
+ <toolbar:toolbaritem xlink:href=".uno:DrawText" toolbar:helpid="10253"/>
+ <toolbar:toolbaritem xlink:href=".uno:DrawCaption" toolbar:helpid="10254"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes" toolbar:style="dropdown" toolbar:helpid="11002"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes" toolbar:style="dropdown" toolbar:helpid="11003"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes" toolbar:style="dropdown" toolbar:helpid="11004"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes" toolbar:style="dropdown" toolbar:helpid="11005"/>
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes" toolbar:style="dropdown" toolbar:helpid="11006"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes" toolbar:style="dropdown" toolbar:helpid="11007"/>
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/flowchartshapes.xml b/chart2/uiconfig/toolbar/flowchartshapes.xml
new file mode 100644
index 000000000000..bb1d1099dbd4
--- /dev/null
+++ b/chart2/uiconfig/toolbar/flowchartshapes.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-alternate-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-decision" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-data" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-predefined-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-internal-storage" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-document" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-multidocument" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-terminator" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-preparation" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-input" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-operation" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-connector" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-off-page-connector" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-card" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-punched-tape" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-summing-junction" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-or" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-collate" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sort" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-extract" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-merge" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-stored-data" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-delay" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sequential-access" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-magnetic-disk" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-direct-access-storage" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-display" toolbar:helpid="helpid:11005" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/starshapes.xml b/chart2/uiconfig/toolbar/starshapes.xml
new file mode 100644
index 000000000000..a2ff874d2fe7
--- /dev/null
+++ b/chart2/uiconfig/toolbar/starshapes.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.bang" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star4" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star5" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star6" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star8" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star12" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star24" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.concave-star6" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.vertical-scroll" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.horizontal-scroll" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.signet" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.doorplate" toolbar:helpid="helpid:11007" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/chart2/uiconfig/toolbar/symbolshapes.xml b/chart2/uiconfig/toolbar/symbolshapes.xml
new file mode 100644
index 000000000000..0fa6aee313db
--- /dev/null
+++ b/chart2/uiconfig/toolbar/symbolshapes.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.smiley" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.sun" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.moon" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.lightning" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.heart" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.flower" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.cloud" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.forbidden" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.puzzle" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.bracket-pair" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-bracket" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-bracket" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.brace-pair" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-brace" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-brace" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.quad-bevel" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.octagon-bevel" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.diamond-bevel" toolbar:helpid="helpid:11003" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx b/configmgr/inc/configmgr/detail/configmgrdllapi.hxx
new file mode 100644
index 000000000000..6eb2ea7bc9d9
--- /dev/null
+++ b/configmgr/inc/configmgr/detail/configmgrdllapi.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
+#define INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_CONFIGMGR
+#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
diff --git a/configmgr/inc/configmgr/update.hxx b/configmgr/inc/configmgr/update.hxx
new file mode 100644
index 000000000000..b27a32487400
--- /dev/null
+++ b/configmgr/inc/configmgr/update.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_UPDATE_HXX
+#define INCLUDED_CONFIGMGR_UPDATE_HXX
+
+#include "sal/config.h"
+
+#include "configmgr/detail/configmgrdllapi.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+namespace update {
+
+OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcsFile(
+ bool shared, rtl::OUString const & fileUri);
+
+OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri);
+
+}
+
+}
+
+#endif
diff --git a/configmgr/inc/makefile.mk b/configmgr/inc/makefile.mk
index a9732db36f46..3dd2fc4d4811 100644
--- a/configmgr/inc/makefile.mk
+++ b/configmgr/inc/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,27 +21,18 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=configmgr
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
+#***********************************************************************/
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
+PRJ = ..
+PRJNAME = configmgr
+TARGET = inc
-.INCLUDE : target.mk
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.IF "$(ENABLE_PCH)" != ""
+ALLTAR: $(SLO)/precompiled.pch $(SLO)/precompiled_ex.pch
+.ENDIF
diff --git a/configmgr/inc/pch/precompiled_configmgr.cxx b/configmgr/inc/pch/precompiled_configmgr.cxx
index fe7de05471b9..abfb44ccb7a3 100644
--- a/configmgr/inc/pch/precompiled_configmgr.cxx
+++ b/configmgr/inc/pch/precompiled_configmgr.cxx
@@ -1,29 +1,28 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
#include "precompiled_configmgr.hxx"
-
diff --git a/configmgr/inc/pch/precompiled_configmgr.hxx b/configmgr/inc/pch/precompiled_configmgr.hxx
index ee0dcc4ec6ac..7561fe89f7c4 100644
--- a/configmgr/inc/pch/precompiled_configmgr.hxx
+++ b/configmgr/inc/pch/precompiled_configmgr.hxx
@@ -1,245 +1,32 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#if defined PRECOMPILED_HEADERS
-// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:35.077252
-
-#ifdef PRECOMPILED_HEADERS
-
-//---MARKER---
#include "sal/config.h"
-#include "sal/types.h"
-
-#include "com/sun/star/beans/IllegalTypeException.hpp"
-#include "com/sun/star/beans/NamedValue.hpp"
-#include "com/sun/star/beans/Property.hpp"
-#include "com/sun/star/beans/PropertyAttribute.hpp"
-#include "com/sun/star/beans/PropertyExistException.hpp"
-#include "com/sun/star/beans/PropertyValue.hpp"
-#include "com/sun/star/beans/PropertyVetoException.hpp"
-#include "com/sun/star/beans/UnknownPropertyException.hpp"
-#include "com/sun/star/beans/XExactName.hpp"
-#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
-#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
-#include "com/sun/star/beans/XMultiPropertySet.hpp"
-#include "com/sun/star/beans/XMultiPropertyStates.hpp"
-#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
-#include "com/sun/star/beans/XProperty.hpp"
-#include "com/sun/star/beans/XPropertyChangeListener.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertySetInfo.hpp"
-#include "com/sun/star/beans/XPropertyState.hpp"
-#include "com/sun/star/beans/XPropertyWithState.hpp"
-#include "com/sun/star/beans/XVetoableChangeListener.hpp"
-#include "com/sun/star/configuration/CannotLoadConfigurationException.hpp"
-#include "com/sun/star/configuration/InstallationIncompleteException.hpp"
-#include "com/sun/star/configuration/InvalidBootstrapFileException.hpp"
-#include "com/sun/star/configuration/MissingBootstrapFileException.hpp"
-#include "com/sun/star/configuration/XTemplateContainer.hpp"
-#include "com/sun/star/configuration/XTemplateInstance.hpp"
-#include "com/sun/star/configuration/backend/AuthenticationFailedException.hpp"
-#include "com/sun/star/configuration/backend/BackendAccessException.hpp"
-#include "com/sun/star/configuration/backend/BackendSetupException.hpp"
-#include "com/sun/star/configuration/backend/CannotConnectException.hpp"
-#include "com/sun/star/configuration/backend/ComponentChangeEvent.hpp"
-#include "com/sun/star/configuration/backend/ConnectionLostException.hpp"
-#include "com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp"
-#include "com/sun/star/configuration/backend/InvalidAuthenticationMechanismException.hpp"
-#include "com/sun/star/configuration/backend/MalformedDataException.hpp"
-#include "com/sun/star/configuration/backend/MergeRecoveryRequest.hpp"
-#include "com/sun/star/configuration/backend/NodeAttribute.hpp"
-#include "com/sun/star/configuration/backend/PropertyInfo.hpp"
-#include "com/sun/star/configuration/backend/SchemaAttribute.hpp"
-#include "com/sun/star/configuration/backend/StratumCreationException.hpp"
-#include "com/sun/star/configuration/backend/TemplateIdentifier.hpp"
-#include "com/sun/star/configuration/backend/XBackend.hpp"
-#include "com/sun/star/configuration/backend/XBackendChangesListener.hpp"
-#include "com/sun/star/configuration/backend/XBackendChangesNotifier.hpp"
-#include "com/sun/star/configuration/backend/XBackendEntities.hpp"
-#include "com/sun/star/configuration/backend/XCompositeLayer.hpp"
-#include "com/sun/star/configuration/backend/XLayer.hpp"
-#include "com/sun/star/configuration/backend/XLayerContentDescriber.hpp"
-#include "com/sun/star/configuration/backend/XLayerHandler.hpp"
-#include "com/sun/star/configuration/backend/XLayerImporter.hpp"
-#include "com/sun/star/configuration/backend/XMultiLayerStratum.hpp"
-#include "com/sun/star/configuration/backend/XSchema.hpp"
-#include "com/sun/star/configuration/backend/XSchemaHandler.hpp"
-#include "com/sun/star/configuration/backend/XSchemaSupplier.hpp"
-#include "com/sun/star/configuration/backend/XSingleLayerStratum.hpp"
-#include "com/sun/star/configuration/backend/XUpdatableLayer.hpp"
-#include "com/sun/star/configuration/backend/XUpdateHandler.hpp"
-#include "com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp"
-#include "com/sun/star/container/ElementExistException.hpp"
-#include "com/sun/star/container/NoSuchElementException.hpp"
-#include "com/sun/star/container/XChild.hpp"
-#include "com/sun/star/container/XContainer.hpp"
-#include "com/sun/star/container/XContainerListener.hpp"
-#include "com/sun/star/container/XContentEnumerationAccess.hpp"
-#include "com/sun/star/container/XEnumeration.hpp"
-#include "com/sun/star/container/XHierarchicalName.hpp"
-#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
-#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/container/XNameContainer.hpp"
-#include "com/sun/star/container/XNameReplace.hpp"
-#include "com/sun/star/container/XNamed.hpp"
-#include "com/sun/star/io/BufferSizeExceededException.hpp"
-#include "com/sun/star/io/IOException.hpp"
-#include "com/sun/star/io/UnexpectedEOFException.hpp"
-#include "com/sun/star/io/WrongFormatException.hpp"
-#include "com/sun/star/io/XActiveDataControl.hpp"
-#include "com/sun/star/io/XActiveDataSink.hpp"
-#include "com/sun/star/io/XActiveDataSource.hpp"
-#include "com/sun/star/io/XDataExporter.hpp"
-#include "com/sun/star/io/XDataImporter.hpp"
-#include "com/sun/star/io/XDataInputStream.hpp"
-#include "com/sun/star/io/XDataOutputStream.hpp"
-#include "com/sun/star/io/XDataTransferEventListener.hpp"
-#include "com/sun/star/io/XInputStream.hpp"
-#include "com/sun/star/io/XOutputStream.hpp"
-#include "com/sun/star/lang/DisposedException.hpp"
-#include "com/sun/star/lang/IllegalAccessException.hpp"
-#include "com/sun/star/lang/IllegalArgumentException.hpp"
-#include "com/sun/star/lang/Locale.hpp"
-#include "com/sun/star/lang/NoSupportException.hpp"
-#include "com/sun/star/lang/NullPointerException.hpp"
-#include "com/sun/star/lang/ServiceNotRegisteredException.hpp"
-#include "com/sun/star/lang/WrappedTargetException.hpp"
-#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
-#include "com/sun/star/lang/XComponent.hpp"
-#include "com/sun/star/lang/XEventListener.hpp"
-#include "com/sun/star/lang/XInitialization.hpp"
-#include "com/sun/star/lang/XLocalizable.hpp"
-#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
-#include "com/sun/star/lang/XSingleServiceFactory.hpp"
-#include "com/sun/star/lang/XTypeProvider.hpp"
-#include "com/sun/star/lang/XUnoTunnel.hpp"
-#include "com/sun/star/registry/XRegistryKey.hpp"
-#include "com/sun/star/registry/XSimpleRegistry.hpp"
-#include "com/sun/star/script/FailReason.hpp"
-#include "com/sun/star/script/XTypeConverter.hpp"
-#include "com/sun/star/task/XInteractionAbort.hpp"
-#include "com/sun/star/task/XInteractionApprove.hpp"
-#include "com/sun/star/task/XInteractionDisapprove.hpp"
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "com/sun/star/task/XInteractionRequest.hpp"
-#include "com/sun/star/task/XInteractionRetry.hpp"
-#include "com/sun/star/task/XJob.hpp"
-#include "com/sun/star/uno/Any.h"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Exception.hpp"
-#include "com/sun/star/uno/Reference.h"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/Sequence.h"
-#include "com/sun/star/uno/Sequence.hxx"
-#include "com/sun/star/uno/Type.hxx"
-#include "com/sun/star/uno/TypeClass.hpp"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/uno/XCurrentContext.hpp"
-#include "com/sun/star/uno/XInterface.hpp"
-#include "com/sun/star/util/XChangesBatch.hpp"
-#include "com/sun/star/util/XChangesListener.hpp"
-#include "com/sun/star/util/XChangesNotifier.hpp"
-#include "com/sun/star/util/XFlushable.hpp"
-#include "com/sun/star/util/XRefreshable.hpp"
-#include "com/sun/star/util/XStringEscape.hpp"
-#include "com/sun/star/util/XTimeStamped.hpp"
-#include "com/sun/star/util/logging/LogLevel.hpp"
-#include "com/sun/star/util/logging/XLogger.hpp"
-#include "com/sun/star/xml/sax/InputSource.hpp"
-#include "com/sun/star/xml/sax/SAXException.hpp"
-#include "com/sun/star/xml/sax/SAXParseException.hpp"
-#include "com/sun/star/xml/sax/XAttributeList.hpp"
-#include "com/sun/star/xml/sax/XDocumentHandler.hpp"
-#include "com/sun/star/xml/sax/XExtendedDocumentHandler.hpp"
-#include "com/sun/star/xml/sax/XParser.hpp"
-
-#include "comphelper/processfactory.hxx"
-#include "comphelper/propertycontainer.hxx"
-#include "comphelper/sequence.hxx"
-#include "comphelper/stl_types.hxx"
-
-#include "cppuhelper/bootstrap.hxx"
-#include "cppuhelper/component_context.hxx"
-#include "cppuhelper/exc_hlp.hxx"
-#include "cppuhelper/factory.hxx"
-#include "cppuhelper/implementationentry.hxx"
-#include "cppuhelper/interfacecontainer.hxx"
-#include "cppuhelper/propshlp.hxx"
-#include "cppuhelper/queryinterface.hxx"
-#include "cppuhelper/servicefactory.hxx"
-#include "cppuhelper/typeprovider.hxx"
-#include "cppuhelper/weak.hxx"
-
-#include "osl/conditn.hxx"
-#include "osl/diagnose.h"
-#include "osl/file.h"
-#include "osl/file.hxx"
-#include "osl/interlck.h"
-#include "osl/module.hxx"
-#include "osl/mutex.hxx"
-#include "osl/process.h"
-#include "osl/thread.h"
-#include "osl/time.h"
-
-#include "rtl/alloc.h"
-#include "rtl/bootstrap.h"
-#include "rtl/bootstrap.hxx"
-#include "rtl/logfile.hxx"
-#include "rtl/process.h"
-#include "rtl/ref.hxx"
-#include "rtl/strbuf.hxx"
-#include "rtl/string.h"
-#include "rtl/string.hxx"
-#include "rtl/ustrbuf.hxx"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-
-#include "sal/main.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "sys/timeb.h"
-
-#include "typelib/typedescription.hxx"
-
-#include "uno/any2.h"
-#include "uno/current_context.hxx"
-
-
-
-#include "vos/conditn.hxx"
-#include "vos/pipe.hxx"
-#include "vos/ref.hxx"
-#include "vos/refernce.hxx"
-#include "vos/socket.hxx"
-#include "vos/thread.hxx"
-#include "vos/timer.hxx"
-//---MARKER---
#endif
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index a3d93b598abe..2fd4e03fa442 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,18 +1,3 @@
-cg configmgr : BOOST:boost offapi comphelper cppuhelper salhelper tools vos NULL
-cg configmgr usr1 - all cg_mkout NULL
-cg configmgr\inc nmake - all cg_inc NULL
-cg configmgr\source\misc nmake - all cg_misc cg_inc NULL
-cg configmgr\source\data nmake - all cg_data cg_inc NULL
-cg configmgr\source\tree nmake - all cg_tree cg_inc NULL
-cg configmgr\source\treecache nmake - all cg_trcache cg_inc NULL
-cg configmgr\source\xml nmake - all cg_xml cg_inc NULL
-cg configmgr\source\backend nmake - all cg_backend cg_inc NULL
-cg configmgr\source\backendhelper nmake - all cg_backendhelper cg_inc NULL
-cg configmgr\source\api nmake - all cg_api cg_inc NULL
-cg configmgr\source\api2 nmake - all cg_api2 cg_inc NULL
-cg configmgr\source\treemgr nmake - all cg_treemgr cg_inc NULL
-cg configmgr\source\registry nmake - all cg_reg cg_inc NULL
-cg configmgr\source\platformbe nmake - all cg_platformbe cg_inc NULL
-cg configmgr\util nmake - all cg_util cg_platformbe cg_api cg_api2 cg_misc cg_reg cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL
-cg configmgr\source\localbe nmake - all cg_localbe cg_inc NULL
-
+cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL
+cg configmgr\inc nmake - all cg_inc NULL
+cg configmgr\source nmake - all cg_source cg_inc NULL
diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst
index 3f4a1d35a121..a9d91980b213 100644
--- a/configmgr/prj/d.lst
+++ b/configmgr/prj/d.lst
@@ -1,10 +1,8 @@
mkdir: %_DEST%\inc%_EXT%\configmgr
-..\%__SRC%\lib\behelper.uno.so %_DEST%\lib%_EXT%\behelper.uno.so
-..\%__SRC%\lib\configmgr*.uno.so %_DEST%\lib%_EXT%\configmgr*.uno.so
-..\%__SRC%\lib\sysmgr*.uno.so %_DEST%\lib%_EXT%\sysmgr*.uno.so
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\bin\behelper*.dll %_DEST%\bin%_EXT%\behelper*.dll
-..\%__SRC%\bin\configmg*.dll %_DEST%\bin%_EXT%\configmg*.dll
-..\%__SRC%\bin\sysmgr*.dll %_DEST%\bin%_EXT%\sysmgr*.dll
-
-..\%__SRC%\misc\configmgr2.uno.xml %_DEST%\xml%_EXT%\configmgr2.uno.xml
+mkdir: %_DEST%\inc%_EXT%\configmgr\detail
+..\%__SRC%\bin\configmgr.dll %_DEST%\bin%_EXT%\configmgr.dll
+..\%__SRC%\lib\iconfigmgr.lib %_DEST%\lib%_EXT%\iconfigmgr.lib
+..\%__SRC%\lib\libconfigmgr.dylib %_DEST%\lib%_EXT%\libconfigmgr.dylib
+..\%__SRC%\lib\libconfigmgr.so %_DEST%\lib%_EXT%\libconfigmgr.so
+..\inc\configmgr\detail\configmgrdllapi.hxx %_DEST%\inc%_EXT%\configmgr\detail\configmgrdllapi.hxx
+..\inc\configmgr\update.hxx %_DEST%\inc%_EXT%\configmgr\update.hxx
diff --git a/configmgr/qa/unit/common.hxx b/configmgr/qa/unit/common.hxx
deleted file mode 100644
index 6da6f861ba20..000000000000
--- a/configmgr/qa/unit/common.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "sal/config.h"
-#include <cstdlib>
-#include "com/sun/star/beans/NamedValue.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertyState.hpp"
-#include "com/sun/star/lang/XComponent.hpp"
-#include "com/sun/star/lang/XMultiComponentFactory.hpp"
-#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/container/XNameReplace.hpp"
-#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
-#include "com/sun/star/util/XChangesBatch.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/component_context.hxx"
-#include "cppuhelper/servicefactory.hxx"
-#include "testshl/simpleheader.hxx"
-#include "osl/file.hxx"
-#include "osl/thread.h"
-#include "osl/process.h"
-#include "rtl/string.h"
-#include "rtl/bootstrap.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-namespace css = com::sun::star;
-
-#define CATCH_FAIL(msg) \
- catch (const css::uno::Exception &e) { \
- t_print ("msg '%s'\n", rtl::OUStringToOString (e.Message, RTL_TEXTENCODING_UTF8).getStr()); \
- CPPUNIT_FAIL( msg ); \
- throw; \
- }
-
-class Magic
-{
- rtl::OUString maTempDir;
- public:
- Magic();
- ~Magic();
-};
-
-class Test: public CppUnit::TestFixture {
- Magic *mpMagic;
-public:
- // init
- virtual void setUp();
- virtual void tearDown();
-
- // helpers
- void normalizePathKey (rtl::OString &rPath, rtl::OString &rKey);
- css::uno::Reference< css::uno::XInterface > createView(const sal_Char *pNodepath, bool bUpdate);
- css::uno::Any getKey (const sal_Char *pPath, rtl::OUString aName);
- css::uno::Any getKey (const sal_Char *pPath, const sal_Char *pName)
- { return getKey (pPath, rtl::OUString::createFromAscii (pName)); }
- void setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a);
- void resetKey (const sal_Char *pPath, rtl::OUString aName);
-
- // tests
- void keyFetch();
- void keySet();
- void keyReset();
- void readCommands();
- void threadTests();
- void recursiveTests();
- void eventTests();
-
- CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(keyFetch);
- CPPUNIT_TEST(keySet);
- CPPUNIT_TEST(keyReset);
- CPPUNIT_TEST(readCommands);
- CPPUNIT_TEST(threadTests);
- CPPUNIT_TEST(recursiveTests);
- CPPUNIT_TEST(eventTests);
- CPPUNIT_TEST_SUITE_END();
-
-private:
- css::uno::Reference< css::uno::XComponentContext > mxContext;
- css::uno::Reference< css::lang::XMultiServiceFactory > mxProvider;
-};
-
-void disposeComponent (const css::uno::Reference<css::uno::XInterface> &xComp);
diff --git a/configmgr/qa/unit/configmgrrc b/configmgr/qa/unit/configmgrrc
deleted file mode 100644
index b162e77c2e00..000000000000
--- a/configmgr/qa/unit/configmgrrc
+++ /dev/null
@@ -1,22 +0,0 @@
-[Bootstrap]
-CFG_ServerType=uno
-BootstrapFile=$ORIGIN/bootstraprc
-VersionFile=$ORIGIN/versionrc
-UnoFile=$ORIGIN/unorc
-BaseInstallation=${$BootstrapFile:BaseInstallation}
-UserInstallation=${$BootstrapFile:UserInstallation}
-CFG_SchemaVersion=${$VersionFile:buildid}
-CFG_SchemaDataUrl=$BaseInstallation/schema
-CFG_DefaultLayerUrls=$BaseInstallation
-CFG_CacheDisposeDelay=900
-CFG_CacheDisposeInterval=60
-CFG_CacheWriteInterval=2
-CFG_UserLayerUrl=$UserInstallation
-CFG_CacheUrl=$BaseInstallation/cache
-CFG_DefaultLayerUrl=$BaseInstallation
-CFG_BackendService=com.sun.star.comp.configuration.backend.MultiStratumBackend
-CFG_SchemaSupplier=com.sun.star.comp.configuration.backend.LocalSchemaSupplier
-CFG_LocalDataSvc=com.sun.star.comp.configuration.backend.LocalStratum
-CFG_LocalModuleDataSvc=com.sun.star.comp.configuration.backend.LocalMultiStratum
-# CFG_Strata=${CFG_LocalDataSvc}:$CFG_DefaultLayerUrl;?com.sun.star.comp.configuration.backend.SystemIntegration:;${CFG_LocalDataSvc}:$CFG_UserLayerUrl
-CFG_Strata=${CFG_LocalDataSvc}:$CFG_DefaultLayerUrl;${CFG_LocalDataSvc}:$CFG_UserLayerUrl
diff --git a/configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu b/configmgr/qa/unit/data.xcd
index 25cc7021d6a7..506a82928eff 100644
--- a/configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu
+++ b/configmgr/qa/unit/data.xcd
@@ -1,31 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-data SYSTEM "../../../../../component-update.dtd">
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Setup" oor:package="org.openoffice" xml:lang="en-US">
+ <info>
+ <author>mmeeks</author>
+ <desc >Setup prefs (for configmgr) and unit test schema bits.</desc>
+ </info>
+ <component>
+ <group oor:name="L10N">
+ <info>
+ <author>PB</author>
+ <desc>Specifies the installation locales.</desc>
+ </info>
+ <prop oor:name="ooLocale" oor:type="xs:string">
+ <info>
+ <author>PB</author>
+ <desc>Indicates the Office language selected by the user.</desc>
+ <label>Locale</label>
+ </info>
+ <value/>
+ </prop>
+ </group>
+ <group oor:name="Test">
+ <info>
+ <author>mmeeks</author>
+ <desc>Misc test pieces</desc>
+ </info>
+ <prop oor:name="ABoolean" oor:type="xs:boolean">
+ <info>
+ <author>mmeeks</author>
+ <desc>A boolean</desc>
+ <label>Boolean</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AString" oor:type="xs:string">
+ <info>
+ <author>mmeeks</author>
+ <desc>A string</desc>
+ <label>String</label>
+ </info>
+ <value>Foo</value>
+ </prop>
+ </group>
+ </component>
+</oor:component-schema>
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Commands" oor:package="org.openoffice.UI" xml:lang="en-US"> <info>
+ <author>CD</author>
+ <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
+ </info>
+ <templates>
+ <group oor:name="LabelType">
+ <info>
+ <desc>Provides a mapping between commands and their textual representation on the user interface.</desc>
+ </info>
+ <prop oor:name="Label" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>A localized text that describes the command or identifier. Can be used as a label inside a menu or as short tool tip help.</desc>
+ </info>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>A localized text that describes the identifier of a command in a structured menu. </desc>
+ </info>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <info>
+ <desc>
+ Additional information about a single command.
+ Bit 0 = Command has an image.
+ Bit 1 = Image must be mirrored (CTL/vertical text).
+ Bit 2 = Image must be rotated (CTL/vertical text).
+ </desc>
+ </info>
+ <value>0</value>
+ </prop>
+ </group>
+ </templates>
+ <component/>
+</oor:component-schema>
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI" xml:lang="en-US">
+ <info>
+ <author>CD</author>
+ <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
+ </info>
+ <import oor:component="org.openoffice.UI.Commands"/>
+ <uses oor:component="org.openoffice.UI.Commands"/>
+ <templates/>
+ <component>
+ <group oor:name="UserInterface">
+ <info>
+ <desc>Contains user interface data for Office commands and identifiers that are used by the user interface."</desc>
+ </info>
+ <set oor:name="Commands" oor:node-type="LabelType" oor:component="org.openoffice.UI.Commands">
+ <info>
+ <desc>Contains label text for Office commands and identifiers that are used by the user interface."</desc>
+ </info>
+ </set>
+ </group>
+ </component>
+</oor:component-schema>
+
+<oor:component-data oor:name="Setup" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <node oor:name="L10N">
+ <prop oor:name="ooLocale" oor:type="xs:string">
+ <value>en-US</value>
+ </prop>
+ </node>
+ <node oor:name="Test">
+ <prop oor:name="ABoolean" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="AString" oor:type="xs:string">
+ <value>Foo</value>
+ </prop>
+ </node>
+</oor:component-data>
+
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI">
<node oor:name="UserInterface">
<node oor:name="Commands">
@@ -5067,3 +5186,5 @@
</node>
</node>
</oor:component-data>
+
+</oor:data>
diff --git a/configmgr/qa/unit/data/org/openoffice/Setup.xcu b/configmgr/qa/unit/data/org/openoffice/Setup.xcu
deleted file mode 100644
index 956aacbf4e1e..000000000000
--- a/configmgr/qa/unit/data/org/openoffice/Setup.xcu
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="Setup" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <node oor:name="L10N">
- <prop oor:name="ooLocale" oor:type="xs:string">
- <value>en-US</value>
- </prop>
- </node>
- <node oor:name="Test">
- <prop oor:name="ABoolean" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="AString" oor:type="xs:string">
- <value>Foo</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/configmgr/qa/unit/export.map b/configmgr/qa/unit/export.map
deleted file mode 100644
index 4ca70fa85463..000000000000
--- a/configmgr/qa/unit/export.map
+++ /dev/null
@@ -1,7 +0,0 @@
-UDK_3.0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index 39f73183a98a..916c40ffedf5 100644
--- a/configmgr/qa/unit/makefile.mk
+++ b/configmgr/qa/unit/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,37 +23,69 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ := ..$/..
-PRJNAME := configmgr
-TARGET := qa_unit
+PRJ = ../..
+PRJNAME = configmgr
+TARGET = unit
-ENABLE_EXCEPTIONS := TRUE
+ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
-DLLPRE = # no leading "lib" on .so files
+SLOFILES = $(SLO)/test.obj
-SHL1TARGET = $(TARGET)
-SHL1OBJS = $(SLO)$/performance.obj $(SLO)$/threading.obj $(SLO)$/ubootstrap.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL1VERSIONMAP = export.map
-SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(TESTSHL2LIB)
+SHL1TARGET = unit
+SHL1VERSIONMAP = version.map
DEF1NAME = $(SHL1TARGET)
-SLOFILES = $(SHL1OBJS)
-
.INCLUDE: target.mk
-ALLTAR: test
+ALLTAR: TEST
+
+.IF "$(OS)" == "OS2" || "$(OS)" == "WNT"
+MY_INI = .ini
+.ELSE
+MY_INI = rc
+.ENDIF
-$(MISC)$/$(TARGET).rdb .ERRREMOVE:
- $(COPY) $(SOLARBINDIR)$/types.rdb $@
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/configmgr2.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/sax.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/stocservices.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/streams.uno$(DLLPOST))
+$(MISC)/unit.rdb .ERRREMOVE:
+ cp $(SOLARBINDIR)/types.rdb $@
+ $(REGCOMP) -register -r $@ -c $(DLLDEST)/$(DLLPRE)configmgr$(DLLPOST)
-test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET).rdb
- $(AUGMENT_LIBRARY_PATH) testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET).rdb#$(PWD)$/$(MISC)$/$(TARGET).registry"
+TEST .PHONY: $(SHL1TARGETN) $(MISC)/unit.rdb
+ rm -rf $(MISC)/unitdata
+ mkdir $(MISC)/unitdata
+ cp urebootstrap.ini $(MISC)/unitdata
+ mkdir $(MISC)/unitdata/basis
+ mkdir $(MISC)/unitdata/basis/program
+ echo '[Bootstrap]' > $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ echo 'UNO_SHARED_PACKAGES_CACHE = $$OOO_BASE_DIR' \
+ >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ echo 'UNO_USER_PACKAGES_CACHE =' \
+ '$${$$BRAND_BASE_DIR/program/bootstrap$(MY_INI):UserInstallation}' \
+ >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ mkdir $(MISC)/unitdata/basis/share
+ mkdir $(MISC)/unitdata/basis/share/registry
+ cp data.xcd $(MISC)/unitdata/basis/share/registry
+ mkdir $(MISC)/unitdata/brand
+ mkdir $(MISC)/unitdata/brand/program
+ echo '[Bootstrap]' > $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
+ echo 'UserInstallation = $$ORIGIN/../../user' \
+ >> $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
+.IF "$(USE_SHELL)" == "bash"
+ export \
+ URE_BOOTSTRAP=vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
+ && $(TESTSHL2) $(SHL1TARGETN) -forward $(MISC)/unit.rdb
+.ELSE
+ setenv \
+ URE_BOOTSTRAP vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
+ && $(TESTSHL2) $(SHL1TARGETN) -forward $(MISC)/unit.rdb
+.ENDIF
diff --git a/connectivity/util/delzip b/configmgr/qa/unit/no_localization
index e69de29bb2d1..e69de29bb2d1 100755..100644
--- a/connectivity/util/delzip
+++ b/configmgr/qa/unit/no_localization
diff --git a/configmgr/qa/unit/performance.cxx b/configmgr/qa/unit/performance.cxx
deleted file mode 100644
index 13c998a3c2ab..000000000000
--- a/configmgr/qa/unit/performance.cxx
+++ /dev/null
@@ -1,268 +0,0 @@
-// To debug me use:
-// $ export ENVCFGFLAGS='-me -ti -tw -tp -td'
-
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-
-void Test::setUp()
-{
- mpMagic = new Magic();
-
- char const * f = getForwardString();
- rtl::OUString args(
- f, rtl_str_getLength(f), osl_getThreadTextEncoding());
- //TODO: handle conversion failure
- sal_Int32 i = args.indexOf('#');
- if (i < 0)
- std::abort();
-
- rtl::OUString rdb(args.copy(0, i));
- rtl::OUString regpath(args.copy(i + 1));
- rtl::OUString regurl;
- if (osl::FileBase::getFileURLFromSystemPath(regpath, regurl) !=
- osl::FileBase::E_None)
- std::abort();
-
- css::uno::Reference< css::beans::XPropertySet > factory(
- cppu::createRegistryServiceFactory(rdb), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::uno::XComponentContext > context(
- factory->getPropertyValue(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
- css::uno::UNO_QUERY_THROW);
- cppu::ContextEntry_Init entry(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/modules/com.sun.star.configuration/bootstrap/Strata")),
- css::uno::makeAny(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LocalStratum:"))
- + regurl));
- mxContext = cppu::createComponentContext(&entry, 1, context);
-
- CPPUNIT_ASSERT_MESSAGE ("component context is valid", mxContext.is());
-
- try {
- mxProvider = css::uno::Reference< css::lang::XMultiServiceFactory >(
- (css::uno::Reference< css::lang::XMultiComponentFactory >(
- mxContext->getServiceManager(), css::uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider")),
- mxContext)),
- css::uno::UNO_QUERY_THROW);
-
- } catch (css::uno::Exception&e) {
- CPPUNIT_FAIL( "exception creating provider" );
- throw;
- }
-}
-
-css::uno::Reference< css::uno::XInterface >
-Test::createView(const sal_Char *pNodepath, bool bUpdate)
-{
- rtl::OUString aNodePath = rtl::OUString::createFromAscii(pNodepath);
- static const rtl::OUString kInfoViewService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")) ;
- static const rtl::OUString kUpdateViewService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")) ;
- static const rtl::OUString kNodepath(RTL_CONSTASCII_USTRINGPARAM("nodepath")) ;
- static const rtl::OUString kAsync(RTL_CONSTASCII_USTRINGPARAM("EnableAsync")) ;
-
- const rtl::OUString & kViewService = bUpdate ? kUpdateViewService : kInfoViewService;
- css::uno::Sequence< css::uno::Any > aViewArgs(2);
- aViewArgs[0] <<= css::beans::NamedValue( kNodepath, css::uno::makeAny(aNodePath) );
- aViewArgs[1] <<= css::beans::NamedValue( kAsync, css::uno::makeAny(sal_False) );
-
- css::uno::Reference< css::uno::XInterface > xView(
- mxProvider->createInstanceWithArguments( kViewService, aViewArgs ) );
- return xView;
-}
-
-void disposeComponent (const css::uno::Reference<css::uno::XInterface> &xComp)
-{
- css::uno::Reference< css::lang::XComponent >(
- xComp, css::uno::UNO_QUERY_THROW)->dispose();
-}
-
-void Test::tearDown()
-{
- disposeComponent (mxProvider);
- disposeComponent (mxContext);
-
- delete mpMagic;
-}
-
-void Test::normalizePathKey (rtl::OString &rPath, rtl::OString &rKey)
-{
- sal_Int32 idx = rKey.lastIndexOf("/");
- if (idx > 0) {
- rPath += "/";
- rPath += rKey.copy (0, idx);
- rKey = rKey.copy (idx + 1);
-// t_print ("write to '%s' '%s'\n", (const sal_Char *)rPath,
-// (const sal_Char *)rKey);
- }
-}
-
-css::uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
-{
- css::uno::Reference< css::container::XHierarchicalNameAccess > xNameAccess(
- createView(pPath, false), css::uno::UNO_QUERY_THROW);
- css::uno::Any aVal;
- aVal = xNameAccess->getByHierarchicalName (aName);
- disposeComponent (xNameAccess);
- return aVal;
-}
-
-void Test::setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a)
-{
- css::uno::Reference< css::util::XChangesBatch > xAppView;
-
- xAppView = css::uno::Reference< css::util::XChangesBatch > (
- createView(pPath, true), css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
- rtl::OUString aStr;
-
- // set key
- xSettings->replaceByName(aName, a);
- xAppView->commitChanges();
-
- disposeComponent(xAppView);
-}
-
-void Test::resetKey (const sal_Char *pPath, rtl::OUString aName)
-{
- css::uno::Reference< css::util::XChangesBatch > xAppView;
-
- // reset to default
- xAppView = css::uno::Reference< css::util::XChangesBatch > ( createView(pPath, true), css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
-
- css::uno::Reference< css::beans::XPropertyState > xSettingsState(xSettings, css::uno::UNO_QUERY);
- xSettingsState->setPropertyToDefault(aName);
- xAppView->commitChanges();
-
- disposeComponent(xAppView);
-}
-
-void Test::keyFetch()
-{
- try {
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup", "L10N/ooLocale") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
- if (!(getKey ("/org.openoffice.Setup", "Test/AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
- } CATCH_FAIL ("fetching key")
-}
-
-void Test::keySet()
-{
- try {
- setKey ("/org.openoffice.Setup/Test",
- rtl::OUString::createFromAscii("AString"),
- css::uno::makeAny (rtl::OUString::createFromAscii("baa")));
-
- // check value
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup/Test", "AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
-
- CPPUNIT_ASSERT_MESSAGE ("check set value valid", aStr.equalsAscii("baa"));
- } CATCH_FAIL ("exception setting keys" )
-}
-
-void Test::keyReset()
-{
- try {
- resetKey ("/org.openoffice.Setup/Test",
- rtl::OUString::createFromAscii("AString"));
-
- // check value
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup/Test", "AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
-
- CPPUNIT_ASSERT_MESSAGE ("check default value valid",
- aStr == rtl::OUString::createFromAscii("Foo"));
- } CATCH_FAIL ("exception setting keys" )
-}
-
-// This simulates the framework UI description code paths
-void Test::readCommands()
-{
- rtl::OUString aPropUILabel( RTL_CONSTASCII_USTRINGPARAM( "Label" ));
- rtl::OUString aPropUIContextLabel( RTL_CONSTASCII_USTRINGPARAM( "ContextLabel" ));
- rtl::OUString aPropProperties( RTL_CONSTASCII_USTRINGPARAM( "Properties" ));
-
- try {
- css::uno::Reference< css::container::XNameAccess > xNameAccess (
- createView("/org.openoffice.UI.GenericCommands/UserInterface/Commands", false),
- css::uno::UNO_QUERY_THROW);
-
- CPPUNIT_ASSERT_MESSAGE ("fetched UI generic commands", xNameAccess.is());
-
- css::uno::Any a;
- css::uno::Sequence< rtl::OUString > aNameSeq = xNameAccess->getElementNames();
-
- CPPUNIT_ASSERT_MESSAGE ("right element / sequence", aNameSeq.getLength() == 696);
- sal_uInt32 end, start = osl_getGlobalTimer();
- for ( sal_Int32 j = 0; j < 8; j++ )
- {
- for ( sal_Int32 i = 0; i < aNameSeq.getLength(); i++ )
- {
- try
- {
- {
- css::uno::Reference< css::container::XNameAccess > xChildNameAccess;
- // This is the slow bit ! ...
- // Creating the @#$@#$ing XNameAccess object [ 650 times ]
- // which we then use to 'getByName' etc.
- a = xNameAccess->getByName( aNameSeq[i] );
- if ( a >>= xChildNameAccess )
- {
- a = xChildNameAccess->getByName( aPropUILabel );
- a = xChildNameAccess->getByName( aPropUIContextLabel );
- a = xChildNameAccess->getByName( aPropProperties );
- }
- }
- } CATCH_FAIL( "fetching keys" );
- }
- }
- end = osl_getGlobalTimer();
- t_print ("Reading elements took %d ms\n", (int)(end-start));
- disposeComponent (xNameAccess);
- } CATCH_FAIL( "accessing commands" );
-}
-
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
-
-NOADDITIONAL;
diff --git a/configmgr/qa/unit/schema/org/openoffice/Setup.xcs b/configmgr/qa/unit/schema/org/openoffice/Setup.xcs
deleted file mode 100644
index 990e4247075e..000000000000
--- a/configmgr/qa/unit/schema/org/openoffice/Setup.xcs
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Setup" oor:package="org.openoffice" xml:lang="en-US">
- <info>
- <author>mmeeks</author>
- <desc >Setup prefs (for configmgr) and unit test schema bits.</desc>
- </info>
- <component>
- <group oor:name="L10N">
- <info>
- <author>PB</author>
- <desc>Specifies the installation locales.</desc>
- </info>
- <prop oor:name="ooLocale" oor:type="xs:string">
- <info>
- <author>PB</author>
- <desc>Indicates the Office language selected by the user.</desc>
- <label>Locale</label>
- </info>
- <value/>
- </prop>
- </group>
- <group oor:name="Test">
- <info>
- <author>mmeeks</author>
- <desc>Misc test pieces</desc>
- </info>
- <prop oor:name="ABoolean" oor:type="xs:boolean">
- <info>
- <author>mmeeks</author>
- <desc>A boolean</desc>
- <label>Boolean</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="AString" oor:type="xs:string">
- <info>
- <author>mmeeks</author>
- <desc>A string</desc>
- <label>String</label>
- </info>
- <value>Foo</value>
- </prop>
- </group>
- </component>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs b/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs
deleted file mode 100644
index 35f365aa714c..000000000000
--- a/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Commands" oor:package="org.openoffice.UI" xml:lang="en-US"> <info>
- <author>CD</author>
- <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
- </info>
- <templates>
- <group oor:name="LabelType">
- <info>
- <desc>Provides a mapping between commands and their textual representation on the user interface.</desc>
- </info>
- <prop oor:name="Label" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>A localized text that describes the command or identifier. Can be used as a label inside a menu or as short tool tip help.</desc>
- </info>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>A localized text that describes the identifier of a command in a structured menu. </desc>
- </info>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <info>
- <desc>
- Additional information about a single command.
- Bit 0 = Command has an image.
- Bit 1 = Image must be mirrored (CTL/vertical text).
- Bit 2 = Image must be rotated (CTL/vertical text).
- </desc>
- </info>
- <value>0</value>
- </prop>
- </group>
- </templates>
- <component/>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs b/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs
deleted file mode 100644
index dcfbe38abba4..000000000000
--- a/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI" xml:lang="en-US">
- <info>
- <author>CD</author>
- <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
- </info>
- <import oor:component="org.openoffice.UI.Commands"/>
- <uses oor:component="org.openoffice.UI.Commands"/>
- <templates/>
- <component>
- <group oor:name="UserInterface">
- <info>
- <desc>Contains user interface data for Office commands and identifiers that are used by the user interface."</desc>
- </info>
- <set oor:name="Commands" oor:node-type="LabelType" oor:component="org.openoffice.UI.Commands">
- <info>
- <desc>Contains label text for Office commands and identifiers that are used by the user interface."</desc>
- </info>
- </set>
- </group>
- </component>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx
new file mode 100644
index 000000000000..8e5e87310336
--- /dev/null
+++ b/configmgr/qa/unit/test.cxx
@@ -0,0 +1,678 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyState.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameReplace.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/servicefactory.hxx"
+#include "osl/conditn.hxx"
+#include "osl/thread.h"
+#include "osl/thread.hxx"
+#include "osl/time.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/textcvt.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "testshl/simpleheader.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+void normalize(
+ rtl::OUString const & path, rtl::OUString const & relative,
+ rtl::OUString * normalizedPath, rtl::OUString * name)
+{
+ sal_Int32 i = relative.lastIndexOf('/');
+ if (i == -1) {
+ *normalizedPath = path;
+ *name = relative;
+ } else {
+ rtl::OUStringBuffer buf(path);
+ buf.append(sal_Unicode('/'));
+ buf.append(relative.copy(0, i));
+ *normalizedPath = buf.makeStringAndClear();
+ *name = relative.copy(i + 1);
+ }
+}
+
+class Test: public CppUnit::TestFixture {
+public:
+ virtual void setUp();
+
+ virtual void tearDown();
+
+ void testKeyFetch();
+
+ void testKeySet();
+
+ void testKeyReset();
+
+ void testSetSetMemberName();
+
+ void testReadCommands();
+
+ void testThreads();
+
+ void testRecursive();
+
+ void testCrossThreads();
+
+ css::uno::Any getKey(
+ rtl::OUString const & path, rtl::OUString const & relative) const;
+
+ void setKey(
+ rtl::OUString const & path, rtl::OUString const & name,
+ css::uno::Any const & value) const;
+
+ bool resetKey(rtl::OUString const & path, rtl::OUString const & name) const;
+
+ css::uno::Reference< css::uno::XInterface > createViewAccess(
+ rtl::OUString const & path) const;
+
+ css::uno::Reference< css::uno::XInterface > createUpdateAccess(
+ rtl::OUString const & path) const;
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testKeyFetch);
+ CPPUNIT_TEST(testKeySet);
+ CPPUNIT_TEST(testKeyReset);
+ CPPUNIT_TEST(testSetSetMemberName);
+ CPPUNIT_TEST(testReadCommands);
+ CPPUNIT_TEST(testThreads);
+ CPPUNIT_TEST(testRecursive);
+ CPPUNIT_TEST(testCrossThreads);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ css::uno::Reference< css::uno::XComponentContext > context_;
+ css::uno::Reference< css::lang::XMultiServiceFactory > provider_;
+};
+
+class TestThread: public osl::Thread {
+public:
+ TestThread(osl::Condition & stop);
+
+ bool getSuccess() const;
+
+protected:
+ virtual bool iteration() = 0;
+
+private:
+ virtual void SAL_CALL run();
+
+ osl::Condition & stop_;
+ bool success_;
+};
+
+TestThread::TestThread(
+ osl::Condition & stop):
+ stop_(stop), success_(true)
+{}
+
+bool TestThread::getSuccess() const {
+ return success_;
+}
+
+void TestThread::run() {
+ try {
+ while (!stop_.check()) {
+ if (!iteration()) {
+ success_ = false;
+ }
+ }
+ } catch (...) {
+ success_ = false;
+ }
+}
+
+class ReaderThread: public TestThread {
+public:
+ ReaderThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative);
+
+private:
+ virtual bool iteration();
+
+ Test const & test_;
+ rtl::OUString path_;
+ rtl::OUString relative_;
+};
+
+ReaderThread::ReaderThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative):
+ TestThread(stop), test_(test), path_(path), relative_(relative)
+{
+ create();
+}
+
+bool ReaderThread::iteration() {
+ return test_.getKey(path_, relative_).hasValue();
+}
+
+class WriterThread: public TestThread {
+public:
+ WriterThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative);
+
+private:
+ virtual bool iteration();
+
+ Test const & test_;
+ rtl::OUString path_;
+ rtl::OUString name_;
+ std::size_t index_;
+};
+
+WriterThread::WriterThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative):
+ TestThread(stop), test_(test), index_(0)
+{
+ normalize(path, relative, &path_, &name_);
+ create();
+}
+
+bool WriterThread::iteration() {
+ rtl::OUString options[] = {
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fish")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("chips")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("kippers")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bloaters")) };
+ test_.setKey(path_, name_, css::uno::makeAny(options[index_]));
+ index_ = (index_ + 1) % (sizeof options / sizeof (rtl::OUString));
+ return true;
+}
+
+class RecursiveTest:
+ public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
+{
+public:
+ RecursiveTest(Test const & theTest, int count, bool * destroyed);
+
+ void test();
+
+protected:
+ virtual ~RecursiveTest();
+
+ virtual void step() const = 0;
+
+ Test const & test_;
+
+private:
+ virtual void SAL_CALL disposing(css::lang::EventObject const &)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL propertyChange(
+ css::beans::PropertyChangeEvent const &)
+ throw (css::uno::RuntimeException);
+
+ int count_;
+ bool * destroyed_;
+ css::uno::Reference< css::beans::XPropertySet > properties_;
+};
+
+RecursiveTest::RecursiveTest(
+ Test const & theTest, int count, bool * destroyed):
+ test_(theTest), count_(count), destroyed_(destroyed)
+{}
+
+void RecursiveTest::test() {
+ properties_ = css::uno::Reference< css::beans::XPropertySet >(
+ test_.createUpdateAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml"))),
+ css::uno::UNO_QUERY_THROW);
+ properties_->addPropertyChangeListener(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")), this);
+ step();
+ CPPUNIT_ASSERT(count_ == 0);
+ css::uno::Reference< css::lang::XComponent >(
+ properties_, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+RecursiveTest::~RecursiveTest() {
+ *destroyed_ = true;
+}
+
+void RecursiveTest::disposing(css::lang::EventObject const & Source)
+ throw (css::uno::RuntimeException)
+{
+ CPPUNIT_ASSERT(properties_.is() && Source.Source == properties_);
+ properties_.clear();
+}
+
+void RecursiveTest::propertyChange(css::beans::PropertyChangeEvent const & evt)
+ throw (css::uno::RuntimeException)
+{
+ CPPUNIT_ASSERT(
+ evt.Source == properties_ &&
+ evt.PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Label")));
+ if (count_ > 0) {
+ --count_;
+ step();
+ }
+}
+
+class SimpleRecursiveTest: public RecursiveTest {
+public:
+ SimpleRecursiveTest(Test const & theTest, int count, bool * destroyed);
+
+private:
+ virtual void step() const;
+};
+
+SimpleRecursiveTest::SimpleRecursiveTest(
+ Test const & theTest, int count, bool * destroyed):
+ RecursiveTest(theTest, count, destroyed)
+{}
+
+void SimpleRecursiveTest::step() const {
+ test_.setKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")),
+ css::uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("step"))));
+}
+
+class CrossThreadTest: public RecursiveTest {
+public:
+ CrossThreadTest(Test const & theTest, int count, bool * destroyed);
+
+private:
+ virtual void step() const;
+};
+
+CrossThreadTest::CrossThreadTest(
+ Test const & theTest, int count, bool * destroyed):
+ RecursiveTest(theTest, count, destroyed)
+{}
+
+void CrossThreadTest::step() const {
+ osl::Condition stop;
+ stop.set();
+ WriterThread(
+ stop, test_,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))).join();
+ test_.resetKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")));
+}
+
+void Test::setUp() {
+ char const * forward = getForwardString();
+ rtl_uString * registry = 0;
+ CPPUNIT_ASSERT(
+ rtl_convertStringToUString(
+ &registry, forward, rtl_str_getLength(forward),
+ osl_getThreadTextEncoding(),
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)));
+ context_ = css::uno::Reference< css::uno::XComponentContext >(
+ css::uno::Reference< css::beans::XPropertySet >(
+ cppu::createRegistryServiceFactory(
+ rtl::OUString(registry, SAL_NO_ACQUIRE)),
+ css::uno::UNO_QUERY_THROW)->getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
+ css::uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(
+ context_->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/"
+ "com.sun.star.configuration.theDefaultProvider"))) >>=
+ provider_);
+}
+
+void Test::tearDown() {
+ css::uno::Reference< css::lang::XComponent >(
+ context_, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+void Test::testKeyFetch() {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString"))) >>=
+ s);
+}
+
+void Test::testKeySet() {
+ setKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString")),
+ css::uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("baa"))));
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))) >>=
+ s);
+ CPPUNIT_ASSERT(s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("baa")));
+}
+
+void Test::testKeyReset() {
+ if (resetKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))))
+ {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))) >>=
+ s);
+ CPPUNIT_ASSERT(s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Foo")));
+ }
+}
+
+void Test::testSetSetMemberName() {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ ".uno:FontworkShapeType")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Fontwork Shape")));
+
+ css::uno::Reference< css::container::XNameAccess > access(
+ createUpdateAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/"
+ "Commands"))),
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::container::XNamed > member;
+ access->getByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:FontworkGalleryFloater"))) >>=
+ member;
+ CPPUNIT_ASSERT(member.is());
+ member->setName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:FontworkShapeType")));
+ css::uno::Reference< css::util::XChangesBatch >(
+ access, css::uno::UNO_QUERY_THROW)->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ ".uno:FontworkShapeType")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Fontwork Gallery")));
+}
+
+void Test::testReadCommands() {
+ css::uno::Reference< css::container::XNameAccess > access(
+ createViewAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/"
+ "Commands"))),
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Sequence< rtl::OUString > names(access->getElementNames());
+ CPPUNIT_ASSERT(names.getLength() == 695);
+ // testSetSetMemberName() already removed ".uno:FontworkGalleryFloater"
+ sal_uInt32 n = osl_getGlobalTimer();
+ for (int i = 0; i < 8; ++i) {
+ for (sal_Int32 j = 0; j < names.getLength(); ++j) {
+ css::uno::Reference< css::container::XNameAccess > child;
+ if (access->getByName(names[j]) >>= child) {
+ CPPUNIT_ASSERT(child.is());
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")));
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContextLabel")));
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Properties")));
+ }
+ }
+ }
+ n = osl_getGlobalTimer() - n;
+ t_print("Reading elements took %" SAL_PRIuUINT32 " ms\n", n);
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+void Test::testThreads() {
+ struct Entry { rtl::OUString path; rtl::OUString relative; };
+ Entry list[] = {
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:WebHtml/Label")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:NewPresentation/Label")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:RecentFileList/Label")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/ABoolean")) }
+ };
+ std::size_t const numReaders = sizeof list / sizeof (Entry);
+ std::size_t const numWriters = numReaders - 2;
+ ReaderThread * readers[numReaders];
+ WriterThread * writers[numWriters];
+ osl::Condition stop;
+ for (std::size_t i = 0; i < numReaders; ++i) {
+ CPPUNIT_ASSERT(getKey(list[i].path, list[i].relative).hasValue());
+ readers[i] = new ReaderThread(
+ stop, *this, list[i].path, list[i].relative);
+ }
+ for (std::size_t i = 0; i < numWriters; ++i) {
+ writers[i] = new WriterThread(
+ stop, *this, list[i].path, list[i].relative);
+ }
+ for (int i = 0; i < 5; ++i) {
+ for (std::size_t j = 0; j < numReaders; ++j) {
+ rtl::OUString path;
+ rtl::OUString name;
+ normalize(list[j].path, list[j].relative, &path, &name);
+ resetKey(path, name);
+ osl::Thread::yield();
+ }
+ }
+ stop.set();
+ bool success = true;
+ for (std::size_t i = 0; i < numReaders; ++i) {
+ readers[i]->join();
+ success = success && readers[i]->getSuccess();
+ delete readers[i];
+ }
+ for (std::size_t i = 0; i < numWriters; ++i) {
+ writers[i]->join();
+ success = success && writers[i]->getSuccess();
+ delete writers[i];
+ }
+ CPPUNIT_ASSERT(success);
+}
+
+void Test::testRecursive() {
+ bool destroyed = false;
+ rtl::Reference< RecursiveTest >(
+ new SimpleRecursiveTest(*this, 100, &destroyed))->test();
+ CPPUNIT_ASSERT(destroyed);
+}
+
+void Test::testCrossThreads() {
+ bool destroyed = false;
+ rtl::Reference< RecursiveTest >(
+ new SimpleRecursiveTest(*this, 10, &destroyed))->test();
+ CPPUNIT_ASSERT(destroyed);
+}
+
+css::uno::Any Test::getKey(
+ rtl::OUString const & path, rtl::OUString const & relative) const
+{
+ css::uno::Reference< css::container::XHierarchicalNameAccess > access(
+ createViewAccess(path), css::uno::UNO_QUERY_THROW);
+ css::uno::Any value(access->getByHierarchicalName(relative));
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+ return value;
+}
+
+void Test::setKey(
+ rtl::OUString const & path, rtl::OUString const & name,
+ css::uno::Any const & value) const
+{
+ css::uno::Reference< css::container::XNameReplace > access(
+ createUpdateAccess(path), css::uno::UNO_QUERY_THROW);
+ access->replaceByName(name, value);
+ css::uno::Reference< css::util::XChangesBatch >(
+ access, css::uno::UNO_QUERY_THROW)->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+bool Test::resetKey(rtl::OUString const & path, rtl::OUString const & name)
+ const
+{
+ //TODO: support setPropertyToDefault
+ css::uno::Reference< css::util::XChangesBatch > access(
+ createUpdateAccess(path), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::beans::XPropertyState > state(
+ access, css::uno::UNO_QUERY);
+ if (!state.is()) {
+ return false;
+ }
+ state->setPropertyToDefault(name);
+ access->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+ return true;
+}
+
+css::uno::Reference< css::uno::XInterface > Test::createViewAccess(
+ rtl::OUString const & path) const
+{
+ css::uno::Any arg(
+ css::uno::makeAny(
+ css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(path))));
+ return provider_->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess")),
+ css::uno::Sequence< css::uno::Any >(&arg, 1));
+}
+
+css::uno::Reference< css::uno::XInterface > Test::createUpdateAccess(
+ rtl::OUString const & path) const
+{
+ css::uno::Any arg(
+ css::uno::makeAny(
+ css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(path))));
+ return provider_->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess")),
+ css::uno::Sequence< css::uno::Any >(&arg, 1));
+}
+
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltest");
+
+}
+
+NOADDITIONAL;
diff --git a/configmgr/qa/unit/threading.cxx b/configmgr/qa/unit/threading.cxx
deleted file mode 100644
index 4ae68133b690..000000000000
--- a/configmgr/qa/unit/threading.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-#include <osl/thread.hxx>
-#include <osl/conditn.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include "com/sun/star/beans/XPropertyChangeListener.hpp"
-
-class KeyTester : public osl::Thread
-{
- osl::Condition *m_pCond;
- protected:
- rtl::OString m_aPath;
- rtl::OString m_aKey;
- Test *m_pTest;
- public:
- KeyTester (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : m_pCond (pCond)
- , m_aPath (pPath)
- , m_aKey (pKey)
- , m_pTest (pTest)
- {
- }
- virtual ~KeyTester ()
- {
- }
- virtual void SAL_CALL run ()
- {
- testIteration();
- while (!m_pCond->check())
- testIteration();
- }
- virtual void testIteration()
- {
- css::uno::Any a = m_pTest->getKey (m_aPath, m_aKey);
- CPPUNIT_ASSERT_MESSAGE ("no value", a.hasValue());
- }
-};
-
-class KeyReader : public KeyTester
-{
-public:
- KeyReader (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : KeyTester (pCond, pTest, pPath, pKey)
- {
- // to ensure we have the right vtable when we hit 'run'
- create();
- }
-};
-
-class KeyWriter : public KeyTester
-{
- int curOpt;
- public:
- KeyWriter (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : KeyTester (pCond, pTest, pPath, pKey)
- , curOpt(0)
- {
- m_pTest->normalizePathKey (m_aPath, m_aKey);
- create();
- }
- virtual void testIteration ()
- {
- try {
- static const char *options[] = { "fish", "chips", "kippers", "bloaters" };
-// fprintf (stderr, "set key %d\n",
-// (int) osl_getThreadIdentifier(NULL));
- m_pTest->setKey (m_aPath, rtl::OUString::createFromAscii (m_aKey),
- css::uno::makeAny (rtl::OUString::createFromAscii(options[(curOpt++ & 3)])));
- } CATCH_FAIL ("setting keys")
- }
-};
-
-void Test::threadTests()
-{
- osl::Condition stop;
- stop.reset();
-
- struct {
- const char *pPath;
- const char *pKey;
- } keyList[] = {
- { "/org.openoffice.Setup", "Test/AString" },
- { "/org.openoffice.Setup", "Test/AString" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:WebHtml/Label" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:NewPresentation/Label" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:RecentFileList/Label" },
-
- { "/org.openoffice.Setup", "L10N/ooLocale" },
- { "/org.openoffice.Setup", "Test/ABoolean" }
- };
- const int numReaders = sizeof (keyList) / sizeof (keyList[0]);
- const int numWriters = (sizeof (keyList) / sizeof (keyList[0])) - 2;
- KeyReader *pReaders[numReaders];
- KeyWriter *pWriters[numReaders];
-
- int i;
- try {
- for (i = 0; i < numReaders; i++) {
- css::uno::Any a = getKey (keyList[i].pPath, keyList[i].pKey);
- CPPUNIT_ASSERT_MESSAGE ("check key", a.hasValue());
- }
-
- // a few readers
- for (i = 0; i < numReaders; i++)
- pReaders[i] = new KeyReader (&stop, this, keyList[i].pPath,
- keyList[i].pKey);
- // a few writers
- for (i = 0; i < numWriters; i++)
- pWriters[i] = new KeyWriter (&stop, this, keyList[i].pPath,
- keyList[i].pKey);
-
- // Threads are running ...
- const int numIters = 5;
- for (int j = 0; j < numIters; j++) {
- for (i = 0; i < numReaders; i++)
- {
- try {
- rtl::OString aPath (keyList[i].pPath);
- rtl::OString aKey (keyList[i].pKey);
- normalizePathKey (aPath, aKey);
- resetKey (aPath, rtl::OUString::createFromAscii (aKey));
- osl::Thread::yield();
- } CATCH_FAIL ("resetting keys");
- }
- }
- stop.set();
-
- for (i = 0; i < numReaders; i++) {
- pReaders[i]->join();
- delete pReaders[i];
- }
- for (i = 0; i < numWriters; i++) {
- pWriters[i]->join();
- delete pWriters[i];
- }
-
- } CATCH_FAIL ("checking keys exist")
-}
-
-class RecursiveListener : public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
-{
-public:
- sal_Int32 m_nRecurse;
- css::uno::Reference< css::beans::XPropertySet > mxPropSet;
- protected:
- Test *m_pTest;
- rtl::OString m_pPath;
- rtl::OString m_pKey;
- public:
- RecursiveListener (Test *pTest, int nCount,
- const char *pPath, const char *pKey)
- : m_nRecurse (nCount)
- , m_pTest (pTest)
- , m_pPath (pPath)
- , m_pKey (pKey)
- {
- mxPropSet = css::uno::Reference< css::beans::XPropertySet > (
- pTest->createView (pPath, true), css::uno::UNO_QUERY_THROW );
-
- CPPUNIT_ASSERT_MESSAGE ("is prop set", mxPropSet.is());
- mxPropSet->addPropertyChangeListener (rtl::OUString::createFromAscii (m_pKey),
- css::uno::Reference<css::beans::XPropertyChangeListener>(this));
- }
- virtual ~RecursiveListener()
- {
- disposeComponent (mxPropSet);
- }
-
- virtual void SAL_CALL acquire() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
- virtual void SAL_CALL release() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
- // XPropertyChangeListener
- virtual void SAL_CALL propertyChange( const ::css::beans::PropertyChangeEvent& ) throw (::css::uno::RuntimeException)
- {
- if (m_nRecurse-- > 0)
- runTest();
- }
- // XEventListener
- virtual void SAL_CALL disposing( const ::css::lang::EventObject& ) throw (::css::uno::RuntimeException)
- {
- }
- virtual void runTest()
- {
- m_pTest->setKey (m_pPath, rtl::OUString::createFromAscii (m_pKey),
- css::uno::makeAny(
- rtl::OUString::valueOf (m_nRecurse) ) );
- }
-};
-
-class CrossThreadListener : public RecursiveListener
-{
- public:
- CrossThreadListener (Test *pTest, int nCount,
- const char *pPath, const char *pKey)
- : RecursiveListener (pTest, nCount, pPath, pKey)
- {
- }
- virtual ~CrossThreadListener()
- {
- }
- virtual void runTest()
- {
- osl::Condition stopAfterOne;
- stopAfterOne.set();
- KeyWriter aWriter (&stopAfterOne, m_pTest, m_pPath, m_pKey);
- aWriter.join();
-
- rtl::OString aPath (m_pPath), aKey (m_pKey);
- m_pTest->normalizePathKey (aPath, aKey);
- m_pTest->resetKey (aPath, rtl::OUString::createFromAscii (aKey));
- }
-};
-
-void Test::recursiveTests()
-{
- RecursiveListener *pList = new RecursiveListener(this, 100,
- "/org.openoffice.UI.GenericCommands/UserInterface/Commands/dotuno:WebHtml",
- "Label");
- css::uno::Reference< css::beans::XPropertyChangeListener > xListener(pList);
- pList->runTest();
-}
-
-void Test::eventTests()
-{
- CrossThreadListener *pList = new CrossThreadListener(this, 10,
- "/org.openoffice.UI.GenericCommands/UserInterface/Commands/dotuno:WebHtml",
- "Label");
- css::uno::Reference< css::beans::XPropertyChangeListener > xListener(pList);
- pList->runTest();
-}
-
diff --git a/configmgr/qa/unit/ubootstrap.cxx b/configmgr/qa/unit/ubootstrap.cxx
deleted file mode 100644
index 362ab31b842e..000000000000
--- a/configmgr/qa/unit/ubootstrap.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-#include <osl/file.hxx>
-
-// Do all those evil things to make the tests actually work ...
-Magic::Magic()
-{
- rtl_uString *curWd = NULL;
- osl_getProcessWorkingDir( &curWd );
-
- rtl::OUString aKey;
- rtl::OUString aValue( curWd );
-
- // Unless you do this, obviously you don't want your paths to be correct
- // or file access to work properly
- aKey = rtl::OUString::createFromAscii( "BaseInstallation" );
- rtl_bootstrap_set( aKey.pData, aValue.pData );
- // Unless you do this, obviously you don't deserve to have anything work
- aKey = rtl::OUString::createFromAscii( "CFG_INIFILE" );
- aValue += rtl::OUString::createFromAscii( "/configmgrrc" );
- rtl_bootstrap_set( aKey.pData, aValue.pData );
-
- // FIXME: Create a safe /tmp directory - unfotunately that
- // either requires dependencies we don't have, or some cut &
- // paste action of unotools/source/ucbhelper/tempfile.cxx
- if (osl::File::getTempDirURL(maTempDir) != osl::FileBase::E_None) {
- t_print ("no tmp dir");
- CPPUNIT_FAIL ("no tmp dir");
- }
- maTempDir += rtl::OUString::createFromAscii("/unittstconfig");
- osl::FileBase::RC err = osl::Directory::create (maTempDir);
-
- if (err != osl::FileBase::E_None) {
- t_print ("tmp dir '%s' already exists\n",
- rtl::OUStringToOString (maTempDir, RTL_TEXTENCODING_UTF8).getStr());
- CPPUNIT_FAIL ("tmp user config dir already exists!");
- }
-
- aKey = rtl::OUString::createFromAscii( "UserInstallation" );
- rtl_bootstrap_set( aKey.pData, maTempDir.pData );
-}
-
-void removeRecursive (const rtl::OUString& aPath)
-{
- sal_Int32 nMask = FileStatusMask_Type | FileStatusMask_FileURL;
-
-// fprintf (stderr, "Remove recursive '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
-
- osl::DirectoryItem aItem;
- osl::FileStatus aStatus( nMask );
- osl::FileBase::RC nError;
-
- nError = osl::DirectoryItem::get( aPath, aItem );
- CPPUNIT_ASSERT_MESSAGE ("invalid path", nError == osl::FileBase::E_None);
-
- nError = aItem.getFileStatus( aStatus );
- CPPUNIT_ASSERT_MESSAGE ("invalid file", nError == osl::FileBase::E_None);
-
- if (aStatus.getFileType() == osl::FileStatus::Regular ||
- aStatus.getFileType() == osl::FileStatus::Link )
- {
- nError = osl::File::remove( aPath );
-// fprintf (stderr, "Remove file '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
- CPPUNIT_ASSERT_MESSAGE ("removing file", nError == osl::FileBase::E_None);
- }
- else if (aStatus.getFileType() == osl::FileStatus::Directory)
- {
- osl::Directory aDirectory (aPath);
- nError = aDirectory.open();
- CPPUNIT_ASSERT_MESSAGE ("opening dir", nError == osl::FileBase::E_None);
-
- rtl::OUString name;
-
- while (true) {
- nError = aDirectory.getNextItem( aItem );
- if ( nError != osl::FileBase::E_None )
- break;
- nError = aItem.getFileStatus( aStatus );
- CPPUNIT_ASSERT_MESSAGE ("getting status", nError == osl::FileBase::E_None);
- removeRecursive (aStatus.getFileURL());
- }
- aDirectory.close();
-
- nError = osl::Directory::remove( aPath );
-// fprintf (stderr, "Remove dir '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
-
- CPPUNIT_ASSERT_MESSAGE ("removing directory", nError == osl::FileBase::E_None);
- }
-}
-
-Magic::~Magic()
-{
- removeRecursive (maTempDir);
-}
diff --git a/configmgr/version.mk b/configmgr/qa/unit/urebootstrap.ini
index eabf1cca63c5..c413645d0f43 100644
--- a/configmgr/version.mk
+++ b/configmgr/qa/unit/urebootstrap.ini
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,24 +23,8 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-# ----------------------------CFGMGR settings------------------------------------#
-# target
-CFGMGR_TARGET=configmgr
-
-# the major
-CFGMGR_MAJOR=2
-# the minor
-CFGMGR_MINOR=0
-# the micro
-CFGMGR_MICRO=0
-
-# this is a c++ compatible library
-CFGMGR_CPP=1
-
-CFGMGR=$(CFGMGR_TARGET_TARGET)_$(CMPEXT)
-
-
-
+#***********************************************************************/
+[Bootstrap]
+OOO_BASE_DIR = $ORIGIN/basis
+BRAND_BASE_DIR = $ORIGIN/brand
diff --git a/crashrep/scripts/makefile.mk b/configmgr/qa/unit/version.map
index 64fa13d9f551..6b30413b896e 100755..100644
--- a/crashrep/scripts/makefile.mk
+++ b/configmgr/qa/unit/version.map
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,21 +23,12 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=crashrep
-TARGET=scripts
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Targets -------------------------------------------------------------
-
-UNIXTEXT= \
- $(MISC)$/crash_report.sh
+#***********************************************************************/
-.INCLUDE : target.mk
+UDK_3_0_0 {
+ global:
+ registerAllTestFunction;
+ local:
+ *;
+};
diff --git a/configmgr/qa/unoapi/cfgmgr2.sce b/configmgr/qa/unoapi/cfgmgr2.sce
deleted file mode 100644
index e7c4adcb6e34..000000000000
--- a/configmgr/qa/unoapi/cfgmgr2.sce
+++ /dev/null
@@ -1,34 +0,0 @@
--o cfgmgr2.LocalSchemaSupplier
--o cfgmgr2.LocalSingleStratum
--o cfgmgr2.MultiStratumBackend
--o sysmgr1.SystemIntegration
-#i46913# -o cfgmgr2.BootstrapContext
--o cfgmgr2.LayerUpdateMerger
--o cfgmgr2.LayerWriter
--o cfgmgr2.LocalDataImporter
--o cfgmgr2.LocalHierarchyBrowser
--o cfgmgr2.LocalSingleBackend
--o cfgmgr2.MergeImporter
--o cfgmgr2.OConfigurationRegistry
--o cfgmgr2.OInnerGroupInfoAccess
--o cfgmgr2.OInnerGroupUpdateAccess
--o cfgmgr2.OInnerSetInfoAccess
-#i46185# -o cfgmgr2.OInnerTreeSetUpdateAccess
--o cfgmgr2.OInnerValueSetUpdateAccess
--o cfgmgr2.ORootElementGroupInfoAccess
--o cfgmgr2.ORootElementGroupUpdateAccess
--o cfgmgr2.ORootElementSetInfoAccess
-#i46185# -o cfgmgr2.ORootElementTreeSetUpdateAccess
--o cfgmgr2.ORootElementValueSetUpdateAccess
--o cfgmgr2.OSetElementGroupInfoAccess
--o cfgmgr2.OSetElementGroupUpdateAccess
--o cfgmgr2.OSetElementSetInfoAccess
-#i46185# -o cfgmgr2.OSetElementTreeSetUpdateAccess
-#i84221# -o cfgmgr2.OSetElementValueSetUpdateAccess
--o cfgmgr2.SchemaParser
--o cfgmgr2.SingleBackendAdapter
--o cfgmgr2.ConfigurationProviderWrapper
-#i87744# -o cfgmgr2.LayerParser
--o cfgmgr2.CopyImporter
--o cfgmgr2.AdministrationProvider
--o cfgmgr2.ConfigurationProvider
diff --git a/configmgr/qa/unoapi/knownissues.xcl b/configmgr/qa/unoapi/knownissues.xcl
deleted file mode 100644
index d8956a6e8d85..000000000000
--- a/configmgr/qa/unoapi/knownissues.xcl
+++ /dev/null
@@ -1,55 +0,0 @@
-### i84222 ###
-cfgmgr2.LocalSingleBackend::com::sun::star::configuration::backend::XMultiLayerStratum
-
-### i23145 ###
-cfgmgr2.OSetElementGroupUpdateAccess::com::sun::star::container::XChild
-
-### i38211 ###
-cfgmgr2.ConfigurationProvider::com::sun::star::lang::XComponent
-
-### i46185 ###
-cfgmgr2.OInnerTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-cfgmgr2.OSetElementTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-cfgmgr2.ORootElementTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-# -> test is disbaled in cfgmgr2.sce
-
-### i46913 ###
-cfgmgr2.BootstrapContext::com::sun::star::uno::XComponentContext
-# -> test is disbaled in cfgmgr2.sce
-
-### i83881 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XNameReplace
-
-### i65847 ###
-cfgmgr2.OInnerTreeSetUpdateAccess::com::sun::star::beans::XPropertyWithState
-# -> test is disbaled in cfgmgr2.sce
-
-### i68673 ###
-cfgmgr2.ORootElementTreeSetUpdateAccess::com::sun::star::beans::XPropertyWithState
-# -> test is disbaled in cfgmgr2.sce
-
-### i79114 ###
-sysmgr1.SystemIntegration::com::sun::star::configuration::backend::XBackend
-
-### i83880 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::container::XNameReplace
-
-### i84221 ###
-cfgmgr2.OSetElementValueSetUpdateAccess
-
-### i87744 ###
-cfgmgr2.LayerParser
-# -> test is disbaled in cfgmgr2.sce
-
-### i88358 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XHierarchicalNameAccess
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::beans::XExactName
-
-### i88360 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::util::XChangesBatch
-
-### i89412 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XElementAccess
-
-### i89413 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::container::XHierarchicalNameAccess
diff --git a/configmgr/qa/unoapi/makefile.mk b/configmgr/qa/unoapi/makefile.mk
index c90cca92ce86..5af6b0729660 100644
--- a/configmgr/qa/unoapi/makefile.mk
+++ b/configmgr/qa/unoapi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,22 +23,16 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
-PRJNAME=configmgr
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = configmgr
+TARGET = unoapi
.INCLUDE: settings.mk
-
.INCLUDE: target.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR: TEST
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce cfgmgr2.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
- @echo =======================================================================
- @echo In case of problems with sysmgr1.SystemIntegration make sure that you
- @echo =======================================================================
- @echo built and registered qadevOOo/testsdocs/backend/org/openoffice/JavaSystemBackend
- @echo =======================================================================
+TEST .PHONY:
+ $(SOLARENV)/bin/checkapi -sce module.sce
diff --git a/configmgr/makefile.pmk b/configmgr/qa/unoapi/module.sce
index ccb15e70959e..d9b1c8b540b3 100644
--- a/configmgr/makefile.pmk
+++ b/configmgr/qa/unoapi/module.sce
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,6 +23,7 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-VISIBILITY_HIDDEN = TRUE
+-o configmgr.ConfigurationProvider
+-o configmgr.DefaultProvider
diff --git a/configmgr/source/README b/configmgr/source/README
new file mode 100644
index 000000000000..6d19a3b78610
--- /dev/null
+++ b/configmgr/source/README
@@ -0,0 +1,156 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+Source Overview
+===============
+
+configurationprovider.cxx
+configurationregistry.cxx
+defaultprovider.cxx
+services.cxx
+ UNO service implementations.
+
+access.cxx
+childaccess.cxx
+rootaccess.cxx
+ UNO objects passed to clients.
+
+components.cxx
+ Central singleton that aggregates all data (reads in the XML files, manages
+ modifications and global notifications).
+
+groupnode.cxx
+localizedpropertynode.cxx
+localizedvaluenode.cxx
+node.cxx
+propertynode.cxx
+setnode.cxx
+ Internal representations of data nodes.
+
+pad.cxx
+parsemanager.cxx
+parser.hxx
+span.hxx
+valueparser.cxx
+xcdparser.cxx
+xcsparser.cxx
+xcuparser.cxx
+xmldata.cxx
+xmlreader.cxx
+ XML file reading.
+
+modifications.cxx
+writemodfile.cxx
+ Modification management.
+
+broadcaster.cxx
+ Notification management.
+
+update.cxx
+ Extension manager interface.
+
+data.cxx
+lock.cxx
+nodemap.cxx
+path.hxx
+type.cxx
+ Utilities.
+
+
+Mandatory Set Members
+=====================
+
+- A set member can be marked as "mandatory," meaning that a member of that name
+must always be present in a set.
+
+- The above definition implies that calling replaceByName on a mandatory set
+member is OK.
+
+- The XCU format can contain oor:mandatory attributes on nodes. (The XCS format
+does not support them. In the registrymodifications file, oor:mandatory
+attributes should never be needed, as being mandatory cannot be controlled via
+the UNO API.) The XCU reading code only evaluates the oor:mandatory attribute
+for set members, and ignores it everywhere else.
+
+- Only true sets support mandatory members. A localized property for the "*"
+locale, though acting much like a set, does not support mandatory members.
+
+- The OpenOffice.org Registry Format document claims that group extension
+properties are implicitly mandatory, but at least the new configmgr code does
+not treat them like that (i.e., they can be removed again).
+
+- For simplicity, setMandatory/getMandatory are available as virtual functions
+at the base Node, even though they can only make sense for GroupNodes and
+SetNodes that are set members. The default getMandatory implementation returns
+NO_LAYER, meaning oor:mandatory is not set to true in any layer. (Returning
+NO_LAYER simplifies the code, e.g., removeByName does not have to check whether
+getMandatory is called on a member of a true set to decide whether to forbid
+removal.)
+
+- When committing changes (made through the UNO API), the "mandatory" status of
+inserted nodes must be updated (in case the insert is due to a replaceByName, or
+the "mandatory" flag was added by a concurrent modification of a lower layer).
+Also, for to-be-removed nodes, removal is ignored for (newly; due to concurrent
+modification of a lower layer) mandatory nodes (but still recorded in
+registrymodifications, so may take effect once the lower layer addition is
+removed again---whether or not that is a good idea).
+
+
+XcuParser Modification Recording
+================================
+
+- XcuParser records modifications when reading user layer data
+(valueParser_.getLayer() == Data::NO_LAYER).
+
+- oor:finalized and oor:mandatory attributes cannot be set via the UNO API, so
+it is assumed that user layer data does not contain them (for one, they are not
+written by writeModFile; for another, the logic to record modifications expects
+a locprop(modify,fuse) to be followed by one or more value(fuse,remove), which
+would not necessarily be true if the locprop were only present in the user layer
+data to flag it as finalized).
+
+- The logic to record modifications considers the top of the XML element stack.
+In the following list of all possible cases, items marked with an asterisk are
+recorded:
+ ... group(modify,fuse) - group(modify,fuse) - ...
+ ... group(modify,fuse) - set(modify,fuse) - ...
+ ... group(modify,fuse) - *prop(modify,fuse,replace) - value(fuse)
+ ... group(modify,fuse) - *prop(remove)
+ ... group(modify,fuse) - locprop(modify,fuse) - *value(fuse)
+ ... group(modify,fuse) - locprop(modify,fuse) - *value(remove)
+ ... group(modify,fuse) - *locprop(replace) ...
+ ... set(modify,fuse,replace) - group(modify/fuse) - ...
+ ... set(modify,fuse,replace) - *group(replace/fuse) - ...
+ ... set(modify,fuse,replace) - *group(remove)
+ ... set(modify,fuse,replace) - set(modify/fuse) - ...
+ ... set(modify,fuse,replace) - *set(replace/fuse) - ...
+ ... set(modify,fuse,replace) - *set(remove)
+Legend: "...": zero or more further items
+ "- ...": one or more further items
+ "modify,fuse" etc.: any of those operations
+ "modify/fuse": a modify or a fuse on an existing member
+ "replace/fuse": a replace or a fuse on a non-existing member
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
new file mode 100644
index 000000000000..7af9c1f8d9c0
--- /dev/null
+++ b/configmgr/source/access.cxx
@@ -0,0 +1,2186 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/beans/Property.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XExactName.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySetInfo.hpp"
+#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XMultiPropertySet.hpp"
+#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/container/ContainerEvent.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XContainer.hpp"
+#include "com/sun/star/container/XContainerListener.hpp"
+#include "com/sun/star/container/XElementAccess.hpp"
+#include "com/sun/star/container/XHierarchicalName.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/lang/XTypeProvider.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/uno/XWeak.hpp"
+#include "com/sun/star/util/ElementChange.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/interlck.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "broadcaster.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "rootaccess.hxx"
+#include "setnode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+oslInterlockedCount Access::acquireCounting() {
+ return osl_incrementInterlockedCount(&m_refCount);
+}
+
+void Access::releaseNondeleting() {
+ osl_decrementInterlockedCount(&m_refCount);
+}
+
+bool Access::isValue() {
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_VALUE:
+ return true;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ return !Components::allLocales(getRootAccess()->getLocale());
+ default:
+ return false;
+ }
+}
+
+void Access::markChildAsModified(rtl::Reference< ChildAccess > const & child) {
+ OSL_ASSERT(child.is() && child->getParentAccess() == this);
+ modifiedChildren_[child->getNameInternal()] = ModifiedChild(child, true);
+ for (rtl::Reference< Access > p(this);;) {
+ rtl::Reference< Access > parent(p->getParentAccess());
+ if (!parent.is()) {
+ break;
+ }
+ OSL_ASSERT(dynamic_cast< ChildAccess * >(p.get()) != 0);
+ parent->modifiedChildren_.insert(
+ ModifiedChildren::value_type(
+ p->getNameInternal(),
+ ModifiedChild(dynamic_cast< ChildAccess * >(p.get()), false)));
+ p = parent;
+ }
+}
+
+void Access::releaseChild(rtl::OUString const & name) {
+ cachedChildren_.erase(name);
+}
+
+void Access::initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster)
+{
+ initBroadcasterAndChanges(modifications, broadcaster, 0);
+}
+
+Access::Access(Components & components):
+ components_(components), disposed_(false)
+{}
+
+Access::~Access() {}
+
+void Access::initDisposeBroadcaster(Broadcaster * broadcaster) {
+ OSL_ASSERT(broadcaster != 0);
+ for (DisposeListeners::iterator i(disposeListeners_.begin());
+ i != disposeListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ *i,
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ for (ContainerListeners::iterator i(containerListeners_.begin());
+ i != containerListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ for (PropertyChangeListeners::iterator i(propertyChangeListeners_.begin());
+ i != propertyChangeListeners_.end(); ++i)
+ {
+ for (PropertyChangeListenersElement::iterator j(i->second.begin());
+ j != i->second.end(); ++j)
+ {
+ broadcaster->addDisposeNotification(
+ j->get(),
+ css::lang::EventObject(
+ static_cast< cppu::OWeakObject * >(this)));
+ }
+ }
+ for (VetoableChangeListeners::iterator i(vetoableChangeListeners_.begin());
+ i != vetoableChangeListeners_.end(); ++i)
+ {
+ for (VetoableChangeListenersElement::iterator j(i->second.begin());
+ j != i->second.end(); ++j)
+ {
+ broadcaster->addDisposeNotification(
+ j->get(),
+ css::lang::EventObject(
+ static_cast< cppu::OWeakObject * >(this)));
+ }
+ }
+ for (PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.begin());
+ i != propertiesChangeListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ //TODO: iterate over children w/ listeners (incl. unmodified ones):
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->initDisposeBroadcaster(broadcaster);
+ }
+ }
+}
+
+void Access::clearListeners() throw() {
+ disposeListeners_.clear();
+ containerListeners_.clear();
+ propertyChangeListeners_.clear();
+ vetoableChangeListeners_.clear();
+ propertiesChangeListeners_.clear();
+ //TODO: iterate over children w/ listeners (incl. unmodified ones):
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->clearListeners();
+ }
+ }
+}
+
+css::uno::Any Access::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Any res(OWeakObject::queryInterface(aType));
+ if (res.hasValue()) {
+ return res;
+ }
+ res = cppu::queryInterface(
+ aType, static_cast< css::lang::XTypeProvider * >(this),
+ static_cast< css::lang::XServiceInfo * >(this),
+ static_cast< css::lang::XComponent * >(this),
+ static_cast< css::container::XHierarchicalNameAccess * >(this),
+ static_cast< css::container::XContainer * >(this),
+ static_cast< css::beans::XExactName * >(this),
+ static_cast< css::container::XHierarchicalName * >(this),
+ static_cast< css::container::XNamed * >(this),
+ static_cast< css::beans::XProperty * >(this),
+ static_cast< css::container::XElementAccess * >(this),
+ static_cast< css::container::XNameAccess * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::beans::XPropertySetInfo * >(this),
+ static_cast< css::beans::XPropertySet * >(this),
+ static_cast< css::beans::XMultiPropertySet * >(this),
+ static_cast< css::beans::XHierarchicalPropertySet * >(this),
+ static_cast< css::beans::XMultiHierarchicalPropertySet * >(this),
+ static_cast< css::beans::XHierarchicalPropertySetInfo * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ }
+ if (getRootAccess()->isUpdate()) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::container::XNameReplace * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (getNode()->kind() != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(getNode().get())->isExtensible())
+ {
+ res = cppu::queryInterface(
+ aType, static_cast< css::container::XNameContainer * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ }
+ if (getNode()->kind() == Node::KIND_SET) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::lang::XSingleServiceFactory * >(this));
+ }
+ }
+ return res;
+}
+
+Components & Access::getComponents() const {
+ return components_;
+}
+
+void Access::checkLocalizedPropertyAccess() {
+ if (getNode()->kind() == Node::KIND_LOCALIZED_PROPERTY &&
+ !Components::allLocales(getRootAccess()->getLocale()))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr Access to specialized LocalizedPropertyNode")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+rtl::Reference< Node > Access::getParentNode() {
+ rtl::Reference< Access > parent(getParentAccess());
+ return parent.is() ? parent->getNode() : rtl::Reference< Node >();
+}
+
+rtl::Reference< ChildAccess > Access::getChild(rtl::OUString const & name) {
+ ModifiedChildren::iterator i(modifiedChildren_.find(name));
+ return i == modifiedChildren_.end()
+ ? getUnmodifiedChild(name) : getModifiedChild(i);
+}
+
+std::vector< rtl::Reference< ChildAccess > > Access::getAllChildren() {
+ std::vector< rtl::Reference< ChildAccess > > vec;
+ NodeMap & members = getNode()->getMembers();
+ for (NodeMap::iterator i(members.begin()); i != members.end(); ++i) {
+ if (modifiedChildren_.find(i->first) == modifiedChildren_.end()) {
+ vec.push_back(getUnmodifiedChild(i->first));
+ OSL_ASSERT(vec.back().is());
+ }
+ }
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ vec.push_back(child);
+ }
+ }
+ return vec;
+}
+
+void Access::checkValue(css::uno::Any const & value, Type type, bool nillable) {
+ bool ok;
+ switch (type) {
+ case TYPE_NIL:
+ OSL_ASSERT(false);
+ // fall through (cannot happen)
+ case TYPE_ERROR:
+ ok = false;
+ break;
+ case TYPE_ANY:
+ switch (getDynamicType(value)) {
+ case TYPE_ANY:
+ OSL_ASSERT(false);
+ // fall through (cannot happen)
+ case TYPE_ERROR:
+ ok = false;
+ break;
+ case TYPE_NIL:
+ ok = nillable;
+ break;
+ default:
+ ok = true;
+ break;
+ }
+ break;
+ default:
+ ok = value.hasValue() ? value.isExtractableTo(mapType(type)) : nillable;
+ break;
+ }
+ if (!ok) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate property value")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+}
+
+void Access::insertLocalizedValueChild(
+ rtl::OUString const & name, css::uno::Any const & value,
+ Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ LocalizedPropertyNode * locprop = dynamic_cast< LocalizedPropertyNode * >(
+ getNode().get());
+ checkValue(value, locprop->getStaticType(), locprop->isNillable());
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(
+ components_, getRootAccess(), this, name,
+ new LocalizedValueNode(Data::NO_LAYER, value)));
+ markChildAsModified(child);
+ localModifications->add(child->getRelativePath());
+}
+
+void Access::reportChildChanges(
+ std::vector< css::util::ElementChange > * changes)
+{
+ OSL_ASSERT(changes != 0);
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->reportChildChanges(changes);
+ changes->push_back(css::util::ElementChange());
+ //TODO: changed value and/or inserted node
+ } else {
+ changes->push_back(css::util::ElementChange()); //TODO: removed node
+ }
+ }
+}
+
+void Access::commitChildChanges(
+ bool valid, Modifications * globalModifications)
+{
+ OSL_ASSERT(globalModifications != 0);
+ while (!modifiedChildren_.empty()) {
+ bool childValid = valid;
+ ModifiedChildren::iterator i(modifiedChildren_.begin());
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ childValid = childValid && !child->isFinalized();
+ child->commitChanges(childValid, globalModifications);
+ //TODO: currently, this is called here for directly inserted
+ // children as well as for children whose sub-children were
+ // modified (and should never be called for directly removed
+ // children); clarify what exactly should happen here for
+ // directly inserted children
+ }
+ NodeMap & members = getNode()->getMembers();
+ NodeMap::iterator j(members.find(i->first));
+ if (child.is()) {
+ // Inserted:
+ if (j != members.end()) {
+ childValid = childValid &&
+ j->second->getFinalized() == Data::NO_LAYER;
+ if (childValid) {
+ child->getNode()->setMandatory(j->second->getMandatory());
+ }
+ }
+ if (childValid) {
+ members[i->first] = child->getNode();
+ }
+ } else {
+ // Removed:
+ childValid = childValid && j != members.end() &&
+ j->second->getFinalized() == Data::NO_LAYER &&
+ j->second->getMandatory() == Data::NO_LAYER;
+ if (childValid) {
+ members.erase(j);
+ }
+ }
+ if (childValid && i->second.directlyModified) {
+ Path path(getAbsolutePath());
+ path.push_back(i->first);
+ components_.addModification(path);
+ globalModifications->add(path);
+ }
+ i->second.child->committed();
+ modifiedChildren_.erase(i);
+ }
+}
+
+void Access::initBroadcasterAndChanges(
+ Modifications::Node const & modifications, Broadcaster * broadcaster,
+ std::vector< css::util::ElementChange > * allChanges)
+{
+ OSL_ASSERT(broadcaster != 0);
+ comphelper::SequenceAsVector< css::beans::PropertyChangeEvent > propChanges;
+ bool collectPropChanges = !propertiesChangeListeners_.empty();
+ for (Modifications::Node::Children::const_iterator i(
+ modifications.children.begin());
+ i != modifications.children.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getChild(i->first));
+ if (child.is()) {
+ switch (child->getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!i->second.children.empty()) {
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ child->initBroadcasterAndChanges(
+ i->second, broadcaster, allChanges);
+ //TODO: if allChanges==0, recurse only into children
+ // w/ listeners
+ } else {
+ //TODO: filter child mods that are irrelevant for
+ // locale:
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->
+ addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ css::uno::makeAny(i->first),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ }
+ // else: spurious Modifications::Node not representing a change
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ OSL_ASSERT(
+ Components::allLocales(getRootAccess()->getLocale()));
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), child->asValue(),
+ css::uno::Any()));
+ //TODO: distinguish add/modify; non-void ReplacedElement
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ child->asValue(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ OSL_ASSERT(!collectPropChanges);
+ break;
+ case Node::KIND_PROPERTY:
+ {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), child->asValue(),
+ css::uno::Any()));
+ //TODO: distinguish add/remove/modify; non-void
+ // ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ child->asValue(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ break;
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ if (i->second.children.empty()) {
+ if (child->getNode()->getTemplateName().getLength() != 0) {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->
+ addContainerElementInsertedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ css::uno::makeAny(i->first),
+ child->asValue(), css::uno::Any()));
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ }
+ // else: spurious Modifications::Node not representing a
+ // change
+ } else {
+ child->initBroadcasterAndChanges(
+ i->second, broadcaster, allChanges);
+ //TODO: if allChanges==0, recurse only into children w/
+ // listeners
+ }
+ break;
+ }
+ } else {
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ // Removed localized property value:
+ OSL_ASSERT(
+ Components::allLocales(getRootAccess()->getLocale()));
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (allChanges != 0) {
+ rtl::OUStringBuffer path(getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(
+ Data::createSegment(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")),
+ i->first));
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(path.makeStringAndClear()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ OSL_ASSERT(!collectPropChanges);
+ break;
+ case Node::KIND_GROUP:
+ {
+ // Removed (non-localized) extension property:
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ rtl::OUStringBuffer path(
+ getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(i->first);
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(path.makeStringAndClear()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ break;
+ case Node::KIND_SET:
+ // Removed set member:
+ if (i->second.children.empty()) {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ //TODO: if (allChanges != 0) {
+ // allChanges->push_back(
+ // css::util::ElementChange(
+ // css::uno::makeAny(...),
+ // css::uno::Any(), css::uno::Any()));
+ // //TODO: non-void ReplacedElement
+ //}
+ }
+ // else: spurious Modifications::Node not representing a change
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ }
+ if (!propChanges.empty()) {
+ css::uno::Sequence< css::beans::PropertyChangeEvent > seq(
+ propChanges.getAsConstList());
+ for (PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.begin());
+ i != propertiesChangeListeners_.end(); ++i)
+ {
+ broadcaster->addPropertiesChangeNotification(*i, seq);
+ }
+ }
+}
+
+bool Access::isDisposed() const {
+ return disposed_;
+}
+
+Access::ModifiedChild::ModifiedChild() {}
+
+Access::ModifiedChild::ModifiedChild(
+ rtl::Reference< ChildAccess > const & theChild, bool theDirectlyModified):
+ child(theChild), directlyModified(theDirectlyModified)
+{}
+
+css::uno::Sequence< css::uno::Type > Access::getTypes()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< css::uno::Type > types;
+ types.push_back(cppu::UnoType< css::uno::XInterface >::get());
+ types.push_back(cppu::UnoType< css::uno::XWeak >::get());
+ types.push_back(cppu::UnoType< css::lang::XTypeProvider >::get());
+ types.push_back(cppu::UnoType< css::lang::XServiceInfo >::get());
+ types.push_back(cppu::UnoType< css::lang::XComponent >::get());
+ types.push_back(
+ cppu::UnoType< css::container::XHierarchicalNameAccess >::get());
+ types.push_back(cppu::UnoType< css::container::XContainer >::get());
+ types.push_back(cppu::UnoType< css::beans::XExactName >::get());
+ types.push_back(cppu::UnoType< css::container::XHierarchicalName >::get());
+ types.push_back(cppu::UnoType< css::container::XNamed >::get());
+ types.push_back(cppu::UnoType< css::beans::XProperty >::get());
+ types.push_back(cppu::UnoType< css::container::XElementAccess >::get());
+ types.push_back(cppu::UnoType< css::container::XNameAccess >::get());
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ types.push_back(cppu::UnoType< css::beans::XPropertySetInfo >::get());
+ types.push_back(cppu::UnoType< css::beans::XPropertySet >::get());
+ types.push_back(cppu::UnoType< css::beans::XMultiPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XHierarchicalPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XMultiHierarchicalPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XHierarchicalPropertySetInfo >::get());
+ }
+ if (getRootAccess()->isUpdate()) {
+ types.push_back(cppu::UnoType< css::container::XNameReplace >::get());
+ if (getNode()->kind() != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(getNode().get())->isExtensible())
+ {
+ types.push_back(
+ cppu::UnoType< css::container::XNameContainer >::get());
+ }
+ if (getNode()->kind() == Node::KIND_SET) {
+ types.push_back(
+ cppu::UnoType< css::lang::XSingleServiceFactory >::get());
+ }
+ }
+ addTypes(&types);
+ return types.getAsConstList();
+}
+
+css::uno::Sequence< sal_Int8 > Access::getImplementationId()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return css::uno::Sequence< sal_Int8 >();
+}
+
+rtl::OUString Access::getImplementationName() throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr Access has no service implementation name")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool Access::supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Sequence< rtl::OUString > names(getSupportedServiceNames());
+ for (sal_Int32 i = 0; i < names.getLength(); ++i) {
+ if (names[i] == ServiceName) {
+ return true;
+ }
+ }
+ return false;
+}
+
+css::uno::Sequence< rtl::OUString > Access::getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< rtl::OUString > services;
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess")));
+ }
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.HierarchyAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.HierarchyElement")));
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.PropertyHierarchy")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupUpdate")));
+ }
+ } else {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SimpleSetAccess")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetUpdate")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SimpleSetUpdate")));
+ }
+ }
+ addSupportedServiceNames(&services);
+ return services.getAsConstList();
+}
+
+void Access::dispose() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (getParentAccess().is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr dispose inappropriate Access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (disposed_) {
+ return;
+ }
+ initDisposeBroadcaster(&bc);
+ clearListeners();
+ disposed_ = true;
+ }
+ bc.send();
+}
+
+void Access::addEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ disposeListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ DisposeListeners::iterator i(disposeListeners_.find(aListener));
+ if (i != disposeListeners_.end()) {
+ disposeListeners_.erase(i);
+ }
+}
+
+css::uno::Type Access::getElementType() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ return mapType(
+ dynamic_cast< LocalizedPropertyNode * >(p.get())->getStaticType());
+ case Node::KIND_GROUP:
+ //TODO: Should a specific type be returned for a non-extensible group
+ // with homogeneous members or for an extensible group that currently
+ // has only homegeneous members?
+ return cppu::UnoType< cppu::UnoVoidType >::get();
+ case Node::KIND_SET:
+ return cppu::UnoType< cppu::UnoVoidType >::get(); //TODO: correct?
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+sal_Bool Access::hasElements() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return !getAllChildren().empty(); //TODO: optimize
+}
+
+css::uno::Any Access::getByName(rtl::OUString const & aName)
+ throw (
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+css::uno::Sequence< rtl::OUString > Access::getElementNames()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
+ comphelper::SequenceAsVector< rtl::OUString > names;
+ for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
+ children.begin());
+ i != children.end(); ++i)
+ {
+ names.push_back((*i)->getNameInternal());
+ }
+ return names.getAsConstList();
+}
+
+sal_Bool Access::hasByName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getChild(aName).is();
+}
+
+css::uno::Any Access::getByHierarchicalName(rtl::OUString const & aName)
+ throw (css::container::NoSuchElementException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getSubChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+sal_Bool Access::hasByHierarchicalName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getSubChild(aName).is();
+}
+
+void Access::addContainerListener(
+ css::uno::Reference< css::container::XContainerListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ containerListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeContainerListener(
+ css::uno::Reference< css::container::XContainerListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ ContainerListeners::iterator i(containerListeners_.find(xListener));
+ if (i != containerListeners_.end()) {
+ containerListeners_.erase(i);
+ }
+}
+
+rtl::OUString Access::getExactName(rtl::OUString const & aApproximateName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return aApproximateName;
+}
+
+css::uno::Sequence< css::beans::Property > Access::getProperties()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
+ comphelper::SequenceAsVector< css::beans::Property > properties;
+ for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
+ children.begin());
+ i != children.end(); ++i)
+ {
+ properties.push_back((*i)->asProperty());
+ }
+ return properties.getAsConstList();
+}
+
+css::beans::Property Access::getPropertyByName(rtl::OUString const & aName)
+ throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asProperty();
+}
+
+sal_Bool Access::hasPropertyByName(rtl::OUString const & Name)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ return getChild(Name).is();
+}
+
+rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getRelativePathRepresentation();
+}
+
+rtl::OUString Access::composeHierarchicalName(
+ rtl::OUString const & aRelativeName)
+ throw (
+ css::lang::IllegalArgumentException, css::lang::NoSupportException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (aRelativeName.getLength() == 0 || aRelativeName[0] == '/') {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr composeHierarchicalName inappropriate relative"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ rtl::OUStringBuffer path(getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(aRelativeName);
+ return path.makeStringAndClear();
+}
+
+rtl::OUString Access::getName() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getNameInternal();
+}
+
+void Access::setName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ checkFinalized();
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ {
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ rtl::Reference< Node > node(getNode());
+ if (node->getTemplateName().getLength() != 0) {
+ rtl::Reference< ChildAccess > other(
+ parent->getChild(aName));
+ if (other.get() == this) {
+ break;
+ }
+ if (node->getMandatory() == Data::NO_LAYER &&
+ !(other.is() && other->isFinalized()))
+ {
+ rtl::Reference< RootAccess > root(getRootAccess());
+ rtl::Reference< ChildAccess > childAccess(
+ dynamic_cast< ChildAccess * >(this));
+ localMods.add(getRelativePath());
+ // unbind() modifies the parent chain that
+ // markChildAsModified() walks, so order is
+ // important:
+ parent->markChildAsModified(childAccess);
+ //TODO: must not throw
+ childAccess->unbind(); // must not throw
+ if (other.is()) {
+ other->unbind(); // must not throw
+ }
+ childAccess->bind(root, parent, aName);
+ // must not throw
+ parent->markChildAsModified(childAccess);
+ //TODO: must not throw
+ localMods.add(getRelativePath());
+ break;
+ }
+ }
+ }
+ }
+ // fall through
+ case Node::KIND_LOCALIZED_PROPERTY:
+ // renaming a property could only work for an extension property,
+ // but a localized property is never an extension property
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setName inappropriate node")),
+ static_cast< cppu::OWeakObject * >(this));
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::beans::Property Access::getAsProperty() throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return asProperty();
+}
+
+css::uno::Reference< css::beans::XPropertySetInfo > Access::getPropertySetInfo()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ return this;
+}
+
+void Access::setPropertyValue(
+ rtl::OUString const & aPropertyName, css::uno::Any const & aValue)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValue on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ Modifications localMods;
+ if (!setChildProperty(aPropertyName, aValue, &localMods)) {
+ throw css::beans::UnknownPropertyException(
+ aPropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Any Access::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getChild(PropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+void Access::addPropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ xListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ checkKnownProperty(aPropertyName);
+ if (!disposed_) {
+ propertyChangeListeners_[aPropertyName].insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removePropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ checkKnownProperty(aPropertyName);
+ PropertyChangeListeners::iterator i(
+ propertyChangeListeners_.find(aPropertyName));
+ if (i != propertyChangeListeners_.end()) {
+ PropertyChangeListenersElement::iterator j(i->second.find(aListener));
+ if (j != i->second.end()) {
+ i->second.erase(j);
+ if (i->second.empty()) {
+ propertyChangeListeners_.erase(i);
+ }
+ }
+ }
+}
+
+void Access::addVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!aListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ checkKnownProperty(PropertyName);
+ if (!disposed_) {
+ vetoableChangeListeners_[PropertyName].insert(aListener);
+ //TODO: actually call vetoableChangeListeners_
+ return;
+ }
+ }
+ try {
+ aListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ checkKnownProperty(PropertyName);
+ VetoableChangeListeners::iterator i(
+ vetoableChangeListeners_.find(PropertyName));
+ if (i != vetoableChangeListeners_.end()) {
+ VetoableChangeListenersElement::iterator j(i->second.find(aListener));
+ if (j != i->second.end()) {
+ i->second.erase(j);
+ if (i->second.empty()) {
+ vetoableChangeListeners_.erase(i);
+ }
+ }
+ }
+}
+
+void Access::setPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ css::uno::Sequence< css::uno::Any > const & aValues)
+ throw (
+ css::beans::PropertyVetoException, css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (aPropertyNames.getLength() != aValues.getLength()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues: aPropertyNames/aValues of"
+ " different length")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ Modifications localMods;
+ for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
+ if (!setChildProperty(aPropertyNames[i], aValues[i], &localMods)) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues inappropriate property"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Sequence< css::uno::Any > Access::getPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ css::uno::Sequence< css::uno::Any > vals(aPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(getChild(aPropertyNames[i]));
+ if (!child.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr getPropertyValues inappropriate property"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ vals[i] = child->asValue();
+ }
+ return vals;
+}
+
+void Access::addPropertiesChangeListener(
+ css::uno::Sequence< rtl::OUString > const &,
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ propertiesChangeListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removePropertiesChangeListener(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.find(xListener));
+ if (i != propertiesChangeListeners_.end()) {
+ propertiesChangeListeners_.erase(i);
+ }
+}
+
+void Access::firePropertiesChangeEvent(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ css::uno::Sequence< css::beans::PropertyChangeEvent > events(
+ aPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < events.getLength(); ++i) {
+ events[i].Source = static_cast< cppu::OWeakObject * >(this);
+ events[i].PropertyName = aPropertyNames[i];
+ events[i].Further = false;
+ events[i].PropertyHandle = -1;
+ }
+ xListener->propertiesChange(events);
+}
+
+css::uno::Reference< css::beans::XHierarchicalPropertySetInfo >
+Access::getHierarchicalPropertySetInfo() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_GROUP));
+ return this;
+}
+
+void Access::setHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName,
+ css::uno::Any const & aValue)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyName on non-update"
+ " access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalPropertyName,
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ child->checkFinalized();
+ Modifications localMods;
+ child->setProperty(aValue, &localMods);
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Any Access::getHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalPropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalPropertyName,
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+void Access::setHierarchicalPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aHierarchicalPropertyNames,
+ css::uno::Sequence< css::uno::Any > const & Values)
+ throw (
+ css::beans::PropertyVetoException, css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (aHierarchicalPropertyNames.getLength() != Values.getLength()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyValues:"
+ " aHierarchicalPropertyNames/Values of different"
+ " length")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ Modifications localMods;
+ for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyNames[i]));
+ if (!child.is()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyValues"
+ " inappropriate property name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ child->checkFinalized();
+ child->setProperty(Values[i], &localMods);
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aHierarchicalPropertyNames)
+ throw (
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ css::uno::Sequence< css::uno::Any > vals(
+ aHierarchicalPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyNames[i]));
+ if (!child.is()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr getHierarchicalPropertyValues inappropriate"
+ " hierarchical property name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ vals[i] = child->asValue();
+ }
+ return vals;
+}
+
+css::beans::Property Access::getPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asProperty();
+}
+
+sal_Bool Access::hasPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ return getSubChild(aHierarchicalName).is();
+}
+
+void Access::replaceByName(
+ rtl::OUString const & aName, css::uno::Any const & aElement)
+ throw (
+ css::lang::IllegalArgumentException,
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ child->checkFinalized();
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ case Node::KIND_GROUP:
+ child->setProperty(aElement, &localMods);
+ break;
+ case Node::KIND_SET:
+ {
+ rtl::Reference< ChildAccess > freeAcc(
+ getFreeSetMember(aElement));
+ rtl::Reference< RootAccess > root(getRootAccess());
+ localMods.add(child->getRelativePath());
+ child->unbind(); // must not throw
+ freeAcc->bind(root, this, aName); // must not throw
+ markChildAsModified(freeAcc); //TODO: must not throw
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+void Access::insertByName(
+ rtl::OUString const & aName, css::uno::Any const & aElement)
+ throw (
+ css::lang::IllegalArgumentException,
+ css::container::ElementExistException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ checkFinalized();
+ if (getChild(aName).is()) {
+ throw css::container::ElementExistException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ insertLocalizedValueChild(aName, aElement, &localMods);
+ break;
+ case Node::KIND_GROUP:
+ {
+ checkValue(aElement, TYPE_ANY, true);
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(
+ components_, getRootAccess(), this, aName,
+ new PropertyNode(
+ Data::NO_LAYER, TYPE_ANY, true, aElement, true)));
+ markChildAsModified(child);
+ localMods.add(child->getRelativePath());
+ }
+ break;
+ case Node::KIND_SET:
+ {
+ rtl::Reference< ChildAccess > freeAcc(
+ getFreeSetMember(aElement));
+ freeAcc->bind(getRootAccess(), this, aName); // must not throw
+ markChildAsModified(freeAcc); //TODO: must not throw
+ localMods.add(freeAcc->getRelativePath());
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+void Access::removeByName(rtl::OUString const & aName)
+ throw (
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is() || child->isFinalized() ||
+ child->getNode()->getMandatory() != Data::NO_LAYER)
+ {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ rtl::Reference< Node > p(child->getNode());
+ if (p->kind() != Node::KIND_PROPERTY ||
+ !dynamic_cast< PropertyNode * >(p.get())->isExtension())
+ {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ }
+ Modifications localMods;
+ localMods.add(child->getRelativePath());
+ // unbind() modifies the parent chain that markChildAsModified() walks,
+ // so order is important:
+ markChildAsModified(child); //TODO: must not throw
+ child->unbind();
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Reference< css::uno::XInterface > Access::createInstance()
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_SET|IS_UPDATE));
+ rtl::OUString tmplName(
+ dynamic_cast< SetNode * >(getNode().get())->getDefaultTemplateName());
+ rtl::Reference< Node > tmpl(
+ components_.getTemplate(Data::NO_LAYER, tmplName));
+ if (!tmpl.is()) {
+ throw css::uno::Exception(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown template ")) +
+ tmplName),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ rtl::Reference< Node > node(tmpl->clone());
+ node->setLayer(Data::NO_LAYER);
+ return static_cast< cppu::OWeakObject * >(
+ new ChildAccess(components_, getRootAccess(), node));
+}
+
+css::uno::Reference< css::uno::XInterface > Access::createInstanceWithArguments(
+ css::uno::Sequence< css::uno::Any > const & aArguments)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_SET|IS_UPDATE));
+ if (aArguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configuration SimpleSetUpdate createInstanceWithArguments"
+ " must not specify any arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return createInstance();
+}
+
+rtl::Reference< ChildAccess > Access::getModifiedChild(
+ ModifiedChildren::iterator const & childIterator)
+{
+ return (childIterator->second.child->getParentAccess() == this &&
+ (childIterator->second.child->getNameInternal() ==
+ childIterator->first))
+ ? childIterator->second.child : rtl::Reference< ChildAccess >();
+}
+
+rtl::Reference< ChildAccess > Access::getUnmodifiedChild(
+ rtl::OUString const & name)
+{
+ OSL_ASSERT(modifiedChildren_.find(name) == modifiedChildren_.end());
+ rtl::Reference< Node > node(getNode()->getMember(name));
+ if (!node.is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ WeakChildMap::iterator i(cachedChildren_.find(name));
+ if (i != cachedChildren_.end()) {
+ rtl::Reference< ChildAccess > child;
+ if (i->second->acquireCounting() > 1) {
+ child.set(i->second); // must not throw
+ }
+ i->second->releaseNondeleting();
+ if (child.is()) {
+ child->setNode(node);
+ return child;
+ }
+ }
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(components_, getRootAccess(), this, name, node));
+ cachedChildren_[name] = child.get();
+ return child;
+}
+
+rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) {
+ rtl::OUString name;
+ bool setElement;
+ rtl::OUString templateName;
+ sal_Int32 i = Data::parseSegment(
+ path, 0, &name, &setElement, &templateName);
+ if (i == -1 || (i != path.getLength() && path[i] != '/')) {
+ return rtl::Reference< ChildAccess >();
+ }
+ rtl::Reference< ChildAccess > child(getChild(name));
+ if (!child.is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ if (setElement) {
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!Components::allLocales(getRootAccess()->getLocale()) ||
+ templateName.getLength() != 0)
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ case Node::KIND_SET:
+ if (templateName.getLength() != 0 &&
+ !dynamic_cast< SetNode * >(p.get())->isValidTemplate(
+ templateName))
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ default:
+ return rtl::Reference< ChildAccess >();
+ }
+ }
+ // For backwards compatibility, ignore a final slash after non-value nodes:
+ return child->isValue()
+ ? (i == path.getLength() ? child : rtl::Reference< ChildAccess >())
+ : (i >= path.getLength() - 1
+ ? child : child->getSubChild(path.copy(i + 1)));
+}
+
+bool Access::setChildProperty(
+ rtl::OUString const & name, css::uno::Any const & value,
+ Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ rtl::Reference< ChildAccess > child(getChild(name));
+ if (!child.is()) {
+ return false;
+ }
+ child->checkFinalized();
+ child->setProperty(value, localModifications);
+ return true;
+}
+
+css::beans::Property Access::asProperty() {
+ css::uno::Type type;
+ bool nillable;
+ bool removable;
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(p.get());
+ type = mapType(prop->getStaticType());
+ nillable = prop->isNillable();
+ removable = prop->isExtension();
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode *>(p.get());
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ type = cppu::UnoType< css::uno::XInterface >::get();
+ //TODO: correct?
+ removable = false;
+ } else {
+ type = mapType(locprop->getStaticType());
+ removable = false; //TODO ???
+ }
+ nillable = locprop->isNillable();
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode * >(getParentNode().get());
+ type = mapType(locprop->getStaticType());
+ nillable = locprop->isNillable();
+ removable = false; //TODO ???
+ }
+ break;
+ default:
+ type = cppu::UnoType< css::uno::XInterface >::get(); //TODO: correct?
+ nillable = false;
+ removable = getParentNode()->kind() == Node::KIND_SET;
+ break;
+ }
+ return css::beans::Property(
+ getNameInternal(), -1, type,
+ (css::beans::PropertyAttribute::BOUND | //TODO: correct for group/set?
+ css::beans::PropertyAttribute::CONSTRAINED |
+ (nillable ? css::beans::PropertyAttribute::MAYBEVOID : 0) |
+ (getRootAccess()->isUpdate()
+ ? (removable ? css::beans::PropertyAttribute::REMOVEABLE : 0)
+ : css::beans::PropertyAttribute::READONLY))); //TODO: MAYBEDEFAULT
+}
+
+void Access::checkFinalized() {
+ if (isFinalized()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr modification of finalized item")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+}
+
+void Access::checkKnownProperty(rtl::OUString const & descriptor) {
+ if (descriptor.getLength() == 0) {
+ return;
+ }
+ rtl::Reference< ChildAccess > child(getChild(descriptor));
+ if (child.is()) {
+ switch (child->getNode()->kind()) {
+ case Node::KIND_PROPERTY:
+ return;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!Components::allLocales(getRootAccess()->getLocale())) {
+ return;
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ throw css::beans::UnknownPropertyException(
+ descriptor, static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::Reference< ChildAccess > Access::getFreeSetMember(
+ css::uno::Any const & value)
+{
+ rtl::Reference< ChildAccess > freeAcc;
+ css::uno::Reference< css::lang::XUnoTunnel > tunnel;
+ value >>= tunnel;
+ if (tunnel.is()) {
+ freeAcc.set(
+ reinterpret_cast< ChildAccess * >(
+ tunnel->getSomething(ChildAccess::getTunnelId())));
+ }
+ if (!freeAcc.is() || freeAcc->getParentAccess().is() ||
+ (freeAcc->isInTransaction() &&
+ freeAcc->getRootAccess() != getRootAccess()))
+ {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate set element")),
+ static_cast< cppu::OWeakObject * >(this), 1);
+ }
+ OSL_ASSERT(dynamic_cast< SetNode * >(getNode().get()) != 0);
+ if (!dynamic_cast< SetNode * >(getNode().get())->isValidTemplate(
+ freeAcc->getNode()->getTemplateName()))
+ {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate set element")),
+ static_cast< cppu::OWeakObject * >(this), 1);
+ }
+ return freeAcc;
+}
+
+rtl::Reference< Access > Access::getNotificationRoot() {
+ for (rtl::Reference< Access > p(this);;) {
+ rtl::Reference< Access > parent(p->getParentAccess());
+ if (!parent.is()) {
+ return p;
+ }
+ p = parent;
+ }
+}
+
+#if OSL_DEBUG_LEVEL > 0
+bool Access::thisIs(int what) {
+ osl::MutexGuard g(lock);
+ rtl::Reference< Node > p(getNode());
+ Node::Kind k(p->kind());
+ return k != Node::KIND_PROPERTY && k != Node::KIND_LOCALIZED_VALUE &&
+ ((what & IS_GROUP) == 0 || k == Node::KIND_GROUP) &&
+ ((what & IS_SET) == 0 || k == Node::KIND_SET) &&
+ ((what & IS_EXTENSIBLE) == 0 || k != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(p.get())->isExtensible()) &&
+ ((what & IS_GROUP_MEMBER) == 0 ||
+ getParentNode()->kind() == Node::KIND_GROUP) ||
+ ((what & IS_SET_MEMBER) == 0 ||
+ getParentNode()->kind() == Node::KIND_SET) ||
+ ((what & IS_UPDATE) == 0 || getRootAccess()->isUpdate());
+}
+#endif
+
+}
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
new file mode 100644
index 000000000000..8c10aa8ccece
--- /dev/null
+++ b/configmgr/source/access.hxx
@@ -0,0 +1,582 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XExactName.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySetInfo.hpp"
+#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XMultiPropertySet.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/container/ElementExistException.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XContainer.hpp"
+#include "com/sun/star/container/XHierarchicalName.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XTypeProvider.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/interlck.h"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "modifications.hxx"
+#include "path.hxx"
+#include "type.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ class XHierarchicalPropertySetInfo;
+ class XPropertiesChangeListener;
+ class XPropertyChangeListener;
+ class XVetoableChangeListener;
+ struct Property;
+ }
+ namespace container { class XContainerListener; }
+ namespace lang { class XEventListener; }
+ namespace uno {
+ class Any;
+ class Type;
+ class XInterface;
+ }
+ namespace util { struct ElementChange; }
+} } }
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Broadcaster;
+class Change;
+class ChildAccess;
+class Components;
+class Node;
+class RootAccess;
+
+class Access:
+ public cppu::OWeakObject, public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::container::XHierarchicalNameAccess,
+ public com::sun::star::container::XContainer,
+ public com::sun::star::beans::XExactName,
+ public com::sun::star::beans::XPropertySetInfo,
+ public com::sun::star::container::XHierarchicalName,
+ public com::sun::star::container::XNamed,
+ public com::sun::star::beans::XProperty,
+ public com::sun::star::beans::XPropertySet,
+ public com::sun::star::beans::XMultiPropertySet,
+ public com::sun::star::beans::XHierarchicalPropertySet,
+ public com::sun::star::beans::XMultiHierarchicalPropertySet,
+ public com::sun::star::beans::XHierarchicalPropertySetInfo,
+ public com::sun::star::container::XNameContainer,
+ public com::sun::star::lang::XSingleServiceFactory,
+ private boost::noncopyable
+{
+public:
+ oslInterlockedCount acquireCounting();
+
+ void releaseNondeleting();
+
+ bool isValue();
+
+ void markChildAsModified(rtl::Reference< ChildAccess > const & child);
+
+ void releaseChild(rtl::OUString const & name);
+
+ virtual Path getAbsolutePath() = 0;
+
+ virtual Path getRelativePath() = 0;
+
+ virtual rtl::OUString getRelativePathRepresentation() = 0;
+
+ virtual rtl::Reference< Node > getNode() = 0;
+
+ virtual bool isFinalized() = 0;
+
+ virtual void initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster);
+
+ using OWeakObject::acquire;
+ using OWeakObject::release;
+
+protected:
+ Access(Components & components);
+
+ virtual ~Access();
+
+ virtual rtl::OUString getNameInternal() = 0;
+
+ virtual rtl::Reference< RootAccess > getRootAccess() = 0;
+
+ virtual rtl::Reference< Access > getParentAccess() = 0;
+
+ virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
+ const = 0;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services) = 0;
+
+ virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
+
+ virtual void clearListeners() throw ();
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ Components & getComponents() const;
+
+ void checkLocalizedPropertyAccess();
+
+ rtl::Reference< Node > getParentNode();
+
+ rtl::Reference< ChildAccess > getChild(rtl::OUString const & name);
+
+ std::vector< rtl::Reference< ChildAccess > > getAllChildren();
+
+ void checkValue(
+ com::sun::star::uno::Any const & value, Type type, bool nillable);
+
+ void insertLocalizedValueChild(
+ rtl::OUString const & name, com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ void reportChildChanges(
+ std::vector< com::sun::star::util::ElementChange > * changes);
+
+ void commitChildChanges(bool valid, Modifications * globalModifications);
+
+ void initBroadcasterAndChanges(
+ Modifications::Node const & modifications, Broadcaster * broadcaster,
+ std::vector< com::sun::star::util::ElementChange > * changes);
+
+ bool isDisposed() const;
+
+private:
+ struct ModifiedChild {
+ rtl::Reference< ChildAccess > child;
+ bool directlyModified;
+
+ ModifiedChild();
+
+ ModifiedChild(
+ rtl::Reference< ChildAccess > const & theChild,
+ bool theDirectlyModified);
+ };
+
+ typedef std::map< rtl::OUString, ModifiedChild > ModifiedChildren;
+
+ 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);
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL dispose()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Type SAL_CALL getElementType()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasElements()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getByName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getElementNames() throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getByHierarchicalName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasByHierarchicalName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addContainerListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeContainerListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getExactName(
+ rtl::OUString const & aApproximateName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
+ SAL_CALL getProperties() throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL getPropertyByName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPropertyByName(rtl::OUString const & Name)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getHierarchicalName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL composeHierarchicalName(
+ rtl::OUString const & aRelativeName)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL getAsProperty()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo() throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Any const & aValue)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & xListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ aValues)
+ throw (
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Any > SAL_CALL
+ getPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertiesChangeListener(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removePropertiesChangeListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL firePropertiesChangeEvent(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XHierarchicalPropertySetInfo > SAL_CALL
+ getHierarchicalPropertySetInfo()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName,
+ com::sun::star::uno::Any const & aValue)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setHierarchicalPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const &
+ aHierarchicalPropertyNames,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ Values)
+ throw (
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Any > SAL_CALL
+ getHierarchicalPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const &
+ aHierarchicalPropertyNames)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL
+ getPropertyByHierarchicalName(rtl::OUString const & aHierarchicalName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL replaceByName(
+ rtl::OUString const & aName, com::sun::star::uno::Any const & aElement)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL insertByName(
+ rtl::OUString const & aName, com::sun::star::uno::Any const & aElement)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::container::ElementExistException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeByName(rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL createInstance()
+ throw (
+ com::sun::star::uno::Exception,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL createInstanceWithArguments(
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ aArguments)
+ throw (
+ com::sun::star::uno::Exception,
+ com::sun::star::uno::RuntimeException);
+
+ rtl::Reference< ChildAccess > getModifiedChild(
+ ModifiedChildren::iterator const & childIterator);
+
+ rtl::Reference< ChildAccess > getUnmodifiedChild(
+ rtl::OUString const & name);
+
+ rtl::Reference< ChildAccess > getSubChild(rtl::OUString const & path);
+
+ bool setChildProperty(
+ rtl::OUString const & name, com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ com::sun::star::beans::Property asProperty();
+
+ void checkFinalized();
+
+ void checkKnownProperty(rtl::OUString const & descriptor);
+
+ rtl::Reference< ChildAccess > getFreeSetMember(
+ com::sun::star::uno::Any const & value);
+
+ rtl::Reference< Access > getNotificationRoot();
+
+ typedef std::map< rtl::OUString, ChildAccess * > WeakChildMap;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener > >
+ DisposeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > >
+ ContainerListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > >
+ PropertyChangeListenersElement;
+
+ typedef std::map< rtl::OUString, PropertyChangeListenersElement >
+ PropertyChangeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > >
+ VetoableChangeListenersElement;
+
+ typedef std::map< rtl::OUString, VetoableChangeListenersElement >
+ VetoableChangeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > >
+ PropertiesChangeListeners;
+
+ Components & components_;
+ ModifiedChildren modifiedChildren_;
+ WeakChildMap cachedChildren_;
+ DisposeListeners disposeListeners_;
+ ContainerListeners containerListeners_;
+ PropertyChangeListeners propertyChangeListeners_;
+ VetoableChangeListeners vetoableChangeListeners_;
+ PropertiesChangeListeners propertiesChangeListeners_;
+ bool disposed_;
+
+#if OSL_DEBUG_LEVEL > 0
+protected:
+ enum {
+ IS_ANY = 0, IS_GROUP = 0x01, IS_SET = 0x02, IS_EXTENSIBLE = 0x04,
+ IS_GROUP_MEMBER = 0x08, IS_SET_MEMBER = 0x10, IS_UPDATE = 0x20 };
+ bool thisIs(int what);
+#endif
+};
+
+}
+
+#endif
diff --git a/configmgr/source/api/confevents.cxx b/configmgr/source/api/confevents.cxx
deleted file mode 100644
index 632fabe49313..000000000000
--- a/configmgr/source/api/confevents.cxx
+++ /dev/null
@@ -1,302 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include "confevents.hxx"
-#include "configexcept.hxx"
-#include "treechangelist.hxx"
-#include <osl/diagnose.h>
-namespace configmgr
-{
- /////////////////////////////////////////////////////////////////////////
- ConfigChangeBroadcastHelper::ConfigChangeBroadcastHelper()
- {
- }
-
- ConfigChangeBroadcastHelper::~ConfigChangeBroadcastHelper()
- {
- OSL_ENSURE(m_aListeners.begin() == m_aListeners.end(), "Remaining listeners found - forgot to dispose ?");
- OSL_ENSURE(m_aPathMap.empty(), "Spurious mappings found");
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::dispose(TreeManager * pSource)
- {
- disposing(pSource);
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pHandler)
- {
- add(aName, pHandler);
- }
-
- void ConfigChangeBroadcastHelper::removeListener(rtl::Reference<INodeListener> const& pHandler)
- {
- remove(pHandler);
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::broadcast(TreeChangeList const& anUpdate, sal_Bool bError, TreeManager * pSource)
- {
- dispatch(anUpdate, bError, pSource);
- }
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::add(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::iterator aAdded = m_aListeners.addListener(internal::NodeListenerInfo(pListener));
- aAdded->addPath(aName);
- m_aPathMap.insert(PathMap::value_type(aName,aAdded));
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::remove(rtl::Reference<INodeListener> const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::const_iterator const iter = m_aListeners.find(pListener);
- if (iter != m_aListeners.end())
- {
- internal::NodeListenerInfo::Pathes const& pathes = iter->pathList();
-
- // first clear the Path Map
- for(internal::NodeListenerInfo::Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
- {
- std::pair<PathMap::iterator, PathMap::iterator> aRange = m_aPathMap.equal_range(*itPath);
- while (aRange.first != aRange.second)
- {
- PathMap::iterator cur = aRange.first++;
- if (cur->second == iter)
- m_aPathMap.erase(cur);
- }
- }
-
- // the remove the broadcast helper entry
- m_aListeners.removeListener(pListener);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////
-// This should actually be available from the TreeChangeList
-/////////////////////////////////////////////////////////////////////////
-
-static Change const* resolvePath(Change const& rChange, configuration::RelativePath& aRelativePath, RemoveNode const*& pRemoveNode)
-{
- std::vector<configuration::Path::Component>::const_reverse_iterator aIter;
-
- OSL_ASSERT(pRemoveNode == NULL);
- pRemoveNode = NULL;
-
- Change const* pChange = &rChange;
- pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
-
- std::vector<configuration::Path::Component>::const_reverse_iterator const aEnd(aRelativePath.end());
-
- for( aIter = aRelativePath.begin();
- aIter != aEnd;
- ++aIter)
- {
- OSL_ASSERT( pChange != NULL );
-
- pChange = pChange->getSubChange(aIter->getName());
-
- if (pChange == NULL) break;
-
- OSL_ASSERT(pRemoveNode == NULL);
- OSL_ASSERT(aIter->getName() == pChange->getNodeName());
-
- pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
- }
-
- if (pRemoveNode)
- {
- aRelativePath = configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) );
- OSL_ASSERT( aRelativePath.getLocalName().getName() == pRemoveNode->getNodeName());
- }
- else
- OSL_ASSERT( pChange == 0 || configuration::matches(aRelativePath, configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) )) );
-
- return pChange;
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatchInner
-(
- rtl::Reference<INodeListener> const& pTarget,
- configuration::AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- TreeManager * pSource
-)
-{
- try
- {
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( configuration::Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
-
- configuration::RelativePath aLocalPath = configuration::Path::stripPrefix( _aTargetPath, _aChangeLocation );
-
- RemoveNode const* pRemoved = 0;
- Change const* pTargetChange = resolvePath(rBaseChange, aLocalPath, pRemoved );
-
- OSL_ASSERT( !pTargetChange || matches(_aChangeLocation.compose(aLocalPath),_aTargetPath) );
-
- if (pRemoved)
- pTarget->nodeDeleted(_aChangeLocation.compose(aLocalPath), pSource);
-
- else if (pTargetChange)
- pTarget->nodeChanged(*pTargetChange, _aTargetPath, pSource);
-
- }
- catch (configuration::InvalidName& )
- {
- OSL_ENSURE(false,"ConfigChangeBroadcastHelper: Could not dispatch notification: context path mismatch");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatchOuter
-(
- rtl::Reference<INodeListener> const& pTarget,
- configuration::AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- TreeManager * pSource
-)
-{
- { (void)_aTargetPath; }
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( configuration::Path::hasPrefix( _aChangeLocation, _aTargetPath) );
-
- pTarget->nodeChanged(rBaseChange, _aChangeLocation, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatch(TreeChangeList const& rList_, sal_Bool _bError, TreeManager * pSource)
-{
- dispatch(rList_.root, rList_.getRootNodePath(),_bError, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-namespace
-{
- struct DispatchTarget
- {
- DispatchTarget(rtl::Reference<INodeListener> _pTarget, configuration::AbsolutePath const* _pDispatchPath)
- : pTarget(_pTarget), pDispatchPath( _pDispatchPath) {}
-
- rtl::Reference<INodeListener> pTarget;
- configuration::AbsolutePath const* pDispatchPath;
- };
-}
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatch
-(
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool _bError,
- TreeManager * pSource
-)
-{
- OSL_ENSURE(!_aChangeLocation.isRoot(),"Cannot dispatch changes directly to the root node");
-
- // listeners registered under multiple sub-pathes will be called multiple times !
-
- // Collect the targets
- osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
-
- // Dispatch listeners to ancestors of the change root
- std::vector<DispatchTarget> aOuterTargets;
- if (_aChangeLocation.getDepth() > 1)
- {
- configuration::AbsolutePath const aModulePath( configuration::Path::Rep(*_aChangeLocation.begin()) );
-
- PathMap::const_iterator itOuter = m_aPathMap.lower_bound( aModulePath );
- PathMap::const_iterator const endOuter = m_aPathMap.upper_bound(_aChangeLocation.getParentPath());
-
- // TODO: Both loops are so similar - they should be a single function
- while (itOuter != endOuter)
- {
- OSL_ASSERT( m_aListeners.find(itOuter->second->get()) != m_aListeners.end() );
-
- // check whether this should be dispatched at all
- if ( configuration::Path::hasPrefix(_aChangeLocation,itOuter->first) )
- {
- aOuterTargets.push_back( DispatchTarget(itOuter->second->get(), &itOuter->first) );
- }
- ++itOuter;
- }
- }
-
- // Dispatch listeners to descendants of the change root
- std::vector<DispatchTarget> aInnerTargets;
- {
- PathMap::const_iterator itInner = m_aPathMap.lower_bound(_aChangeLocation);
-
- while( itInner != m_aPathMap.end() && configuration::Path::hasPrefix(itInner->first,_aChangeLocation) )
- {
- OSL_ASSERT( m_aListeners.find(itInner->second->get()) != m_aListeners.end() );
-
- aInnerTargets.push_back( DispatchTarget(itInner->second->get(), &itInner->first) );
-
- ++itInner;
- }
- }
-
- aGuard.clear();
-
- {for (std::vector<DispatchTarget>::const_iterator it = aOuterTargets.begin(); it != aOuterTargets.end(); ++it){
- this->dispatchOuter(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
- {for (std::vector<DispatchTarget>::const_iterator it = aInnerTargets.begin(); it != aInnerTargets.end(); ++it){
- this->dispatchInner(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::disposing(TreeManager * pSource)
-{
- osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
- m_aPathMap.clear();
-
- aGuard.clear();
- m_aListeners.disposing(pSource);
-}
-
-} // namespace
-
-
-
diff --git a/configmgr/source/api/confsvccomponent.cxx b/configmgr/source/api/confsvccomponent.cxx
deleted file mode 100644
index 90ed466dbf9d..000000000000
--- a/configmgr/source/api/confsvccomponent.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "confsvccomponent.hxx"
-#include "datalock.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <osl/mutex.hxx>
-#include "utility.hxx"
-
-#include <map>
-
-namespace configmgr {
-
-
- ServiceComponentImpl::ServiceComponentImpl(ServiceImplementationInfo const* aInfo)
- : ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >(UnoApiLock::getLock())
- , m_info(aInfo)
- {
- }
-
- void ServiceComponentImpl::disposing()
- {
- ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >::disposing();
- }
- void ServiceComponentImpl::checkAlive() throw (uno::RuntimeException)
- {
- checkAlive("Object was disposed");
- }
- void ServiceComponentImpl::checkAlive(rtl::OUString const& sMessage) throw (uno::RuntimeException)
- {
- if (rBHelper.bDisposed)
- throw lang::DisposedException(sMessage, *this);
- }
-
- // XTypeProvider
- uno::Sequence<sal_Int8> ServiceComponentImpl::getStaticImplementationId(ServiceImplementationInfo const* pServiceInfo)
- throw(uno::RuntimeException)
- {
- static osl::Mutex aMapMutex;
- static std::map<ServiceImplementationInfo const*, ::cppu::OImplementationId> aIdMap;
-
- osl::MutexGuard aMapGuard(aMapMutex);
- return aIdMap[pServiceInfo].getImplementationId();
- }
-
- uno::Sequence<sal_Int8> SAL_CALL ServiceComponentImpl::getImplementationId()
- throw(uno::RuntimeException)
- {
- return getStaticImplementationId(m_info);
- }
-
- // XServiceInfo
- rtl::OUString SAL_CALL ServiceComponentImpl::getImplementationName( ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).getImplementationName();
- }
-
- sal_Bool SAL_CALL ServiceComponentImpl::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).supportsService( ServiceName );
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames( ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).getSupportedServiceNames( );
- }
-
- //ServiceComponentImpl::
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/accessimpl.cxx b/configmgr/source/api2/accessimpl.cxx
deleted file mode 100644
index 4b8936129b1a..000000000000
--- a/configmgr/source/api2/accessimpl.cxx
+++ /dev/null
@@ -1,804 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "accessimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "propertyinfohelper.hxx"
-#include "treeiterators.hxx"
-#include "attributes.hxx"
-#include "apitypes.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
-
-//-----------------------------------------------------------------------------------
-// Constructors
-//-----------------------------------------------------------------------------------
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implGetHierarchicalName( NodeAccess& rNode ) throw(uno::RuntimeException)
-{
- // RTL_LOGFILE_CONTEXT(aLog, "Configmgr::API::implGetHierarchicalName()");
-
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree());
-
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(lock.getNode());
- sRet = aFullPath.toString();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
- configuration::NodeRef aNode( lock.getNode() );
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
-
- configuration::RelativePath const aAddedPath = configuration::validateRelativePath(sRelativeName, aTree, aNode);
-
- // TODO: add (relative) name validation based on node type - may then need provider lock
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedPath);
-
- sRet = aFullPath.toString();
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(1);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& sElementName )
- throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
- configuration::NodeRef aNode( lock.getNode() );
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
-
- configuration::Path::Component const aAddedName = configuration::validateElementPathComponent(sElementName, aTree, aNode);
-
- // TODO: add (relative) name validation based on node type - may then need provider lock
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedName);
-
- sRet = aFullPath.toString();
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(1);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------------
-// for group nodes
-uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
-{
- rNode.checkAlive();
- // group nodes have a mix of types
- // TODO(?): Discover single common type
- return ::getCppuType( static_cast< uno::Any const*>(0) );
-}
-
-// for set nodes
-uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
-{
- uno::Type aRet;
- try
- {
- GuardedNodeData<NodeSetInfoAccess> lock( rNode );
-
- aRet = rNode.getElementInfo()->getInstanceType();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- return aRet;
-}
-
-//-----------------------------------------------------------------------------------
-// for group nodes
-sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
-{
- // rNode.checkAlive();
-// return true; // group nodes always have children
-
-// Better: cater for the case where we are reaching the depth limit
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode ); // no provider lock needed
-
- rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
- configuration::NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree->hasElements(aThisNode) );
- return aThisTree->hasChildren(aThisNode);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-// for set nodes
-sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode ); // provider lock needed
-
- rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
- configuration::NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree->hasChildren(aThisNode) );
- return aThisTree->hasElements(aThisNode);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------------------------------------------
-namespace internal
-{
- struct SearchExactName : private configuration::NodeVisitor
- {
- protected:
- // warning: order dependency
- configuration::RelativePath aSearchPath;
- std::vector<configuration::Path::Component>::reverse_iterator pSearchComponent;
- public:
- explicit
- SearchExactName(const configuration::RelativePath& aLookFor)
- : aSearchPath(aLookFor)
- , pSearchComponent(aSearchPath.begin_mutate())
- {}
-
- bool complete() { return aSearchPath.end_mutate() == pSearchComponent; }
-
- bool search(configuration::NodeRef const& aNode, rtl::Reference< configuration::Tree > const& aTree);
-
- configuration::RelativePath const& getBestMatch() const { return aSearchPath; }
-
- private:
- bool findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree);
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const&); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const&); // NodeVisitor
- };
-//..................................................................................................................
- bool SearchExactName::findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree)
- {
- OSL_ASSERT( !complete() );
-
- if ( !aNode.isValid() ) return false;
-
- // exact match ?
- if (!configuration::hasChildOrElement(aTree,aNode,*pSearchComponent))
- {
- if (aTree->dispatchToChildren(aNode,*this) == CONTINUE) // not found there
- return false;
- }
- OSL_ASSERT(configuration::hasChildOrElement(aTree,aNode,*pSearchComponent));
-
- if (! configuration::findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
- aNode = configuration::NodeRef(); // will stop recursion (value or unloaded element found)
- ++pSearchComponent;
-
- return true;
- }
- //..................................................................................................................
- // helper
- static configuration::Path::Component getExtendedNodeName(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, rtl::OUString const& aSimpleNodeName)
- {
- OSL_PRECOND( !configuration::isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires valid tree" );
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match tree" );
-
- if (aTree->isRootNode(aNode))
- return aTree->getExtendedRootName();
-
- else
- return configuration::Path::wrapSimpleName(aSimpleNodeName);
- }
- //..................................................................................................................
- configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- OSL_ASSERT( aNode.isValid() );
- OSL_ASSERT( !complete() );
-
- // find inexact match (the first one, but the order is unspecified)
- // TODO: Add support for node-type-specific element names
- rtl::OUString aNodeName = aTree->getSimpleNodeName(aNode.getOffset());
- rtl::OUString aSearchName = pSearchComponent->getName();
- if (aNodeName.equalsIgnoreAsciiCase(aSearchName))
- {
- *pSearchComponent = getExtendedNodeName(aTree,aNode,aNodeName);
- return DONE; // for this level
- }
- else
- return CONTINUE;
- }
- //..................................................................................................................
- configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const&, configuration::ValueRef const& aNode)
- {
- OSL_ASSERT( aNode.isValid() );
- OSL_ASSERT( !complete() );
-
- // find inexact match (the first one, but the order is unspecified)
- // TODO: Add support for node-type-specific element names
- rtl::OUString aNodeName = aNode.m_sNodeName;
- OSL_ASSERT( configuration::isSimpleName(aNodeName) );
-
- // value refs are group members and thus have to have simple names
- if (aNodeName.equalsIgnoreAsciiCase(pSearchComponent->getName()))
- {
- *pSearchComponent = configuration::Path::wrapSimpleName(aNodeName);
- return DONE; // for this level
- }
- else
- return CONTINUE;
- }
-//..................................................................................................................
- bool SearchExactName::search(configuration::NodeRef const & aNode, rtl::Reference< configuration::Tree > const & aTree)
- {
- if (!aNode.isValid()) return false;
-
- rtl::Reference< configuration::Tree > aSearchTree(aTree);
- configuration::NodeRef aSearchNode(aNode);
-
- while (!complete())
- if (! findMatch(aSearchNode, aSearchTree))
- break;
-
- return complete();
- }
-
-} // namespace internal
-
-//..................................................................................................................
-rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- // here we try to support both tree-fragment-local pathes and simple names (the latter ones are just an instance of the first)
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree(lock.getTree());
- configuration::NodeRef aNode(lock.getNode());
-
- configuration::RelativePath aApproximatePath = configuration::validateRelativePath(rApproximateName,aTree,aNode);
-
- internal::SearchExactName aSearch(aApproximatePath);
-
- aSearch.search(aNode, aTree);
-
- OSL_ENSURE( aSearch.getBestMatch().getDepth() == aApproximatePath.getDepth(),
- "Search for exact names changed number of path components !?");
-
- return aSearch.getBestMatch().toString();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::getExactName: query uses locally invalid Path");
- return rApproximateName;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return rApproximateName;
-}
-
-//..................................................................................................................
-rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
-
- // here we can support only local names
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree(lock.getTree());
- configuration::NodeRef aNode(lock.getNode());
-
- configuration::Path::Component aApproximateName = configuration::validateElementPathComponent(rApproximateName,aTree,aNode);
-
- internal::SearchExactName aSearch(aApproximateName);
-
- aSearch.search(aNode, aTree);
-
- OSL_ENSURE( aSearch.getBestMatch().getDepth() == 1,
- "Search for exact names changed number of path components !?");
-
- return aSearch.getBestMatch().getLocalName().getName();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::getExactName: query uses locally invalid Path");
- return rApproximateName;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return rApproximateName;
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-beans::Property implGetAsProperty(NodeAccess& rNode)
- throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree());
- configuration::NodeRef aNode( lock.getNode());
-
- rtl::OUString aName = aTree->getSimpleNodeName(aNode.getOffset());
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = getUnoInterfaceType();
-
- return helperMakeProperty( aName,aAttributes,aApiType, aTree->hasNodeDefault(aNode) );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return beans::Property();
-}
-// XPropertySetInfo
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode ) throw (uno::RuntimeException)
-{
- CollectPropertyInfo aCollect;
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence( aCollect.list() );
-}
-
-//-----------------------------------------------------------------------------------
-css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(aName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
-
- if (!aChildNode.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property. Property '") );
- sMessage += aName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw css::beans::UnknownPropertyException( sMessage, xContext );
- }
-
- node::Attributes aChildAttributes = aTree->getAttributes(aChildNode);
- uno::Type aApiType = aChildNode.isNode() ? getUnoInterfaceType() : aTree->getUnoType(aChildNode.toValue());
-
- return helperMakeProperty( aChildName,aChildAttributes,aApiType, aTree->hasNodeDefault(aChildNode) );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw css::beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return css::beans::Property();
-}
-
-
-//-----------------------------------------------------------------------------------
-sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name ) throw (uno::RuntimeException)
-{
- return implHasByName(rNode, name);
-}
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// TODO: optimization - cache the node found (for subsequent getByName)
-// TODO: optimization - less locking for group nodes
-//-----------------------------------------------------------------------------------
-sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::OUString aChildName(sName);
-
- return configuration::hasChildOrElement(lock.getTree(), lock.getNode(), aChildName);
- }
-#if OSL_DEBUG_LEVEL > 0
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- OSL_ENSURE(false,"configmgr: BasicAccess::hasByName: Unexpected exception <InvalidName>");
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-#endif
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(sName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Child Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return configapi::makeElement( rNode.getFactory(), aTree, aChildNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-//-----------------------------------------------------------------------------------
-// TODO: optimization - less locking for group nodes
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > implGetElementNames( NodeAccess& rNode ) throw( uno::RuntimeException)
-{
- CollectNodeNames aCollect;
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence( aCollect.list() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// TO DO: optimization - cache the node found for subsequent getByHierarchicalName()
-//-----------------------------------------------------------------------------------
-sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& sHierarchicalName ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
-
- return configuration::getDeepDescendant(aTree, aNode, aRelPath).isValid();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::hasByHierarchicalName: query uses locally invalid Path");
- return false;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetByHierarchicalName(NodeAccess& rNode, const rtl::OUString& sHierarchicalName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- // rtl::OUString aTmpStr(implGetHierarchicalName(rNode));
- // RTL_LOGFILE_CONTEXT_TRACE2(aLog, "Node: %s HierachicalName: %s",RTL_LOGFILE_OU2A(aTmpStr), RTL_LOGFILE_OU2A(sHierarchicalName));
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedNode = configuration::getDeepDescendant( aTree, aNode, aRelPath );
- if (!aNestedNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Descendant Element '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Node ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
- }
-
- OSL_ASSERT(aNode.isValid());
- return configapi::makeElement( rNode.getFactory(), aTree, aNestedNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XPropertyWithState
-//---------------------------------------------------------------------
-css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
- throw (uno::RuntimeException)
-{
- css::beans::PropertyState aRet = css::beans::PropertyState_AMBIGUOUS_VALUE;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- if ( lock.getTree()->isNodeDefault( lock.getNode() ) )
- aRet = css::beans::PropertyState_DEFAULT_VALUE;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- return aRet;
-}
-
-uno::Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
- throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- // not really supported
-
- /* possible, but nor really useful:
- GuardedNodeAccess lock( rNode );
- if (implGetStateAsProperty(rNode) == PropertyState_DEFAULT_VALUE)
- return rNode.getUnoInstance();
- */
-
- return uno::Reference< uno::XInterface >();
-}
-
-
-// set-specific Interfaces
-//-----------------------------------------------------------------------------------
-
-
-// XTemplateContainer
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException)
-{
- GuardedNodeData<NodeSetInfoAccess> lock(rNode);
- return rNode.getElementInfo()->getPathString();
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/accessimpl.hxx b/configmgr/source/api2/accessimpl.hxx
deleted file mode 100644
index b4b7e95f2a0f..000000000000
--- a/configmgr/source/api2/accessimpl.hxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BASEACCESSIMPL_HXX_
-#define CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeSetInfoAccess;
- class NodeGroupInfoAccess;
-
- // XHierarchicalName
- rtl::OUString implGetHierarchicalName(NodeAccess& rNode)
- throw(uno::RuntimeException);
-
- rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
-
- rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- uno::Type implGetElementType(NodeGroupInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- uno::Type implGetElementType(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- sal_Bool implHasElements(NodeGroupInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- sal_Bool implHasElements(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- // XNameAccess
- uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > implGetElementNames(NodeAccess& rNode)
- throw( uno::RuntimeException);
-
- sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- uno::Any implGetByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XExactName
- rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- css::beans::Property implGetAsProperty(NodeAccess& rNode)
- throw(uno::RuntimeException);
-
- // XPropertySetInfo
- uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode )
- throw (uno::RuntimeException);
-
- css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException);
-
- sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name )
- throw (uno::RuntimeException);
-
-
- // XPropertyWithState
- css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
- throw (uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // set-specific interfaces
-
- // XTemplateContainer
- rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/apiaccessobj.cxx b/configmgr/source/api2/apiaccessobj.cxx
deleted file mode 100644
index 9f06806d290c..000000000000
--- a/configmgr/source/api2/apiaccessobj.cxx
+++ /dev/null
@@ -1,290 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apiaccessobj.hxx"
-
-#include "apiserviceinfo.hxx"
-#include "confsvccomponent.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//========================================================================
-//= service infos
-//========================================================================
-/*
-const AsciiServiceName c_aUserContainerServices[] =
-{
- "com.sun.star.configuration.UserAdministration",
- "com.sun.star.configuration.ConfigurationContainer",
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-const AsciiServiceName c_aContainerServices[] =
-{
- "com.sun.star.configuration.ConfigurationContainer",
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-const AsciiServiceName c_aUpdateServices[] =
-{
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-
-const AsciiServiceName c_aAccessServices[] =
-{
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-
-const AsciiServiceName c_aNoServices[] =
-{
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aInnerGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.OInnerGroupInfoAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.OInnerGroupUpdateAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.OInnerSetInfoAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerTreeSetSI =
-{
- "com.sun.star.configuration.configmgr.OInnerTreeSetUpdateAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerValueSetSI =
-{
- "com.sun.star.configuration.configmgr.OInnerValueSetUpdateAccess",
- c_aNoServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aSetElementGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementGroupInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aSetElementGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementGroupUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aSetElementSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementSetInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aSetElementTreeSetSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementTreeSetUpdateAccess",
- c_aContainerServices
-};
-ServiceInfo const aSetElementValueSetSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementValueSetUpdateAccess",
- c_aContainerServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aRootElementGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementGroupInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementGroupUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aRootElementSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementSetInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementTreeSetUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementTreeSetUpdateAccess",
- c_aContainerServices
-};
-ServiceInfo const aRootElementValueSetUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementValueSetUpdateAccess",
- c_aContainerServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aRootElementReadAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementReadAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementUpdateAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aRootElementAdminAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementUserAdminAccess",
- c_aUserContainerServices
-};*/
-
-//========================================================================
-//= service info static members
-//========================================================================
-
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeGroupInfoAccess>::s_pServiceInfo = &aInnerGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeGroupAccess>::s_pServiceInfo = &aInnerGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeSetInfoAccess>::s_pServiceInfo = &aInnerSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeTreeSetAccess>::s_pServiceInfo = &aInnerTreeSetSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeValueSetAccess>::s_pServiceInfo = &aInnerValueSetSI;
-
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeGroupInfoAccess>::s_pServiceInfo = &aSetElementGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeGroupAccess>::s_pServiceInfo = &aSetElementGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeSetInfoAccess>::s_pServiceInfo = &aSetElementSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeTreeSetAccess>::s_pServiceInfo = &aSetElementTreeSetSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeValueSetAccess>::s_pServiceInfo = &aSetElementValueSetSI;
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OReadRootElement<NodeGroupInfoAccess>::s_pServiceInfo = &aRootElementGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeGroupAccess>::s_pServiceInfo = &aRootElementGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OReadRootElement<NodeSetInfoAccess>::s_pServiceInfo = &aRootElementSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeTreeSetAccess>::s_pServiceInfo = &aRootElementTreeSetUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeValueSetAccess>::s_pServiceInfo = &aRootElementValueSetUpdateSI;
-
-
-
-//========================================================================
-//= Instantiations
-//========================================================================
-/*
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template class OInnerElement<NodeGroupInfoAccess>; // OInnerGroupInfoAccess
-template class OInnerElement<NodeGroupAccess>; // OInnerGroupUpdateAccess
-template class OInnerElement<NodeSetInfoAccess>; // OInnerSetInfoAccess
-template class OInnerElement<NodeTreeSetAccess>; // OInnerTreeSetUpdateAccess
-template class OInnerElement<NodeValueSetAccess>; // OInnerValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-template class OSetElement<NodeGroupInfoAccess>; // OSetElementGroupInfoAccess
-template class OSetElement<NodeGroupAccess>; // OSetElementGroupUpdateAccess
-template class OSetElement<NodeSetInfoAccess>; // OSetElementSetInfoAccess
-template class OSetElement<NodeTreeSetAccess>; // OSetElementTreeSetUpdateAccess
-template class OSetElement<NodeValueSetAccess>; // OSetElementValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template class OReadRootElement<NodeGroupInfoAccess>; // ORootElementGroupInfoAccess
-template class OUpdateRootElement<NodeGroupAccess>; // ORootElementGroupUpdateAccess
-template class OReadRootElement<NodeSetInfoAccess>; // ORootElementSetInfoAccess
-template class OUpdateRootElement<NodeTreeSetAccess>; // ORootElementTreeSetUpdateAccess
-template class OUpdateRootElement<NodeValueSetAccess>; // ORootElementValueSetUpdateAccess
-*/
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apiaccessobj.hxx b/configmgr/source/api2/apiaccessobj.hxx
deleted file mode 100644
index dc2bf7e107da..000000000000
--- a/configmgr/source/api2/apiaccessobj.hxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ACCESSOBJECTS_HXX_
-#define CONFIGMGR_API_ACCESSOBJECTS_HXX_
-
-#include "apitreeaccess.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "noderef.hxx"
-
-#include "apiserviceinfo.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OInnerElement : public InnerElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- uno::XInterface* m_pUnoThis;
- ApiTreeImpl& m_rTree;
- configuration::NodeRef m_aNode;
- public:
- inline OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode);
- inline ~OInnerElement();
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OSetElement : public SetElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- mutable ApiTreeImpl m_aTree;
- public:
- OSetElement(uno::XInterface* pUnoThis, rtl::Reference< configuration::Tree > const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
- : m_aTree(pUnoThis, rProvider,aTree,pParentTree)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OReadRootElement : public RootElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
- mutable ApiRootTreeImpl m_aRootTree;
- public:
- OReadRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aRootTree(pUnoThis, rProvider,aTree, _xOptions)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline ApiRootTreeImpl& getRootTree();
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
- //-------------------------------------------------------------------------
-
- template <class NodeClass>
- class OUpdateRootElement : public UpdateRootElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- mutable ApiRootTreeImpl m_aRootTree;
- public:
- OUpdateRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aRootTree(pUnoThis, rProvider,aTree,_xOptions)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline ApiRootTreeImpl& getRootTree();
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
- }
-}
-//-----------------------------------------------------------------------------
-#include "apiaccessobj.inl"
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_API_ACCESSOBJECTS_HXX_
diff --git a/configmgr/source/api2/apiaccessobj.inl b/configmgr/source/api2/apiaccessobj.inl
deleted file mode 100644
index 5cdb54ae6802..000000000000
--- a/configmgr/source/api2/apiaccessobj.inl
+++ /dev/null
@@ -1,260 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-
-//========================================================================
-//= member functions
-//========================================================================
-
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-OInnerElement<NodeClass>::OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
-: m_pUnoThis(pUnoThis)
-, m_rTree(rTree)
-, m_aNode(aNode)
-{
- m_rTree.setNodeInstance(aNode,pUnoThis);
- m_rTree.getUnoInstance()->acquire();
-}
-
-template <class NodeClass>
-OInnerElement<NodeClass>::~OInnerElement()
-{
- m_rTree.getUnoInstance()->release();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OInnerElement<NodeClass>::doGetNode() const
-{
- return m_aNode;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OInnerElement<NodeClass>::getApiTree() const
-{
- return m_rTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OInnerElement<NodeClass>::doGetUnoInstance() const
-{
- return m_pUnoThis;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OInnerElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OInnerElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OSetElement<NodeClass>::doGetNode() const
-{
- return m_aTree.getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OSetElement<NodeClass>::getApiTree() const
-{
- return m_aTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OSetElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aTree.getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OSetElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OSetElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Read-only Root Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OReadRootElement<NodeClass>::doGetNode() const
-{
- return m_aRootTree.getApiTree().getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OReadRootElement<NodeClass>::getApiTree() const
-{
- return m_aRootTree.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiRootTreeImpl& OReadRootElement<NodeClass>::getRootTree()
-{
- return m_aRootTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OReadRootElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aRootTree.getApiTree().getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OReadRootElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OReadRootElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Update Root Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OUpdateRootElement<NodeClass>::doGetNode() const
-{
- return m_aRootTree.getApiTree().getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OUpdateRootElement<NodeClass>::getApiTree() const
-{
- return m_aRootTree.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiRootTreeImpl& OUpdateRootElement<NodeClass>::getRootTree()
-{
- return m_aRootTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OUpdateRootElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aRootTree.getApiTree().getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//========================================================================
-//= Instantiations
-//========================================================================
-/*
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template class OInnerElement<NodeGroupInfoAccess>; // OInnerGroupInfoAccess
-template class OInnerElement<NodeGroupAccess>; // OInnerGroupUpdateAccess
-template class OInnerElement<NodeSetInfoAccess>; // OInnerSetInfoAccess
-template class OInnerElement<NodeTreeSetAccess>; // OInnerTreeSetUpdateAccess
-template class OInnerElement<NodeValueSetAccess>; // OInnerValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-template class OSetElement<NodeGroupInfoAccess>; // OSetElementGroupInfoAccess
-template class OSetElement<NodeGroupAccess>; // OSetElementGroupUpdateAccess
-template class OSetElement<NodeSetInfoAccess>; // OSetElementSetInfoAccess
-template class OSetElement<NodeTreeSetAccess>; // OSetElementTreeSetUpdateAccess
-template class OSetElement<NodeValueSetAccess>; // OSetElementValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template class OReadRootElement<NodeGroupInfoAccess>; // ORootElementGroupInfoAccess
-template class OUpdateRootElement<NodeGroupAccess>; // ORootElementGroupUpdateAccess
-template class OReadRootElement<NodeSetInfoAccess>; // ORootElementSetInfoAccess
-template class OUpdateRootElement<NodeTreeSetAccess>; // ORootElementTreeSetUpdateAccess
-template class OUpdateRootElement<NodeValueSetAccess>; // ORootElementValueSetUpdateAccess
-*/
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apifactory.cxx b/configmgr/source/api2/apifactory.cxx
deleted file mode 100644
index 5e338431822e..000000000000
--- a/configmgr/source/api2/apifactory.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apifactory.hxx"
-#include "objectregistry.hxx"
-
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-
-#include "noderef.hxx"
-#include "anynoderef.hxx"
-
-#include "configexcept.hxx"
-#include "configset.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-ObjectRegistry::~ObjectRegistry()
-{
- OSL_ENSURE(m_aMap.empty(),"WARNING: Configuration Object Map: Some Objects were not revoked correctly");
-}
-
-//-----------------------------------------------------------------------------
-
-Factory::Factory(rtl::Reference<ObjectRegistry> pRegistry)
-: m_pRegistry(pRegistry)
-, m_aTunnelID()
-{
- OSL_ENSURE(pRegistry.is(), "ERROR: Factory requires a Object Registry");
-}
-//-----------------------------------------------------------------------------
-
-Factory::~Factory()
-{
-}
-//-----------------------------------------------------------------------------
-inline
-NodeElement* Factory::implFind(configuration::NodeID const& aNode)
-{
- return m_pRegistry->findElement(aNode);
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::doRegisterElement(configuration::NodeID const& aNode, NodeElement* pElement)
-{
- m_pRegistry->registerElement(aNode,pElement);
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::doRevokeElement(configuration::NodeID const& aNode, NodeElement* pElement)
-{
- m_pRegistry->revokeElement(aNode,pElement);
-}
-//-----------------------------------------------------------------------------
-
-ApiTreeImpl& Factory::getImplementation(NodeElement& rElement)
-{
- return rElement.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-inline
-rtl::Reference<configuration::Template> Factory::implGetSetElementTemplate(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- rtl::Reference<configuration::Template> aRet;
- if (configuration::isSetNode(aTree,aNode))
- {
- aRet = aTree->extractElementInfo(aNode);
- }
- else if (!configuration::isGroupNode(aTree,aNode))
- {
- OSL_ENSURE( !configuration::isStructuralNode(aTree,aNode), "ERROR: Configuration: unknown kind of object");
- throw configuration::Exception("INTERNAL ERROR: Cannot create template - Unexpected node type");
- }
- return aRet;
-}
-//-----------------------------------------------------------------------------
-inline
-uno::Reference< uno::XInterface > Factory::implToUno(NodeElement* pElement)
-{
- if ( pElement )
- return uno::Reference< uno::XInterface >(pElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- else
- return uno::Reference< uno::XInterface >();
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::implHaveNewElement(configuration::NodeID aNodeID, NodeElement* pElement)
-{
- OSL_ENSURE(pElement ,"WARNING: New API object could not be created");
-
- if (pElement)
- {
- doRegisterElement(aNodeID,pElement);
- OSL_ENSURE(implFind(aNodeID) == pElement,"WARNING: New API object could not be registered with its factory");
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- return implToUno(makeElement(aTree,aNode));
-}
-//-----------------------------------------------------------------------------
-NodeElement* Factory::makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- OSL_PRECOND( !configuration::isEmpty(aTree.get()) == aNode.isValid(), "ERROR: Configuration: Making element from tree requires valid node");
- if (configuration::isEmpty(aTree.get()))
- return 0;
-
- OSL_PRECOND( aNode.isValid() && aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
- OSL_PRECOND( configuration::isStructuralNode(aTree,aNode), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aNode);
- NodeElement* pRet = findElement(aNodeID);
- if (pRet == 0)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aNode);
-
- if (!aTree->isRootNode(aNode))
- {
- pRet = doCreateGroupMember(aTree,aNode,aTemplate.get());
- }
- else
- {
- rtl::Reference< configuration::ElementTree > aElementTree(dynamic_cast< configuration::ElementTree * >(aTree.get()));
- if (aElementTree.is())
- {
- pRet = doCreateSetElement(aElementTree,aTemplate.get());
- }
- else
- {
- OSL_ENSURE(configuration::isEmpty(aTree->getContextTree()),"INTERNAL ERROR: Found tree (not a set element) with a parent tree.");
- pRet = doCreateAccessRoot(aTree,aTemplate.get(), vos::ORef< OOptions >());
- }
- }
- implHaveNewElement(aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::findUnoElement(configuration::NodeID const& aNodeID)
-{
- return implToUno(findElement(aNodeID));
-}
-//-----------------------------------------------------------------------------
-NodeElement* Factory::findElement(configuration::NodeID const& aNodeID)
-{
- NodeElement* pReturn = implFind(aNodeID);
- if (pReturn) pReturn->getUnoInstance()->acquire();
- return pReturn;
-}
-//-----------------------------------------------------------------------------
-
-void Factory::revokeElement(configuration::NodeID const& aNodeID)
-{
- if (NodeElement* pElement = implFind(aNodeID))
- doRevokeElement(aNodeID, pElement);
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* Factory::makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions)
-{
- OSL_PRECOND( !configuration::isEmpty(aTree.get()) , "ERROR: Configuration: Making element from tree requires valid tree");
- if (configuration::isEmpty(aTree.get())) return 0;
-
- OSL_ENSURE(configuration::isEmpty(aTree->getContextTree()),"INTERNAL ERROR: Tree with parent tree should not be used for an access root");
- OSL_ENSURE(dynamic_cast< configuration::ElementTree * >(aTree.get()) == 0, "INTERNAL ERROR: Element Tree should not be used for an access root");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- OSL_PRECOND( configuration::isStructuralNode(aTree,aRoot), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a tree element if it is a tree root
- TreeElement* pRet = static_cast<TreeElement*>(findElement(aNodeID));
- if (0 == pRet)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
- vos::ORef<OOptions> xOptions = new OOptions(_aOptions);
- pRet = doCreateAccessRoot(aTree,aTemplate.get(), xOptions);
- implHaveNewElement (aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- uno::Reference< uno::XInterface > aRet = implToUno(makeSetElement(aElementTree));
- OSL_ENSURE( uno::Reference<lang::XUnoTunnel>::query(aRet).is(),"ERROR: API set element has no UnoTunnel");
- OSL_ENSURE( uno::Reference<lang::XUnoTunnel>::query(aRet).is() &&
- 0 != uno::Reference<lang::XUnoTunnel>::query(aRet)->getSomething(doGetElementTunnelID()),
- "ERROR: API set element does not support the right tunnel ID");
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::makeSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_PRECOND( aElementTree.is() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElementTree.is()) return 0;
-
- rtl::Reference< configuration::Tree > aTree(aElementTree.get());
- OSL_ENSURE(!configuration::isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- OSL_ENSURE( configuration::isStructuralNode(aTree,aRoot), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a set element if it wraps a ElementTree
- SetElement* pRet = static_cast<SetElement*>( findElement(aNodeID) );
- if (0 == pRet)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
-
- pRet = doCreateSetElement(aElementTree,aTemplate.get());
-
- implHaveNewElement(aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::findSetElement(rtl::Reference< configuration::ElementTree > const& aElement)
-{
- OSL_PRECOND( aElement.is() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElement.is()) return 0;
-
- rtl::Reference< configuration::Tree > aTree(aElement.get());
- OSL_ENSURE(!isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a set element if it wraps a ElementTree
- SetElement* pRet = static_cast<SetElement*>( findElement(aNodeID) );
-
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::extractSetElement(uno::Any const& aElement)
-{
- SetElement* pTunneledImpl = 0;
-
- uno::Reference< lang::XUnoTunnel > xElementTunnel;
- if ( aElement.hasValue() && (aElement >>= xElementTunnel) )
- {
- OSL_ASSERT( xElementTunnel.is() );
-
- sal_Int64 nSomething = xElementTunnel->getSomething(doGetElementTunnelID());
- if (0 != nSomething)
- {
- void* pVoid = reinterpret_cast<void*>(nSomething);
- pTunneledImpl = static_cast<SetElement*>(pVoid);
- }
- }
- return pTunneledImpl;
-}
-//-----------------------------------------------------------------------------
-
-bool Factory::tunnelSetElement(sal_Int64& nSomething, SetElement& rElement, uno::Sequence< sal_Int8 > const& aTunnelID)
-{
- if (aTunnelID == doGetElementTunnelID())
- {
- void* pVoid = &rElement;
- nSomething = reinterpret_cast<sal_Int64>(pVoid);
-
- return true;
- }
- else
- return false;
-}
-
-//-----------------------------------------------------------------------------
-
-ApiTreeImpl const* Factory::findDescendantTreeImpl(configuration::NodeID const& aNode, ApiTreeImpl const* pImpl)
-{
- ApiTreeImpl* pRet = 0;
- if (pImpl)
- {
- if ( NodeElement* pElement = pImpl->getFactory().implFind( aNode ) )
- pRet = &pElement->getApiTree();
- }
- return pRet;
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apifactory.hxx b/configmgr/source/api2/apifactory.hxx
deleted file mode 100644
index ff5de1296712..000000000000
--- a/configmgr/source/api2/apifactory.hxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#define CONFIGMGR_API_FACTORY_HXX_
-
-#include "options.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <rtl/ref.hxx>
-#include <vos/ref.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
- class NodeID;
- class NodeRef;
- class ElementTree;
- class Template;
- class Tree;
- }
- namespace configapi
- {
- namespace uno = com::sun::star::uno;
-
- class ApiTreeImpl;
- class NodeElement;
- class InnerElement;
- class TreeElement;
- class SetElement;
- class RootElement;
-
- // used to register objects
- class ObjectRegistry;
-
- // used to create UNO objects
- class Factory : private boost::noncopyable
- {
- rtl::Reference<ObjectRegistry> m_pRegistry;
- cppu::OImplementationId const m_aTunnelID;
-
- private:
- /// return the element _without_ acquiring it
- NodeElement* implFind(configuration::NodeID const& aNode);
-
- public:
- Factory(rtl::Reference<ObjectRegistry> pRegistry);
- virtual ~Factory();
-
- uno::Reference< uno::XInterface > makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- uno::Reference< uno::XInterface > findUnoElement(configuration::NodeID const& aNode);
-
- uno::Reference< uno::XInterface > makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
-
- NodeElement* makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- NodeElement* findElement(configuration::NodeID const& aNode);
-
- TreeElement* makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions);
- SetElement* makeSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
-
- SetElement* findSetElement(rtl::Reference< configuration::ElementTree > const& aElement);
-
- /// check for the existence of an element
- sal_Bool hasElement(configuration::NodeID const& _rNode) { return NULL != implFind(_rNode); }
-
- void revokeElement(configuration::NodeID const& aNode);
-
- SetElement* extractSetElement(uno::Any const& aElement);
- bool tunnelSetElement(sal_Int64& nSomething, SetElement& rElement, uno::Sequence< sal_Int8 > const& aTunnelID);
- // registry operations
-
- static ApiTreeImpl const* findDescendantTreeImpl(configuration::NodeID const& aNode, ApiTreeImpl const* pImpl);
- protected:
- void doRegisterElement(configuration::NodeID const& aNode, NodeElement* pElement);
- void doRevokeElement(configuration::NodeID const& aNode, NodeElement* pElement);
-
- uno::Sequence< sal_Int8 > doGetElementTunnelID() const { return m_aTunnelID.getImplementationId(); }
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate) = 0;
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions) = 0;
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate) = 0;
-
- static ApiTreeImpl& getImplementation(NodeElement& pElement);
- private:
- static rtl::Reference<configuration::Template> implGetSetElementTemplate(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- static uno::Reference< uno::XInterface > implToUno(NodeElement* pNode);
- void implHaveNewElement(configuration::NodeID aNodeID, NodeElement* pNode);
- };
-
- }
-}
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
diff --git a/configmgr/source/api2/apifactoryimpl.cxx b/configmgr/source/api2/apifactoryimpl.cxx
deleted file mode 100644
index 4d355a4bbb8c..000000000000
--- a/configmgr/source/api2/apifactoryimpl.cxx
+++ /dev/null
@@ -1,352 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apifactoryimpl.hxx"
-
-#include "setobjects.hxx"
-#include "groupobjects.hxx"
-
-#include "configset.hxx"
-#include "configpath.hxx"
-#include "template.hxx"
-#include "noderef.hxx"
-#include "objectregistry.hxx"
-#include "attributes.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-// class ReadOnlyObjectFactory
-//-----------------------------------------------------------------------------
-
-ReadOnlyObjectFactory::ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
-: Factory(pRegistry)
-, m_rProvider(rProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-ReadOnlyObjectFactory::~ReadOnlyObjectFactory()
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeElement* ReadOnlyObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a group member without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create a group member without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create a group member");
- OSL_ENSURE(!aTree->isRootNode(aNode), "ERROR: trying to create a group member on a root node");
- if (aTree->isRootNode(aNode))
- return 0;
-
- NodeElement* pRootElement = makeElement(aTree,aTree->getRootNode());
- OSL_ENSURE(pRootElement, "Could not create root element of tree - cannot create group member object");
- if (!pRootElement)
- return 0;
-
- uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
-
- NodeElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- OInnerGroupInfo * pNewObject = new OInnerGroupInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerSetInfo * pNewObject = new OInnerSetInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* ReadOnlyObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
-
- TreeElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- ORootElementGroupInfo * pNewObject = new ORootElementGroupInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementSetInfo * pNewObject = new ORootElementSetInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-SetElement* ReadOnlyObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
-
- rtl::Reference< configuration::Tree > aTree( aElementTree.get() );
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a set element object without a tree");
-
- ApiTreeImpl * pParentContext = 0;
- uno::Reference<uno::XInterface> aParentRelease;
-
- rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
- if (!configuration::isEmpty(aParentTree.get()))
- {
- //configuration::NodeRef aParentNode = aTree.getContextNode();
- configuration::NodeRef aParentRoot = aParentTree->getRootNode();
- if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
- {
- aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- pParentContext = &getImplementation(*pParentRootElement);
- }
- }
-
- SetElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class UpdateObjectFactory
-//-----------------------------------------------------------------------------
-
-UpdateObjectFactory::UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
-: Factory(pRegistry)
-, m_rProvider(rProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-UpdateObjectFactory::~UpdateObjectFactory()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool UpdateObjectFactory::implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create an object without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create an object without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create an object");
-
- return aTree->getAttributes(aNode).isReadonly();
-}
-//-----------------------------------------------------------------------------
-
-NodeElement* UpdateObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a group member without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create a group member without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create a group");
-
- NodeElement* pRootElement = makeElement(aTree,aTree->getRootNode());
- OSL_ENSURE(pRootElement, "Could not create root element of tree - cannot create group member object");
- if (!pRootElement)
- return 0;
-
- uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
-
- NodeElement * pResult = 0;
-
- if (implIsReadOnly(aTree,aNode))
- {
- if (!pSetElementTemplate)
- {
- OInnerGroupInfo * pNewObject = new OInnerGroupInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerSetInfo * pNewObject = new OInnerSetInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- OInnerGroupUpdate * pNewObject = new OInnerGroupUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- OInnerValueSetUpdate * pNewObject = new OInnerValueSetUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerTreeSetUpdate * pNewObject = new OInnerTreeSetUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* UpdateObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
-
- TreeElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree->getRootNode()))
- {
- OSL_ENSURE(false, "WARNING: Trying to create an 'Update Access' on a read-only tree/node");
- if (!pSetElementTemplate)
- {
- ORootElementGroupInfo * pNewObject = new ORootElementGroupInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementSetInfo * pNewObject = new ORootElementSetInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- ORootElementGroupUpdate * pNewObject = new ORootElementGroupUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- ORootElementValueSetUpdate * pNewObject = new ORootElementValueSetUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementTreeSetUpdate * pNewObject = new ORootElementTreeSetUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
-
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-SetElement* UpdateObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
-
- rtl::Reference< configuration::Tree > aTree( aElementTree.get() );
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a set element object without a tree");
-
- ApiTreeImpl * pParentContext = 0;
- uno::Reference<uno::XInterface> aParentRelease;
-
- rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
- if (!configuration::isEmpty(aParentTree.get()))
- {
- //configuration::NodeRef aParentNode = aTree.getContextNode();
- configuration::NodeRef aParentRoot = aParentTree->getRootNode();
- if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
- {
- aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- pParentContext = &getImplementation(*pParentRootElement);
- }
- }
-
- SetElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree->getRootNode()))
- {
- if (!pSetElementTemplate)
- {
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- OSetElementGroupUpdate * pNewObject = new OSetElementGroupUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- OSetElementValueSetUpdate * pNewObject = new OSetElementValueSetUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementTreeSetUpdate * pNewObject = new OSetElementTreeSetUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/apifactoryimpl.hxx b/configmgr/source/api2/apifactoryimpl.hxx
deleted file mode 100644
index 7f9408dd60f2..000000000000
--- a/configmgr/source/api2/apifactoryimpl.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORYIMPL_HXX_
-#define CONFIGMGR_API_FACTORYIMPL_HXX_
-
-#include "apifactory.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
- class ApiProvider;
- // used to create UNO objects
- class ReadOnlyObjectFactory : public Factory
- {
- ApiProvider& m_rProvider;
- public:
- ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
- ~ReadOnlyObjectFactory();
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate);
- };
- // used to create UNO objects
- class UpdateObjectFactory : public Factory
- {
- ApiProvider& m_rProvider;
- public:
- UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
- ~UpdateObjectFactory();
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate);
- private:
- bool implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- };
-
- }
-}
-
-#endif // CONFIGMGR_API_FACTORYIMPL_HXX_
diff --git a/configmgr/source/api2/apinodeaccess.cxx b/configmgr/source/api2/apinodeaccess.cxx
deleted file mode 100644
index 1c064efadec4..000000000000
--- a/configmgr/source/api2/apinodeaccess.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apinodeaccess.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "apifactory.hxx"
-
-#include "apitreeaccess.hxx"
-#include "noderef.hxx"
-
-#include "anynoderef.hxx"
-#include "valueref.hxx"
-
-#include "configset.hxx"
-#include "configpath.hxx"
-#include "confignotifier.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
-NodeAccess::~NodeAccess()
-{
-}
-//-----------------------------------------------------------------------------
-
-configuration::NodeRef NodeAccess::getNodeRef() const
-{
- return doGetNode();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > NodeAccess::getTreeRef() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > NodeAccess::getTree() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
-
-void NodeAccess::checkAlive() const
-{
- getApiTree().checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-void NodeAccess::disposeNode()
-{
- getApiTree().disposeNode(getNodeRef(), getUnoInstance());
-}
-//-----------------------------------------------------------------------------
-
-
-Factory& NodeAccess::getFactory() const
-{
- return getApiTree().getFactory();
-}
-//-----------------------------------------------------------------------------
-
-Notifier NodeAccess::getNotifier() const
-{
- return getApiTree().getNotifier();
-}
-
-//-----------------------------------------------------------------------------
-
-uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::AnyNodeRef const& aNode)
-{
- if (!configuration::isEmpty(aTree.get()) && aNode.isValid())
- {
- if (aNode.isNode())
- {
- configuration::NodeRef aInnerNode = aNode.toNode();
-
- if (configuration::isStructuralNode(aTree,aInnerNode))
- return uno::makeAny( rFactory.makeUnoElement(aTree,aInnerNode) );
-
- else
- return configuration::getSimpleElementValue(aTree,aInnerNode);
- }
- else
- {
- return configuration::getSimpleValue(aTree,aNode.toValue());
- }
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-uno::Any makeInnerElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- if (!configuration::isEmpty(aTree.get()) && aNode.isValid())
- {
- OSL_ENSURE(configuration::isStructuralNode(aTree,aNode), "Trying to makeInnerElement for a simple value");
-
- return uno::makeAny( rFactory.makeUnoElement(aTree,aNode) );
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree)
-{
- if (aTree.is())
- {
- return uno::makeAny( rFactory.makeUnoSetElement(aTree) );
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::ElementTree > extractElementTree(configapi::Factory& rFactory, uno::Any const& aElement, rtl::Reference< configuration::Template > const& aTemplate )
-{
- OSL_ENSURE(aTemplate.is(), "ERROR: Need a template to extract a matching set element");
-
- if (SetElement* pSetElement = rFactory.extractSetElement(aElement))
- {
- rtl::Reference<configuration::Template> aFoundTemplate = pSetElement->getTemplateInfo();
- if (aFoundTemplate.is())
- {
- if (aFoundTemplate != aTemplate)
- throw configuration::TypeMismatch(aFoundTemplate->getPathString(), aTemplate->getPathString());
-
- return pSetElement->getElementRef( );
- }
- }
- return rtl::Reference< configuration::ElementTree >();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Template > NodeSetInfoAccess::getElementInfo() const
-{
- rtl::Reference<configuration::Template> aTemplate = getTree()->extractElementInfo(getNodeRef());
-
- OSL_ENSURE(aTemplate.is(), "ERROR: Set must have an element template");
-
- return aTemplate;
-}
-
-}
-}
diff --git a/configmgr/source/api2/apinodeaccess.hxx b/configmgr/source/api2/apinodeaccess.hxx
deleted file mode 100644
index 39ad1b120f05..000000000000
--- a/configmgr/source/api2/apinodeaccess.hxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NODEACCESS_HXX_
-#define CONFIGMGR_API_NODEACCESS_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "datalock.hxx"
-#include "utility.hxx"
-#include "noderef.hxx"
-
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
- namespace configuration
- {
- class AnyNodeRef;
- class NodeRef;
- class Tree;
- }
- namespace configapi
- {
- class Factory;
- class Notifier;
- class SetElement;
-
- class ApiTreeImpl;
-
- namespace uno = com::sun::star::uno;
-
- // API object implementation wrappers
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // The common part of all nodes, provides all you need to read and listen
- class NodeAccess : private boost::noncopyable
- {
- public:
- virtual ~NodeAccess();
-
- // model access
- configuration::NodeRef getNodeRef() const;
- rtl::Reference< configuration::Tree > getTreeRef() const;
- rtl::Reference< configuration::Tree > getTree() const;
-
- // self-locked methods for dispose handling
- void checkAlive() const;
- void disposeNode();
-
- // api object handling
- uno::XInterface* getUnoInstance() const
- { return doGetUnoInstance(); }
- Factory& getFactory() const;
- Notifier getNotifier() const;
-
- protected:
- virtual configuration::NodeRef doGetNode() const = 0;
- virtual uno::XInterface* doGetUnoInstance() const = 0;
- virtual ApiTreeImpl& getApiTree() const = 0;
- };
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing node <var>aNode</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::AnyNodeRef const& aNode);
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing inner node <var>aNode</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeInnerElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing set element <var>aElement</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree);
-
-
- // Info interfaces for Group Nodes
- class NodeGroupInfoAccess : public NodeAccess
- {
- public:
- // currently only used for tagging group nodes
- };
-
- // Info interfaces for Set Nodes
- class NodeSetInfoAccess : public NodeAccess
- {
- friend class SetElement;
- public:
- rtl::Reference< configuration::Template > getElementInfo() const;
- };
-
- /** extracts a <type scope='configmgr::configuration'>ElementTree</type> from a <type scope='com::sun::star::uno'>Any</type>
- which must contain an object which wraps an instance of the template available in <var>aTemplate</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to resolve inner nodes (which may suppose that the object was created using the same factory)</p>
- <p> returns an empty tree if <var>aElement</var> is empty.</p>
- <p> May throw exceptions if the type doesn't match the template.</p>
- */
- rtl::Reference< configuration::ElementTree > extractElementTree(Factory& rFactory, uno::Any const& aElement, rtl::Reference< configuration::Template > const& aTemplate );
-
- /// wraps a NodeAccess; provides both object and provider (read) locks,
- // ensures object was not disposed
- template <class Access>
- class GuardedNodeData
- {
- UnoApiLock m_aLock;
- Access & m_rNode;
- public:
- GuardedNodeData(Access& rNode);
- public:
- Access& get() const { return m_rNode; }
-
- rtl::Reference< configuration::Tree > getTree() const;
- configuration::NodeRef getNode() const;
- };
-
- template <class Access>
- GuardedNodeData<Access>::GuardedNodeData(Access& rNode)
- : m_rNode(rNode)
- {
- rNode.checkAlive();
- }
-
- template <class Access>
- rtl::Reference< configuration::Tree > GuardedNodeData<Access>::getTree() const
- {
- return m_rNode.getTree();
- }
-
- template <class Access>
- configuration::NodeRef GuardedNodeData<Access>::getNode() const
- {
- return m_rNode.getNodeRef();
- }
- }
-}
-
-#endif // CONFIGMGR_API_NODEACCESS_HXX_
diff --git a/configmgr/source/api2/apinodeupdate.cxx b/configmgr/source/api2/apinodeupdate.cxx
deleted file mode 100644
index 9251520bbe05..000000000000
--- a/configmgr/source/api2/apinodeupdate.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apinodeupdate.hxx"
-#include "apitreeimplobj.hxx"
-#include "apitreeaccess.hxx"
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "configgroup.hxx"
-#include "configpath.hxx"
-#include "apifactory.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
-NodeGroupAccess& withDefaultData(NodeGroupAccess& _aGroup)
-{
- configuration::GroupDefaulter::ensureDataAvailable(_aGroup.getTreeRef(),_aGroup.getNodeRef(),
- _aGroup.getApiTree().getDefaultProvider());
- return _aGroup;
-}
-//-----------------------------------------------------------------------------
-
-configuration::GroupUpdater NodeGroupAccess::getNodeUpdater()
-{
- return configuration::GroupUpdater(getTree(),getNodeRef(), getApiTree().getProvider().getTypeConverter());
-}
-//-----------------------------------------------------------------------------
-
-configuration::GroupDefaulter NodeGroupAccess::getNodeDefaulter()
-{
- return configuration::GroupDefaulter(getTree(),getNodeRef(), getApiTree().getDefaultProvider());
-}
-//-----------------------------------------------------------------------------
-
-configuration::SetElementFactory NodeTreeSetAccess::getElementFactory()
-{
- configuration::TemplateProvider aProvider = configuration::SetElementFactory::findTemplateProvider(getTree(),getNodeRef());
- return configuration::SetElementFactory(aProvider);
-}
-//-----------------------------------------------------------------------------
-
-configuration::SetDefaulter NodeSetAccess::getNodeDefaulter()
-{
- return configuration::SetDefaulter(getTree(),getNodeRef(), getApiTree().getDefaultProvider());
-}
-//-----------------------------------------------------------------------------
-
-configuration::TreeSetUpdater NodeTreeSetAccess::getNodeUpdater()
-{
- return configuration::TreeSetUpdater(getTree(),getNodeRef(),getElementInfo());
-}
-//-----------------------------------------------------------------------------
-
-
-configuration::ValueSetUpdater NodeValueSetAccess::getNodeUpdater()
-{
- return configuration::ValueSetUpdater(getTree(),getNodeRef(),getElementInfo(), getApiTree().getProvider().getTypeConverter());
-}
-//-----------------------------------------------------------------------------
-
-void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement)
-{
- OSL_ENSURE( configuration::NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- configuration::NodeID(rtl::Reference< configuration::Tree >(aElement.getTreeRef()->getContextTree()),aElement.getTreeRef()->getContextNodeRef()),
- "ERROR: Attaching an unrelated SetElement to a SetInfoAccess");
-
- aElement.haveNewParent(&aSet);
-}
-//-----------------------------------------------------------------------------
-
-bool attachSetElement(NodeTreeSetAccess& aSet, rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_ENSURE( configuration::NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- configuration::NodeID(rtl::Reference< configuration::Tree >(aElementTree->getContextTree()), aElementTree->getContextNodeRef()),
- "ERROR: Attaching an unrelated ElementTree to a SetInfoAccess");
-
- Factory& rFactory = aSet.getFactory();
- if (SetElement* pSetElement = rFactory.findSetElement(aElementTree))
- {
- // the factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- attachSetElement(aSet, *pSetElement);
- return true;
- }
- else
- return false;
-
-}
-//-----------------------------------------------------------------------------
-
-void detachSetElement(SetElement& aElement)
-{
- OSL_ENSURE( configuration::isEmpty(aElement.getTreeRef()->getContextTree()),
- "ERROR: Detaching a SetElement that has a parent");
-
- aElement.haveNewParent(0);
-}
-//-----------------------------------------------------------------------------
-
-bool detachSetElement(Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_ENSURE( configuration::isEmpty(aElementTree->getContextTree()),
- "ERROR: Detaching an ElementTree that has a parent");
-
- if (SetElement* pSetElement = rFactory.findSetElement(aElementTree))
- {
- // the factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- detachSetElement(*pSetElement);
- return true;
- }
- else
- return false;
-
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::UpdateGuardImpl(NodeGroupAccess& rNode)
-: m_rNode(rNode)
-{
- rNode.checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::UpdateGuardImpl(NodeSetAccess& rNode)
-: m_rNode(rNode)
-{
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::~UpdateGuardImpl() throw ()
-{
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apinodeupdate.hxx b/configmgr/source/api2/apinodeupdate.hxx
deleted file mode 100644
index 23c5a32257c9..000000000000
--- a/configmgr/source/api2/apinodeupdate.hxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NODEUPDATE_HXX_
-#define CONFIGMGR_API_NODEUPDATE_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "apinodeaccess.hxx"
-#include "utility.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
- class GroupUpdater;
- class GroupDefaulter;
- class TreeSetUpdater;
- class ValueSetUpdater;
- class SetDefaulter;
- class SetElementFactory;
-
- class NodeUpdate;
- }
- namespace configapi
- {
- class SetElement;
-
- // API object implementation wrappers
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // Updating access for Group Nodes
- class NodeGroupAccess : public NodeGroupInfoAccess
- {
- public:
- typedef configuration::GroupUpdater NodeUpdater;
- typedef configuration::GroupDefaulter NodeDefaulter;
- NodeUpdater getNodeUpdater();
- NodeDefaulter getNodeDefaulter();
-
- /** ensures that the default data for a group is loaded (if possible)
- <p>Must be called outside of any locks !</p>
- */
- friend NodeGroupAccess& withDefaultData(NodeGroupAccess& aGroup);
- };
-
- // Updating access for Set Nodes
- class NodeSetAccess : public NodeSetInfoAccess
- {
- public:
- typedef struct SetUpdater_PlaceHolder NodeUpdater;
- typedef configuration::SetDefaulter NodeDefaulter;
- NodeDefaulter getNodeDefaulter();
- };
-
- // Updating access for Set Nodes containing whole trees
- class NodeTreeSetAccess : public NodeSetAccess
- {
- public:
- typedef configuration::TreeSetUpdater NodeUpdater;
- NodeUpdater getNodeUpdater();
-
- configuration::SetElementFactory getElementFactory();
- };
-
- // Updating access for Set Nodes containing simple values
- class NodeValueSetAccess : public NodeSetAccess
- {
- public:
- typedef configuration::ValueSetUpdater NodeUpdater;
- NodeUpdater getNodeUpdater();
- };
-
- /// informs a <type>SetElement</type> that it should now link to the given SetElement
- void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement);
-
- /// informs a <type>SetElement</type> that it should now link to the given SetElement
- bool attachSetElement(NodeTreeSetAccess& aSet, rtl::Reference< configuration::ElementTree > const& aElementTree);
-
- /// informs a <type>SetElement</type> that it should now unlink from its owning SetElement
- void detachSetElement(SetElement& aElement);
-
- /// informs a <type>SetElement</type> that it should now unlink from its owning SetElement
- bool detachSetElement(Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aElementTree);
-
- /// Guarding and locking implementations
- /// guards a NodeGroupAccess, or NodeSetAccess; provides an object (write)/provider(read) lock; ensures object was not disposed
- class UpdateGuardImpl : private boost::noncopyable
- {
- NodeAccess& m_rNode;
- public:
- UpdateGuardImpl(NodeGroupAccess& rNode);
- UpdateGuardImpl(NodeSetAccess& rNode);
- ~UpdateGuardImpl() throw ();
- public:
- NodeAccess& get() const { return m_rNode; }
-
- void downgrade() { }
- };
-
- // Thin Wrappers around NodeAccesses: Provide guarding and convenient access
- /// wraps a NodeAccess; provides an object (write)/provider(read) lock, ensures object was not disposed
- template <class Access>
- class GuardedNodeUpdate
- {
- UnoApiLock m_aLock;
- UpdateGuardImpl m_aImpl;
- public:
- GuardedNodeUpdate(Access& rNode) : m_aImpl(rNode) {}
- public:
- Access& get() const { return static_cast<Access&>(m_aImpl.get()); }
-
- rtl::Reference< configuration::Tree > getTree() const;
- configuration::NodeRef getNode() const;
-
- typename Access::NodeUpdater getNodeUpdater() const;
- typename Access::NodeDefaulter getNodeDefaulter() const;
-
- void clearForBroadcast() { m_aImpl.downgrade(); }
- };
-
- template <class Access>
- rtl::Reference< configuration::Tree > GuardedNodeUpdate<Access>::getTree() const
- {
- return get().getTree();
- }
-
- template <class Access>
- configuration::NodeRef GuardedNodeUpdate<Access>::getNode() const
- {
- return get().getNodeRef();
- }
-
- template <class Access>
- typename Access::NodeUpdater GuardedNodeUpdate<Access>::getNodeUpdater() const
- {
- return get().getNodeUpdater();
- }
-
- template <class Access>
- typename Access::NodeDefaulter GuardedNodeUpdate<Access>::getNodeDefaulter() const
- {
- return get().getNodeDefaulter();
- }
- }
-}
-
-#endif // CONFIGMGR_API_NODEUPDATE_HXX_
diff --git a/configmgr/source/api2/apinotifierimpl.cxx b/configmgr/source/api2/apinotifierimpl.cxx
deleted file mode 100644
index 2bffaef03381..000000000000
--- a/configmgr/source/api2/apinotifierimpl.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "confignotifier.hxx"
-#include "configexcept.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
-
-// Generic Notifier Support Implementations
-//-----------------------------------------------------------------------------------
-
-/// add a Listener to the notifier of a NodeAccess
-template <class Listener>
-inline
-void genericAddListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
-{
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- aGuardedNotifier->add(rNode.getNodeRef(), xListener);
-}
-
-/// remove a Listener from the notifier of a NodeAccess
-template <class Listener>
-inline
-void genericRemoveListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
-{
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- aGuardedNotifier->remove(rNode.getNodeRef(), xListener);
-}
-
-
-/** add a Listener for all or some children of a NodeAccess to its notifier
- <p> If the name given is empty, the listener will be added to all children of the node</p>
- @returns
- <TRUE/> if the node was found, or the name was empty
- <FALSE/> if the named node wasn't found
-*/
-template <class Listener>
-inline
-bool genericAddChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
-{
- if (sName.getLength() != 0)
- {
- GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
- configuration::NodeRef aNode( aGuardedNode.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- if (!aTree->hasChild(aNode,aChildName)) return false;
-
- aGuardedNotifier->addForOne(aNode, xListener, aChildName);
- }
- else
- {
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- aGuardedNotifier->addForAll(rNode.getNodeRef(), xListener);
-
- // always ok, as we addreess no specific NodeRef
- }
- return true;
-}
-
-/** remove a Listener from all or some children of a NodeAccess to its notifier
- <p> If the name given is empty, the listener will be removed from any children of the node</p>
- @returns
- <TRUE/> if the node was found, or the name was empty
- <FALSE/> if the named node wasn't found
-*/
-template <class Listener>
-inline
-bool genericRemoveChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
-{
- if (sName.getLength() != 0)
- {
- GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
- configuration::NodeRef aNode( aGuardedNode.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- if (!aTree->hasChild(aNode,aChildName)) return false;
-
- aGuardedNotifier->removeForOne(aNode, xListener, aChildName);
- }
- else
- {
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- aGuardedNotifier->removeForAll(rNode.getNodeRef(), xListener);
-
- // always ok, as we addreess no specific NodeRef
- }
- return true;
-}
-
-
-
-// XComponent
-//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XContainer
-//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XChangesNotifier
-//-----------------------------------------------------------------------------------
-
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
-
- GuardedNotifier impl( rNode );
-
- // TODO: is an exception for unknown names allowed/needed ?
- impl->add(rNode.getNodeRef(), xListener, aPropertyNames);
-}
-
-
-void implRemoveListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XPropertySet (manages listeners associated with named child node)
-//-----------------------------------------------------------------------------------
-
-// XPropertySet - VetoableChangeListeners
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericAddChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XPropertySet - PropertyChangeListeners
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericAddChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/apinotifierimpl.hxx b/configmgr/source/api2/apinotifierimpl.hxx
deleted file mode 100644
index c5ca7217aad1..000000000000
--- a/configmgr/source/api2/apinotifierimpl.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
-#include <com/sun/star/container/XChild.hpp>
-#endif
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the event notification interfaces
- supported by a node within the configuration tree.
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeSetInfoAccess;
- class NodeGroupInfoAccess;
-
- // Notification support
-
- // XComponent
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- // XContainer
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XPropertySet - VetoableChangeListeners
- void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertySet
- void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- void implAddListener( NodeAccess& rNode, const uno::Reference< css::beans::XPropertiesChangeListener >& xListener, const uno::Sequence< rtl::OUString >& sPropertyNames )
- throw(uno::RuntimeException);
-
- void implRemoveListener( NodeAccess& rNode, const uno::Reference< css::beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/apiserviceinfo.cxx b/configmgr/source/api2/apiserviceinfo.cxx
deleted file mode 100644
index 4aed033127e4..000000000000
--- a/configmgr/source/api2/apiserviceinfo.cxx
+++ /dev/null
@@ -1,337 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "apiserviceinfo.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//========================================================================
-//= service names
-//========================================================================
-
-//========================================================================
-//= service infos
-//========================================================================
-
-//-- ACCESS (CONTAINER) ROLES -----------------------------
-
-#define CFG_SVCLIST_SETACCESS \
- "com.sun.star.configuration.ConfigurationAccess", \
- "com.sun.star.configuration.SetAccess", \
- "com.sun.star.configuration.HierarchyAccess", \
- "com.sun.star.configuration.SimpleSetAccess"
-
-#define CFG_SVCLIST_GROUPACCESS \
- "com.sun.star.configuration.ConfigurationAccess", \
- "com.sun.star.configuration.GroupAccess", \
- "com.sun.star.configuration.HierarchyAccess", \
- "com.sun.star.configuration.PropertyHierarchy"
-
-#define CFG_SVCLIST_SETUPDATE \
- "com.sun.star.configuration.ConfigurationUpdateAccess", \
- "com.sun.star.configuration.SetUpdate", \
- "com.sun.star.configuration.SimpleSetUpdate", \
- "com.sun.star.configuration.ConfigurationContainer", /* Obsolete */ \
- CFG_SVCLIST_SETACCESS
-
-#define CFG_SVCLIST_GROUPUPDATE \
- "com.sun.star.configuration.ConfigurationUpdateAccess", \
- "com.sun.star.configuration.GroupUpdate", \
- CFG_SVCLIST_GROUPACCESS
-
-//-- ELEMENT ROLES ----------------------------------------
-
-#define CFG_SVCLIST_SETELEMENT \
- "com.sun.star.configuration.SetElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_GROUPELEMENT \
- "com.sun.star.configuration.GroupElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_ACCESSROOTELEMENT \
- "com.sun.star.configuration.AccessRootElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_UPDATEROOTELEMENT \
- "com.sun.star.configuration.UpdateRootElement", \
- CFG_SVCLIST_ACCESSROOTELEMENT
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aNoServices[] =
-{
- NULL
-};
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aCreateAccessServiceNames[] =
-{
- "com.sun.star.configuration.ConfigurationAccess",
- "com.sun.star.configuration.HierarchyAccess",
- "com.sun.star.configuration.HierarchyElement",
- NULL
-};
-
-sal_Char const * const c_aCreateUpdateServiceNames[] =
-{
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- "com.sun.star.configuration.HierarchyAccess",
- "com.sun.star.configuration.HierarchyElement",
- NULL
-};
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aUserAdministrationServices[] =
-{
- "com.sun.star.configuration.UserAdministration",
- "com.sun.star.configuration.SimpleSetUpdate",
- "com.sun.star.configuration.SimpleSetAccess",
- "com.sun.star.configuration.ConfigurationContainer", // Obsolete
- NULL
-};
-
-sal_Char const * const c_aGroupAdministrationServices[] =
-{
- "com.sun.star.configuration.GroupAdministration",
- "com.sun.star.configuration.SimpleSetUpdate",
- "com.sun.star.configuration.SimpleSetAccess",
- "com.sun.star.configuration.ConfigurationContainer", // Obsolete
- NULL
-};
-
-//-- ROLE COMBINATIONS ------------------
-
-//-- GroupElements
-
-sal_Char const * const c_aInnerGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-//-- SetElements
-
-sal_Char const * const c_aSetElementGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-//-- RootElements
-
-sal_Char const * const c_aRootGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_ACCESSROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_UPDATEROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_ACCESSROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_UPDATEROOTELEMENT,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aInnerGroupInfoSI =
-{
- "com.sun.star.comp.configuration.OInnerGroupInfoAccess",
- c_aInnerGroupAccessServices,
- NULL
-};
-ServiceImplementationInfo const aInnerGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.OInnerGroupUpdateAccess",
- c_aInnerGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aInnerSetInfoSI =
-{
- "com.sun.star.comp.configuration.OInnerSetInfoAccess",
- c_aInnerSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aInnerTreeSetSI =
-{
- "com.sun.star.comp.configuration.OInnerTreeSetUpdateAccess",
- c_aInnerSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aInnerValueSetSI =
-{
- "com.sun.star.comp.configuration.OInnerValueSetUpdateAccess",
- c_aInnerSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aSetElementGroupInfoSI =
-{
- "com.sun.star.comp.configuration.OSetElementGroupInfoAccess",
- c_aSetElementGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.OSetElementGroupUpdateAccess",
- c_aSetElementGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementSetInfoSI =
-{
- "com.sun.star.comp.configuration.OSetElementSetInfoAccess",
- c_aSetElementSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementTreeSetSI =
-{
- "com.sun.star.comp.configuration.OSetElementTreeSetUpdateAccess",
- c_aSetElementSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementValueSetSI =
-{
- "com.sun.star.comp.configuration.OSetElementValueSetUpdateAccess",
- c_aSetElementSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aRootElementGroupInfoSI =
-{
- "com.sun.star.comp.configuration.ORootElementGroupInfoAccess",
- c_aRootGroupAccessServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementGroupUpdateAccess",
- c_aRootGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementSetInfoSI =
-{
- "com.sun.star.comp.configuration.ORootElementSetInfoAccess",
- c_aRootSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementTreeSetUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementTreeSetUpdateAccess",
- c_aRootSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementValueSetUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementValueSetUpdateAccess",
- c_aRootSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceRegistrationInfo const aCreateReadAccessSI =
-{
- NULL, //"com.sun.star.comp.configuration.ORootElementReadAccess",
- c_aCreateAccessServiceNames
-};
-ServiceRegistrationInfo const aCreateUpdateAccessSI =
-{
- NULL, //"com.sun.star.comp.configuration.ORootElementUpdateAccess",
- c_aCreateUpdateServiceNames
-};
-//-----------------------------------------------------------------------------
-
- }
-}
diff --git a/configmgr/source/api2/apiserviceinfo.hxx b/configmgr/source/api2/apiserviceinfo.hxx
deleted file mode 100644
index 3b529e864547..000000000000
--- a/configmgr/source/api2/apiserviceinfo.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SERVICEINFO_HXX_
-#define CONFIGMGR_API_SERVICEINFO_HXX_
-
-#include "serviceinfohelper.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
- extern sal_Char const * const c_aUserAdministrationServices[];
- extern sal_Char const * const c_aGroupAdministrationServices[];
-
-//-----------------------------------------------------------------------------
- extern ServiceImplementationInfo const aInnerGroupInfoSI;
- extern ServiceImplementationInfo const aInnerGroupUpdateSI;
- extern ServiceImplementationInfo const aInnerSetInfoSI;
- extern ServiceImplementationInfo const aInnerTreeSetSI;
- extern ServiceImplementationInfo const aInnerValueSetSI;
- extern ServiceImplementationInfo const aSetElementGroupInfoSI;
- extern ServiceImplementationInfo const aSetElementGroupUpdateSI;
- extern ServiceImplementationInfo const aSetElementSetInfoSI;
- extern ServiceImplementationInfo const aSetElementTreeSetSI;
- extern ServiceImplementationInfo const aSetElementValueSetSI;
- extern ServiceImplementationInfo const aRootElementGroupInfoSI;
- extern ServiceImplementationInfo const aRootElementGroupUpdateSI;
- extern ServiceImplementationInfo const aRootElementSetInfoSI;
- extern ServiceImplementationInfo const aRootElementTreeSetUpdateSI;
- extern ServiceImplementationInfo const aRootElementValueSetUpdateSI;
-
-//-----------------------------------------------------------------------------
- extern ServiceRegistrationInfo const aCreateReadAccessSI;
- extern ServiceRegistrationInfo const aCreateUpdateAccessSI;
-
-//-----------------------------------------------------------------------------
- }
-}
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_API_SERVICEINFO_HXX_
diff --git a/configmgr/source/api2/apitreeaccess.cxx b/configmgr/source/api2/apitreeaccess.cxx
deleted file mode 100644
index 59fed7215bd3..000000000000
--- a/configmgr/source/api2/apitreeaccess.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apitreeaccess.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "committer.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
- // self-locked methods for dispose handling
-void NodeElement::checkAlive() const
-{
- getApiTree().checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > TreeElement::getTree() const
-{
- return getTreeRef();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > TreeElement::getTreeRef() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
- // self-locked methods for dispose handling
-bool SetElement::disposeTree(bool bForce)
-{
- return getApiTree().disposeTree(bForce);
-}
-//-----------------------------------------------------------------------------
-Factory& TreeElement::getFactory()
-{
- return getApiTree().getFactory();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::ElementTree > SetElement::getElementRef() const
-{
- return dynamic_cast< configuration::ElementTree * >(getTreeRef().get());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Template > SetElement::getTemplateInfo() const
-{
- rtl::Reference< configuration::ElementTree > aTree(dynamic_cast< configuration::ElementTree * >(getTreeRef().get()));
- OSL_ENSURE(aTree.is(), "This really must be a set element");
- return aTree->getTemplate();
-}
-//-----------------------------------------------------------------------------
-
-void SetElement::haveNewParent(NodeSetInfoAccess* pNewParent)
-{
- ApiTreeImpl* pNewParentImpl = pNewParent ? &pNewParent->getApiTree() : 0;
-
- this->getApiTree().haveNewParent( pNewParentImpl );
-}
-//-----------------------------------------------------------------------------
-
-bool RootElement::disposeTree()
-{
- return getRootTree().disposeTree();
-}
-//-----------------------------------------------------------------------------
-
-Committer UpdateRootElement::getCommitter()
-{
- return Committer(getRootTree());
-}
- }
-}
-
diff --git a/configmgr/source/api2/apitreeaccess.hxx b/configmgr/source/api2/apitreeaccess.hxx
deleted file mode 100644
index 4c350779d7d0..000000000000
--- a/configmgr/source/api2/apitreeaccess.hxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TREEACCESS_HXX_
-#define CONFIGMGR_API_TREEACCESS_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-#include "rtl/ref.hxx"
-
-#include "datalock.hxx"
-#include "options.hxx"
-#include "utility.hxx"
-
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- struct ServiceImplementationInfo;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- class ElementTree;
- class Template;
- class Tree;
- }
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- namespace uno = com::sun::star::uno;
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
- class Committer;
- class NodeSetInfoAccess;
-//-----------------------------------------------------------------------------
- // API object implementation wrappers
- //-------------------------------------------------------------------------
- class ApiTreeImpl;
- class ApiRootTreeImpl;
-
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // A common base class for 'element' classes
- class NodeElement: private boost::noncopyable
- {
- public:
- virtual ~NodeElement() {}
-
- // self-locked methods for dispose handling
- void checkAlive() const;
-
- // api object handling
- uno::XInterface* getUnoInstance() const
- { return doGetUnoInstance(); }
-
- ServiceImplementationInfo const * getServiceInfo() const
- { return doGetServiceInfo(); }
- private:
- virtual uno::XInterface* doGetUnoInstance() const = 0;
- virtual ServiceImplementationInfo const* doGetServiceInfo() const = 0;
- virtual ApiTreeImpl& getApiTree() const = 0;
-
- friend class Factory;
- };
-//-----------------------------------------------------------------------------
-
- // A class for tagging inner nodes
- class InnerElement : public NodeElement
- {
- public:
- // Only used as a tag
- };
-//-----------------------------------------------------------------------------
-
- // A common base class for tree-owning elemnt classes
- class TreeElement : public NodeElement
- {
- public:
- // model access
- rtl::Reference< configuration::Tree > getTreeRef() const;
- rtl::Reference< configuration::Tree > getTree() const;
-
- // api object handling
- Factory& getFactory();
-
- protected:
- virtual ApiTreeImpl& getApiTree() const = 0;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class SetElement : public TreeElement
- {
- public:
- // self-locked methods for dispose handling
- bool disposeTree(bool bForceDispose);
-
- void haveNewParent(NodeSetInfoAccess* pNewParent);
-
- rtl::Reference< configuration::ElementTree > getElementRef() const;
- rtl::Reference< configuration::Template > getTemplateInfo() const;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class RootElement : public TreeElement
- {
- public:
- bool disposeTree();
- protected:
- virtual ApiRootTreeImpl& getRootTree() = 0;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class UpdateRootElement : public RootElement
- {
- public:
- Committer getCommitter();
- };
-
- // Thin Wrappers around TreeElements: Provide guarding and convenient access
- /// wraps a TreeElement; provides an object (read) lock, ensures object was not disposed
- class GuardedTreeElement {
- UnoApiLock m_aLock;
- TreeElement & m_rTree;
-
- public:
- explicit GuardedTreeElement(TreeElement & rTree): m_rTree(rTree)
- { rTree.checkAlive(); }
-
- TreeElement & get() const { return m_rTree; }
- };
-
- class GuardedRootElement {
- UnoApiLock m_aLock;
- RootElement & m_rTree;
-
- public:
- explicit GuardedRootElement(RootElement & rTree): m_rTree(rTree)
- { rTree.checkAlive(); }
-
- RootElement & get() const { return m_rTree; }
- };
- }
-}
-
-#endif // CONFIGMGR_API_TREEACCESS_HXX_
diff --git a/configmgr/source/api2/apitreeimplobj.cxx b/configmgr/source/api2/apitreeimplobj.cxx
deleted file mode 100644
index e74c142c1b91..000000000000
--- a/configmgr/source/api2/apitreeimplobj.cxx
+++ /dev/null
@@ -1,1001 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "apitreeimplobj.hxx"
-#include "confignotifier.hxx"
-#include "notifierimpl.hxx"
-#include "apifactory.hxx"
-#include "apitreeaccess.hxx"
-#include "nodechangeinfo.hxx"
-#include "broadcaster.hxx"
-#include "change.hxx"
-#include "providerimpl.hxx"
-#include "roottree.hxx"
-#include "noderef.hxx"
-#include "anynoderef.hxx"
-#include "tracer.hxx"
-#include "treemanager.hxx"
-#include <cppuhelper/queryinterface.hxx>
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- namespace lang = ::com::sun::star::lang;
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
-//-----------------------------------------------------------------------------
-class ApiTreeImpl::ComponentAdapter : public lang::XEventListener
-{
- vos::ORefCount m_refs;
-
- ApiTreeImpl* pOwner;
-
- uno::Reference< lang::XComponent > xProvider;
- uno::Reference< lang::XComponent > xParent;
-public:
- ComponentAdapter(ApiTreeImpl& rParent) : pOwner(&rParent) {}
- virtual ~ComponentAdapter() {}
-
- void clear();
-
- void setProvider(uno::Reference< lang::XComponent > const& xProvider);
- void setParent(uno::Reference< lang::XComponent > const& xParent);
- uno::Reference< lang::XComponent > getProvider() const;
-
-// XEventListener
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-private:
- void setComponent(uno::Reference< lang::XComponent >& rxSlot,uno::Reference< lang::XComponent > const& xComp);
- uno::Reference< lang::XComponent > getComponent(uno::Reference< lang::XComponent > const& rxSlot) const;
-
- virtual uno::Any SAL_CALL queryInterface(uno::Type const& rType) throw();
- virtual void SAL_CALL disposing(com::sun::star::lang::EventObject const& rEvt) throw();
-};
-//-----------------------------------------------------------------------------
-inline
-uno::Reference< lang::XComponent >
- ApiTreeImpl::ComponentAdapter::getComponent(
- uno::Reference< lang::XComponent > const& rxSlot
- ) const
-{
- return rxSlot;
-}
-//-----------------------------------------------------------------------------
-inline
-void ApiTreeImpl::ComponentAdapter::setComponent(
- uno::Reference< lang::XComponent >& rxSlot,
- uno::Reference< lang::XComponent > const& xComp
- )
-{
- UnoApiLockClearable aGuard;
-
- uno::Reference< lang::XComponent > xOld = rxSlot;
- if (xOld != xComp)
- {
- rxSlot = xComp;
-
- aGuard.clear();
-
- if (xOld.is()) try { xOld->removeEventListener(this); } catch (uno::Exception & ) {}
- if (xComp.is()) xComp->addEventListener(this);
- }
-}
-//-----------------------------------------------------------------------------
-uno::Reference< lang::XComponent > ApiTreeImpl::ComponentAdapter::getProvider() const
-{
- return this->getComponent( this->xProvider );
-}
-void ApiTreeImpl::ComponentAdapter::setProvider(uno::Reference< lang::XComponent > const& rProvider)
-{
- this->setComponent( this->xProvider, rProvider);
-}
-void ApiTreeImpl::ComponentAdapter::setParent(uno::Reference< lang::XComponent > const& rParent)
-{
- this->setComponent( this->xParent, rParent);
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::acquire() throw()
-{
- ++m_refs;
-}
-//-------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::release() throw()
-{
- if (--m_refs == 0)
- delete this;
-}
-//-------------------------------------------------------------------------
-
-uno::Any SAL_CALL ApiTreeImpl::ComponentAdapter::queryInterface(uno::Type const& rType) throw()
-{
- return cppu::queryInterface( rType
- , static_cast< com::sun::star::lang::XEventListener*>(this)
- , static_cast< uno::XInterface*>(this)
- );
-}
-//-------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::disposing(com::sun::star::lang::EventObject const& rEvt) throw()
-{
- UnoApiLockClearable aGuard;
-
- if (this->pOwner != NULL)
- {
- CFG_TRACE_INFO("ApiTreeImpl:ComponentAdapter: Providing UNO object is disposed - relaying to my owner");
- // ensure our owner stays alive
- uno::Reference<uno::XInterface> xKeepOwnerAlive( this->pOwner->getUnoInstance() );
- // and we stay alive too
- rtl::Reference< ApiTreeImpl::ComponentAdapter > xKeepAlive( this );
-
- aGuard.clear();
-
- pOwner->disposing( rEvt );
-
- UnoApiLock aClearGuard;
- if (rEvt.Source == this->xParent) this->xParent.clear();
- if (rEvt.Source == this->xProvider) this->xProvider.clear();
- }
- else
- CFG_TRACE_INFO("ApiTreeImpl:ComponentAdapter: Providing UNO object is disposed - but my owner is already gone");
-}
-
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::ComponentAdapter::clear()
-{
- UnoApiLockClearable aGuard;
-
- this->pOwner = 0;
-
- uno::Reference< lang::XComponent > aProvider = this->xProvider;
- uno::Reference< lang::XComponent > aParent = this->xParent;
- this->xProvider = 0;
- this->xParent = 0;
-
- aGuard.clear();
-
- if (aParent.is()) try { aParent ->removeEventListener(this); } catch (uno::Exception & ) {}
- if (aProvider.is()) try { aProvider->removeEventListener(this); } catch (uno::Exception & ) {}
-}
-
-//-----------------------------------------------------------------------------
-class ApiRootTreeImpl::NodeListener : public INodeListener
-{
- ApiRootTreeImpl* pParent;
- TreeManager * pSource;
-
- vos::ORef< OOptions > m_xOptions;
- configuration::AbsolutePath m_aLocationPath;
-public:
- NodeListener(ApiRootTreeImpl& _rParent)
- : pParent(&_rParent)
- , pSource(NULL)
- , m_aLocationPath( configuration::AbsolutePath::root() )
- {}
- ~NodeListener()
- {
- unbind();
- }
-
- TreeManager * getSource()
- {
- UnoApiLock aGuard;
- return pSource;
- }
-
- void setSource(TreeManager * pNew)
- {
- UnoApiLock aGuard;
- if (pParent)
- {
- if (pNew != pSource)
- {
- OSL_ENSURE(m_xOptions.isValid(),"Cannot set IConfigListener without Options");
- if (m_xOptions.isValid())
- {
- if (pSource)
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
-
- pSource = pNew;
- if (pNew)
- {
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Cannot register for notifications: no location set");
- pNew->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
- }
- }
- else
- pSource = 0;
- }
- }
- }
-
- void setLocation(configuration::AbsolutePath const& _aLocation, vos::ORef< OOptions > const& _xOptions)
- {
- OSL_ASSERT(_xOptions.isValid());
-
- UnoApiLock aGuard;
-
- if (pSource && pParent)
- {
- OSL_ASSERT(m_xOptions.isValid());
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
- }
-
- m_aLocationPath = _aLocation;
- m_xOptions = _xOptions;
-
- if (pSource && pParent)
- pSource->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
- }
-
- void unbind()
- {
- UnoApiLock aGuard;
- OSL_ASSERT(pParent == 0);
- pParent = 0;
- if (pSource)
- {
- OSL_ASSERT(m_xOptions.isValid());
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
- m_xOptions.unbind();
- m_aLocationPath = configuration::AbsolutePath::root();
- }
-
- }
-
- void clearParent()
- {
- UnoApiLockClearable aGuard;
- if (pParent)
- {
- pParent = 0;
-
- if (pSource)
- {
- TreeManager * pOrgSource = pSource;
- vos::ORef< OOptions > xOptions = m_xOptions;
-
- pSource = 0;
- m_xOptions.unbind();
- m_aLocationPath = configuration::AbsolutePath::root();
-
- aGuard.clear();
-
- OSL_ASSERT(xOptions.isValid());
- pOrgSource->removeListener(xOptions->getRequestOptions(), this);
- }
- }
- }
-
- // Interfaces
- virtual void disposing(TreeManager * pSource);
- virtual void nodeChanged(Change const& aChange, configuration::AbsolutePath const& sPath, TreeManager * pSource);
- virtual void nodeDeleted(configuration::AbsolutePath const& sPath, TreeManager * pSource);
-};
-
-//-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// API object implementation wrappers
-//-------------------------------------------------------------------------
-ApiProvider::ApiProvider(Factory& rFactory, OProviderImpl& rProviderImpl )
- : m_rFactory(rFactory)
- , m_rProviderImpl(rProviderImpl)
-{}
-//-------------------------------------------------------------------------
-
-uno::Reference<com::sun::star::script::XTypeConverter> ApiProvider::getTypeConverter() const
-{
- return m_rProviderImpl.getTypeConverter();
-}
-//-------------------------------------------------------------------------
-static
-inline
-configuration::DefaultProvider createDefaultProvider(
- ApiProvider& rProvider,
- rtl::Reference< configuration::Tree > const& aTree,
- vos::ORef< OOptions > const& _xOptions
- )
-{
- OProviderImpl& rProviderImpl = rProvider.getProviderImpl();
- rtl::Reference< TreeManager > xDefaultProvider = rProviderImpl.getDefaultProvider();
-
- OSL_ASSERT(_xOptions.isValid());
- RequestOptions const aOptions = _xOptions.isValid() ? _xOptions->getRequestOptions() : RequestOptions();
-
- return configuration::DefaultProvider::create(aTree,aOptions,xDefaultProvider,&rProviderImpl);
-}
-//-------------------------------------------------------------------------
-static
-inline
-configuration::DefaultProvider extractDefaultProvider(ApiTreeImpl* pParentTree)
-{
- if (pParentTree)
- return pParentTree->getDefaultProvider();
-
- else
- return configuration::DefaultProvider::createEmpty();
-}
-//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl* pParentTree)
-: m_aTree(aTree)
-, m_aNotifier(new NotifierImpl(aTree))
-, m_aDefaultProvider(extractDefaultProvider(pParentTree))
-, m_xProvider()
-, m_rProvider(rProvider)
-, m_pParentTree(0)
-, m_pInstance(pInstance)
-{
- OSL_ENSURE(pParentTree == NULL || &rProvider == &pParentTree->m_rProvider,"WARNING: Parent tree has a different provider - trouble may be ahead");
- setNodeInstance(aTree->getRootNode(), pInstance);
- init(pParentTree);
-}
-//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(uno::XInterface* _pInstance, ApiProvider& _rProvider, rtl::Reference< configuration::Tree > const& _aTree, configuration::DefaultProvider const& _aDefaultProvider)
-: m_aTree(_aTree)
-, m_aNotifier(new NotifierImpl(_aTree))
-, m_aDefaultProvider(_aDefaultProvider)
-, m_xProvider()
-, m_rProvider(_rProvider)
-, m_pParentTree(0)
-, m_pInstance(_pInstance)
-{
- setNodeInstance(_aTree->getRootNode(), _pInstance);
- init(NULL);
-}
-//-------------------------------------------------------------------------
-
-ApiTreeImpl::~ApiTreeImpl()
-{
- OSL_ENSURE(m_aNotifier->m_aListeners.isDisposed(),"ApiTree Object was not disposed properly");
- deinit();
-}
-//-------------------------------------------------------------------------
-
-ApiRootTreeImpl::ApiRootTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions > const& _xOptions)
-: m_aTreeImpl(pInstance, rProvider, aTree, createDefaultProvider(rProvider, aTree, _xOptions))
-, m_aLocationPath( configuration::Path::Rep() )
-, m_pNotificationListener(NULL)
-, m_xOptions(_xOptions)
-{
- implSetLocation(aTree);
- enableNotification(true);
-}
-//-------------------------------------------------------------------------
-ApiRootTreeImpl::~ApiRootTreeImpl()
-{
- if (m_pNotificationListener.is())
- {
- m_pNotificationListener->setSource(0);
- m_pNotificationListener->clearParent();
- }
-}
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::setNodeInstance(configuration::NodeRef const& aNode, uno::XInterface* pInstance)
-{
- OSL_ENSURE(aNode.isValid(),"ERROR: adding invalid node to ApiTree");
- OSL_ENSURE(m_aTree->isValidNode(aNode.getOffset()),"ERROR: foreign node being added to ApiTree");
- m_aNotifier->m_aListeners.setObjectAt( configuration::NodeID(m_aTree, aNode).toIndex(), pInstance );
-}
-
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::isAlive() const
-{
- return m_aNotifier->m_aListeners.isAlive();
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::checkAlive() const
-{
- m_aNotifier->m_aListeners.checkAlive( getUnoInstance() );
-}
-
-//-------------------------------------------------------------------------
-
-Notifier ApiTreeImpl::getNotifier() const
-{
- return Notifier(m_aNotifier,this);
-}
-//-------------------------------------------------------------------------
-
-bool ApiRootTreeImpl::enableNotification(bool bEnable)
-{
- TreeManager * pSource = bEnable ? getApiTree().getProvider().getProviderImpl().getNotifier() : 0;
-
- TreeManager * pOld = this->implSetNotificationSource(pSource);
-
- return pOld != 0;
-}
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::disposeTree(bool bForce)
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing Tree (may throw if already disposed)");
-
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepParentAlive(this->getParentComponent());
- // ensure we stay alive too
- uno::Reference<uno::XInterface> xKeepAlive(this->getUnoInstance());
-
- // #109077# If already disposed, we may have no source data or data lock
- if (!isAlive())
- return false;
-
- if (!bForce)
- {
- if (m_pParentTree != 0)
- return false;
-
- // recheck after having the mutex
- checkAlive(); // may throw
- }
- else if (m_pParentTree)
- setParentTree(NULL);
-
- implDisposeTree();
- OSL_ASSERT(!isAlive()); // post condition
-
- return true;
-}
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::disposeTreeNow()
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing Tree Now (unless disposed)");
- if (isAlive() )
- return implDisposeTree();
- else
- return false;
-}
-//-------------------------------------------------------------------------
-bool ApiRootTreeImpl::disposeTree()
-{
- CFG_TRACE_INFO("Api Root Tree: Disposing Tree And Releasing (unless disposed)");
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- bool bDisposed = m_aTreeImpl.disposeTreeNow();
-
- if (bDisposed) releaseData();
-
- if (!m_xOptions.isEmpty())
- {
- OSL_ENSURE(!bDisposed, "Disposing/Releasing should clear the options");
- CFG_TRACE_INFO2("Api Root Tree: data was not released in disposeTree");
- }
-
- return bDisposed;
-}
-//-------------------------------------------------------------------------
-bool ApiTreeImpl::implDisposeTree()
-{
- OSL_ENSURE(m_pParentTree == 0,"WARNING: Disposing a tree that still has a parent tree set");
-
- SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex>& aContainer = m_aNotifier->m_aListeners;
- if (aContainer.beginDisposing())
- {
- CFG_TRACE_INFO("ApiTreeImpl: Tree is now disposed");
-
- Factory& rFactory = getFactory();
-
- std::vector<configuration::NodeID> aChildNodes;
- configuration::getAllContainedNodes( m_aTree, aChildNodes);
-
- for (std::vector<configuration::NodeID>::reverse_iterator it = aChildNodes.rbegin(), stop = aChildNodes.rend();
- it != stop;
- ++it)
- {
- rFactory.revokeElement( *it );
- }
-
- CFG_TRACE_INFO_NI("ApiTreeImpl: Listeners are now informed");
- aContainer.notifyDisposing();
-
- OSL_ASSERT(!aContainer.isDisposed());
-
- CFG_TRACE_INFO_NI("ApiTreeImpl: Deinitializing");
- deinit(); // releases the provider and parent
- aContainer.endDisposing();
-
- OSL_ASSERT(aContainer.isDisposed());
-
- return true;
- }
- else
- {
- CFG_TRACE_INFO("ApiTreeImpl: Tree was already disposed.");
- return false;
- }
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::disposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance)
-{
- // This used to contain 3 nested 'isAlive()' calls; why !?
- if (isAlive())
- implDisposeNode(aNode,pInstance);
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::implDisposeNode(configuration::NodeRef const& aNode, uno::XInterface* )
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing a single node.");
- OSL_ENSURE(aNode.isValid(),"INTERNAL ERROR: Disposing NULL node");
- OSL_ENSURE(m_aTree->isValidNode(aNode.getOffset()),"INTERNAL ERROR: Disposing: node does not match tree");
- OSL_ENSURE( !m_aTree->isRootNode(aNode),"INTERNAL ERROR: Disposing the root node of the tree");
-
- configuration::NodeID aNodeID(m_aTree,aNode);
-
- if (m_aNotifier->m_aListeners.disposeOne(aNodeID.toIndex()) )
- {
- getFactory().revokeElement(aNodeID);
- }
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::init(ApiTreeImpl* pParentTree)
-{
- m_xProvider = new ComponentAdapter(*this);
- m_xProvider->setProvider( this->getProviderComponent() );
-
- OSL_ENSURE(m_xProvider->getProvider().is(),"WARNING: Provider is no Component - Lifetime trouble ahead");
-
- OSL_ASSERT(m_pParentTree == 0);
- setParentTree(pParentTree);
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::deinit()
-{
- setParentTree(0);
-
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
- m_xProvider.clear();
-
- if (xAdapter.is())
- xAdapter->clear();
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::haveNewParent(ApiTreeImpl* pNewParent) // public interface
-{
- setParentTree(pNewParent);
-}
-
-//-------------------------------------------------------------------------
-
-ApiTreeImpl const* ApiTreeImpl::getRootTreeImpl() const
-{
- ApiTreeImpl const* pRet = this;
- while (pRet->m_pParentTree)
- pRet = pRet->m_pParentTree;
-
- return pRet;
-}
-
-//-------------------------------------------------------------------------
-void ApiTreeImpl::setParentTree(ApiTreeImpl* pParentTree) // internal implementation
-{
-#if OSL_DEBUG_LEVEL > 0
- if (pParentTree)
- {
- rtl::Reference< configuration::Tree > aContext = m_aTree->getContextTree();
- rtl::Reference< configuration::Tree > aParent = pParentTree->m_aTree;
-
- configuration::NodeID aContextID( aContext, aContext->getRootNode() );
- configuration::NodeID aParentID( aParent, aParent->getRootNode() );
-
- OSL_ENSURE( aContextID == aParentID, "Parent relationship mismatch !");
- }
-#endif
-
- if (m_pParentTree != pParentTree)
- {
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
-
- m_pParentTree = pParentTree;
-
- uno::Reference<com::sun::star::lang::XComponent> xNew = getParentComponent();
- OSL_ENSURE( xNew.is() == (pParentTree != 0), "WARNING: Parent Tree is no Component");
-
- if (xAdapter.is())
- xAdapter->setParent(xNew);
- else
- OSL_ENSURE( pParentTree == 0, "ERROR: Setting New Parent at deinitialized ApiTreeImpl");
-
- }
-}
-//-------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> ApiTreeImpl::getUnoProviderInstance() const
-{
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
-
- uno::Reference<uno::XInterface> xReturn;
- if (xAdapter.is())
- xReturn = xAdapter->getProvider();
- return xReturn;
-}
-
-//-------------------------------------------------------------------------
-uno::Reference<com::sun::star::lang::XComponent> ApiTreeImpl::getParentComponent()
-{
- uno::XInterface* pInterface = m_pParentTree ? m_pParentTree->getUnoInstance() : 0;
- return uno::Reference<com::sun::star::lang::XComponent>::query(pInterface);
-}
-//-------------------------------------------------------------------------
-
-uno::Reference<com::sun::star::lang::XComponent> ApiTreeImpl::getProviderComponent()
-{
- uno::XInterface* pInterface = m_rProvider.getProviderImpl().getProviderInstance();
- return uno::Reference<com::sun::star::lang::XComponent>::query(pInterface);
-}
-
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::disposing(com::sun::star::lang::EventObject const& ) throw()
-{
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- CFG_TRACE_INFO("ApiTreeImpl: Providing UNO object is disposed - disposing the tree");
-
- // Tree write Lock should be set by sender
-
- CFG_TRACE_INFO_NI("Clearing parent reference");
- setParentTree(0);
-
- CFG_TRACE_INFO_NI("Trying to dispose");
- //implDisposeTree();
- disposeTreeNow();
-
- CFG_TRACE_INFO_NI("Done disposing Tree");
- // uno::Reference<com::sun::star::lang::XComponent> xThis(getUnoInstance(),UNO_QUERY);
- // if (xThis.is()) xThis->dispose();
-}
-//-------------------------------------------------------------------------
-TreeManager * ApiRootTreeImpl::implSetNotificationSource(TreeManager * pNew)
-{
- TreeManager * pOld = m_pNotificationListener.is() ? m_pNotificationListener->getSource() : 0;
- if (pOld != pNew)
- {
- OSL_ENSURE(m_xOptions.isValid(), "Cannot change notification source without options");
-
- if (!m_pNotificationListener.is())
- m_pNotificationListener = new NodeListener(*this);
-
- m_pNotificationListener->setSource(pNew);
-
- }
- return pOld;
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::implSetLocation(rtl::Reference< configuration::Tree > const& _aTree)
-{
- OSL_ASSERT(_aTree == getApiTree().getTree());
- if (!configuration::isEmpty(_aTree.get()))
- {
- m_aLocationPath = _aTree->getRootPath();
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Setting up a root tree without location");
- }
- else
- {
- OSL_ENSURE(false, "Setting up a root tree without data");
- m_aLocationPath = configuration::AbsolutePath::root();
- }
-
- if (!m_pNotificationListener.is())
- m_pNotificationListener = new NodeListener(*this);
-
- OSL_ENSURE(!m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Cannot reregister for notifications: setting empty location");
- OSL_ENSURE( m_xOptions.isValid(), "Cannot reregister for notifications: no options available" );
-
- m_pNotificationListener->setLocation(m_aLocationPath, m_xOptions);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::releaseData()
-{
- CFG_TRACE_INFO("Api Root Tree at %s: releasing the Data",OUSTRING2ASCII(m_aLocationPath.toString()));
- rtl::Reference< configuration::Tree > aTree( m_aTreeImpl.getTree() );
-
- if (aTree.is()) {
- aTree->disposeData();
- }
- OSL_ASSERT(configuration::isEmpty(aTree.get()));
-
- OSL_ENSURE( !m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Location still needed to release data" );
- OSL_ENSURE( m_xOptions.isValid(), "Options still needed to release data" );
-
- getApiTree().getProvider().getProviderImpl().releaseSubtree(m_aLocationPath,m_xOptions->getRequestOptions());
- m_xOptions.unbind();
-
- m_aLocationPath = configuration::AbsolutePath::detachedRoot();
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::NodeListener::disposing(TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->disposing(_pSource);
- }
-}
-void ApiRootTreeImpl::disposing(TreeManager *)
-{
- CFG_TRACE_INFO("Api Root Tree at %s: Cache data is disposed - dispose and release own data",
- OUSTRING2ASCII(m_aLocationPath.toString()));
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- if (m_aTreeImpl.disposeTreeNow())
- releaseData(); // not really needed: the whole data is going away anyways
-}
-// ---------------------------------------------------------------------------------------------------
-
-static
-void disposeOneRemovedNode(configuration::NodeChangeInformation const& aRemoveInfo, Factory& aFactory)
-{
- if (aRemoveInfo.change.element.oldValue.is())
- {
- OSL_ENSURE(aRemoveInfo.change.element.isDataChange(), "ERROR: Disposing replaced element: Element did not really change !");
-
- rtl::Reference< configuration::ElementTree > aElementRef( aRemoveInfo.change.element.oldValue.get() );
-
- SetElement* pSetElement = aFactory.findSetElement(aElementRef );
- if (pSetElement)
- {
- // factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- pSetElement->haveNewParent(0);
- pSetElement->disposeTree(true);
- }
- }
- else
- {
- // This must apply to a node for which no element tree had been loaded in this view
- // thus there should not be one now after the change (even if the change was replacing)
- OSL_ENSURE(!aRemoveInfo.change.element.newValue.is(), "Cannot dispose replaced element: No tree object available");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-static
-void disposeRemovedNodes(configuration::NodeChangesInformation const& aChanges, Factory& aFactory)
-{
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- switch (it->change.type)
- {
- case configuration::NodeChangeData::eReplaceElement:
- // check if element is actually unchanged !
- // (cannot dispose of the tree, if it is still in use)
- if (! it->change.element.isDataChange()) break;
-
- // else dispose the old one: fall thru
-
- case configuration::NodeChangeData::eRemoveElement:
- disposeOneRemovedNode( *it, aFactory );
- break;
-
- default: break;
- }
- }
-}
-// ---------------------------------------------------------------------------------------------------
-//INodeListener : IConfigListener
-void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, configuration::AbsolutePath const& sPath, TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->nodeChanged(aChange,sPath,_pSource);
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-//INodeListener : IConfigListener
-void ApiRootTreeImpl::nodeChanged(Change const& aChange, configuration::AbsolutePath const& aChangePath, TreeManager *)
-{
- // do not dipatch if we are dying/dead anyway
- if (m_aTreeImpl.isAlive())
- try
- {
- rtl::Reference< configuration::Tree > aTree(m_aTreeImpl.getTree());
-
- OSL_ENSURE(configuration::Path::hasPrefix(aChangePath, m_aLocationPath),
- "'changed' Path does not indicate this tree or its context: ");
-
- configuration::RelativePath aLocalChangePath = configuration::Path::stripPrefix(aChangePath,m_aLocationPath);
-
- // find the node and change
- configuration::NodeRef aNode;
-
- if ( !aLocalChangePath.isEmpty() )
- {
- configuration::NodeRef aBaseNode = aTree->getRootNode();
-
-#ifdef DBG_UTIL
- try {
- configuration::RelativePath aLocalPathOld = configuration::validateAndReducePath(aChangePath.toString(), aTree, aBaseNode);
- OSL_ENSURE( configuration::matches(aLocalPathOld,aLocalChangePath),
- "New local path different from validateAndReducePath(...) result in notification dispatch");
- }
- catch (configuration::Exception& e) {
- rtl::OString sMsg("Cannot validate new path handling for notification dispatch: ");
- sMsg += e.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
-#endif // DBG_UTIL
-
- configuration::AnyNodeRef aFoundNode = configuration::getDeepDescendant(aTree, aBaseNode, aLocalChangePath);
- if ( aFoundNode.isValid() )
- {
- if (aFoundNode.isNode())
- {
- aNode = aFoundNode.toNode();
- }
- else
- {
- // TODO: Notify using parent node and temporary dummy change
- OSL_ENSURE( false, "Notification broken: Node being adressed is a Value");
- }
- }
- }
- else
- {
- aNode = aTree->getRootNode();
- }
-
- SubtreeChange const* pTreeChange = NULL;
- if (aNode.isValid())
- {
- pTreeChange = dynamic_cast<SubtreeChange const*>(&aChange);
- OSL_ENSURE(pTreeChange != 0, "Notification broken: Change to inner node is not a subtree change"); // TODO: Notify set change using parent (if available) and temporary dummy change
- }
-
- if (pTreeChange != NULL) // implies aNode.isValid()
- {
- OSL_ENSURE( aChange.getNodeName() == aTree->getSimpleNodeName(aNode.getOffset()),
- "Change's node-name does not match found node's name - erratic notification");
-
- configuration::NodeChangesInformation aChanges;
-
- if (configuration::adjustToChanges(aChanges, aTree,aNode, *pTreeChange))
- {
- OSL_ASSERT(aChanges.size() > 0);
-
- Broadcaster aSender(m_aTreeImpl.getNotifier(),aChanges,false);
-
- // Should be improved later. Maybe this is the wrong lock for disposeTree ?
- // aLocalGuard.downgrade(); // partial clear for broadcast
-
- aSender.notifyListeners(aChanges, false);
-
- disposeRemovedNodes(aChanges, m_aTreeImpl.getFactory());
- }
- }
- }
- catch (configuration::InvalidName& i)
- {
- rtl::OString sMsg("Cannot locate change within this tree: ");
- sMsg += i.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
- catch (configuration::Exception& e)
- {
- rtl::OString sMsg("Unexpected error trying to react on update: ");
- sMsg += e.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::NodeListener::nodeDeleted(configuration::AbsolutePath const& _aPath, TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->nodeDeleted(_aPath,_pSource);
- }
-}
-// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::nodeDeleted(configuration::AbsolutePath const& _aDeletedPath, TreeManager *)
-{
- { (void)_aDeletedPath; }
-
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( m_aTreeImpl.getUnoInstance() );
-
-#ifdef DBG_UTIL
- OSL_ENSURE(configuration::Path::hasPrefix(m_aLocationPath, _aDeletedPath),
- "'deleted' Path does not indicate this tree or its context: ");
-#endif
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- if (m_aTreeImpl.disposeTreeNow())
- releaseData();
-}
-
-// ---------------------------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/apitreeimplobj.hxx b/configmgr/source/api2/apitreeimplobj.hxx
deleted file mode 100644
index 9b93e2c79458..000000000000
--- a/configmgr/source/api2/apitreeimplobj.hxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
-#define CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
-
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "configdefaultprovider.hxx"
-#include "confevents.hxx"
-#include "options.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <vos/ref.hxx>
-#include <rtl/ref.hxx>
-#include <osl/mutex.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class OProviderImpl;
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
- class NotifierImpl;
-//-----------------------------------------------------------------------------
- class ObjectRegistry;
-//-----------------------------------------------------------------------------
-// API object implementation wrappers
-//-------------------------------------------------------------------------
- class ApiProvider: private boost::noncopyable
- {
- Factory& m_rFactory;
- OProviderImpl& m_rProviderImpl;
- public:
- ApiProvider(Factory& rFactory, OProviderImpl& rProviderImpl );
-
- ~ApiProvider()
- {}
-
- uno::Reference<com::sun::star::script::XTypeConverter> getTypeConverter() const;
- Factory& getFactory() { return m_rFactory; }
- OProviderImpl& getProviderImpl() { return m_rProviderImpl; }
- };
-
- //-----------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- class ApiTreeImpl: private boost::noncopyable
- {
- class ComponentAdapter;
-
- rtl::Reference< configuration::Tree > m_aTree;
- vos::ORef<NotifierImpl> m_aNotifier;
- configuration::DefaultProvider m_aDefaultProvider;
- uno::Reference<ComponentAdapter> m_xProvider;
- ApiProvider& m_rProvider;
- ApiTreeImpl* m_pParentTree;
- uno::XInterface* m_pInstance;
-
- public:
- explicit ApiTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl* pParentTree);
- explicit ApiTreeImpl(uno::XInterface* _pInstance, ApiProvider& _rProvider, rtl::Reference< configuration::Tree > const& _aTree, configuration::DefaultProvider const & _aDefaultProvider);
- ~ApiTreeImpl();
-
- // initialization
- void setNodeInstance(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- // model access
- rtl::Reference< configuration::Tree > getTree() const { return m_aTree; }
-
- // self-locked methods for dispose handling
- bool isAlive() const;
- void checkAlive() const;
- bool disposeTree(bool bForce);
- bool disposeTreeNow();
- void disposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- // api object handling
- Factory& getFactory() const { return m_rProvider.getFactory(); }
- Notifier getNotifier() const;
- configuration::DefaultProvider getDefaultProvider() const { return m_aDefaultProvider; }
-
- // needs external locking
- ApiTreeImpl const* getRootTreeImpl() const;
-
- uno::XInterface* getUnoInstance() const { return m_pInstance; }
- ApiProvider& getProvider() { return m_rProvider; }
- uno::Reference<uno::XInterface> getUnoProviderInstance() const; // { return m_xProvider; }
-
- /// wire this to a new parent tree
- void haveNewParent(ApiTreeImpl* pNewParent);
- private:
- void init(ApiTreeImpl* pParentTree);
- void setParentTree(ApiTreeImpl* pNewParentTree);
- void deinit();
-
- bool implDisposeTree();
- void implDisposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- friend class ComponentAdapter;
- void disposing(com::sun::star::lang::EventObject const& rEvt) throw();
- uno::Reference<com::sun::star::lang::XComponent> getProviderComponent();
- uno::Reference<com::sun::star::lang::XComponent> getParentComponent();
-
- };
-
- //-----------------------------------------------------------------------------
- class ApiRootTreeImpl
- {
- public:
- explicit ApiRootTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions > const& _xOptions);
- ~ApiRootTreeImpl();
-
- ApiTreeImpl& getApiTree() { return m_aTreeImpl; }
- ApiTreeImpl const& getApiTree() const { return m_aTreeImpl; }
-
- configuration::AbsolutePath const & getLocation() const { return m_aLocationPath; }
- vos::ORef< OOptions > getOptions() const { return m_xOptions; }
-
- // self-locked methods for dispose handling
- bool disposeTree();
-
- /// toggle whether this object relays notifications from the base provider
- bool enableNotification(bool bEnable);
- private:
- TreeManager * implSetNotificationSource(TreeManager * pNew);
- void implSetLocation(rtl::Reference< configuration::Tree > const& _aTree);
- void releaseData();
-
- private:
- class NodeListener;
- friend class NodeListener;
-
- // IConfigListener
- void disposing(TreeManager * pSource) ;
- //INodeListener : IConfigListener
- void nodeChanged(Change const& aChange, configuration::AbsolutePath const& aPath, TreeManager * pSource);
- void nodeDeleted(configuration::AbsolutePath const& aPath, TreeManager * pSource);
-
- private:
- ApiTreeImpl m_aTreeImpl;
- configuration::AbsolutePath m_aLocationPath;
- rtl::Reference<NodeListener> m_pNotificationListener;
- vos::ORef< OOptions > m_xOptions;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
diff --git a/configmgr/source/api2/broadcaster.cxx b/configmgr/source/api2/broadcaster.cxx
deleted file mode 100644
index 0a3abc01e81d..000000000000
--- a/configmgr/source/api2/broadcaster.cxx
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "broadcaster.hxx"
-#include "notifierimpl.hxx"
-#include "confignotifier.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "translatechanges.hxx"
-#include "apifactory.hxx"
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-#include <vos/refernce.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-// Broadcaster implementation
-// ---------------------------------------------------------------------------------------------------
- class BroadcasterHelper
- {
- public:
- static vos::ORef<NotifierImpl> getImpl(Notifier const& aNotifier) { return aNotifier.m_aImpl; }
- };
-// ---------------------------------------------------------------------------------------------------
-
- namespace
- {
- // -----------------------------------------------------------------------------------------------
- template <class T>
- struct LessORefBodyPtr
- {
- bool operator()(vos::ORef<T> const& lhs, vos::ORef<T> const& rhs) const
- {
- return ptr_less(lhs.getBodyPtr(), rhs.getBodyPtr());
- }
-
- std::less<T*> ptr_less;
- };
- // -----------------------------------------------------------------------------------------------
- class ApiTreeRef
- {
- ApiTreeImpl const* m_pApiTree;
- uno::Reference<uno::XInterface> m_xKeepAlive;
- public:
- explicit ApiTreeRef(ApiTreeImpl const* _pApiTree = NULL)
- : m_pApiTree(_pApiTree)
- , m_xKeepAlive()
- {
- if (m_pApiTree) m_xKeepAlive = m_pApiTree->getUnoInstance();
- }
-
- bool is() const
- {
- OSL_ASSERT(!m_pApiTree == !m_xKeepAlive.is());
- return m_pApiTree != NULL;
- }
-
- ApiTreeImpl const* get() const { return m_pApiTree; }
- ApiTreeImpl const* operator->() const { return m_pApiTree; }
-
- friend bool operator==(ApiTreeRef const& lhs,ApiTreeRef const& rhs)
- { return lhs.m_pApiTree == rhs.m_pApiTree; }
-
- friend bool operator!=(ApiTreeRef const& lhs,ApiTreeRef const& rhs)
- { return lhs.m_pApiTree != rhs.m_pApiTree; }
- };
- // -----------------------------------------------------------------------------------------------
- typedef std::map< vos::ORef<NotifierImpl>, ApiTreeRef, LessORefBodyPtr<NotifierImpl> > NotifierSet;
- // -----------------------------------------------------------------------------------------------
-
- }
-// ---------------------------------------------------------------------------------------------------
-// class Broadcaster::Impl
-// ---------------------------------------------------------------------------------------------------
- class Broadcaster::Impl : public vos::OReference
- {
- private:
- NotifierSet::value_type m_aNotifierData;
- public:
- Impl(NotifierSet::value_type const& aNotifierData) : m_aNotifierData(aNotifierData) {}
-
- NotifierSet::value_type getNotifierData() const { return m_aNotifierData; }
-
- bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChanges const& aChanges, bool bSingleBase) const;
- bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool bSingleBase) const;
-
- void queryConstraints(configuration::NodeChangesInformation const& aChanges) { this->doQueryConstraints(aChanges); }
- void notifyListeners(configuration::NodeChangesInformation const& aChanges) { this->doNotifyListeners(aChanges); }
-
- void notifyRootListeners(configuration::NodeChangesInformation const& aChanges);
-
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChange, bool bLocal);
-
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges) = 0;
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges) = 0;
- };
-// ---------------------------------------------------------------------------------------------------
- namespace
- {
- // -----------------------------------------------------------------------------------------------
-
- class EmptyBroadcaster_Impl : public Broadcaster::Impl
- {
- EmptyBroadcaster_Impl(NotifierSet::value_type const& rNotifierData)
- : Broadcaster::Impl(rNotifierData)
- {
- }
- public:
- static
- vos::ORef< Broadcaster::Impl > create(NotifierSet::value_type const& rRootNotifier)
- {
- return new EmptyBroadcaster_Impl(rRootNotifier);
- }
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- void EmptyBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const&) {}
- void EmptyBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const&) {}
- // -----------------------------------------------------------------------------------------------
-
- class NodeLocalBroadcaster_Impl : public Broadcaster::Impl
- {
- configuration::NodeID aAffectedNode;
-
- public:
- NodeLocalBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID)
- : Broadcaster::Impl(rTreeNotifierData)
- , aAffectedNode(aAffectedID)
- {
- }
-
- configuration::NodeID getAffectedNodeID() const { return aAffectedNode; }
- unsigned int getNodeIndex() const { return aAffectedNode.toIndex(); }
-
- protected:
- void querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore);
- void notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent);
- };
- // -----------------------------------------------------------------------------------------------
-
- class SingleChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
- {
- configuration::SubNodeID m_aChangingValue;
-
- SingleChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedValue);
-
- public:
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangeLocation const& aChange);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangeLocation const& aChange);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::SubNodeID const& aChangedNode,
- configuration::NodeChangeLocation const& aChange);
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- // -----------------------------------------------------------------------------------------------
- class MultiChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
- {
- std::set< configuration::SubNodeID > m_aChangingNodes;
-
- MultiChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes);
-
- public:
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangesInformation const& aChanges);
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
- // -----------------------------------------------------------------------------------------------
- class SingleTreeBroadcaster_Impl : public Broadcaster::Impl
- {
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > m_aBroadcasters;
-
- SingleTreeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters);
-
- public:
- //--------------------------
- static
- vos::ORef< Broadcaster::Impl > create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges);
-
- static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector);
- //--------------------------
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
- // -----------------------------------------------------------------------------------------------
- class MultiTreeBroadcaster_Impl : public Broadcaster::Impl
- {
- std::vector< vos::ORef< Broadcaster::Impl > > m_aBroadcasters;
-
- MultiTreeBroadcaster_Impl(NotifierSet::value_type const& rRootNotifierData, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters);
- public:
- //--------------------------
- static
- vos::ORef< Broadcaster::Impl > create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet const& rNotifiers,
- configuration::NodeChangesInformation const& aChanges);
-
- static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector);
- //--------------------------
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- // -----------------------------------------------------------------------------------------------
-
- inline configuration::NodeID makeRootID( rtl::Reference< configuration::Tree > const& aTree ) { return configuration::NodeID( aTree, aTree->getRootNode() ); }
- inline configuration::NodeID makeRootID( ApiTreeRef const& pTreeImpl ) { return makeRootID( pTreeImpl->getTree() ); }
- // -----------------------------------------------------------------------------------------------
- NotifierSet::value_type findNotifier(configuration::NodeChangeLocation const& aChange, ApiTreeRef const& pTreeImpl)
- {
- OSL_ENSURE(aChange.isValidData(),"Invalid change location - cannot find notifier");
-
- configuration::NodeID aAffectedNode = aChange.getAffectedNodeID();
- if (aAffectedNode.isEmpty())
- return NotifierSet::value_type();
-
- ApiTreeRef aAffectedImpl( Factory::findDescendantTreeImpl(aAffectedNode, pTreeImpl.get()) );
- if (aAffectedImpl.is())
- {
- vos::ORef<NotifierImpl> aAffectedNotifier = BroadcasterHelper::getImpl(aAffectedImpl->getNotifier());
-
- return NotifierSet::value_type(aAffectedNotifier, aAffectedImpl);
- }
- else
- return NotifierSet::value_type();
- }
- // -----------------------------------------------------------------------------------------------
- inline
- NotifierSet::value_type findNotifier(configuration::NodeChangeInformation const& aChange, ApiTreeRef const& pTreeImpl)
- {
- return findNotifier(aChange.location,pTreeImpl);
- }
- // -----------------------------------------------------------------------------------------------
-
- void findNotifiers(NotifierSet& aNotifiers, configuration::NodeChangesInformation const& aChanges, ApiTreeRef const& pTreeImpl )
- {
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- NotifierSet::value_type aNotifierData( findNotifier(*it,pTreeImpl) );
-
- if (aNotifierData.first.isValid())
- {
- aNotifiers.insert( aNotifierData );
- OSL_ENSURE( aNotifiers[aNotifierData.first] == aNotifierData.second, "Different Api Trees for the same notifier" );
- }
- }
- }
- // -----------------------------------------------------------------------------------------------
- // NodeLocalBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore)
- {
- uno::Reference< css::beans::XVetoableChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
- cppu::OInterfaceContainerHelper* pSpecial = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
-
- if (pSpecial || pListeners)
- {
- css::beans::PropertyChangeEvent aEvent;
- aEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(aEvent,aChange,bMore))
- {
- // Catch only RuntimeExceptions here: vetoableChange issues its veto by throwing
- // a PropertyVetoException (which is not a RuntimeException)
- if (pListeners)
- {
- ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pListeners);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- aIterator.next()->vetoableChange(aEvent);
- }
- catch (uno::RuntimeException & )
- {}
- }
- if (pSpecial)
- {
- ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pSpecial);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- aIterator.next()->vetoableChange(aEvent);
- }
- catch (uno::RuntimeException & )
- {}
- }
- }
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent)
- {
- uno::Reference< css::beans::XPropertyChangeListener > const * const SelectPropertyListener = 0;
- uno::Reference< css::container::XContainerListener > const * const SelectContainerListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainerListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectContainerListener) );
-
- if (pContainerListeners)
- {
- css::container::ContainerEvent aEvent;
- aEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(aEvent,aChange))
- {
-
- ListenerContainerIterator< css::container::XContainerListener > aIterator(*pContainerListeners);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- uno::Reference<css::container::XContainerListener> xListener( aIterator.next() );
- OSL_ASSERT( xListener.is() );
-
- switch (aChange.change.type)
- {
- case configuration::NodeChangeData::eSetValue:
- case configuration::NodeChangeData::eSetDefault:
- case configuration::NodeChangeData::eReplaceElement:
- xListener->elementReplaced(aEvent);
- break;
-
- case configuration::NodeChangeData::eInsertElement:
- xListener->elementInserted(aEvent);
- break;
-
- case configuration::NodeChangeData::eRemoveElement:
- xListener->elementRemoved(aEvent);
- break;
-
-
- case configuration::NodeChangeData::eResetSetDefault:
- case configuration::NodeChangeData::eRenameElementTree:
- case configuration::NodeChangeData::eNoChange:
- OSL_ASSERT(false);
- break;
- }
- }
- catch (uno::Exception &)
- {}
- }
- }
-
-
- OSL_ASSERT(pCurEvent);
- css::beans::PropertyChangeEvent& rEvent = *pCurEvent;
-
- rEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(rEvent,aChange,bMore))
- {
- cppu::OInterfaceContainerHelper* pPropertyListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectPropertyListener) );
- if (pPropertyListeners)
- {
- ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pPropertyListeners);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
- }
-
- cppu::OInterfaceContainerHelper* pSpecialListeners = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
- if (pSpecialListeners)
- {
- ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pSpecialListeners);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
- }
-
- ++pCurEvent;
- }
-
- }
- // -----------------------------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------------------------
- // SingleBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- SingleChangeBroadcaster_Impl::SingleChangeBroadcaster_Impl(
- NotifierSet::value_type const& rTreeNotifierData,
- configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedNode
- )
- : NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
- , m_aChangingValue(aChangedNode)
- {
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangeLocation const& aChange)
- {
- OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Single Broadcaster");
-
- OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = aChange.getAffectedNodeID();
- if (aAffectedNodeID.isEmpty())
- return 0;
-
- return create(rLocalNotifier,aAffectedNodeID,aChange.getChangingValueID(),aChange);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangeLocation const& aChange)
- {
-
- return create(rLocalNotifier,aAffectedID,aChange.getChangingValueID(),aChange);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::SubNodeID const& aChangedNodeID,
- configuration::NodeChangeLocation const& aChange)
- {
- { (void)aChange; }
- OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
- OSL_ENSURE(aAffectedID.isValidNode(),"Cannot broadcast without affected node");
-
- OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Single Broadcaster");
- OSL_ENSURE( aChange.getAffectedNodeID() == aAffectedID,
- "ERROR: Node Mismatch creating Single Broadcaster");
- OSL_ENSURE( aChange.getChangingValueID() == aChangedNodeID,
- "ERROR: Value Node Mismatch creating Single Broadcaster");
-
- return new SingleChangeBroadcaster_Impl(rLocalNotifier,aAffectedID,aChangedNodeID);
- }
- // -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- OSL_ASSERT(aChanges.size() <= 1);
- if (!aChanges.empty())
- {
- std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
-
- OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
-
- querySingleConstraint(*it, false);
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- OSL_ASSERT(aChanges.size() <= 1);
- if (!aChanges.empty())
- {
- css::beans::PropertyChangeEvent aEvent;
- css::beans::PropertyChangeEvent * pEventNext = &aEvent;
-
- std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
-
- OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
-
- notifySingleChange(*it, false, pEventNext);
-
- if (pEventNext != &aEvent)
- {
- uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(&aEvent,1);
-
- uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
-
- if (pContainer)
- {
- ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
- }
- }
- }
- }
-
- // -----------------------------------------------------------------------------------------------
- // MultiChangeBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
-
- MultiChangeBroadcaster_Impl::MultiChangeBroadcaster_Impl(
- NotifierSet::value_type const& rTreeNotifierData,
- configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes
- )
- : NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
- , m_aChangingNodes()
- {
- m_aChangingNodes.swap(aChangedNodes);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty())
- return 0;
-
- OSL_ENSURE(aChanges.begin()->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = aChanges.begin()->location.getAffectedNodeID();
- if (aAffectedNodeID.isEmpty())
- return 0;
-
- return create(rLocalNotifier, aAffectedNodeID, aChanges);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedNodeID,
- configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty())
- return 0;
-
- else if (aChanges.size() == 1)
- return SingleChangeBroadcaster_Impl::create(rLocalNotifier,aAffectedNodeID,aChanges.begin()->location);
-
- else
- {
- OSL_ENSURE(aAffectedNodeID.isValidNode(),"Cannot broadcast without affected node");
-
- std::set< configuration::SubNodeID > aChangedNodes;
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- OSL_ENSURE(it->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- OSL_ENSURE(it->location.getAffectedNodeID() == aAffectedNodeID, "ERROR: Change is not local to affected node (as advertised)");
- OSL_ENSURE(rLocalNotifier.second->getTree() == it->location.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Multi Change Broadcaster");
-
- configuration::SubNodeID aChangedValueID = it->location.getChangingValueID();
-
- aChangedNodes.insert(aChangedValueID);
- }
- OSL_ENSURE(!aChangedNodes.empty(), "Changes don't affect any nodes");
-
- if (aChangedNodes.size() == 1) OSL_TRACE("WARNING: Different changes all affect the same node !");
-
- return new MultiChangeBroadcaster_Impl(rLocalNotifier, aAffectedNodeID, aChangedNodes);
- }
- }
- // -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
- {
- OSL_ENSURE( m_aChangingNodes.find( it->location.getChangingValueID() ) != m_aChangingNodes.end(), "Broadcasting unanticipated change");
-
- querySingleConstraint(*it, it != last);
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(aChanges.size());
-
- css::beans::PropertyChangeEvent * const pEventStart = aPropertyEvents.getArray();
- css::beans::PropertyChangeEvent * pEventNext = pEventStart;
-
- std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
- {
- // #92463# Skip nodes that are not in the tree
- if (it->location.getAffectedNodeID().isEmpty()) continue;
-
- OSL_ENSURE( m_aChangingNodes.find( it->location.getChangingValueID() ) != m_aChangingNodes.end(), "Broadcasting unanticipated change");
-
- notifySingleChange(*it, it != last, pEventNext);
- }
-
- sal_Int32 nPropertyEvents = pEventNext-pEventStart;
-
- if (nPropertyEvents > 0)
- {
- OSL_ASSERT(nPropertyEvents <= aPropertyEvents.getLength());
- if (nPropertyEvents != aPropertyEvents.getLength())
- aPropertyEvents.realloc(nPropertyEvents);
-
- uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
-
- if (pContainer)
- {
- ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
- }
- }
- }
- // -----------------------------------------------------------------------------------------------
- // TreeLocalBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
-
- SingleTreeBroadcaster_Impl::SingleTreeBroadcaster_Impl(
- NotifierSet::value_type const& aTreeNotifierData,
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters
- )
- : Broadcaster::Impl(aTreeNotifierData)
- , m_aBroadcasters()
- {
- m_aBroadcasters.swap(aBroadcasters);
- }
-
- // -----------------------------------------------------------------------------------------------
-
- bool SingleTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector)
- {
- OSL_ASSERT(rSelected.empty()); // nothing in there yet
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
- {
- if ( it->location.getAffectedNodeID() == aSelector )
- {
- rSelected.push_back(*it);
- }
- }
- return !rSelected.empty();
- }
- // -----------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > SingleTreeBroadcaster_Impl::create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges)
- {
- std::set< configuration::NodeID > aNodes;
- for (std::vector< configuration::NodeChangeInformation >::const_iterator itChanges = aChanges.begin(); itChanges != aChanges.end(); ++itChanges)
- {
- OSL_ENSURE(itChanges->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = itChanges->location.getAffectedNodeID();
- if (!aAffectedNodeID.isEmpty())
- aNodes.insert(aAffectedNodeID);
- }
-
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > aNodecasters;
- for (std::set< configuration::NodeID >::const_iterator itNodes = aNodes.begin(); itNodes != aNodes.end(); ++itNodes)
- {
- OSL_ASSERT(itNodes->isValidNode()); // filtered empty ones above
-
- configuration::NodeChangesInformation aSelectedChanges;
- if ( selectChanges(aSelectedChanges, aChanges, *itNodes))
- {
- NodeLocalBroadcaster_Impl* pSelectedImpl = MultiChangeBroadcaster_Impl::create(rLocalNotifier, *itNodes, aSelectedChanges);
- if (pSelectedImpl)
- aNodecasters.push_back(pSelectedImpl);
- }
- }
-
- if (aNodecasters.empty())
- return 0;
-
- else if (aNodecasters.size() == 1)
- return aNodecasters.begin()->getBodyPtr();
-
- else
- return new SingleTreeBroadcaster_Impl(rRootNotifier, aNodecasters);
- }
- // -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
- (*it)->queryConstraints(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
- (*it)->notifyListeners(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- // MultiTreeBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- MultiTreeBroadcaster_Impl::MultiTreeBroadcaster_Impl(NotifierSet::value_type const& aRootSelector, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters)
- : Broadcaster::Impl(aRootSelector)
- , m_aBroadcasters()
- {
- m_aBroadcasters.swap(aBroadcasters);
- }
-
- // -----------------------------------------------------------------------------------------------
-
- bool MultiTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector)
- {
- OSL_ASSERT(aSelector.first.isValid());
- OSL_ASSERT(aSelector.second.is());
-
- OSL_ASSERT(rSelected.empty()); // nothing in there yet
-
- rtl::Reference< configuration::Tree > const aSelectedTree( aSelector.second->getTree() );
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
- {
- if (it->location.getAffectedTreeRef() == aSelectedTree)
- {
- rSelected.push_back(*it);
- }
- }
- return !rSelected.empty();
- }
- // -------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > MultiTreeBroadcaster_Impl::create(NotifierSet::value_type const& rRootNotifier, NotifierSet const& rNotifiers, configuration::NodeChangesInformation const& aChanges)
- {
- std::vector< vos::ORef< Broadcaster::Impl > > aTreecasters;
- for (NotifierSet::const_iterator it = rNotifiers.begin(); it != rNotifiers.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedChanges;
- if ( selectChanges(aSelectedChanges, aChanges, *it))
- {
- vos::ORef< Broadcaster::Impl > pSelectedImpl = SingleTreeBroadcaster_Impl::create(rRootNotifier, *it, aSelectedChanges);
- if (pSelectedImpl.isValid())
- aTreecasters.push_back(pSelectedImpl);
- }
- }
-
- if (aTreecasters.empty())
- return 0;
-
- else if (aTreecasters.size() == 1)
- return *aTreecasters.begin();
-
- else
- return new MultiTreeBroadcaster_Impl(rRootNotifier, aTreecasters);
- }
- // -------------------------------------------------------------------------------------------
-
- void MultiTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
- (*it)->queryConstraints(aSelectedInfos);
- }
- }
- // -------------------------------------------------------------------------------------------
-
- void MultiTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
- (*it)->notifyListeners(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal)
- {
- OSL_ASSERT(pTreeImpl.is());
-
- vos::ORef< Broadcaster::Impl > pRet;
-
- configuration::NodeChangeLocation aLocation;
- if (aChange.getChangeLocation(aLocation))
- {
- if (bLocal)
- {
- pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aLocation);
- }
- else
- {
- NotifierSet::value_type aAffectedNotifier( findNotifier(aLocation, pTreeImpl) );
- if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
- pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aLocation);
- }
- }
- else
- {
- OSL_ENSURE(false, "Invalid change location set in node change - cannot broadcast");
- // can't create a matching change - must still create an empty one
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChanges, bool bLocal)
- {
- NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
-
- configuration::NodeChangesInformation aChangeInfos;
- if (aChanges.getChangesInfos(aChangeInfos))
- {
- return create(rNotifierImpl,pTreeImpl,aChangeInfos,bLocal);
- }
- else
- {
- OSL_ENSURE(aChanges.isEmpty(), "Cannot get information for changes - cannot notify");
-
- // make an empty one below
- vos::ORef< Broadcaster::Impl > pRet = EmptyBroadcaster_Impl::create( aRootData );
-
- return pRet;
- }
-
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal)
- {
- OSL_ASSERT(pTreeImpl.is());
-
- vos::ORef< Broadcaster::Impl > pRet;
-
- if (aChange.hasValidLocation())
- {
- if (bLocal)
- {
- pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aChange.location);
- }
- else
- {
- NotifierSet::value_type aAffectedNotifier( findNotifier(aChange.location, pTreeImpl) );
- if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
- pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aChange.location);
- }
- }
- else
- {
- OSL_ENSURE(false, "Invalid change location set in node change - cannot broadcast");
- // can't create a matching change - must still create an empty one
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChanges, bool bLocal)
- {
- vos::ORef< Broadcaster::Impl > pRet;
-
- NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
-
- if (aChanges.size() == 1)
- {
- pRet = create(rNotifierImpl, pTreeImpl, *aChanges.begin(), bLocal);
- }
- else if (bLocal)
- {
- pRet = MultiChangeBroadcaster_Impl::create( aRootData, aChanges);
- }
- else
- {
- NotifierSet aNotifiers;
- findNotifiers( aNotifiers, aChanges, pTreeImpl);
-
- if (aNotifiers.size() > 1)
- {
- pRet = MultiTreeBroadcaster_Impl::create(aRootData, aNotifiers, aChanges);
- }
- else if (!aNotifiers.empty())
- {
- pRet = SingleTreeBroadcaster_Impl::create(aRootData, *aNotifiers.begin(), aChanges);
- }
- // else: empty
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( aRootData );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& _rInfos, configuration::NodeChanges const& aChanges, bool /*bSingleBase*/) const
- {
- rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
- Factory& rFactory = m_aNotifierData.second->getFactory();
-
- configuration::NodeChangesInformation aRawInfos;
-
- sal_uInt32 nChanges = aChanges.getChangesInfos(aRawInfos);
-
- OSL_ENSURE(nChanges, "Cannot get info(s) for change - skipping for notification");
- OSL_ENSURE(nChanges == aRawInfos.size(), "Incorrect change count returned");
-
- configuration::NodeChangesInformation aNewInfos;
- aNewInfos.reserve(nChanges);
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator pos = aRawInfos.begin(); pos != aRawInfos.end(); ++pos)
- {
- configuration::NodeChangeInformation aInfo = *pos;
- if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
- {
- OSL_TRACE("Change is not within expected tree - skipping for notification");
- continue;
- }
-
- OSL_ENSURE(!pos->isEmptyChange(), "Empty Change Found for Notification");
- // it actually is expected that elements may not be found - thus ignoring result
- configapi::resolveToUno(aInfo.change, rFactory);
-
- aNewInfos.push_back( aInfo );
- }
-
- aNewInfos.swap(_rInfos);
-
- return !_rInfos.empty();
- }
-
-// ---------------------------------------------------------------------------------------------------
-
- bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool /*bSingleBase*/) const
- {
- configuration::NodeChangesInformation aNewInfos;
- aNewInfos.reserve( aChanges.size() );
-
- rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
- Factory& rFactory = m_aNotifierData.second->getFactory();
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- configuration::NodeChangeInformation aInfo(*it);
- if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
- {
- OSL_TRACE("Change is not within expected tree - skipping for notification");
- continue;
- }
-
- if( !configapi::resolveToUno(aInfo.change,rFactory) )
- {
- // it actually is expected that elements may not be found
- // OSL_TRACE("Cannot find affected elements of Change");
- }
-
- aNewInfos.push_back( aInfo );
- }
-
- aNewInfos.swap(aInfos);
- return !aInfos.empty();
- }
-
-// ---------------------------------------------------------------------------------------------------
- void Broadcaster::Impl::notifyRootListeners(configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty()) return;
-
- ApiTreeRef pRootTree( m_aNotifierData.second->getRootTreeImpl() );
- if (pRootTree.is())
- {
- vos::ORef<NotifierImpl> aRootNotifier = BroadcasterHelper::getImpl(pRootTree->getNotifier());
- if (aRootNotifier.isValid())
- {
- uno::Reference< css::util::XChangesListener > const * const pSelect = 0;
-
- configuration::NodeID aNotifiedNode = makeRootID( pRootTree );
-
- if (cppu::OInterfaceContainerHelper* pContainer = aRootNotifier->m_aListeners.getContainer(aNotifiedNode.toIndex(), ::getCppuType(pSelect)) )
- {
- css::util::ChangesEvent aEvent;
- aEvent.Source = pRootTree->getUnoInstance();
-
- uno::Reference<uno::XInterface> xBaseInstance = m_aNotifierData.second->getUnoInstance();
- aEvent.Base <<= xBaseInstance;
-
- // translate and collect the changes
- aEvent.Changes.realloc(aChanges.size());
- css::util::ElementChange* pChange = aEvent.Changes.getArray();
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- fillChangeFromResolved(*pChange, *it);
- ++pChange;
- }
-
- // now notify
- ListenerContainerIterator< css::util::XChangesListener > aIter(*pContainer);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIter.hasMoreElements())
- try { aIter.next()->changesOccurred(aEvent); } catch (uno::Exception & ) {}
- }
- }
- }
- }
-
-// ---------------------------------------------------------------------------------------------------
-// class Broadcaster
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChange,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster::Broadcaster(Broadcaster const& aOther)
-: m_pImpl(aOther.m_pImpl)
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster::~Broadcaster()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::queryConstraints(configuration::NodeChange const& aChange) throw(beans::PropertyVetoException)
-{
- OSL_ENSURE(aChange.isChange(),"Constraint query without a change !");
-
- configuration::NodeChanges aChanges;
- aChanges.add(aChange);
- this->queryConstraints(aChanges,true);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase) throw(beans::PropertyVetoException)
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Constraint query without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges,bSingleBase))
- {
- m_pImpl->queryConstraints(aInfos);
- }
- }
- catch (beans::PropertyVetoException & )
- {
- throw;
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChange const& aChange) throw()
-{
- OSL_ENSURE(aChange.isChange(),"Notifying without a change !");
-
- configuration::NodeChanges aChanges;
- aChanges.add(aChange);
- this->notifyListeners(aChanges, true);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw()
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Notifying without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
- {
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
- }
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase) throw()
-{
- OSL_ENSURE(!aChanges.empty(),"Notifying without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
- {
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
- }
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/broadcaster.hxx b/configmgr/source/api2/broadcaster.hxx
deleted file mode 100644
index c247750dcfe4..000000000000
--- a/configmgr/source/api2/broadcaster.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BROADCASTER_HXX_
-#define CONFIGMGR_API_BROADCASTER_HXX_
-
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-
-#include <vos/ref.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
-// ---------------------------------------------------------------------------------------------------
- class NodeChange;
- class NodeChanges;
- class NodeChangeInformation;
- class NodeChangesInformation;
- }
-// ---------------------------------------------------------------------------------------------------
- namespace configapi
- {
- class Notifier;
-
- namespace css = ::com::sun::star;
-// ---------------------------------------------------------------------------------------------------
-
- /// broadcasts events for changes to a single config node or several sibling nodes
- class Broadcaster
- {
- public:
- /// construct a broadcaster
- Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal);
- Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal);
- Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal);
- Broadcaster(Broadcaster const& aOther);
- ~Broadcaster();
-
- /// give all property veto listeners on the affected node a chance to veto
- void queryConstraints(configuration::NodeChange const& aChange) throw(css::beans::PropertyVetoException);
- /// give all property veto listeners on any of the affected nodes a chance to veto
- void queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase = true) throw(css::beans::PropertyVetoException);
-
- /// notify all listeners which are affected by this change
- void notifyListeners(configuration::NodeChange const& aChange) throw();
- /// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw();
- /// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase = false) throw();
-
- class Impl;
- private:
- vos::ORef<Impl> m_pImpl;
- private:
- void operator=(Broadcaster const& aOther);
- };
-
-// ---------------------------------------------------------------------------------------------------
-
- }
-}
-
-#endif // CONFIGMGR_API_BROADCASTER_HXX_
diff --git a/configmgr/source/api2/committer.cxx b/configmgr/source/api2/committer.cxx
deleted file mode 100644
index a19743c79f3c..000000000000
--- a/configmgr/source/api2/committer.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "committer.hxx"
-#include "apitreeimplobj.hxx"
-#include "providerimpl.hxx"
-#include "roottree.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-namespace
-{
- //-------------------------------------------------------------------------
- struct NotifyDisabler
- {
- ApiRootTreeImpl& m_rTree;
- bool m_bOldState;
-
- NotifyDisabler(ApiRootTreeImpl& rTree)
- : m_rTree(rTree)
- , m_bOldState(rTree .enableNotification(false) )
- {
- }
-
- ~NotifyDisabler()
- {
- m_rTree.enableNotification(m_bOldState);
- }
- };
- //-------------------------------------------------------------------------
-}
-
-//-----------------------------------------------------------------------------
-// class Committer
-//-----------------------------------------------------------------------------
-
-Committer::Committer(ApiRootTreeImpl& rTree)
-: m_rTree(rTree)
-{}
-//-----------------------------------------------------------------------------
-
-OProviderImpl * Committer::getUpdateProvider()
-{
- return &m_rTree.getApiTree().getProvider().getProviderImpl();
-}
-
-//-----------------------------------------------------------------------------
-void Committer::commit()
-{
- ApiTreeImpl& rApiTree = m_rTree.getApiTree();
-
- OSL_PRECOND(!m_rTree.getLocation().isRoot(),"INTERNAL ERROR: Empty location used.");
- OSL_PRECOND(m_rTree.getOptions().isValid(),"INTERNAL ERROR: Invalid Options used.");
-
- if (!m_rTree.getOptions().isValid()) return;
-
- RequestOptions aOptions = m_rTree.getOptions()->getRequestOptions();
-
- OProviderImpl * pUpdateProvider = getUpdateProvider();
- OSL_ASSERT(pUpdateProvider);
-
- rtl::Reference< configuration::Tree > aTree( rApiTree.getTree());
- if (!aTree->hasChanges()) return;
-
- TreeChangeList aChangeList(aOptions,
- aTree->getRootPath(),
- aTree->getAttributes(aTree->getRootNode()));
-
- // now do the commit
- configuration::CommitHelper aHelper(rApiTree.getTree());
- if (aHelper.prepareCommit(aChangeList))
- try
- {
- pUpdateProvider->updateTree(aChangeList);
-
- aHelper.finishCommit(aChangeList);
-
- NotifyDisabler aDisableNotify(m_rTree); // do not notify self
- pUpdateProvider->saveAndNotifyUpdate(aChangeList);
- }
- catch(...)
- {
- // should be a special clean-up routine, but for now we just need a consistent state
- try
- {
- aHelper.failedCommit(aChangeList);
- }
- catch(configuration::Exception&)
- {
- OSL_ENSURE(false, "Cleanup really should not throw");
- }
- throw;
- }
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/confignotifier.cxx b/configmgr/source/api2/confignotifier.cxx
deleted file mode 100644
index 2de91c9775ed..000000000000
--- a/configmgr/source/api2/confignotifier.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "confignotifier.hxx"
-
-#include "notifierimpl.hxx"
-#include "broadcaster.hxx"
-
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "nodechange.hxx"
-
-#include "apinodeaccess.hxx"
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-
-#include <set>
-#include <functional>
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-// class Notifier (-Impl)
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::Notifier(vos::ORef<NotifierImpl> const& aImpl,ApiTreeImpl const* pTree)
-: m_aImpl(aImpl)
-, m_pTree(pTree)
-{
- OSL_ENSURE(aImpl.isValid(),"Invalid initialization of a Notifier: No impl");
- OSL_ENSURE(pTree,"Invalid initialization of a Notifier: No tree");
-}
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::Notifier(Notifier const& aOther)
-: m_aImpl(aOther.m_aImpl)
-, m_pTree(aOther.m_pTree)
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::~Notifier()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster Notifier::makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const
-{
- return Broadcaster(*this,aChange,bLocal);
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster Notifier::makeBroadcaster(configuration::NodeChanges const& aChanges, bool bLocal) const
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Creating broadcaster for no changes");
- return Broadcaster(*this,aChanges,bLocal);
-}
-// ---------------------------------------------------------------------------------------------------
-
-NotifierImpl::NotifierImpl(rtl::Reference< configuration::Tree > const& aTree)
-: m_aListeners(aTree->nodeCount(), SubNodeToIndex(aTree))
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-NotifierImpl::~NotifierImpl()
-{
-}
-
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const
-{
- if (xListener.is())
- {
- if (aNames.getLength() > 0)
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener, aNames);
- else
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-
-// ---------------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------
-
-DisposeGuardImpl::DisposeGuardImpl(Notifier const&) throw()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-DisposeGuardImpl::~DisposeGuardImpl() throw ()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-GuardedNotifier::GuardedNotifier(NodeAccess& rNode) throw()
-: m_aNotifier(rNode.getNotifier())
-, m_aImpl(m_aNotifier)
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-DisposeGuard::DisposeGuard(NodeAccess& rNode) throw(css::lang::DisposedException)
-: m_aImpl(rNode.getNotifier())
-{
- rNode.checkAlive();
-}
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/confignotifier.hxx b/configmgr/source/api2/confignotifier.hxx
deleted file mode 100644
index 0e3a35841bbf..000000000000
--- a/configmgr/source/api2/confignotifier.hxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNOTIFIER_HXX_
-#define CONFIGMGR_CONFIGNOTIFIER_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "datalock.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <vos/ref.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace beans
- {
- class XPropertyChangeListener;
- class XVetoableChangeListener;
- class XPropertiesChangeListener;
- class PropertyVetoException;
- }
- namespace lang
- {
- class XEventListener;
- struct EventObject;
- }
- namespace container { class XContainerListener; }
- namespace util { class XChangesListener; }
- namespace uno { class RuntimeException; }
-} } }
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
- namespace configuration
- {
-// ---------------------------------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class NodeChange;
- class NodeChanges;
- }
-// ---------------------------------------------------------------------------------------------------
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
- class Broadcaster;
- class NotifierImpl;
- class ApiTreeImpl;
-
- namespace css = ::com::sun::star;
-// ---------------------------------------------------------------------------------------------------
- /// manages collections of event listeners observing a config tree, thread-safe
- class Notifier
- {
- friend class Broadcaster;
- friend class BroadcasterHelper;
- vos::ORef<NotifierImpl> m_aImpl;
- ApiTreeImpl const*const m_pTree;
- public:
- /// construct this around the given Implementation, for the given tree
- explicit Notifier(vos::ORef<NotifierImpl> const & aImpl, ApiTreeImpl const* pTree);
- Notifier(Notifier const& aOther);
- ~Notifier();
-
- // ---------------------------------------------------------------------------------------------------
- /// create a broadcaster for a single change (either local or (possibly) nested)
- Broadcaster makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const;
- /// create a broadcaster for a collection of changes (either local or (possibly) nested)
- Broadcaster makeBroadcaster(configuration::NodeChanges const& aChange, bool bLocal) const;
-
- // ---------------------------------------------------------------------------------------------------
- bool checkAlive(uno::XInterface* pObject) const throw(css::lang::DisposedException);
-
- // ---------------------------------------------------------------------------------------------------
- /// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing all children of <var>aNode</var>.
- void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining all children of <var>aNode</var>.
- void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
- */
- void add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const;
-
- // ---------------------------------------------------------------------------------------------------
- /// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
-
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing any properties of <var>aNode</var>.
- */
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const;
- // ---------------------------------------------------------------------------------------------------
- private:
- void operator=(Notifier const& aOther);
- };
-// ---------------------------------------------------------------------------------------------------
-
-// Thin Wrappers around Notifiers: Provide guarding and convenient access
- // Guarding and locking implementations
- class NodeAccess;
- class TreeElement;
-
- /// guards a NodeAccess; provides a simple lock for non-data access, does not check for disposed state
- class DisposeGuardImpl: private boost::noncopyable
- {
- public:
- DisposeGuardImpl(Notifier const& rNotifier) throw();
- ~DisposeGuardImpl() throw ();
- };
-
- /// wraps a Notifier (from a node or tree); provides a simple lock for notifier access, does not check for disposed state
- class GuardedNotifier
- {
- UnoApiLock m_aLock;
- Notifier m_aNotifier;
- DisposeGuardImpl m_aImpl;
- public:
- GuardedNotifier(NodeAccess& rNode) throw();
- public:
- Notifier const& get() const { return m_aNotifier; }
-
- Notifier const& operator *() const { return get(); }
- Notifier const* operator->() const { return &get(); }
- };
-
- /// guards a Node or Tree provides a simple lock for non-data access, does (!) check for disposed state
- class DisposeGuard
- {
- DisposeGuardImpl m_aImpl;
- UnoApiLock m_aLock;
- public:
- DisposeGuard(NodeAccess& rNode) throw(css::lang::DisposedException);
- };
-
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNOTIFIER_HXX_
diff --git a/configmgr/source/api2/elementaccess.cxx b/configmgr/source/api2/elementaccess.cxx
deleted file mode 100644
index 2b533550968c..000000000000
--- a/configmgr/source/api2/elementaccess.cxx
+++ /dev/null
@@ -1,486 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementaccess.hxx"
-
-#include "elementimpl.hxx"
-#include "apinotifierimpl.hxx"
-
-#include "apitreeaccess.hxx"
-
-//-----------------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------------
-
- namespace uno = com::sun::star::uno;
-
-//-----------------------------------------------------------------------------------
-// XInterface (but not method queryInterface)
-//-----------------------------------------------------------------------------------
-
-// acuire doesn't really do anything but forward. OTOH it should always be overridden when release() is
-void SAL_CALL BasicInnerElement ::acquire() throw() { cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::acquire(); }
-void SAL_CALL BasicSetElement ::acquire() throw() { cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::acquire(); }
-void SAL_CALL BasicRootElement ::acquire() throw() { cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::acquire(); }
-void SAL_CALL BasicUpdateElement::acquire() throw() { cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::acquire(); }
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicInnerElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XTypeProvider (but not method getTypes)
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicInnerElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicSetElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicRootElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicUpdateElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChild (not for root elements)
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicInnerElement::getParent( ) throw(uno::RuntimeException)
-{
- return configapi::implGetParent( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(uno::RuntimeException)
-{
- return configapi::implGetParent( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setParent( const uno::Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, uno::RuntimeException)
-{
- configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::setParent( const uno::Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, uno::RuntimeException)
-{
- configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XNamed
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicInnerElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicRootElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicUpdateElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChangesNotifier
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XComponent
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XServiceInfo
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicInnerElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicRootElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicUpdateElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicInnerElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicSetElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicRootElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicUpdateElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicInnerElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicSetElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicRootElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-// ONLY set elements
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XTemplateInstance
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetTemplateName( getElementClass() );
-}
-
-//-----------------------------------------------------------------------------------
-// XUnoTunnel
-//-----------------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL BasicSetElement::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException)
-{
- return configapi::implGetSomething( getElementClass(), aIdentifier);
-}
-
-//-----------------------------------------------------------------------------------
-
-// ONLY root elements
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XLocalizable
-//-----------------------------------------------------------------------------------
-
-css::lang::Locale SAL_CALL BasicRootElement::getLocale( ) throw(uno::RuntimeException)
-{
- return configapi::implGetLocale( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-css::lang::Locale SAL_CALL BasicUpdateElement::getLocale( ) throw(uno::RuntimeException)
-{
- return configapi::implGetLocale( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
-{
- configapi::implSetLocale( getElementClass(), eLocale );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
-{
- configapi::implSetLocale( getElementClass(), eLocale );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChangesBatch (only on update root)
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::commitChanges( ) throw(css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implCommitChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicUpdateElement::hasPendingChanges( ) throw(uno::RuntimeException)
-{
- return configapi::implHasPendingChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< css::util::ElementChange > SAL_CALL BasicUpdateElement::getPendingChanges( ) throw(uno::RuntimeException)
-{
- return configapi::implGetPendingChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/elementaccess.hxx b/configmgr/source/api2/elementaccess.hxx
deleted file mode 100644
index 2241acc91bdd..000000000000
--- a/configmgr/source/api2/elementaccess.hxx
+++ /dev/null
@@ -1,383 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ELEMENTACCESS_HXX_
-#define CONFIGMGR_API_ELEMENTACCESS_HXX_
-
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/implbase5.hxx>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
-//-----------------------------------------------------------------------------
- namespace configapi
- {
- class NodeAccess;
- class InnerElement;
- class SetElement;
- class RootElement;
- class UpdateRootElement;
- }
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a inner node
- within the configuration tree that is a plain node (group member).
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>InnerElement</type>.</p>
- */
- class BasicInnerElement : public cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >
- {
- protected:
- // Destructors
- virtual ~BasicInnerElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XChild
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getParent( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // not supported
- setParent( const uno::Reference< uno::XInterface >& Parent )
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::InnerElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration tree that is a set element (or floating free).
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicSetElement : public cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >
- {
- protected:
- // Destructors
- virtual ~BasicSetElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XChild
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getParent( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // currently not supported
- setParent( const uno::Reference< uno::XInterface >& Parent )
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XTemplateInstance
- virtual rtl::OUString SAL_CALL
- getTemplateName( )
- throw(uno::RuntimeException);
-
- // XUnoTunnel
- virtual sal_Int64 SAL_CALL
- getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::SetElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration that is the root of a read-only access
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicRootElement : public cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >
- {
- protected:
- // Destructors
- virtual ~BasicRootElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL
- addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XLocalizable
- virtual css::lang::Locale SAL_CALL
- getLocale( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // maybe not supported (! - missing exception)
- setLocale( const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::RootElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration that is the root of an update access
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicUpdateElement : public cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >
- {
- protected:
- // Destructors
- virtual ~BasicUpdateElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL
- addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XChangesBatch
- virtual void SAL_CALL
- commitChanges( )
- throw(css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasPendingChanges( )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< css::util::ElementChange > SAL_CALL
- getPendingChanges( )
- throw(uno::RuntimeException);
-
- // XLocalizable
- virtual css::lang::Locale SAL_CALL
- getLocale( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // maybe not supported (! - missing exception)
- setLocale( const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::UpdateRootElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-}
-#endif // CONFIGMGR_API_ELEMENTACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/elementimpl.cxx b/configmgr/source/api2/elementimpl.cxx
deleted file mode 100644
index b9e9ee0466d0..000000000000
--- a/configmgr/source/api2/elementimpl.cxx
+++ /dev/null
@@ -1,588 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementimpl.hxx"
-#include "apitreeaccess.hxx"
-#include "apinodeaccess.hxx"
-#include "apifactory.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "translatechanges.hxx"
-#include "apitypes.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "confsvccomponent.hxx"
-#include "committer.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
-
-//-----------------------------------------------------------------------------------
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-// XChild
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement&) throw(uno::RuntimeException)
-{
- uno::Reference<uno::XInterface> xRet;
-
- try
- {
- GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
- configuration::NodeRef aParentNode = aTree->getParent(impl.getNode());
-
- uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aTree, aParentNode );
-
- if (!(aAny >>= xRet)) // no parent available
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicElement::getParent: could not extract parent - node is not an object");
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& /*rElement*/) throw(uno::RuntimeException)
-{
- uno::Reference<uno::XInterface> xRet;
-
- try
- {
- // assume shared lock for connected trees
- GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
-
- rtl::Reference< configuration::Tree > aParentTree( aTree->getContextTree() );
-
- if (!configuration::isEmpty(aParentTree.get()))
- {
- configuration::NodeRef aParentNode( aTree->getContextNodeRef() );
-
- // assume shared factory for connected trees
- uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aParentTree, aParentNode );
-
- if (!(aAny >>= xRet)) // no parent available
- {
- // should occur only if the any is void
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicSetElement::getParent: could not extract parent - node is not an object");
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- }
- }
- else
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-//-----------------------------------------------------------------------------------
-
-// UNSUPPORTED method
-void implSetParent(NodeAccess& rNode, InnerElement& /*rElement*/, const uno::Reference< uno::XInterface >& /*xParent*/ )
- throw(lang::NoSupportException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.checkAlive(); // Does locking internally, checks for disposed nodes
-
- // TODO(?): allow for xParent == getParent()
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setParent: cannot move Entry")),
- rNode.getUnoInstance() );
-}
-//-----------------------------------------------------------------------------------
-
-// preliminary implementation
-void implSetParent(NodeAccess& rNode, SetElement& rElement, const uno::Reference< uno::XInterface >& xParent )
- throw(lang::NoSupportException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- //implSetParent(rNode,xParent);
- // TODO: lock the whole transaction ???? - would need Uno Tunneling ?
- uno::Reference< uno::XInterface > xGotParent( implGetParent(rNode,rElement) );
- uno::Reference< css::container::XNameContainer > xOldParent( xGotParent, uno::UNO_QUERY );
- uno::Reference< css::container::XNameContainer > xNewParent( xParent, uno::UNO_QUERY );
-
- if (xGotParent.is() && !xOldParent.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: this is not element of a container")),
- rNode.getUnoInstance() );
- }
- if (xParent.is() && !xNewParent.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent is no container")),
- rNode.getUnoInstance() );
- }
-
- uno::Reference< uno::XInterface > xThis(rNode.getUnoInstance());
- OSL_ASSERT(xThis.is());
-
- if (xOldParent != xNewParent)
- {
- rtl::OUString const sName( implGetName(rNode,rElement) );
-
- if (xParent.is())
- {
- rtl::OUString const sTemplate( implGetTemplateName(rElement) );
-
- if (sTemplate.getLength() == 0)
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has no recognizable type")),
- xThis );
- }
-
- uno::Reference< css::configuration::XTemplateContainer > xNewTemplate( xParent, uno::UNO_QUERY );
- if (!xNewTemplate.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent has no element template")),
- xThis );
- }
-
- if ( sTemplate != xNewTemplate->getElementTemplateName())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has wrong type")),
- xThis );
- }
-
- if ( xNewParent->hasByName( sName ) )
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: an object of this name already exists in new parent")),
- xThis );
- }
-
- // TODO: check for circularity (i.e. that This is not one of new parent's ancestors) !!
- }
-
- // now do it
-
- try
- {
- if ( xOldParent.is()) xOldParent->removeByName(sName);
- if ( xNewParent.is()) xNewParent->insertByName(sName, uno::makeAny(xThis));
- }
- catch (uno::Exception& e)
- {
- e.Message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: changing parent failed: "))
- += e.Message;
-
- if (xOldParent.is())
- try
- {
- xOldParent->insertByName(sName, uno::makeAny(xThis));
- }
- catch(uno::Exception& bad)
- {
- e.Message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\t ! Could not restore old parent: ")) += bad.Message;
- }
-
- throw uno::RuntimeException(e.Message,xThis);
- }
-
- }
-}
-//-----------------------------------------------------------------------------
-
-
-// XNamed
-//-----------------------------------------------------------------------------
-rtl::OUString implGetName(NodeAccess& rNode, NodeElement& ) throw(uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> impl( rNode ); // maybe passive only ?
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
- configuration::NodeRef aNode(impl.getNode());
-
- sRet = aTree->getSimpleNodeName(aNode.getOffset());
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return sRet;
-}
-//-----------------------------------------------------------------------------
-
-// UNSUPPORTED method
-void implSetName(NodeAccess & rNode, NodeElement& /*rElement*/, const rtl::OUString& /*aName*/ ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.checkAlive(); // Does locking internally, checks for disposed nodes
-
- // TODO(?): allow for aName == getName()
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setName: cannot rename Entry")),
- rNode.getUnoInstance() );
-}
-//-----------------------------------------------------------------------------
-
-// TODO: Implementations for elements to be added to a container node
-void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- // TODO: Implement
- NodeElement& rDelegate = rElement;
- implSetName(rNode,rDelegate,aName); // delegate to unsupported version
-}
-//-----------------------------------------------------------------------------
-
-// XComponent & XInterface
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-
-void implDispose( SetElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!rElement.disposeTree(false))
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that has an owner")),
- rElement.getUnoInstance() );
- }
-}
-//-----------------------------------------------------------------------------
-
-void implDispose( RootElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!rElement.disposeTree())
- {
- throw lang::DisposedException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that already was disposed")),
- rElement.getUnoInstance() );
- }
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& ,SetElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-// FIXME: should we hold a ref on the element over this ?
-// call apitreeaccess.hxx (doGetUnoInterface) & hold a ref / unref ?
-// [or!] - call getApiTree & ref/unref on that ?
-// [or!] - hold the ref inside the dispose method itself ...
- rElement.disposeTree(true);
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& , RootElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rElement.disposeTree();
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& rNode, InnerElement& ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.disposeNode();
-}
-//-----------------------------------------------------------------------------
-
-
-// XTypeProvider
-//-----------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement& rElement)
- throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
-
- OSL_ENSURE(pInfo, "Configuration: Object has no implementation (service) info - cannot get implementation id");
- if (!pInfo)
- throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Object has no implementation information - cannot get implementation id")),rElement.getUnoInstance() );
-
- return ServiceComponentImpl::getStaticImplementationId(pInfo);
-}
-//-----------------------------------------------------------------------------
-
-// XServiceInfo
-//-----------------------------------------------------------------------------
-
-rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).getImplementationName();
-}
-//-----------------------------------------------------------------------------
-
-sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).supportsService(ServiceName);
-}
-//-----------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).getSupportedServiceNames();
-}
-//-----------------------------------------------------------------------------
-
-// Root only ------------------------------------------------------------------
-
-// XLocalizable
-// TODO: Implement locale support
-//-----------------------------------------------------------------------------
-
-lang::Locale implGetLocale( RootElement& rElement ) throw(uno::RuntimeException)
-{
- GuardedRootElement aLocked(rElement);
-
- OSL_ENSURE(false,"CONFIGURATION: Locale information is not yetsupported.");
- return lang::Locale();
-}
-//-----------------------------------------------------------------------------
-
-void implSetLocale( RootElement& rElement, const css::lang::Locale& /*eLocale*/ ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
- // TODO: Implement if possible
- rElement.checkAlive();
-
- OSL_ENSURE(false,"CONFIGURATION: Changing the set Locale is not supported.");
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Changing the locale is currently not supported")),
- rElement.getUnoInstance()
- );
-}
-//-----------------------------------------------------------------------------
-
-// XChangesBatch
-//-----------------------------------------------------------------------------
-
-void implCommitChanges( UpdateRootElement& rElement ) throw(css::lang::WrappedTargetException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- // quick check to avoid big locks for nothing (has its own locking)
- if (!implHasPendingChanges(rElement)) return;
-
- try
- {
- rElement.getCommitter().commit();
- }
-
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- // filter/wrap uno::Exceptions
- catch (lang::WrappedTargetException& ) { throw; }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& ex)
- {
- uno::Reference<uno::XInterface> xContext( rElement.getUnoInstance() );
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration: can't commit Changes: ") );
- throw lang::WrappedTargetException( sMessage += ex.Message, xContext, uno::makeAny(ex));
- }
-}
-//-----------------------------------------------------------------------------
-
-sal_Bool implHasPendingChanges( RootElement& rElement ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedRootElement aLocked(rElement);
- return aLocked.get().getTree()->hasChanges();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- OSL_ENSURE(false,"Unreachable Code");
- return false;
-}
-//-----------------------------------------------------------------------------
-
-uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException)
-{
- std::vector<css::util::ElementChange> aResult;
- try
- {
- GuardedRootElement aLocked(rElement);
-
- rtl::Reference< configuration::Tree > aTree( aLocked.get().getTree() );
-
- configuration::NodeChangesInformation aInfos;
-
- {
- configuration::NodeChanges aChanges;
- if (aTree->collectChanges(aChanges))
- {
- aChanges.getChangesInfos(aInfos);
- }
- }
-
- Factory& rFactory = rElement.getFactory();
-
- for(std::vector< configuration::NodeChangeInformation >::const_iterator it = aInfos.begin(), stop = aInfos.end();
- it != stop;
- ++it)
- {
- css::util::ElementChange aChange;
- fillChange(aChange,*it,aTree,rFactory);
- aResult.push_back(aChange);
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence(aResult);
-}
-//-----------------------------------------------------------------------------
-
-// Set only -------------------------------------------------------------------------
-
-// XTemplateInstance
-//-----------------------------------------------------------------------------------
-
-rtl::OUString implGetTemplateName(SetElement& rElement)
- throw(uno::RuntimeException)
-{
- try
- {
- GuardedTreeElement aLocked(rElement);
- return rElement.getTemplateInfo()->getPathString();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- OSL_ENSURE(false,"Unreachable Code");
- return rtl::OUString();
-}
-//-----------------------------------------------------------------------------------
-
-// XUnoTunnel
-//-----------------------------------------------------------------------------------
-sal_Int64 implGetSomething(SetElement& rElement, const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException)
-{
- sal_Int64 nSomething = 0;
- try
- {
- GuardedTreeElement aLocked(rElement);
-
- if (!rElement.getFactory().tunnelSetElement(nSomething, rElement, aIdentifier))
- OSL_ASSERT(nSomething == 0);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- return nSomething;
-}
-//-----------------------------------------------------------------------------------
-
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/elementimpl.hxx b/configmgr/source/api2/elementimpl.hxx
deleted file mode 100644
index a20eab92098b..000000000000
--- a/configmgr/source/api2/elementimpl.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ELEMENTIMPL_HXX_
-#define CONFIGMGR_API_ELEMENTIMPL_HXX_
-
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- //-------------------------------------------------------------------------
- class NodeAccess;
- class NodeElement;
- class InnerElement;
- class TreeElement;
- class SetElement;
- class RootElement;
- class UpdateRootElement;
- //-------------------------------------------------------------------------
-
- // XComponent and XInterface (EOL handling)
- //---------------------------------------------------------------------
- void implDispose( SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implDispose( RootElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, RootElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, InnerElement& rElement)
- throw(uno::RuntimeException);
-
- // XTypeProvider
- //---------------------------------------------------------------------
- uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException);
-
- // XChild
- //---------------------------------------------------------------------
- uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement& rElement)
- throw(uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implSetParent(NodeAccess& rNode, InnerElement& rElement, const uno::Reference< uno::XInterface >& Parent ) // generally not supported
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- void implSetParent(NodeAccess& rNode, SetElement& rElement, const uno::Reference< uno::XInterface >& Parent ) // maybe supported
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- //---------------------------------------------------------------------
- rtl::OUString implGetName(NodeAccess& rNode, NodeElement& rElement)
- throw(uno::RuntimeException);
-
- void implSetName(NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& aName ) // generally not supported (! - missing exception)
- throw(uno::RuntimeException);
-
- void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) // maybe supported
- throw(uno::RuntimeException);
-
- // XServiceInfo
- //---------------------------------------------------------------------
- rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement )
- throw(uno::RuntimeException);
-
- sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement )
- throw(uno::RuntimeException);
-
- // Root only only
- //-------------------------------------------------------------------------
-
- // XLocalizable
- //---------------------------------------------------------------------
-
- css::lang::Locale implGetLocale( RootElement& rElement )
- throw(uno::RuntimeException);
-
- void implSetLocale( RootElement& rElement, const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- // XChangesBatch
- //---------------------------------------------------------------------
-
- void implCommitChanges( UpdateRootElement& rElement )
- throw(css::lang::WrappedTargetException, uno::RuntimeException);
-
- sal_Bool implHasPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException);
-
- uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException);
-
- // Set only
- //-------------------------------------------------------------------------
- // XTemplateInstance
- //---------------------------------------------------------------------
- rtl::OUString implGetTemplateName(SetElement& rElement)
- throw(uno::RuntimeException);
-
- // XUnoTunnel
- //---------------------------------------------------------------------
- sal_Int64 implGetSomething(SetElement& rElement, const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException);
-
- //-------------------------------------------------------------------------
- }
-
-}
-#endif // CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/groupaccess.cxx b/configmgr/source/api2/groupaccess.cxx
deleted file mode 100644
index a6491871bd51..000000000000
--- a/configmgr/source/api2/groupaccess.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "groupaccess.hxx"
-#include "accessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicGroupAccess::getHierarchicalName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalName( getNode() );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException)
-{
- return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Type SAL_CALL BasicGroupAccess::getElementType( ) throw(uno::RuntimeException)
-{
- return configapi::implGetElementType( getNode() );
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(uno::RuntimeException)
-{
- return configapi::implHasElements( getNode() );
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicGroupAccess::getExactName( const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- return configapi::implGetExactName( getNode(), rApproximateName);
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-css::beans::Property SAL_CALL BasicGroupAccess::getAsProperty( ) throw(uno::RuntimeException)
-{
- return configapi::implGetAsProperty( getNode() );
-}
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicGroupAccess::hasByName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicGroupAccess::getByName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetByName( getNode(), sName );
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicGroupAccess::getElementNames( ) throw( uno::RuntimeException)
-{
- return configapi::implGetElementNames( getNode() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasByHierarchicalName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByHierarchicalName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- return configapi::implGetByHierarchicalName( getNode(), sName );
-}
-
-
-// XContainer
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicGroupAccess::addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener );
-}
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicGroupAccess::removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-
-
-
-//-----------------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/groupaccess.hxx b/configmgr/source/api2/groupaccess.hxx
deleted file mode 100644
index 9c00f1817b8d..000000000000
--- a/configmgr/source/api2/groupaccess.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPACCESS_HXX_
-#define CONFIGMGR_API_GROUPACCESS_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- namespace configapi { class NodeGroupInfoAccess; }
-
- /** implements the (read-only) interfaces supported by a group node
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeAccess</type>.</p>
- */
- class BasicGroupAccess
- : public ::cppu::ImplHelper6
- < css::container::XNameAccess
- , css::container::XHierarchicalName
- , css::container::XHierarchicalNameAccess
- , css::container::XContainer
- , css::beans::XExactName
- , css::beans::XProperty
- >
- {
- protected:
- // Destructors
- virtual ~BasicGroupAccess() {}
-
- public:
- // Interface methods
-
- // XHierarchicalName
- virtual rtl::OUString SAL_CALL
- getHierarchicalName( )
- throw(uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- composeHierarchicalName( const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
- uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- virtual uno::Type SAL_CALL
- getElementType( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasElements( )
- throw(uno::RuntimeException);
-
- // XNameAccess
- virtual uno::Any SAL_CALL
- getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getElementNames( )
- throw( uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- virtual uno::Any SAL_CALL
- getByHierarchicalName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByHierarchicalName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XContainer
- virtual void SAL_CALL
- addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XExactName
- virtual ::rtl::OUString SAL_CALL
- getExactName( const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- virtual css::beans::Property SAL_CALL
- getAsProperty( )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::NodeGroupInfoAccess& getNode() = 0;
- };
-
-}
-#endif // CONFIGMGR_API_GROUPACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/groupobjects.cxx b/configmgr/source/api2/groupobjects.cxx
deleted file mode 100644
index f31c3d6092ef..000000000000
--- a/configmgr/source/api2/groupobjects.cxx
+++ /dev/null
@@ -1,407 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "groupobjects.hxx"
-#include "comphelper/sequence.hxx"
-
-//........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OInnerGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerGroupInfo::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerGroupInfo::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OInnerGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OInnerGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::InnerElement& OInnerGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerGroupUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerGroupUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(), BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OInnerGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OInnerGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementGroupInfo::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementGroupInfo::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OSetElementGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OSetElementGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::SetElement& OSetElementGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementGroupUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementGroupUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(), BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OSetElementGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OSetElementGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementGroupInfo::acquire( ) throw ()
-{
- BasicRootElement::acquire();
-}
-
-void SAL_CALL ORootElementGroupInfo::release( ) throw ()
-{
- BasicRootElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicRootElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicRootElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicRootElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& ORootElementGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* ORootElementGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::RootElement& ORootElementGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementGroupUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementGroupUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& ORootElementGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* ORootElementGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/api2/groupobjects.hxx b/configmgr/source/api2/groupobjects.hxx
deleted file mode 100644
index d7afa5ef01ec..000000000000
--- a/configmgr/source/api2/groupobjects.hxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPOBJECTS_HXX_
-#define CONFIGMGR_API_GROUPOBJECTS_HXX_
-
-#include "groupaccess.hxx"
-#include "groupupdate.hxx"
-#include "propertysetaccess.hxx"
-#include "elementaccess.hxx"
-
-#include "apiaccessobj.hxx"
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
-
-//==========================================================================
-//= Inner Group Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are inner nodes and groups of other nodes
-*/
- class OInnerGroupInfo
- : public BasicInnerElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OInnerGroupInfo(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are inner nodes and groups of other nodes
-*/
- class OInnerGroupUpdate
- : public BasicInnerElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OInnerGroupUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//==========================================================================
-//= Set Element Group Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are set elements and groups of other nodes
-*/
- class OSetElementGroupInfo
- : public BasicSetElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OSetElementGroupInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are set elements and groups of other nodes
-*/
- class OSetElementGroupUpdate
- : public BasicSetElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OSetElementGroupUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//==========================================================================
-//= Root Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are root nodes and groups of other nodes
-*/
- class ORootElementGroupInfo
- : public BasicRootElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- ORootElementGroupInfo(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::RootElement& getElementClass();
- private:
- configapi::OReadRootElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are root nodes and groups of other nodes
-*/
- class ORootElementGroupUpdate
- : public BasicUpdateElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- ORootElementGroupUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_GROUPOBJECTS_HXX_
-
-
diff --git a/configmgr/source/api2/groupupdate.cxx b/configmgr/source/api2/groupupdate.cxx
deleted file mode 100644
index 84fd40e914b5..000000000000
--- a/configmgr/source/api2/groupupdate.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "groupupdate.hxx"
-#include "updateimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apitypes.hxx"
-
-#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// class BasicGroup
-//////////////////////////////////////////////////////////////////////////////////
-
-// XInterface joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicGroup::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicGroupAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameReplace *>(this)
- );
- }
- return aRet;
-}
-
-// XTypeProvider joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Type > SAL_CALL BasicGroup::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- BasicGroupAccess::getTypes());
-
- return aTypes.getTypes();
-}
-
-//uno::Sequence< sal_Int8 > SAL_CALL BasicGroup::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
-//////////////////////////////////////////////////////////////////////////////////
-
-// safe write access
-/////////////////////////////////////////////////////////////
-configapi::NodeGroupAccess& BasicGroup::getGroupNode()
-{
- configapi::NodeGroupAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update interface missing.")),
- static_cast< css::container::XNameReplace * >(this)
- );
- }
- return *pAccess;
-}
-
-// New Interface methods
-// XNameReplace
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicGroup::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getGroupNode(), rName, rElement );
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/groupupdate.hxx b/configmgr/source/api2/groupupdate.hxx
deleted file mode 100644
index 3d172a265c12..000000000000
--- a/configmgr/source/api2/groupupdate.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPUPDATE_HXX_
-#define CONFIGMGR_API_GROUPUPDATE_HXX_
-
-#include "groupaccess.hxx"
-#include <com/sun/star/container/XNameReplace.hpp>
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
- namespace configapi { class NodeGroupAccess; }
-
-//==========================================================================
-//= BasicGroup
-//==========================================================================
-
-/** base class for configuration nodes which are dynamic sets of complex types (trees)
-*/
- class BasicGroup
- : public BasicGroupAccess
- , public css::container::XNameReplace
- {
- protected:
- // Destructors
- virtual ~BasicGroup() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicGroupAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicGroupAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicGroupAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicGroupAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicGroupAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- configapi::NodeGroupAccess& getGroupNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess() = 0;
- };
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_GROUPUPDATE_HXX_
-
-
diff --git a/configmgr/source/api2/listenercontainer.cxx b/configmgr/source/api2/listenercontainer.cxx
deleted file mode 100644
index 2b0351be684b..000000000000
--- a/configmgr/source/api2/listenercontainer.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "listenercontainer.hxx"
-#include <com/sun/star/lang/XEventListener.hpp>
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// class DisposeNotifier
-//-----------------------------------------------------------------------------
-
-void DisposeNotifier::appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer)
-{
- if (pContainer)
- {
- {
- cppu::OInterfaceIteratorHelper aIterator(*pContainer);
- while (aIterator.hasMoreElements())
- {
- aListeners.push_back(uno::Reference< lang::XEventListener >::query(aIterator.next()));
- }
- }
- pContainer->clear();
- }
-}
-//-----------------------------------------------------------------------------
-void DisposeNotifier::notify()
-{
- for(std::vector< uno::Reference< lang::XEventListener > >::iterator it = aListeners.begin(); it != aListeners.end(); ++it)
- {
- if (it->is())
- {
- try { (*it)->disposing(aEvent); } catch (uno::Exception & ) {}
- it->clear();
- }
- }
- aListeners.clear();
-}
-
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- }
-}
-
-
diff --git a/configmgr/source/api2/listenercontainer.hxx b/configmgr/source/api2/listenercontainer.hxx
deleted file mode 100644
index 72598f0ab223..000000000000
--- a/configmgr/source/api2/listenercontainer.hxx
+++ /dev/null
@@ -1,581 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_LISTENERCONTAINER_HXX_
-#define CONFIGMGR_API_LISTENERCONTAINER_HXX_
-
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
-#include "datalock.hxx"
-#include "utility.hxx"
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-/////////////////////////////////////////////////////////////////////////////////////////////
-
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-//-----------------------------------------------------------------------------
- template <class Listener>
- class ListenerContainerIterator
- {
- public:
- /**
- * Create an iterator over the elements of the container. The iterator
- * copies the elements of the conatainer. A change to the container does not
- * affect the iterator.<BR>
- * Remark: The copy is on demand. The iterator copy the elements only if the container
- * change the contens. It is not allowed to destroy the container if a iterator exist.
- *
- * @param rCont the container of the elements.
- */
- ListenerContainerIterator( cppu::OInterfaceContainerHelper& rCont )
- : m_aIter(rCont)
- , m_xNext()
- { advance(); }
-
- /**
- * Release the connection to the container.
- */
- ~ListenerContainerIterator() {}
-
- /** Return true, if there are more elements in the iterator. */
- sal_Bool hasMoreElements() const { return m_xNext.is() != 0; }
-
- /** Return the next element of the iterator. Call this method if
- * hasMoreElements return false, is an error.
- */
- uno::Reference<Listener> next();
-
- private:
- void advance();
-
- cppu::OInterfaceIteratorHelper m_aIter;
- uno::Reference<Listener> m_xNext;
- };
-//-----------------------------------------------------------------------------
- class DisposeNotifier
- {
- lang::EventObject aEvent;
- std::vector< uno::Reference< lang::XEventListener > > aListeners;
- public:
- explicit
- DisposeNotifier(uno::Reference<uno::XInterface> const& aInterface) : aEvent(aInterface) {}
-
- void appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer);
- void notify();
- };
-//-----------------------------------------------------------------------------
- struct BasicContainerInfo
- {
- uno::XInterface* pInterface;
- cppu::OMultiTypeInterfaceContainerHelper* pContainer;
- BasicContainerInfo() : pInterface(0), pContainer(0) {}
- };
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- class SpecialListenerContainer
- {
- public:
- /**
- * Create a container of interface containers.
- */
- SpecialListenerContainer(std::vector<BasicContainerInfo>::size_type nCount, KeyToIndex_ aMapper)
- : m_aSpecialHelper(UnoApiLock::getLock())
- , m_aContainers(nCount)
- , m_aMapper(aMapper)
- , m_bDisposeLock(false)
- {}
-
- ~SpecialListenerContainer()
- {
- OSL_ENSURE(isDisposed(), "ERROR: Object was not disposed properly");
- }
- public:
- /**
- * check whether this is disposed or still alive
- * @param pObject
- * an interface on the object on which's behalf the operation was started
- * @return <FALSE/>
- * if the object is being disposed
- * @throw com::sun::star::lang::DisposedException
- * if the object was disposed completely
- */
- bool checkAlive(uno::XInterface* pObject = 0) volatile const throw(lang::DisposedException);
-
- /// return whether the object is completely alive
- bool isAlive() volatile const throw();
- /// return whether the object is currently being disposed
- bool isDisposing()volatile const throw();
- /// return whether the object is completely disposed
- bool isDisposed()volatile const throw();
-
- /// return whether the object is present in this container
- bool isAvailable(std::vector<BasicContainerInfo>::size_type nIndex) const throw()
- {
- return nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface;
- }
-
- std::vector<BasicContainerInfo>::size_type getSize() const
- {
- return m_aContainers.size();
- }
-
- /// return the interface associated with an index
- void setObjectAt(std::vector<BasicContainerInfo>::size_type nIndex, uno::XInterface* pInterface)
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if (isAlive())
- {
- OSL_ENSURE( nIndex < m_aContainers.size(), " Invalid Index into Notifier");
- OSL_ENSURE( pInterface, "Invalid NULL Interface passed into Notifier");
-
- if ( nIndex < m_aContainers.size() && pInterface != NULL)
- {
- OSL_ENSURE( m_aContainers[nIndex].pInterface == NULL, "Interface already set");
- if (m_aContainers[nIndex].pInterface == NULL)
- m_aContainers[nIndex].pInterface = pInterface;
- }
- }
- }
-
-
- /// return the interface associated with an index
- uno::Reference<uno::XInterface> getObjectAt(std::vector<BasicContainerInfo>::size_type nIndex) const
- {
- uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
- return xRet;
- }
-
- /// return the interface associated with an index
- uno::Reference<uno::XInterface> getObjectForKey(Key_ const& aKey ) const
- {
- std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
- uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
- return xRet;
- }
-
- /**
- * Call disposing on all object in all the container for anIndex
- * and in the containers for the associated indices
- * support XEventListener. Then clear the container.
- */
- bool disposeOne( std::vector<BasicContainerInfo>::size_type anIndex ) throw();
-
- /**
- * Start disposing this object
- * @return <TRUE/>
- * if disposing has been started
- * @return <FALSE/>
- * if disposing had already been started before
- */
- bool beginDisposing() throw();
- /**
- * Continue disposing this object
- * <p> Call disposing on all object in all the containers that
- * support XEventListener. Then clear the container.
- * </p>
- * @return <TRUE/>
- * if disposing has been started
- * @return <FALSE/>
- * if disposing had already been started before
- */
- void notifyDisposing() throw();
-
- /// mark the end of the dispose processing
- void endDisposing() throw();
-
- public:
- /**
- * Return the specuial container created under this key.
- * @return the container created under this key. If the container
- * was not created, null was returned.
- */
- cppu::OInterfaceContainerHelper * getSpecialContainer( const Key_ & aKey) const
- { return m_aSpecialHelper.aLC.getContainer(aKey); }
-
- /**
- * Return the containerhelper created under this index.
- * @return the container helper created under this key. If the container helper
- * was not created, null was returned.
- */
- cppu::OMultiTypeInterfaceContainerHelper * getContainerHelper( std::vector<BasicContainerInfo>::size_type nIndex) const
- {
- return ((nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 );
- }
- /**
- * Return the container for the given type created under this index.
- * @return the container created under this key. If the container
- * was not created, null was returned.
- */
- cppu::OInterfaceContainerHelper * getContainer( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type & aType) const
- {
- cppu::OMultiTypeInterfaceContainerHelper* pContainer = (nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 ;
-
- return pContainer ? pContainer->getContainer(aType) : 0;
- }
-
- /**
- * Insert an element in the container specified with the index and type. The position is not specified.
- * The interface at the given index must be set already.
- * @param aKey the id of the container.
- * @param xListener the added interface. It is allowed to insert null or
- * the same pointer more than once.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- /**
- * Remove an element from the container specified with the index and type.
- * It uses the equal definition of uno objects to remove the interfaces.
- * @param aKey the id of the container.
- * @param xListener the removed interface.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
-
-
- /**
- * Insert an element in the special container specified with the key. The position is not specified.
- * The interface at the given index must be set already.
- * @param aKey the id of the container.
- * @param xListener the added interface. It is allowed to insert null or
- * the same pointer more than once.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 addSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- /**
- * Remove an element from the container specified with the key.
- * It uses the equal definition of uno objects to remove the interfaces.
- * @param aKey the id of the container.
- * @param xListener the removed interface.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 removeSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- private:
- void implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex);
-
- cppu::OBroadcastHelperVar< cppu::OMultiTypeInterfaceContainerHelperVar< Key_,KeyHash_,KeyEq_ >, Key_ > m_aSpecialHelper;
- std::vector<BasicContainerInfo> m_aContainers;
- KeyToIndex_ m_aMapper;
- bool m_bDisposeLock;
- };
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::checkAlive(uno::XInterface* pObject) volatile const throw(lang::DisposedException)
- {
- bool bAlive = !m_aSpecialHelper.bInDispose;
- if (m_aSpecialHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The object has already been disposed")),pObject);
- }
- return bAlive;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isAlive() volatile const throw()
- {
- return !m_aSpecialHelper.bInDispose && !m_aSpecialHelper.bDisposed;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isDisposing() volatile const throw()
- {
- return !!m_aSpecialHelper.bInDispose;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isDisposed() volatile const throw()
- {
- return !!m_aSpecialHelper.bDisposed;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::disposeOne(std::vector<BasicContainerInfo>::size_type nIndex) throw()
- {
- // OSL_ENSURE(!isDisposed(),"Object is already disposed in toto");
- if (isAlive())
- {
- if (nIndex < m_aContainers.size())
- {
- if (uno::XInterface* pObject = m_aContainers[nIndex].pInterface)
- {
- DisposeNotifier aNotifier(pObject);
-
- implFillDisposer(aNotifier, nIndex);
- m_aContainers[nIndex].pInterface = 0;
- delete m_aContainers[nIndex].pContainer;
-
- aNotifier.notify();
- }
- }
- return true;
- }
- else
- return false;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::beginDisposing() throw()
- {
- if (isAlive())
- {
- m_aSpecialHelper.bInDispose = sal_True;
- m_bDisposeLock = true;
-
- return true;
- }
- return false;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::notifyDisposing() throw()
- {
- OSL_ENSURE(isDisposing(),"Disposing isn't in progress on this object");
- OSL_ENSURE(m_bDisposeLock,"Duplicate call for dispose notification or disposing is not taking place");
-
- if (m_bDisposeLock)
- {
- OSL_ASSERT(m_aSpecialHelper.bInDispose);
-
- lang::EventObject aBaseEvt;
- std::vector<DisposeNotifier> aNotifiers;
-
- if (std::vector<BasicContainerInfo>::size_type size = m_aContainers.size())
- {
- aNotifiers.reserve(m_aContainers.size());
-
- aBaseEvt.Source = m_aContainers[0].pInterface;
- for(std::vector<BasicContainerInfo>::size_type ix = 0; ix < size; ++ix)
- {
- if (m_aContainers[ix].pInterface)
- {
- aNotifiers.push_back(DisposeNotifier(m_aContainers[ix].pInterface));
- implFillDisposer(aNotifiers.back(), ix);
- m_aContainers[ix].pInterface = 0;
- delete m_aContainers[ix].pContainer;
- }
- }
- }
-
- m_bDisposeLock = false;
-
- for(std::vector<BasicContainerInfo>::size_type jx = 0, count = aNotifiers.size(); jx < count; ++jx)
- {
- aNotifiers[jx].notify();
- }
- // in case we missed something
- m_aSpecialHelper.aLC.disposeAndClear( aBaseEvt );
- }
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::endDisposing() throw()
- {
- OSL_ENSURE(isDisposing(),"Disposing isn't in progress on this object");
-
- if (!isAlive())
- {
- OSL_ENSURE(!m_bDisposeLock,"Did you forget to notify ?");
-
- m_aSpecialHelper.bDisposed = sal_True;
- m_aSpecialHelper.bInDispose = sal_False;
-
- if (m_bDisposeLock)
- {
- m_bDisposeLock = false;
- }
- }
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
- {
- if ( isAlive() )
- {
- if (m_aContainers[nIndex].pContainer == 0)
- m_aContainers[nIndex].pContainer = new cppu::OMultiTypeInterfaceContainerHelper(UnoApiLock::getLock());
-
- return m_aContainers[nIndex].pContainer->addInterface(aType,xListener);
- }
-
- else if (xListener.is())
- {
- lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
- try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
- }
-
- }
- else
- OSL_ENSURE(false, "Invalid index or interface not set");
-
- return 0;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
- {
- if ( isAlive() )
- {
- return m_aSpecialHelper.aLC.addInterface(aKey,xListener);
- }
-
- else if (xListener.is())
- {
- lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
- try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
- }
- }
- else
- OSL_ENSURE(false, "Invalid index or interface not set");
-
- return 0;
- }
-//-----------------------------------------------------------------------------
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if ( isAlive() )
- {
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pContainer )
- {
- return m_aContainers[nIndex].pContainer->removeInterface(aType,xListener);
- }
- }
- return 0;
- }
-//-----------------------------------------------------------------------------
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if ( isAlive() )
- return m_aSpecialHelper.aLC.removeInterface(aKey, xListener );
-
- else
- return 0;
- }
-//-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
-/* template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::Index
- SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findIndexForKey(Key const& aKey)
- {
- m_aMapper.findIndexForKey(aKey);
- }
-//-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findKeysForIndex(std::vector<BasicContainerInfo>::size_type nIndex, std::vector<Key_> & aKeys)
- {
- aKeys.clear();
- m_aMapper.findKeysForIndex(nIndex,aKeys);
- return !aKeys.empty();
- }
-*///-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex)
- {
- if (cppu::OMultiTypeInterfaceContainerHelper* pMultiContainer = m_aContainers[nIndex].pContainer)
- {
- uno::Sequence< uno::Type > aTypes(pMultiContainer->getContainedTypes());
- for (sal_Int32 ix = 0; ix < aTypes.getLength(); ++ix)
- {
- cppu::OInterfaceContainerHelper* pContainer = pMultiContainer->getContainer(aTypes[ix]);
- OSL_ENSURE(pContainer,"No container, but the type ?");
- if (pContainer)
- aNotifier.appendAndClearContainer(pContainer);
- }
- }
- std::vector<Key_> aKeys;
- if (m_aMapper.findKeysForIndex(nIndex,aKeys))
- {
- for(typename std::vector<Key_>::iterator it = aKeys.begin(); it != aKeys.end(); ++it)
- {
- if (cppu::OInterfaceContainerHelper* pContainer = m_aSpecialHelper.aLC.getContainer(*it))
- {
- aNotifier.appendAndClearContainer(pContainer);
- }
- }
- }
- }
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
- template <class Listener>
- inline
- void ListenerContainerIterator<Listener>::advance()
- {
- while (!m_xNext.is() && m_aIter.hasMoreElements())
- {
- m_xNext = m_xNext.query( m_aIter.next() );
- }
- }
-//-----------------------------------------------------------------------------
-
- template <class Listener>
- uno::Reference<Listener> ListenerContainerIterator<Listener>::next()
- {
- uno::Reference<Listener> xRet(m_xNext);
- m_xNext.clear();
- advance();
- return xRet;
- }
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- }
-}
-#endif // CONFIGMGR_API_LISTENERCONTAINER_HXX_
-
-
diff --git a/configmgr/source/api2/makefile.mk b/configmgr/source/api2/makefile.mk
deleted file mode 100644
index 314ca98752bd..000000000000
--- a/configmgr/source/api2/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=api2
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/broadcaster.obj \
- $(SLO)$/listenercontainer.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/providerimpl.obj \
- $(SLO)$/accessimpl.obj \
- $(SLO)$/apiaccessobj.obj \
- $(SLO)$/apiserviceinfo.obj \
- $(SLO)$/apifactory.obj \
- $(SLO)$/apifactoryimpl.obj \
- $(SLO)$/apinodeaccess.obj \
- $(SLO)$/apinodeupdate.obj \
- $(SLO)$/apinotifierimpl.obj \
- $(SLO)$/apitreeaccess.obj \
- $(SLO)$/apitreeimplobj.obj \
- $(SLO)$/confignotifier.obj \
- $(SLO)$/committer.obj \
- $(SLO)$/elementaccess.obj \
- $(SLO)$/elementimpl.obj \
- $(SLO)$/groupaccess.obj \
- $(SLO)$/groupobjects.obj \
- $(SLO)$/groupupdate.obj \
- $(SLO)$/propertiesfilterednotifier.obj \
- $(SLO)$/propertyinfohelper.obj \
- $(SLO)$/propertysetaccess.obj \
- $(SLO)$/propsetaccessimpl.obj \
- $(SLO)$/setaccess.obj \
- $(SLO)$/setobjects.obj \
- $(SLO)$/setupdate.obj \
- $(SLO)$/translatechanges.obj \
- $(SLO)$/treeiterators.obj \
- $(SLO)$/updateimpl.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/api2/notifierimpl.hxx b/configmgr/source/api2/notifierimpl.hxx
deleted file mode 100644
index 6b4a9965ae6c..000000000000
--- a/configmgr/source/api2/notifierimpl.hxx
+++ /dev/null
@@ -1,238 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-#include "listenercontainer.hxx"
-
-#include "noderef.hxx"
-#include "valueref.hxx"
-
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/beans/XVetoableChangeListener.hpp>
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <com/sun/star/container/XContainerListener.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-
-#include "propertiesfilterednotifier.hxx"
-
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-
- struct SubNodeHash
- {
- size_t operator() (const configuration::SubNodeID& rKey) const {return rKey.hashCode();}
- };
- struct SubNodeEq
- {
- bool operator() (const configuration::SubNodeID& lhs,const configuration::SubNodeID& rhs) const {return lhs == rhs;}
- };
- struct SubNodeToIndex
- {
- rtl::Reference< configuration::Tree > aTree;
-
- SubNodeToIndex( rtl::Reference< configuration::Tree > const& rTree ) : aTree(rTree) {}
-
- bool findKeysForIndex(unsigned int nNode, std::vector<configuration::SubNodeID>& aList)
- {
- aList.clear();
- configuration::getAllChildrenHelper(configuration::findNodeFromIndex(aTree,nNode), aList);
- return !aList.empty();
- }
- unsigned int findIndexForKey(configuration::SubNodeID const& aNode)
- {
- return aNode.getParentID().toIndex();
- }
- };
-
- /// manages collections of event listeners observing a whole config tree, thread-safe
- class NotifierImpl : public vos::OReference
- {
- public:
- SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex> m_aListeners;
-
- public:
- /// construct this around the given Implementation, for the given tree
- explicit
- NotifierImpl(rtl::Reference< configuration::Tree > const& aTree);
- ~NotifierImpl();
-
- /// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addSpecialListener(aNode,xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addSpecialListener(aNode,xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing all properties of <var>aNode</var>.
- */
- void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
- */
- void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence< rtl::OUString> const& aNames)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
- OSL_PRECOND(aNames.getLength() > 0, "ERROR: Unexpected empty sequence");
-
- uno::Reference< css::beans::XPropertiesChangeListener > xForwarder( new PropertiesFilteredNotifier(xListener,aNames) );
- // ignore the names for now
- add(aNode,xForwarder);
- }
-
- // ---------------------------------------------------------------------------------------------------
- /// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeSpecialListener(aNode,xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeSpecialListener(aNode,xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
-
- /** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing any properties of <var>aNode</var>.
- */
- void remove(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- // ---------------------------------------------------------------------------------------------------
- };
-
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_NOTIFIERIMPL_HXX_
diff --git a/configmgr/source/api2/objectregistry.hxx b/configmgr/source/api2/objectregistry.hxx
deleted file mode 100644
index 461120aa993b..000000000000
--- a/configmgr/source/api2/objectregistry.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_OBJECTREGISTRY_HXX_
-#define CONFIGMGR_API_OBJECTREGISTRY_HXX_
-
-#include "noderef.hxx"
-
-#include <osl/mutex.hxx>
-#include <vos/refernce.hxx>
-
-#include <hash_map>
-#include "tracer.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-
- class NodeElement;
-
- class ObjectRegistry : public vos::OReference
- {
- public:
- static NodeElement* notFound() { return 0; }
-
- struct KeyHash
- {
- size_t operator() (const configuration::NodeID& rKey) const {return rKey.hashCode();}
- };
- struct KeyEq
- {
- bool operator() (const configuration::NodeID& lhs,const configuration::NodeID& rhs) const {return lhs == rhs;}
- };
- typedef std::hash_map<configuration::NodeID,NodeElement*,KeyHash, KeyEq> ObjectMap;
- public:
- ObjectRegistry() {}
- ~ObjectRegistry();
-
- NodeElement* findElement(configuration::NodeID const& aNode) const
- {
- ObjectMap::const_iterator aFound = m_aMap.find(aNode);
-
- return (aFound != m_aMap.end()) ? aFound->second : notFound();
- }
- void registerElement(configuration::NodeID const& aNode, NodeElement* aElement)
- {
- OSL_ENSURE(m_aMap.find(aNode) == m_aMap.end(), "ERROR: Node is already registered");
-
- m_aMap[aNode] = aElement;
- }
- void revokeElement(configuration::NodeID const& aNode, NodeElement* aElement)
- {
- ObjectMap::iterator aFound = m_aMap.find(aNode);
-
- if (aFound != m_aMap.end())
- {
- OSL_ENSURE(aFound->second == aElement,"Found unexpected element in map");
-
- if (aFound->second == aElement)
- m_aMap.erase(aFound);
- }
- }
- private:
- ObjectMap m_aMap;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
diff --git a/configmgr/source/api2/propertiesfilterednotifier.cxx b/configmgr/source/api2/propertiesfilterednotifier.cxx
deleted file mode 100644
index a8cd0a50cd81..000000000000
--- a/configmgr/source/api2/propertiesfilterednotifier.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertiesfilterednotifier.hxx"
-
-#include <cppuhelper/queryinterface.hxx>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-
-//-----------------------------------------------------------------------------
-// class PropertiesFilteredNotifier
-//-----------------------------------------------------------------------------
-
-PropertiesFilteredNotifier::PropertiesFilteredNotifier(
- uno::Reference< beans::XPropertiesChangeListener >const& xTarget,
- uno::Sequence< rtl::OUString > const& aFilterNames
-)
-: m_aRefCount()
-, m_xTarget(xTarget)
-, m_aFilterNames(aFilterNames)
-{
- OSL_ENSURE(xTarget.is(),"PropertiesFilteredNotifier: FORWARDING TO NULL LISTENER");
- OSL_ENSURE(aFilterNames.getLength() > 0,"PropertiesFilteredNotifier: FILTER IS EMPTY (no target)");
-}
-//-----------------------------------------------------------------------------
-
-PropertiesFilteredNotifier::~PropertiesFilteredNotifier()
-{
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::acquire() throw()
-{
- m_aRefCount.acquire();
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::release( ) throw()
-{
- if (m_aRefCount.release() == 0)
- delete this;
-}
-//-----------------------------------------------------------------------------
-
-uno::Any SAL_CALL PropertiesFilteredNotifier::queryInterface( const uno::Type& aType )
- throw(uno::RuntimeException)
-{
- return cppu::queryInterface(aType
- , static_cast< beans::XPropertiesChangeListener *>(this)
- , static_cast< lang::XEventListener *>(this)
- , static_cast< uno::XInterface *>(this)
- );
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::disposing( const lang::EventObject& Source )
- throw(uno::RuntimeException)
-{
- if (m_xTarget.is())
- m_xTarget->disposing(Source);
-}
-//-----------------------------------------------------------------------------
-
-inline // private and only used twice
-bool PropertiesFilteredNotifier::implAccept(const ::com::sun::star::beans::PropertyChangeEvent& evt) const
-{
- // todo: optimize by presorting and binary searching
- sal_Int32 const nCount = m_aFilterNames.getLength();
-
- for (sal_Int32 i = 0; i<nCount; ++i)
- if (evt.PropertyName == m_aFilterNames[i])
- return true;
- return false;
-}
-//-----------------------------------------------------------------------------
-
-// private and only used once
-uno::Sequence< beans::PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const uno::Sequence< beans::PropertyChangeEvent >& evt) const
-{
- sal_Int32 const nSize = evt.getLength();
- sal_Int32 nAccepted = 0;
-
- while ( nAccepted < nSize && implAccept(evt[nAccepted]) )
- ++nAccepted;
-
- if (nAccepted == nSize) // all accepted
- return evt;
-
- // create a modified copy
- uno::Sequence< beans::PropertyChangeEvent > aResult(evt);
- for (sal_Int32 nCur = nAccepted+1; nCur<nSize; ++nCur)
- {
- if (implAccept(evt[nCur]))
- {
- aResult[nAccepted++] = evt[nCur];
- }
- }
- aResult.realloc(nAccepted);
- OSL_ASSERT(aResult.getLength() == nAccepted);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::propertiesChange( const uno::Sequence< beans::PropertyChangeEvent >& evt )
- throw(uno::RuntimeException)
-{
- uno::Sequence< beans::PropertyChangeEvent > aFilteredEvt( implFilter(evt) );
-
- if (aFilteredEvt.getLength() > 0)
- {
- if (m_xTarget.is())
- m_xTarget->propertiesChange(aFilteredEvt);
- }
-}
-//-----------------------------------------------------------------------------
-
-}
-
-
diff --git a/configmgr/source/api2/propertiesfilterednotifier.hxx b/configmgr/source/api2/propertiesfilterednotifier.hxx
deleted file mode 100644
index 50b668542f47..000000000000
--- a/configmgr/source/api2/propertiesfilterednotifier.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-#define CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- class PropertiesFilteredNotifier
- : public ::com::sun::star::beans::XPropertiesChangeListener
- {
- public:
- PropertiesFilteredNotifier(
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > const& xTarget,
- ::com::sun::star::uno::Sequence< ::rtl::OUString > const& aFilterNames
- );
- virtual ~PropertiesFilteredNotifier();
-
- public:
- virtual void SAL_CALL acquire( ) throw();
- virtual void SAL_CALL release( ) throw();
-
- virtual ::com::sun::star::uno::Any SAL_CALL
- queryInterface( const ::com::sun::star::uno::Type& aType )
- throw(::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL
- disposing( const ::com::sun::star::lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException) ;
-
- virtual void SAL_CALL
- propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt )
- throw(::com::sun::star::uno::RuntimeException);
- private:
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >
- implFilter(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt)
- const;
-
- bool implAccept(const ::com::sun::star::beans::PropertyChangeEvent& evt) const;
-
- ::vos::ORefCount m_aRefCount;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > m_xTarget;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aFilterNames;
- };
-}
-
-#endif // CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-
diff --git a/configmgr/source/api2/propertyinfohelper.cxx b/configmgr/source/api2/propertyinfohelper.cxx
deleted file mode 100644
index 099fd48ff54c..000000000000
--- a/configmgr/source/api2/propertyinfohelper.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertyinfohelper.hxx"
-#include "configpath.hxx"
-#include "attributes.hxx"
-
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HDL_
-#include <com/sun/star/beans/PropertyAttribute.hdl>
-#endif
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
- namespace beans = ::com::sun::star::beans;
-
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-beans::Property helperMakeProperty(rtl::OUString const& aName,
- node::Attributes const aAttributes,
- uno::Type const& aType,
- bool bDefaultable )
- throw(uno::RuntimeException)
-{
- namespace PropertyAttribute = com::sun::star::beans::PropertyAttribute;
-
- sal_Int16 nPropAttributes = 0;
- if (aAttributes.isReadonly()) nPropAttributes |= PropertyAttribute::READONLY;
- if (aAttributes.isNullable()) nPropAttributes |= PropertyAttribute::MAYBEVOID;
- /*if ( aAttributes.bNotified)*/ nPropAttributes |= PropertyAttribute::BOUND;
- /*if ( aAttributes.bConstrained)nPropAttributes |= PropertyAttribute::CONSTRAINED;*/
-
- if ( aAttributes.isRemovable()) nPropAttributes |= PropertyAttribute::REMOVABLE;
- if ( bDefaultable) nPropAttributes |= PropertyAttribute::MAYBEDEFAULT;
-
- return beans::Property(aName, -1, aType, nPropAttributes);
-}
-//-----------------------------------------------------------------------------
- }
-
-}
-
-
diff --git a/configmgr/source/api2/propertyinfohelper.hxx b/configmgr/source/api2/propertyinfohelper.hxx
deleted file mode 100644
index 5f56596847bf..000000000000
--- a/configmgr/source/api2/propertyinfohelper.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-#define CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace beans = ::com::sun::star::beans;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace node { struct Attributes; }
-
- namespace configapi
- {
- // translation helper
- beans::Property helperMakeProperty( rtl::OUString const& aName, node::Attributes const aAttributes, uno::Type const& aType, bool bDefaultable )
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/propertysetaccess.cxx b/configmgr/source/api2/propertysetaccess.cxx
deleted file mode 100644
index 98176016cf29..000000000000
--- a/configmgr/source/api2/propertysetaccess.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertysetaccess.hxx"
-#include "propsetaccessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// class BasicPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////////
-// getting Property Metadata
-//////////////////////////////////////////////////////////////////////////////////
-
-// XPropertySet & XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< beans::XPropertySetInfo > SAL_CALL BasicPropertySet::getPropertySetInfo( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetPropertySetInfo( getNode(), NULL != maybeGetUpdateAccess() );
-}
-
-// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL BasicPropertySet::getHierarchicalPropertySetInfo( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertySetInfo( getNode() );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
-//////////////////////////////////////////////////////////////////////////////////
-
-/// get the access for updating, check that it is present
-configapi::NodeGroupAccess& BasicPropertySet::getGroupNode()
-{
- configapi::NodeGroupAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with PropertyVetoException");
-
- if (!pAccess)
- {
- throw beans::PropertyVetoException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: INTERNAL VETO - Write operation invoked on a read-only node access")),
- static_cast< beans::XPropertySet * >(this)
- );
- }
- return *pAccess;
-}
-
-// XPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetPropertyValue( getGroupNode(), aPropertyName, aValue );
-}
-
-// XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetPropertyValues( getGroupNode(), PropertyNames, Values );
-}
-
-// XHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetHierarchicalPropertyValue( getGroupNode(), aPropertyName, aValue );
-}
-
-// XMultiHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetHierarchicalPropertyValues( getGroupNode(), PropertyNames, Values );
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-// getting values
-//////////////////////////////////////////////////////////////////////////////////
-// XPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetPropertyValue( getNode(), aPropertyName );
-}
-
-// XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- return configapi::implGetPropertyValues( getNode(), aPropertyNames );
-}
-
-// XHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertyValue( getNode(), aPropertyName );
-}
-
-// XMultiHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertyValues( getNode(), aPropertyNames );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// adding/removing listeners
-//////////////////////////////////////////////////////////////////////////////////
-
-void SAL_CALL BasicPropertySet::addVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyName );
-}
-
-void SAL_CALL BasicPropertySet::addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyName );
-}
-
-void SAL_CALL BasicPropertySet::addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyNames );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::removeVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener, aPropertyName );
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener, aPropertyName );
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-//---------------------------------------------------------------------------------
-
-
-//////////////////////////////////////////////////////////////////////////////////
-// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implFirePropertiesChangeEvent( getNode(),aPropertyNames , xListener );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// XPropertyState / XMultiPropertyStates
-//////////////////////////////////////////////////////////////////////////////////
-
-// getting property states
-//////////////////////////////////////////////////////////////////////////////////
-
-beans::PropertyState SAL_CALL BasicPropertySet::getPropertyState( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyState( getNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyStates( getNode(), aPropertyNames );
-}
-//---------------------------------------------------------------------------------
-
-// setting to default state
-//////////////////////////////////////////////////////////////////////////////////
-
-void SAL_CALL BasicPropertySet::setPropertyToDefault( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- configapi::implSetPropertyToDefault( getGroupNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
-{
- configapi::implSetPropertiesToDefault( getGroupNode(), aPropertyNames);
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::setAllPropertiesToDefault( )
- throw (uno::RuntimeException)
-{
- configapi::implSetAllPropertiesToDefault( getGroupNode() );
-}
-//---------------------------------------------------------------------------------
-
-// getting defaults
-//////////////////////////////////////////////////////////////////////////////////
-
-uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-
-{
- return configapi::implGetPropertyDefault( getNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetPropertyDefaults( getNode(), aPropertyNames);
-}
-//---------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/propertysetaccess.hxx b/configmgr/source/api2/propertysetaccess.hxx
deleted file mode 100644
index 9ab9dbd99361..000000000000
--- a/configmgr/source/api2/propertysetaccess.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYSET_HXX_
-#define CONFIGMGR_API_PROPERTYSET_HXX_
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XMultiHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/beans/XMultiPropertyStates.hpp>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
-/////////////////////////////////////////////////////////////////////////////////////////////
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- namespace configapi
- {
- class NodeGroupAccess;
- class NodeGroupInfoAccess;
- }
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-/** implements the interfaces supported by a group node, viewed as a property set
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeGroup(Info)Access</type>.</p>
-*/
-class BasicPropertySet
-: public ::cppu::ImplHelper6
- < beans::XPropertySet
- , beans::XMultiPropertySet
- , beans::XHierarchicalPropertySet
- , beans::XMultiHierarchicalPropertySet
- , beans::XPropertyState
- , beans::XMultiPropertyStates
- >
-{
-protected:
-// Constructors & Destructors
- virtual ~BasicPropertySet() {}
-
-public:
-// getting Property Metadata
- // XPropertySet & XMultiPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
- getPropertySetInfo( )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet & XHierarchicalMultiPropertySet
- virtual uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL
- getHierarchicalPropertySetInfo( )
- throw(uno::RuntimeException);
-
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
- // XPropertySet
- virtual void SAL_CALL
- setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XHierarchicalPropertySet
- virtual void SAL_CALL
- setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- virtual void SAL_CALL
- setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
-// getting values
- // XPropertySet
- virtual uno::Any SAL_CALL
- getPropertyValue( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet
- virtual uno::Any SAL_CALL
- getHierarchicalPropertyValue( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- virtual uno::Sequence< uno::Any > SAL_CALL
- getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
-// adding listeners
- // XPropertySet
- virtual void SAL_CALL
- addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
-// removing listeners
- // XPropertySet
- virtual void SAL_CALL
- removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& Listener )
- throw(uno::RuntimeException);
-
-// SPECIAL: support for VetoableChangeListeners
- // XPropertySet
- virtual void SAL_CALL
- addVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-// SPECIAL: firePropertiesChangeEvent
- // XMultiPropertySet
- virtual void SAL_CALL
- firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
-// XPropertyState
- virtual beans::PropertyState SAL_CALL
- getPropertyState( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- // see below:
- // virtual uno::Sequence< beans::PropertyState > SAL_CALL
- // getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
- // throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyToDefault( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual uno::Any SAL_CALL
- getPropertyDefault( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-// XMultiPropertyStates
- virtual uno::Sequence< beans::PropertyState > SAL_CALL
- getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
- throw (beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setAllPropertiesToDefault( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-protected:
- virtual configapi::NodeGroupInfoAccess& getNode() = 0;
- configapi::NodeGroupAccess& getGroupNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess() = 0;
-};
-
-//--------------------------------------------------------------------------
-
-}
-#endif // CONFIGMGR_API_PROPERTYSET_HXX_
-
-
diff --git a/configmgr/source/api2/propsetaccessimpl.cxx b/configmgr/source/api2/propsetaccessimpl.cxx
deleted file mode 100644
index 14f8309e8690..000000000000
--- a/configmgr/source/api2/propsetaccessimpl.cxx
+++ /dev/null
@@ -1,1284 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propsetaccessimpl.hxx"
-#include "propertyinfohelper.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "nodechange.hxx"
-#include "configgroup.hxx"
-#include "confignotifier.hxx"
-#include "broadcaster.hxx"
-#include "apitypes.hxx"
-#include "attributes.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <osl/diagnose.h>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace beans = css::beans;
-
-//-----------------------------------------------------------------------------------
-// a helper class
-//-----------------------------------------------------------------------------------
-
-class CollectProperties : configuration::NodeVisitor
-{
- std::vector< beans::Property > m_aProperties;
- sal_Bool m_bReadonly;
-public:
- CollectProperties(sal_Bool _bReadonly)
- : m_bReadonly(_bReadonly)
- { }
- CollectProperties(sal_Bool _bReadonly, sal_Int32 _nCount)
- : m_bReadonly(_bReadonly)
- { m_aProperties.reserve(_nCount); }
-
- uno::Sequence<beans::Property> forChildren(rtl::Reference< configuration::Tree > const& _aPropertyTree, configuration::NodeRef const& _rNode)
- {
- OSL_ENSURE( _rNode.isValid() && _aPropertyTree->isValidNode(_rNode.getOffset()), "Node to retrieve properties from does not match tree");
- reset();
- _aPropertyTree->dispatchToChildren(_rNode, *this);
- return makeSequence(m_aProperties);
- }
-
-private:
- void reset() { m_aProperties.clear(); }
-
- node::Attributes adjustAttributes(node::Attributes nNodeAttr);
-
- Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rValue);
- Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue);
-};
-
-//-----------------------------------------------------------------------------------
-node::Attributes CollectProperties::adjustAttributes(node::Attributes nNodeAttr)
-{
- if (m_bReadonly) nNodeAttr.markReadonly();
-
- return nNodeAttr;
-}
-
-//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue)
-{
- // can be default ?
- m_aProperties.push_back(
- helperMakeProperty( _rValue.m_sNodeName,
- adjustAttributes(_aTree->getAttributes(_rValue)),
- _aTree->getUnoType(_rValue),
- _aTree->hasNodeDefault(_rValue)
- )
- );
-
- return CONTINUE;
-}
-
-//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rNode)
-{
- // can be default ?
- OSL_ENSURE( configuration::isStructuralNode(_aTree,_rNode),
- "Unexpected value element node. Cannot get proper type for this node as property" );
-
- m_aProperties.push_back(
- helperMakeProperty( _aTree->getSimpleNodeName(_rNode.getOffset()),
- adjustAttributes(_aTree->getAttributes(_rNode)),
- getUnoInterfaceType(),
- _aTree->hasNodeDefault(_rNode)
- )
- );
-
- return CONTINUE;
-}
-
-//-----------------------------------------------------------------------------------
-// yet another helper class (more robust, but can't well be extended to be a HierarchicalPropertySetInfo though)
-//-----------------------------------------------------------------------------------
-
-class NodePropertySetInfo
- :public ::cppu::WeakImplHelper1< beans::XPropertySetInfo >
-{
- uno::Sequence< beans::Property > const m_aProperties;
-
-public:
- NodePropertySetInfo(uno::Sequence< beans::Property > const& _aProperties) throw(uno::RuntimeException)
- : m_aProperties(_aProperties)
- {
- }
-
- static NodePropertySetInfo* create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException);
- beans::Property const* begin() const throw() { return m_aProperties.getConstArray(); }
- beans::Property const* end() const throw() { return m_aProperties.getConstArray() + m_aProperties.getLength(); }
-
- beans::Property const* find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException);
-
- // XPropertySetInfo
- virtual uno::Sequence< beans::Property > SAL_CALL getProperties() throw(uno::RuntimeException);
- virtual beans::Property SAL_CALL getPropertyByName(const rtl::OUString& _rPropertyName) throw(beans::UnknownPropertyException, uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasPropertyByName(const rtl::OUString& _rPropertyName) throw(uno::RuntimeException);
-};
-
-//-----------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------
-NodePropertySetInfo* NodePropertySetInfo::create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rtl::Reference< configuration::Tree > aTree( _rNode.getTree() );
- OSL_ENSURE( !configuration::isEmpty(aTree.get()), "WARNING: Getting Tree information requires a valid tree");
- if (configuration::isEmpty(aTree.get())) return NULL;
-
- configuration::NodeRef aNode( _rNode.getNodeRef() );
- OSL_ENSURE( aNode.isValid() && aTree->isValidNode(aNode.getOffset()), "ERROR: Tree does not match node");
-
- uno::Sequence< beans::Property > aProperties = CollectProperties(_bReadonly).forChildren(aTree,aNode);
- OSL_ENSURE( aProperties.getLength() > 0, "ERROR: PropertySet (Configuration group) has no Properties");
-
- return new NodePropertySetInfo( aProperties );
-}
-
-//-----------------------------------------------------------------------------------
-struct MatchName // : std::unary_function< beans::Property, bool >
-{
- rtl::OUString sName;
- MatchName(rtl::OUString const& _sName) throw(uno::RuntimeException)
- : sName(_sName)
- {
- }
-
- bool operator()(beans::Property const& _aProperty) const
- {
- return !!(_aProperty.Name == this->sName);
- }
-};
-
-beans::Property const* NodePropertySetInfo::find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException)
-{
- beans::Property const* const first = this->begin();
- beans::Property const* const last = this->end();
-
- return std::find_if(first,last,MatchName(_rPropertyName));
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< beans::Property > SAL_CALL NodePropertySetInfo::getProperties() throw(uno::RuntimeException)
-{
- return m_aProperties;
-}
-//-----------------------------------------------------------------------------------
-beans::Property SAL_CALL NodePropertySetInfo::getPropertyByName(const rtl::OUString& _rPropertyName)
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- beans::Property const* pFound = find(_rPropertyName);
-
- if (pFound == this->end())
- {
- rtl::OUString sMessage = rtl::OUString::createFromAscii("Configuration - ");
- sMessage += rtl::OUString::createFromAscii("No Property named '");
- sMessage += _rPropertyName;
- sMessage += rtl::OUString::createFromAscii("' in this PropertySetInfo");
- throw beans::UnknownPropertyException(sMessage, static_cast<XPropertySetInfo*>(this));
- }
-
- return *pFound;
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL NodePropertySetInfo::hasPropertyByName(const rtl::OUString& _rPropertyName)
- throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- beans::Property const* pFound = find(_rPropertyName);
-
- return (pFound != this->end());
-}
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// getting Property Metadata
-//-----------------------------------------------------------------------------------
-
-// XPropertySet & XMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
- throw(uno::RuntimeException)
-{
- GuardedNodeData<NodeAccess> lock( rNode );
- return NodePropertySetInfo::create(rNode, !_bWriteable);
-}
-
-// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& /*rNode*/ )
- throw(uno::RuntimeException)
-{
- // TODO: Implement
- return 0;
-}
-
-//-----------------------------------------------------------------------------------
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
-//-----------------------------------------------------------------------------------
-
-// XPropertySet
-//-----------------------------------------------------------------------------------
-void implSetPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
- {
- OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- else
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValue );
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-void implSetPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
- {
- OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
-
- OSL_TRACE("Configuration: MultiPropertySet: trying to set unknown property - ignored");
- continue;
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValues[i] );
- if (aChange.maybeChange())
- {
- aChanges.add(aChange);
- }
- }
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,true));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, true);
- }
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::RelativePath const aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedValue.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' was not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- if (aNestedValue.isNode())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValue );
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,false));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, false);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XMultiHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
- try
- {
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedValue.isValid())
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to set unknown property - ignored");
- continue;
- }
- if ( aNestedValue.isNode() )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValues[i] );
- if (aChange.maybeChange())
- {
- aChanges.add(aChange);
- }
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("Configuration: MultiHierarchicalPropertySet: trying to set property <invalid path> - ignored");
- continue;
- }
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,false));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, false);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, true); // if we use 'false' we don't need 'Deep' change objects
- }
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-// getting values
-//-----------------------------------------------------------------------------------
-
-// XPropertySet
-//-----------------------------------------------------------------------------------
-uno::Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(aPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
- sMessage += aPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
-
- return configapi::makeElement( rNode.getFactory(), aTree, aChild );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (aChild.isValid())
- {
- aRet[i] = configapi::makeElement( rNode.getFactory(), aTree, aChild );
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OSL_TRACE("Configuration: MultiPropertySet: trying to get unknown property - returning void");
- }
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-// XHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-uno::Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedNode = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return configapi::makeElement( rNode.getFactory(), aTree, aNestedNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XMultiHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- try
- {
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (aNestedValue.isValid())
- {
- aRet[i] = configapi::makeElement( rNode.getFactory(), aTree, aNestedValue );
- }
- else
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to get unknown property - returning void");
- }
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to get property from unknown path - returning void");
- OSL_ASSERT(!aRet[i].hasValue());
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
-//------------------------------------------------------------------------------------------------------------------
-
-void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- OSL_ENSURE(xListener.is(), "ERROR: requesting to fire Events to a NULL listener.");
- if (!xListener.is())
- {
- return; // should this be an exception ??
- }
-
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<beans::PropertyChangeEvent> aEvents(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
- configapi::Factory& rFactory = rNode.getFactory();
-
- sal_Int32 nFire = 0;
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (aChild.isValid())
- {
- aEvents[nFire].Source = rNode.getUnoInstance();
- aEvents[nFire].PropertyName = aChildName;
- aEvents[nFire].PropertyHandle = -1;
-
- aEvents[nFire].NewValue = aEvents[nFire].OldValue = configapi::makeElement( rFactory, aTree, aChild );
- nFire++;
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OSL_TRACE("Configuration: MultiPropertySet: request to fire unknown property - skipping");
- }
- }
-
- if (nFire < count) aEvents.realloc(nFire);;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- xListener->propertiesChange(aEvents);
-}
-
-//------------------------------------------------------------------------------------------------------------------
-// XPropertyState
-//------------------------------------------------------------------------------------------------------------------
-
-beans::PropertyState implGetPropertyState( NodeAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild = configuration::getChildOrElement(aTree,aNode,aChildName);
- if (!aChild.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyState. Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return aTree->isNodeDefault(aChild) ? beans::PropertyState_DEFAULT_VALUE :
- aChild.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
- beans::PropertyState_DIRECT_VALUE;
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return beans::PropertyState_AMBIGUOUS_VALUE;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<beans::PropertyState> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildOrElementName(aPropertyNames[i],aTree,aNode);
-
- rtl::Reference< configuration::Tree > aChildTree( aTree);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aChildTree,aNode,aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyStates. Property '") );
- sMessage += aPropertyNames[i];
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aChildNode.isValid());
-
- aRet[i] = aChildTree->isNodeDefault(aChildNode) ? beans::PropertyState_DEFAULT_VALUE :
- aChildNode.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
- beans::PropertyState_DIRECT_VALUE;
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------------
-static inline configuration::NodeChange validateSetToDefaultHelper(configuration::GroupDefaulter& _rDefaulter, configuration::AnyNodeRef _aNode)
-{
- if (!_aNode.isNode())
- return _rDefaulter.validateSetToDefaultValue( _aNode.toValue() );
-
- else
- return _rDefaulter.validateSetToDefaultState( _aNode.toNode() );
-}
-//-----------------------------------------------------------------------------------
-void implSetPropertyToDefault( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- configuration::NodeChange aChange = validateSetToDefaultHelper( aDefaulter, aChild );
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (aChange.test().isChange() )
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,bLocal));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-//-----------------------------------------------------------------------------------
-void implSetPropertiesToDefault( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aPropertyNames.getLength(); i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildName( aPropertyNames[i], aTree, aNode ); // validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree, aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aTree->hasNodeDefault(aChild))
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
-
- if (aChild.isNode())
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- else
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' does not have a default value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
-
- configuration::NodeChange aChildChange = validateSetToDefaultHelper(aDefaulter, aChild );
- if (aChildChange.maybeChange())
- aChanges.add(aChildChange);
- }
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,bLocal));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, bLocal);
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
- throw(uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChanges aChanges = aDefaulter.validateSetAllToDefault( );
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,bLocal));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, bLocal);
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetPropertyDefault( NodeGroupInfoAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- uno::Any aDefault;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = aTree->getAnyChild(aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default. Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aChildNode.isNode())
- {
- aDefault = aTree->getNodeDefaultValue(aChildNode.toValue());
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aDefault;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetPropertyDefaults( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aDefaults(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildName(aPropertyNames[i],aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = aTree->getAnyChild(aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default. Property '") );
- sMessage += aPropertyNames[i];
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aChildNode.isNode())
- {
- aDefaults[i] = aTree->getNodeDefaultValue(aChildNode.toValue());
- }
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aDefaults;
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/propsetaccessimpl.hxx b/configmgr/source/api2/propsetaccessimpl.hxx
deleted file mode 100644
index 7c580dfd3022..000000000000
--- a/configmgr/source/api2/propsetaccessimpl.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-#define CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XMultiHierarchicalPropertySet.hpp>
-
-#ifndef CONFIGMGR_NO_PROPERTYSTATE
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
-#include <com/sun/star/beans/XPropertyState.hpp>
-#endif
-#endif
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeGroupInfoAccess;
- class NodeGroupAccess;
-
- // getting Property Metadata
- // XPropertySet & XMultiPropertySet
- uno::Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet & XHierarchicalMultiPropertySet
- uno::Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& rNode )
- throw(uno::RuntimeException);
-
- // setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
- // XPropertySet
- void implSetPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- void implSetPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XHierarchicalPropertySet
- void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // getting values
- // XPropertySet
- uno::Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- uno::Sequence< uno::Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet
- uno::Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- uno::Sequence< uno::Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // SPECIAL: firePropertiesChangeEvent
- // XMultiPropertySet
- void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
- // XPropertyState
- beans::PropertyState implGetPropertyState( NodeAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetPropertyToDefault( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- uno::Any implGetPropertyDefault( NodeGroupInfoAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertyState
- uno::Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetPropertiesToDefault( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
- throw(uno::RuntimeException);
-
- uno::Sequence< uno::Any > implGetPropertyDefaults( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
- }
-
-}
-#endif // CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/provider.cxx b/configmgr/source/api2/provider.cxx
deleted file mode 100644
index c6d24f5e3e2f..000000000000
--- a/configmgr/source/api2/provider.cxx
+++ /dev/null
@@ -1,711 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apiserviceinfo.hxx"
-#include "confapifactory.hxx"
-#include "configpath.hxx"
-#include "datalock.hxx"
-#include "provider.hxx"
-#include "providerimpl.hxx"
-#include "tracer.hxx"
-#include "bootstrap.hxx"
-#include "wrapexception.hxx"
-#include <osl/mutex.hxx>
-#include <rtl/ustrbuf.hxx>
-#ifndef __SGI_STL_ALGORITHM
-#include <algorithm>
-#endif
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- namespace
- {
- //------------------------------------------------------------------------
- sal_Char const * const aConfigProviderServices[] =
- {
- "com.sun.star.configuration.ConfigurationProvider",
- 0
- };
- sal_Char const * const aAdminProviderServices[] =
- {
- "com.sun.star.configuration.AdministrationProvider",
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceImplementationInfo const aConfigProviderInfo =
- {
- "com.sun.star.comp.configuration.ConfigurationProvider",
- aConfigProviderServices,
- 0
- };
- ServiceImplementationInfo const aAdminProviderInfo =
- {
- "com.sun.star.comp.configuration.AdministrationProvider",
- aAdminProviderServices,
- aConfigProviderServices
- };
- //------------------------------------------------------------------------
-
- sal_Char const * const
- aDefaultProviderServiceAndImplName = A_DefaultProviderServiceAndImplName;
-
- //------------------------------------------------------------------------
-
- sal_Char const * const aDefaultProviderServices[] =
- {
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceRegistrationInfo const aDefaultProviderInfo =
- {
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServices
- };
- SingletonRegistrationInfo const aDefaultProviderSingletonInfo =
- {
- A_DefaultProviderSingletonName,
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
- typedef uno::Reference< uno::XInterface > (OProviderImpl::*CreatorFunc)(const uno::Sequence< uno::Any >& aArguments);
- struct ServiceCreationInfo
- {
- ServiceRegistrationInfo const* info;
- CreatorFunc create;
- };
-
- static sal_Int32 getCreateServiceDataCount()
- {
- return 2;
- }
-
- static const ServiceCreationInfo* getCreateServiceData()
- {
- static ServiceCreationInfo const createServiceData[] =
- {
- { &configapi::aCreateReadAccessSI, &OProviderImpl::createReadAccess },
- { &configapi::aCreateUpdateAccessSI, &OProviderImpl::createUpdateAccess },
- };
- OSL_ENSURE(sizeof(createServiceData)/sizeof(createServiceData[0]) == getCreateServiceDataCount(),
- "getCreateServiceData : inconsistent data !");
- return createServiceData;
- }
- //------------------------------------------------------------------------
- }
-
- static ServiceCreationInfo const* findCreationInfo( const rtl::OUString& aServiceSpecifier )
- {
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceCreationInfo const& rCreationInfo = getCreateServiceData()[i];
-
- ServiceRegistrationInfo const* pInfo = rCreationInfo.info;
- if (!pInfo)
- continue;
-
- if (sal_Char const * pImplName = pInfo->implementationName)
- {
- if (0 == aServiceSpecifier.compareToAscii(pImplName))
- return &rCreationInfo;
- }
-
- if (sal_Char const * const* pNames = pInfo->registeredServiceNames)
- {
- while(*pNames)
- {
- if (0 == aServiceSpecifier.compareToAscii(*pNames))
- return &rCreationInfo;
-
- ++pNames;
- }
- }
- }
- // not found
- return 0;
- }
-
- //#define ID_PREFETCH 1
- static const int ID_PREFETCH=1;
- static const int ID_ENABLEASYNC=2;
-
- static inline
- rtl::OUString getPrefetchPropName() { return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrefetchNodes") ); }
- static inline
- rtl::OUString getEnableAsyncPropName() { return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("EnableAsync") ); }
- //=============================================================================
- //= OProvider
- //=============================================================================
- // service info export
- const ServiceRegistrationInfo* getConfigurationProviderServiceInfo()
- {
- return getRegistrationInfo(&aConfigProviderInfo);
- }
-
- const ServiceRegistrationInfo* getAdminProviderServiceInfo()
- {
- return getRegistrationInfo(&aAdminProviderInfo);
- }
-
- const ServiceRegistrationInfo* getDefaultProviderServiceInfo()
- {
- return &aDefaultProviderInfo;
- }
-
- const SingletonRegistrationInfo* getDefaultProviderSingletonInfo()
- {
- return &aDefaultProviderSingletonInfo;
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultConfigProviderSingleton( uno::Reference< uno::XComponentContext > const& xContext )
- {
- OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
-
- UnoContextTunnel aTunnel;
- aTunnel.passthru( xContext );
-
- uno::Reference<uno::XInterface> xResult;
-
- if (xContext.is())
- try
- {
- rtl::OUString aSingletonName = SINGLETON(A_DefaultProviderSingletonName);
- uno::Any aResult = xContext->getValueByName(aSingletonName);
- aResult >>= xResult;
- }
- catch (uno::Exception & )
- {
- // to do: really use the tunneled failure when that is set properly
- if ( aTunnel.recoverFailure(true).hasValue() )
- {
- // have a failure, but can't recover it
- // -> try to regenerate
- instantiateDefaultProvider(xContext);
-
- OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
- }
- // cannot recover any failure
- throw;
- }
-
- return xResult;
- }
- // ------------------------------------------------------------------------
- // ----------------------------------------------------------------------------
- #define TUNNEL_ALL_EXCEPTIONS() \
- WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true)
-
- // ----------------------------------------------------------------------------
- // ------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL instantiateDefaultProvider( uno::Reference< uno::XComponentContext > const & xTargetContext )
- {
- uno::Reference< uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- ServiceImplementationInfo const * pProviderInfo =
- ContextReader::testAdminService(xContext,true) ? &aAdminProviderInfo : &aConfigProviderInfo;
-
- OProvider* pNewProvider = new OProvider(xContext,pProviderInfo);
- uno::Reference< lang::XMultiServiceFactory > aRet( pNewProvider );
-
- try
- {
- pNewProvider->connect();
- }
- TUNNEL_ALL_EXCEPTIONS()
-
- return uno::Reference< uno::XInterface >( aRet, uno::UNO_QUERY );
- }
-
- // -----------------------------------------------------------------------------
- class OProviderDisposingListener : public cppu::WeakImplHelper1<lang::XEventListener>
- {
- OProvider* m_pProvider;
-
- public:
- OProviderDisposingListener(OProvider* pProvider)
- :m_pProvider(pProvider){}
-
- virtual void SAL_CALL disposing(com::sun::star::lang::EventObject const& rEvt) throw()
- {
- CFG_TRACE_INFO("Service Manager or context disposed, disposing the provider");
- if (OProvider* pProvider = m_pProvider)
- {
- m_pProvider = NULL;
- pProvider->disposing(rEvt);
- }
- }
- };
-
- //=============================================================================
- //= OProvider
- //=============================================================================
- //-----------------------------------------------------------------------------
- OProvider::OProvider(uno::Reference< uno::XComponentContext > const & xContext, ServiceImplementationInfo const* pInfo)
- :ServiceComponentImpl(pInfo)
- ,OPropertyContainer(ServiceComponentImpl::rBHelper)
- ,m_xContext(xContext)
- ,m_pImpl(NULL)
- ,m_bEnableAsync(false)
- {
- OSL_ENSURE(m_xContext.is(), "Creating a provider without a context");
- attachToContext();
- registerProperty(getPrefetchPropName(), ID_PREFETCH, 0,&m_aPrefetchNodes, ::getCppuType(&m_aPrefetchNodes));
- registerProperty(getEnableAsyncPropName(), ID_ENABLEASYNC, 0, &m_bEnableAsync, ::getBooleanCppuType());
- }
-
- //-----------------------------------------------------------------------------
- OProvider::~OProvider()
- {
- delete m_pImpl;
- discardContext(releaseContext());
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::connect() throw (uno::Exception)
- {
- OSL_ENSURE( m_pImpl == NULL, "Error: Configuration Provider already is connected");
-
- std::auto_ptr<OProviderImpl> pNewImpl( new OProviderImpl(this, m_xContext) );
-
- implConnect(*pNewImpl,ContextReader(m_xContext));
-
- m_pImpl = pNewImpl.release();
- if (m_pImpl)
- {
- sal_Bool isEnabled = m_pImpl->getDefaultOptions().isAsyncEnabled();
- this->setPropertyValue( getEnableAsyncPropName(), uno::makeAny(isEnabled) );
- }
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::attachToContext()
- {
- UnoApiLock aLock;
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
- OSL_ASSERT(!m_xDisposeListener.is());
- if (m_xContext.is())
- {
- uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
- uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
-
- m_xDisposeListener = new OProviderDisposingListener(this);
-
- if (xContextComp.is()) xContextComp ->addEventListener(m_xDisposeListener);
- if (xServiceMgrComp.is()) xServiceMgrComp->addEventListener(m_xDisposeListener);
-
- OSL_ENSURE(xServiceMgrComp.is() || xContextComp.is(),
- "Provider cannot detect shutdown -> no XComponent found");
- }
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< lang::XComponent > OProvider::releaseContext()
- {
- UnoApiLock aLock;
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
-
- uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
- if (m_xDisposeListener.is() && m_xContext.is())
- {
- uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
-
- if (xContextComp.is())
- {
- try { xContextComp ->removeEventListener(m_xDisposeListener); }
- catch (uno::Exception & ) {}
- }
-
- if (xServiceMgrComp.is())
- {
- try { xServiceMgrComp->removeEventListener(m_xDisposeListener); }
- catch (uno::Exception & ) {}
- }
- }
- m_xDisposeListener = NULL;
- m_xContext = NULL;
-
- return xContextComp;
- }
- //-----------------------------------------------------------------------------
-
- void OProvider::discardContext(uno::Reference< lang::XComponent > const & xContext)
- {
- UnoApiLock aLock;
- if (xContext.is())
- {
- uno::Reference< uno::XComponentContext > xCC(xContext,uno::UNO_QUERY);
- OSL_ASSERT(xCC.is());
-
- if (BootstrapContext::isWrapper(xCC))
- {
- try { xContext->dispose(); }
- catch (uno::Exception & ) {}
- }
- }
- }
- //-----------------------------------------------------------------------------
- // XTypeProvider
- //-----------------------------------------------------------------------------
- uno::Sequence< uno::Type > SAL_CALL OProvider::getTypes( ) throw(uno::RuntimeException)
- {
- cppu::OTypeCollection aCollection(::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XMultiPropertySet > *)0 ),
- ::comphelper::concatSequences(ServiceComponentImpl::getTypes(), cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >::getTypes()));
- return aCollection.getTypes();
- }
-
- // XPropertySet
- //-----------------------------------------------------------------------------
- uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OProvider::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
- {
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL OProvider::createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
- // same as creating with empty sequence of arguments
- return this->createInstanceWithArguments( aServiceSpecifier, uno::Sequence< uno::Any >() );
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL
- OProvider::createInstanceWithArguments( const rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- if (ServiceCreationInfo const* pInfo = findCreationInfo(aServiceSpecifier))
- {
- // it's a known service name - try to create without args
- if (CreatorFunc create = pInfo->create)
- {
- return (m_pImpl->*create)(aArguments);
- }
- }
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("ConfigurationProvider: Cannot create view - ");
- sMsg.append( aServiceSpecifier ) .appendAscii(" is not a valid configuration access service. ");
-
- throw lang::ServiceNotRegisteredException(sMsg.makeStringAndClear(),*this);
- }
-
- //-----------------------------------------------------------------------------
- uno::Sequence< rtl::OUString > SAL_CALL OProvider::getAvailableServiceNames( )
- throw(uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- sal_Int32 nCount = 0;
- {
- for (int i= 0; i< getCreateServiceDataCount(); ++i)
- nCount += countServices(getCreateServiceData()[i].info);
- }
-
- uno::Sequence< rtl::OUString > aNames(nCount);
- if (nCount > 0)
- {
- sal_Int32 n = 0;
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceRegistrationInfo const* pInfo = getCreateServiceData()[i].info;
- sal_Char const * const* pNames = pInfo ? pInfo->registeredServiceNames : 0;
-
- if (pNames)
- {
- while(*pNames)
- {
- aNames[n] = rtl::OUString::createFromAscii(*pNames);
- ++n;
- ++pNames;
- }
- }
- }
- }
-
- return aNames;
- }
-
- // XLocalizable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- m_pImpl->setDefaultLocale( eLocale );
- }
-
- //-----------------------------------------------------------------------------
- lang::Locale SAL_CALL OProvider::getLocale()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- return m_pImpl->getDefaultOptions().getUnoLocale();
- }
-
- //XRefreshable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::refresh()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- try
- {
- m_pImpl->refreshAll();
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- // FIXME: use getCaughtException()
- throw lang::WrappedTargetRuntimeException(e.Message, *this, uno::makeAny(e));
- }
- //Broadcast the changes
- uno::Reference< css::util::XRefreshListener > const * const pRefresh = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer (::getCppuType(pRefresh));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XRefreshListener > xRefresh (xIface, uno::UNO_QUERY);
- if (xRefresh.is())
- {
- xRefresh->refreshed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
- //XFlushable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::flush( )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
- m_pImpl->flushAll();
-
- //Broadcast the changes
- uno::Reference< css::util::XFlushListener > const * const pFlush = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer(::getCppuType(pFlush));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XFlushListener > xFlush (xIface, uno::UNO_QUERY);
- if (xFlush.is())
- {
- xFlush->flushed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
-
- // XInterface
- //-----------------------------------------------------------------------------
- uno::Any SAL_CALL OProvider::queryInterface(uno::Type const& rType) throw(uno::RuntimeException)
- {
- UnoApiLock aLock;
- uno::Any aRet( ServiceComponentImpl::queryInterface(rType) );
- if ( !aRet.hasValue() )
- aRet = cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >::queryInterface(rType);
- if ( !aRet.hasValue() )
- aRet = queryPropertyInterface(rType);
- return aRet;
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::implConnect(OProviderImpl& _rFreshProviderImpl, const ContextReader& _rSettings) throw(uno::Exception)
- {
- UnoApiLock aLock;
- if (!_rFreshProviderImpl.initSession(_rSettings))
- throw uno::Exception(::rtl::OUString::createFromAscii("Could not connect to the configuration. Please check your settings."), static_cast< ::cppu::OWeakObject* >(this) );
- }
-
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::disposing(com::sun::star::lang::EventObject const& /*rEvt*/) throw()
- {
- UnoApiLock aLock;
- releaseContext();
- this->dispose();
- }
-
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::disposing()
- {
- UnoApiLock aLock;
-
- if (m_pImpl)
- m_pImpl->dispose();
-
- uno::Reference< lang::XComponent > xComp = releaseContext();
-
- ServiceComponentImpl::disposing();
- OPropertyContainer::disposing();
-
- discardContext( xComp );
- }
-
- // OPropertyArrayUsageHelper
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper* OProvider::createArrayHelper( ) const
- {
- UnoApiLock aLock;
- uno::Sequence< beans::Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
- }
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper & OProvider::getInfoHelper()
- {
- UnoApiLock aLock;
- return *getArrayHelper();
- }
-
- void SAL_CALL OProvider::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception)
- {
- UnoApiLock aLock;
-
- OPropertyContainer::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-
- switch(nHandle)
- {
- case ID_PREFETCH:
- {
- uno::Sequence< rtl::OUString > aNodeList;
- rValue >>= aNodeList;
-
- RequestOptions const aOptions = m_pImpl->getDefaultOptions();
-
- for (sal_Int32 i = 0; i < aNodeList.getLength(); i++)
- {
- configuration::AbsolutePath aModulePath = configuration::AbsolutePath::makeModulePath(aNodeList[i]);
- m_pImpl->fetchSubtree(aModulePath , aOptions);
- }
- }break;
-
- case ID_ENABLEASYNC:
- {
- //Forward to TreeManager
- sal_Bool bAsync;
- if (rValue >>= bAsync)
- {
- m_pImpl->enableAsync(bAsync);
- if (!bAsync)
- this->flush();
- }
- else
- OSL_ENSURE(false, "Unexpected type of new property value");
- }
- break;
- default:
- {
- OSL_ENSURE(false, "OProvider::setFastPropertyValue_NoBroadcast -unknown property");
- }
-
- }
- }
-} // namespace configmgr
diff --git a/configmgr/source/api2/provider.hxx b/configmgr/source/api2/provider.hxx
deleted file mode 100644
index 596e602c01d7..000000000000
--- a/configmgr/source/api2/provider.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROVIDER_HXX_
-#define CONFIGMGR_API_PROVIDER_HXX_
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/util/XRefreshable.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HDL_
-#include <com/sun/star/lang/IllegalArgumentException.hdl>
-#endif
-#include "confsvccomponent.hxx"
-#include <rtl/ustring.hxx>
-#include <vos/ref.hxx>
-#include <cppuhelper/implbase4.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/propertycontainer.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
- namespace util = css::util;
-
- class Module;
- class ContextReader;
- class OProviderImpl;
-
- //==========================================================================
- //= OProvider
- //==========================================================================
- /** Base class to receive access to the configuration data. A provider for configuration is
- a factory for service which allow a readonly or update access to the configuration trees.
- */
- class OProvider:
- private ServiceComponentImpl, private comphelper::OPropertyContainer,
- public comphelper::OPropertyArrayUsageHelper< OProvider >
- // don't want to allow our derivees to access the mutex of ServiceComponentImpl
- // (this helps to prevent deadlocks: The mutex of the base class is used by the OComponentHelper to
- // protect addEvenetListener calls. Unfortunately these calls are made from within API object we create,
- // too, which can lead do deadlocks ....)
- , public cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >
- {
- private:
- friend class OProviderDisposingListener;
-
- uno::Reference< uno::XComponentContext > m_xContext;
- uno::Reference< lang::XEventListener > m_xDisposeListener;
- OProviderImpl * m_pImpl;
- uno::Sequence< ::rtl::OUString > m_aPrefetchNodes;
- sal_Bool m_bEnableAsync;
-
- public:
- // make ServiceComponentImpl allocation functions public
- static void * SAL_CALL operator new( size_t nSize ) throw()
- { return ServiceComponentImpl::operator new( nSize ); }
- static void SAL_CALL operator delete( void * pMem ) throw()
- { ServiceComponentImpl::operator delete( pMem ); }
-
- OProvider(uno::Reference< uno::XComponentContext > const & xContext, ServiceImplementationInfo const* pInfo);
- virtual ~OProvider();
-
- void connect() throw (uno::Exception);
-
- /// XTypeOProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw(uno::RuntimeException);
-
- /// XInterface
- virtual void SAL_CALL acquire() throw() { ServiceComponentImpl::acquire(); }
- virtual void SAL_CALL release() throw() { ServiceComponentImpl::release(); }
- virtual uno::Any SAL_CALL queryInterface(uno::Type const& rType) throw (uno::RuntimeException);
-
- // XPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(uno::RuntimeException);
-
- /// XMultiServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getAvailableServiceNames( )
- throw(uno::RuntimeException);
-
- /// XLocalizable
- virtual void SAL_CALL
- setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException);
-
- virtual lang::Locale SAL_CALL
- getLocale( )
- throw (uno::RuntimeException);
-
-
- //XRefreshable
- virtual void SAL_CALL
- refresh( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- //XFlushable
- virtual void SAL_CALL
- flush( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
-
- // OPropertSetHelper
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle, const uno::Any& rValue) throw (uno::Exception);
-
- static sal_Int32 countServices(ServiceRegistrationInfo const* aInfo) { return ServiceRegistrationHelper(aInfo).countServices(); }
-
- private:
- // creates a new session
- void implConnect(OProviderImpl& rFreshProviderImpl, const ContextReader& _rSettings) throw (uno::Exception);
-
- // disambuiguated access
- cppu::OBroadcastHelper & getBroadcastHelper()
- { return ServiceComponentImpl::rBHelper; }
-
- /// Component Helper override
- virtual void SAL_CALL disposing();
- virtual void SAL_CALL disposing(lang::EventObject const& rEvt) throw();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // OPropertyContainer
- void registerProperty(const rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
- void* _pPointerToMember, const uno::Type& _rMemberType)
- { OPropertyContainer::registerProperty(_rName, _nHandle, _nAttributes, _pPointerToMember, _rMemberType);}
-
- void describeProperties(uno::Sequence< beans::Property >& /* [out] */ _rProps) const
- { OPropertyContainer::describeProperties(_rProps);}
-
-
- uno::Any SAL_CALL queryPropertyInterface(uno::Type const& rType) throw (uno::RuntimeException)
- { return OPropertyContainer::queryInterface(rType);}
-
- void attachToContext();
- uno::Reference< lang::XComponent > releaseContext();
- void discardContext(uno::Reference< lang::XComponent > const & xContext);
- };
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_PROVIDER_HXX_
-
-
diff --git a/configmgr/source/api2/providerimpl.cxx b/configmgr/source/api2/providerimpl.cxx
deleted file mode 100644
index 106838dd5ca0..000000000000
--- a/configmgr/source/api2/providerimpl.cxx
+++ /dev/null
@@ -1,893 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include "providerimpl.hxx"
-#include "options.hxx"
-#include "apifactoryimpl.hxx"
-#include "apitreeimplobj.hxx"
-#include "apitreeaccess.hxx"
-#include "roottree.hxx"
-#include "node.hxx"
-#include "noderef.hxx"
-#include "objectregistry.hxx"
-#include "bootstrap.hxx"
-#include "cachefactory.hxx"
-#include "provider.hxx"
-#include "treemanager.hxx"
-#include "tracer.hxx"
-#include <osl/interlck.h>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace beans = css::beans;
-
- namespace configapi
- {
-
- class ApiProviderInstances
- {
- rtl::Reference<ObjectRegistry> m_aObjectRegistry;
- ReadOnlyObjectFactory m_aReaderFactory;
- UpdateObjectFactory m_aWriterFactory;
- ApiProvider m_aReaderProvider;
- ApiProvider m_aWriterProvider;
- public:
- ApiProviderInstances(OProviderImpl& rProviderImpl)
- : m_aObjectRegistry(new ObjectRegistry())
- , m_aReaderFactory(m_aReaderProvider,m_aObjectRegistry)
- , m_aWriterFactory(m_aWriterProvider,m_aObjectRegistry)
- , m_aReaderProvider(m_aReaderFactory,rProviderImpl)
- , m_aWriterProvider(m_aWriterFactory,rProviderImpl)
- {
- }
-
- ~ApiProviderInstances()
- {}
-
- ApiProvider& getReaderProvider() { return m_aReaderProvider; }
- ApiProvider& getWriterProvider() { return m_aWriterProvider; }
- Factory& getReaderFactory() { return m_aReaderFactory; }
- Factory& getWriterFactory() { return m_aWriterFactory; }
- };
- }
-
- //=============================================================================
-
- //=============================================================================
- //= OProviderImpl
- //=============================================================================
- //-----------------------------------------------------------------------------
- OProviderImpl::OProviderImpl(OProvider* _pProvider, uno::Reference< uno::XComponentContext > const & _xContext)
- :m_pProvider(_pProvider)
- ,m_xTypeConverter()
- ,m_aDefaultOptions()
- ,m_pNewProviders(NULL)
- ,m_aTreeManagerMutex()
- ,m_pTreeManager(NULL)
- {
- OSL_ENSURE(_xContext.is(), "OProviderImpl : NULL context !");
-
- uno::Reference< lang::XMultiComponentFactory > xFactory = _xContext->getServiceManager();
- OSL_ENSURE(xFactory.is(), "OProviderImpl : missing service factory !");
-
- m_xTypeConverter = m_xTypeConverter.query(
- xFactory->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Converter" )),
- _xContext));
-
- OSL_ENSURE(m_xTypeConverter.is(), "Module::Module : could not create an instance of the type converter !");
- }
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::maybeGetTreeManager() const SAL_THROW(())
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
- rtl::Reference< TreeManager > xResult(m_pTreeManager);
- return xResult;
- }
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::getTreeManager() const SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
- if (m_pTreeManager == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("OProviderImpl: No cache available - provider was already disposed.");
- throw com::sun::star::lang::DisposedException(sMsg,static_cast<lang::XMultiServiceFactory*>(m_pProvider));
- }
- rtl::Reference< TreeManager > xResult(m_pTreeManager);
- return xResult;
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::setTreeManager(TreeManager * pTreeManager) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
-
- OSL_PRECOND(m_pTreeManager == NULL, "OProviderImpl: TreeManager is already set");
- OSL_PRECOND(pTreeManager != NULL, "OProviderImpl: Trying to set a NULL TreeManager");
-
- if (pTreeManager == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("OProviderImpl: No cache available - cache creation failed.");
- throw com::sun::star::uno::RuntimeException(sMsg,NULL);
- }
-
- (m_pTreeManager = pTreeManager) -> acquire();
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::clearTreeManager() SAL_THROW(())
- {
- osl::ClearableMutexGuard aGuard(m_aTreeManagerMutex);
- if (TreeManager * pTM = m_pTreeManager)
- {
- m_pTreeManager = NULL;
- pTM->release();
- }
- }
- //-----------------------------------------------------------------------------
- bool OProviderImpl::initSession(const ContextReader& _rSettings)
- {
- bool bNeedProfile = false;
- rtl::Reference< TreeManager > xNewTreeManager;
- if (_rSettings.isUnoBackend())
- {
- this->implInitFromSettings(_rSettings,bNeedProfile);
-
- xNewTreeManager = CacheFactory::instance().createCacheManager(_rSettings.getBaseContext());
- }
- else
- {
- throw com::sun::star::uno::RuntimeException(rtl::OUString::createFromAscii("OProviderImpl: Only UNO Backends Supported"),NULL);
- }
-
- setTreeManager( xNewTreeManager.get() );
- OSL_ASSERT( xNewTreeManager.get() );
-
- // put out of line to get rid of the order dependency (and to have a acquired configuration)
- m_pNewProviders = new configapi::ApiProviderInstances(*this);
-
- // now complete our state from the user's profile, if necessary
- if (bNeedProfile)
- try
- {
- static ::rtl::OUString ssUserProfile(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"));
- configuration::AbsolutePath aProfileModule = configuration::AbsolutePath::makeModulePath(ssUserProfile);
-
- sharable::Node * profileTree = xNewTreeManager->requestSubtree(aProfileModule, m_aDefaultOptions);
- if (profileTree != 0)
- {
- implInitFromProfile(profileTree);
-
- // should we clean this up ?
- // xNewTreeManager->releaseSubtree(aProfileModule, xTempOptions);
- }
- }
- catch (uno::Exception& e)
- {
- // could not read profile
- (void)e;
- CFG_TRACE_ERROR_NI("Provider bootstrapping: Caught an exception trying to get 'Setup' data: %s", OUSTRING2ASCII(e.Message));
- }
-
- return true;
- }
- //-----------------------------------------------------------------------------
-
- // these can be overridden. default does nothing
- void OProviderImpl::initFromSettings(const ContextReader& , bool& )
- {
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::initFromProfile(sharable::Node *)
- {
- }
- //-----------------------------------------------------------------------------
- // these implement the base class behavior
- void OProviderImpl::implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile)
- {
- bool bIntrinsicNeedProfile = true;
-
- if (_rSettings.hasLocale())
- {
- bIntrinsicNeedProfile = false;
- rtl::OUString sDefaultLocale = _rSettings.getLocale();
- m_aDefaultOptions.setIsoLocale(sDefaultLocale);
- }
- else if (_rSettings.isAdminService())
- {
- bIntrinsicNeedProfile = false;
- m_aDefaultOptions.setAllLocales();
- }
- else
- OSL_ASSERT(!m_aDefaultOptions.hasLocale());
-
- if (_rSettings.hasAsyncSetting())
- {
- m_aDefaultOptions.enableAsync( !!_rSettings.getAsyncSetting() );
- }
-
-
- // call the template method
- this->initFromSettings(_rSettings, rNeedProfile);
-
- if (bIntrinsicNeedProfile)
- rNeedProfile = true; // to get locale
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::implInitFromProfile(sharable::Node * profile)
- {
- OSL_ASSERT(profile != 0);
-
- sharable::GroupNode * profileNode = sharable::GroupNode::from(profile);
-
- OSL_ASSERT(profileNode != 0);
-
- // read the default locale for the user
- if (!m_aDefaultOptions.hasLocale())
- {
- static rtl::OUString ssSubGroup(RTL_CONSTASCII_USTRINGPARAM("L10N"));
- static rtl::OUString ssLocale(RTL_CONSTASCII_USTRINGPARAM("ooLocale"));
-
- sharable::GroupNode * l10nNode = sharable::GroupNode::from(profileNode->getChild(ssSubGroup));
- if (l10nNode != 0)
- {
- sharable::ValueNode * value = sharable::ValueNode::from(l10nNode->getChild(ssLocale));
-
- if (value != 0)
- {
- rtl::OUString sDefaultLocale;
- if (value->getValue() >>= sDefaultLocale)
- {
- m_aDefaultOptions.setIsoLocale(sDefaultLocale);
- }
- else
- OSL_ENSURE(false, "Could not extract locale parameter into string");
- }
- }
- }
-
- // call the template method
- this->initFromProfile(profile);
-
- // last fallback, if there is no locale - even in ooLocale
- m_aDefaultOptions.ensureLocaleSet();
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::setDefaultLocale( com::sun::star::lang::Locale const & aLocale )
- {
- m_aDefaultOptions.setLocale( aLocale );
- // ensure that the locale is never cleared to 'empty'
- m_aDefaultOptions.ensureLocaleSet();
- }
-
- //-----------------------------------------------------------------------------
- OProviderImpl::~OProviderImpl()
- {
- UnoApiLock aLock; // hmm...
- clearTreeManager();
-
- delete m_pNewProviders;
- }
-
- // --------------------------------- disposing ---------------------------------
- void SAL_CALL OProviderImpl::dispose() throw()
- {
- try
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
-
- if (xTM.is())
- xTM->dispose();
-
- clearTreeManager();
- }
- catch (uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR("Disposing the TreeManager or closing the session caused an exception: %s", OUSTRING2ASCII(e.Message));
- clearTreeManager();
- }
- }
-
- //-----------------------------------------------------------------------------
- // access to the raw notifications
- TreeManager * OProviderImpl::getNotifier() SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- return xTM.get();
- }
-
- // DefaultProvider access
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::getDefaultProvider() const SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- return getTreeManager().get();
- }
-
- //-----------------------------------------------------------------------------
- sharable::Node * OProviderImpl::requestSubtree( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const & _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
- {
- rtl::Reference< TreeManager > xTreeManager = getTreeManager();
-
- sharable::Node * tree = 0;
- try
- {
- tree = xTreeManager->requestSubtree(aSubtreePath, _aOptions);
- }
- catch(uno::Exception&e)
- {
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
- // append the error message given by the tree provider
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nThe backend returned the following error:\n"));
- sMessage += e.Message;
-
- throw lang::WrappedTargetException(sMessage, getProviderInstance(), uno::makeAny(e));
- }
-
- if (tree == 0)
- {
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
-
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nNo backend error message available\n"));
-
- throw uno::Exception(sMessage, getProviderInstance());
- }
-
- return tree;
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception))
- {
- getTreeManager()->updateTree(aChanges);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::releaseSubtree( configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions ) SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- if (xTM.is())
- xTM->releaseSubtree(aSubtreePath, _aOptions);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception))
- {
- getTreeManager()->saveAndNotifyUpdate(aChanges);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::fetchSubtree(configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- if (xTM.is())
- xTM->fetchSubtree(aSubtreePath, _aOptions);
- }
-
- //-----------------------------------------------------------------------------
- sal_Bool OProviderImpl::fetchDefaultData(configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) SAL_THROW((com::sun::star::uno::Exception))
- {
- return getTreeManager()->fetchDefaultData(aSubtreePath, _aOptions);
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::refreshAll()SAL_THROW((com::sun::star::uno::Exception))
- {
- m_pTreeManager->refreshAll();
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::flushAll()SAL_THROW(())
- {
- m_pTreeManager->flushAll();
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(())
- {
- m_pTreeManager->enableAsync(bEnableAsync);
- }
- //-----------------------------------------------------------------------------
- uno::XInterface* OProviderImpl::getProviderInstance()
- {
- return static_cast<com::sun::star::lang::XMultiServiceFactory*>(m_pProvider);
- }
-
- //-----------------------------------------------------------------------------------
- rtl::OUString OProviderImpl::getErrorMessage(configuration::AbsolutePath const& _rAccessor, RequestOptions const& _aOptions)
- {
- rtl::OUString const sAccessor = _rAccessor.toString();
-
- CFG_TRACE_ERROR("config provider: the cache manager could not provide the tree (neither from the cache nor from the session)");
- ::rtl::OUString sMessage;
- ::rtl::OUString sEntity(_aOptions.getEntity());
- ::rtl::OUString sLocale(_aOptions.getLocale());
- CFG_TRACE_INFO_NI("config provider: the entity we tried this for is \"%s\", the locale \"%s\", the path \"%s\"", OUSTRING2ASCII(sEntity), OUSTRING2ASCII(sLocale), OUSTRING2ASCII(sAccessor));
- sMessage += sAccessor;
-
- if (sEntity.getLength())
- {
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for entity "));
- sMessage += sEntity;
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
-
- if (sLocale.getLength())
- {
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for locale "));
- sMessage += sLocale;
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
-
- sMessage += ::rtl::OUString::createFromAscii(" could not be created. Unable to retrieve the node from the configuration server.");
- return sMessage;
- }
-
- // actual factory methods
- //-----------------------------------------------------------------------------------
- configapi::NodeElement* OProviderImpl::buildReadAccess(rtl::OUString const& _rAccessor, RequestOptions const& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
-
- OSL_ASSERT(sal_Int16(nMinLevels) == nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::OProviderImpl", "jb99855", "configmgr::OProviderImpl::buildReadAccess()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(_rAccessor) );
-
- try
- {
- configuration::AbsolutePath aAccessorPath = configuration::AbsolutePath::parse(_rAccessor);
-
- sharable::Node * tree = requestSubtree(aAccessorPath,_aOptions);
-
- RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
-
- unsigned int nDepth = (nMinLevels == treeop::ALL_LEVELS) ? configuration::C_TreeDepthAll : (unsigned int)(nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "configmgr: createReadOnlyTree()");
-
- rtl::Reference< configuration::Tree > aRootTree( configuration::createReadOnlyTree(
- aAccessorPath, tree, nDepth,
- configuration::TemplateProvider( getTreeManager(), _aOptions )
- ));
-
- return m_pNewProviders->getReaderFactory().makeAccessRoot(aRootTree, _aOptions);
- }
- catch (configuration::Exception& e)
- {
- configapi::ExceptionMapper ec(e);
- ec.setContext(this->getProviderInstance());
- //ec.unhandled();
- throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
- }
- }
-
-
- //-----------------------------------------------------------------------------------
- configapi::NodeElement* OProviderImpl::buildUpdateAccess(rtl::OUString const& _rAccessor, RequestOptions const& _aOptions,
- sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
- OSL_ASSERT(sal_Int16(nMinLevels) == nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::OProviderImpl", "jb99855", "configmgr: buildUpdateAccess()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(_rAccessor) );
-
- try
- {
- configuration::AbsolutePath aAccessorPath = configuration::AbsolutePath::parse(_rAccessor);
-
- sharable::Node * tree = requestSubtree(aAccessorPath, _aOptions);
-
- RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
-
- unsigned int nDepth = (nMinLevels == treeop::ALL_LEVELS) ? configuration::C_TreeDepthAll : (unsigned int)(nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "createUpdatableTree()");
-
- rtl::Reference< configuration::Tree > aRootTree( configuration::createUpdatableTree(
- aAccessorPath, tree, nDepth,
- configuration::TemplateProvider( getTreeManager(), _aOptions )
- ));
-
-
- return m_pNewProviders->getWriterFactory().makeAccessRoot(aRootTree, _aOptions);
- }
- catch (configuration::Exception& e)
- {
- configapi::ExceptionMapper ec(e);
- ec.setContext(this->getProviderInstance());
- //ec.unhandled();
- throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
- }
- }
-
- //=============================================================================
- //= OProvider::FactoryArguments
- //=============================================================================
-
- sal_Char const * const OProviderImpl::FactoryArguments::asciiArgumentNames[] =
- {
- "nodepath", // ARG_NODEPATH, // requested node path
- "depth", // ARG_DEPTH, // depth of the tree
- "user", // ARG_USER_DEPRECATED, // name of the user - only for admin
- "locale", // ARG_LOCALE, // desired locale
- "nocache", // ARG_NOCACHE_OBSOLETE, // cache disabling
- "lazywrite", // ARG_ASYNC_DEPRECATED, // lasy write data
- "enableasync", // ARG_ASYNC, // lasy write data
- "entity", // ARG_ENTITY, // name of the entity to be manipulated - only for admin
- "reload", //ARG_REFRESH // refresh component
-
- };
-
- OProviderImpl::FactoryArguments::Argument
- OProviderImpl::FactoryArguments::lookupArgument(const rtl::OUString& rName)
- SAL_THROW(())
- {
- rtl::OUString sCheck( rName.toAsciiLowerCase() );
-
- sal_Char const * const * const pFirst = asciiArgumentNames;
- sal_Char const * const * const pLast = pFirst + _arg_count;
-
- sal_Char const * const * it = pFirst;
-
- for(; it != pLast; ++it)
- {
- if (0 == sCheck.compareToAscii(*it))
- {
- break;
- }
- }
-
- OSL_ASSERT( Argument(pLast-pFirst) == ARG_NOT_FOUND );
- return static_cast<Argument>(it - pFirst);
- }
-
- //-----------------------------------------------------------------------------------
- bool OProviderImpl::FactoryArguments::extractOneArgument(
- rtl::OUString const& aName, uno::Any const& aValue,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ _rOptions )
- SAL_THROW(())
- {
- switch ( lookupArgument(aName) )
- {
- case ARG_NODEPATH:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- _rNodeAccessor = sStringVal;
- else
- return false;
- }
- break;
-
- case ARG_DEPTH:
- {
- sal_Int32 nIntVal = 0;
- if (aValue >>= nIntVal)
- _nLevels = nIntVal;
- else
- return false;
- }
- break;
-
- case ARG_ENTITY:
- case ARG_USER_DEPRECATED:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- _rOptions.setEntity(sStringVal);
- else
- return false;
- }
- break;
-
- case ARG_LOCALE:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- {
- _rOptions.setIsoLocale(sStringVal);
- break;
- }
-
- lang::Locale aLocale;
- if (aValue >>= aLocale)
- {
- _rOptions.setLocale(aLocale);
- break;
- }
-
- return false;
- }
-
- case ARG_NOCACHE_OBSOLETE:
- {
- sal_Bool bBoolVal;
- if (aValue >>= bBoolVal)
- OSL_ENSURE(false,"ConfigurationProvider: Parameter \"nocache\" is obsolete and has no effect");
- else
- return false;
- }
- break;
-
- case ARG_ASYNC:
- case ARG_ASYNC_DEPRECATED:
- {
- sal_Bool bBoolVal = sal_False;
- if (aValue >>= bBoolVal)
- _rOptions.enableAsync(!!bBoolVal);
- else
- return false;
- }
- break;
- case ARG_REFRESH:
- {
- sal_Bool bBoolVal = sal_False;
- if (aValue >>= bBoolVal)
- _rOptions.forceRefresh(!!bBoolVal);
- else
- return false;
- }
- break;
-
- case ARG_NOT_FOUND:
- {
- rtl::OString sMessage(RTL_CONSTASCII_STRINGPARAM("Unknown argument \""));
- sMessage += rtl::OUStringToOString(aName, RTL_TEXTENCODING_ASCII_US);
- sMessage += rtl::OString(RTL_CONSTASCII_STRINGPARAM("\" !\n- Parameter will be ignored -\n"));
- CFG_TRACE_WARNING( "provider: %s", sMessage.getStr() );
- #ifdef DBG_UTIL
- OSL_ENSURE(false, sMessage.getStr());
- #endif
- }
- break;
-
- default:
- CFG_TRACE_ERROR( "Known argument is not handled" );
- OSL_ENSURE(false, "Known argument is not handled");
- break;
- }
- return true;
- }
-
- //-----------------------------------------------------------------------------------
- static
- void failInvalidArg(uno::Any const & aArg, sal_Int32 _nArg = -1)
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ENSURE( sal_Int16(_nArg) == _nArg, "Argument number out of range. Raising imprecise exception.");
-
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration Provider: An argument");
- sMessage.appendAscii(" has the wrong type.");
- sMessage.appendAscii("\n- Expected a NamedValue or PropertyValue");
- sMessage.appendAscii("\n- Found type ").append( aArg.getValueType().getTypeName() );
-
- throw lang::IllegalArgumentException( sMessage.makeStringAndClear(),
- uno::Reference<uno::XInterface>(),
- sal_Int16(_nArg+1));
- }
-
- //-----------------------------------------------------------------------------------
- static
- void failInvalidArgValue(rtl::OUString const & aName, uno::Any const & aValue, sal_Int32 _nArg = -1)
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ENSURE( sal_Int16(_nArg) == _nArg, "Argument number out of range. Raising imprecise exception.");
-
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration Provider: The argument ").append(aName);
- sMessage.appendAscii(" has the wrong type.");
- sMessage.appendAscii("\n- Found type ").append( aValue.getValueType().getTypeName() );
-
- throw lang::IllegalArgumentException( sMessage.makeStringAndClear(),
- uno::Reference<uno::XInterface>(),
- sal_Int16(_nArg+1));
- }
-
- //-----------------------------------------------------------------------------------
- static
- bool extractLegacyArguments( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels )
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ASSERT( _rArgs.getLength() != 0 );
-
- // compatibility : formerly, you could specify the node path as first arg and the (optional) depth
- // as second arg
- if (! (_rArgs[0] >>= _rNodeAccessor) )
- return false;
-
- switch (_rArgs.getLength() )
- {
- case 1:
- // valid single argument
- return true;
-
- case 2:
- // valid second argument
- if (_rArgs[1] >>= _nLevels)
- return true;
-
- break;
-
- default:
- if (_rArgs[1] >>= _nLevels)
- {
- // valid second argument, but too many arguments altogether
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration Provider: Too many arguments. "
- "Additional arguments are not supported when passing the node path as string (deprecated convention).")),
- uno::Reference<uno::XInterface>(),
- sal_Int16(3)
- );
- }
-
- break;
-
- }
- // here we have an invalid second argument
-
- if (_rArgs[1].getValueTypeClass() != uno::TypeClass_STRUCT)
- {
- // completely invalid second argument
- failInvalidArgValue(rtl::OUString::createFromAscii("<depth>"),_rArgs[1],1);
- }
-
- // Assume PropertyValue or NamedValue,
- // which should be handled consistently by caller
- return false;
- }
-
- //-----------------------------------------------------------------------------------
- void OProviderImpl::FactoryArguments::extractArgs( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions & /* [in/out] */ _aOptions )
- SAL_THROW((lang::IllegalArgumentException))
- {
- UnoApiLock aLock;
-
- _nLevels = treeop::ALL_LEVELS; // setting a fallback
-
- // the args have to be a sequence of property or named values
- beans::NamedValue aNV;
- beans::PropertyValue aPV;
- for (sal_Int32 i=0; i<_rArgs.getLength(); ++i)
- {
- if (_rArgs[i] >>= aPV)
- {
- if ( !extractOneArgument(aPV.Name,aPV.Value,_rNodeAccessor,_nLevels,_aOptions) )
- failInvalidArgValue(aPV.Name,aPV.Value,i);
- }
- else if (_rArgs[i] >>= aNV)
- {
- if ( !extractOneArgument(aNV.Name,aNV.Value,_rNodeAccessor,_nLevels,_aOptions) )
- failInvalidArgValue(aNV.Name,aNV.Value,i);
- }
- else
- {
- if (i == 0)// try compatibility format
- if ( extractLegacyArguments(_rArgs,_rNodeAccessor,_nLevels))
- break;
-
- failInvalidArg(_rArgs[i],i);
- OSL_ASSERT(false);
- }
- }
-
- if (_rNodeAccessor.getLength() == 0)
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Configuration Provider: Missing argument: no nodepath was provided"));
- throw lang::IllegalArgumentException(sMessage,uno::Reference<uno::XInterface>(),0);
- }
- }
-
- //--------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OProviderImpl::createReadAccess( uno::Sequence<uno::Any> const& aArgs)
- SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: going to create a read access instance");
-
- // extract the args
- rtl::OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- configapi::NodeElement* pElement = buildReadAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-
- //-----------------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OProviderImpl::createUpdateAccess( uno::Sequence<uno::Any> const& aArgs)
- SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: going to create an update access instance");
-
- // extract the args
- rtl::OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- configapi::NodeElement* pElement = buildUpdateAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-//-----------------------------------------------------------------------------------
-
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/providerimpl.hxx b/configmgr/source/api2/providerimpl.hxx
deleted file mode 100644
index 37608184631c..000000000000
--- a/configmgr/source/api2/providerimpl.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROVIDERIMPL_HXX_
-#define CONFIGMGR_API_PROVIDERIMPL_HXX_
-
-#include "defaultprovider.hxx"
-#include "requestoptions.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace uno
- {
- class Any;
- class XInterface;
- template <class> class Sequence;
- template <class> class Reference;
- }
- namespace beans
- {
- struct PropertyValue;
- }
-} } }
-
-namespace rtl
-{
- class OUString;
- template <class RCType> class Reference;
-}
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace script = css::script;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- class ISubtree;
- struct TreeChangeList;
- class TreeManager;
- class ContextReader;
- class OProvider;
-
- namespace configapi
- {
- class NodeElement;
- class ApiProviderInstances;
- class Factory;
- }
- namespace sharable { union Node; }
-
- // -----------------------------------------------------------------------------
- class OProviderImpl : public IDefaultableTreeManager
- {
- friend class OProvider;
- public:
- //==========================================================================
- //= FactoryArguments
- //==========================================================================
- /** Helper class for evaluation of the arguments for creating a service instance.*/
- struct FactoryArguments
- {
- /// possible arguments, given only in small letters.
- enum Argument
- {
- ARG_NODEPATH, // requested node path
- ARG_DEPTH, // depth of the tree
- ARG_USER_DEPRECATED, // name of the entity to be manipulated - deprecated version
- ARG_LOCALE, // desired locale
- ARG_NOCACHE_OBSOLETE, // cache disabling - obsolete and nonfunctional
- ARG_ASYNC_DEPRECATED, // lasy write data - deprecated version
- ARG_ASYNC, // lazy write data
- ARG_ENTITY, // name of the entity to be manipulated - only for admin
- ARG_REFRESH, // force refresh of data into cache
-
- _arg_count,
- ARG_NOT_FOUND = _arg_count
- };
- static sal_Char const * const asciiArgumentNames[];
-
- static Argument lookupArgument(rtl::OUString const& sArgumentName) SAL_THROW(());
- public:
- /** extracts arguments from the argument sequence into to the parameter variables
-
- <p>unknown arguments are ignored</p>
-
- @throws com::sun::star::lang::IllegalArgumentException
- if an element of _rArgs had the wrong type or
- if the value of a known argument has the wrong type or
- if the value of a known argument is out of range (sometimes)
- or if no non-empty node path argument could be extracted,
- */
- static void extractArgs( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ xOptions)
- SAL_THROW((lang::IllegalArgumentException));
-
- static bool extractOneArgument( rtl::OUString const& aName, uno::Any const& aValue,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ xOptions
- ) SAL_THROW(());
-
- };
-
- private:
- OProvider* m_pProvider; /// used for ref counting, uno representation
-
- uno::Reference< script::XTypeConverter > m_xTypeConverter;
- RequestOptions m_aDefaultOptions;
- configapi::ApiProviderInstances* m_pNewProviders;
- mutable osl::Mutex m_aTreeManagerMutex;
- TreeManager* m_pTreeManager; /// the tree cache. Will hold a reference to us as long as it life
-
- rtl::Reference< TreeManager > maybeGetTreeManager() const SAL_THROW(());
- rtl::Reference< TreeManager > getTreeManager() const SAL_THROW((com::sun::star::uno::RuntimeException));
- void setTreeManager(TreeManager * pTreeManager) SAL_THROW((com::sun::star::uno::RuntimeException));
- void clearTreeManager() SAL_THROW(());
-
- OProviderImpl(OProvider* _pProvider,
- uno::Reference< uno::XComponentContext > const & xContext);
-
- public:
- virtual ~OProviderImpl();
-
- /** request that the tree named by a path is added to the collection of managed trees
- respecting certain options and requiring a specific loading depth.
- Return a reference to that managed tree.
- The reference must later be released by calling releaseSubtree with the same path and options.
- */
- sharable::Node * requestSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) SAL_THROW((com::sun::star::uno::Exception));
-
- /// update the managed data according to a changes list - update the changes list accordingly with old values
- void updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- // bookkeeping support
- void releaseSubtree( configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions ) SAL_THROW(());
-
- // notification
- void saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- /** request that the tree named by a path is added to the collection of managed trees
- respecting certain options and requiring a specific loading depth.
- */
- void fetchSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) SAL_THROW(());
-
- //Refresh all components in the cache
- void refreshAll() SAL_THROW((com::sun::star::uno::Exception));
-
- //Flush all components in the cache
- void flushAll() SAL_THROW(());
-
- //Enable/Disable Asynchronous write-back to cache
- void enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(());
-
- /// IDefaultableTreeManager
- virtual sal_Bool fetchDefaultData(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- // DefaultProvider access
- rtl::Reference< TreeManager > getDefaultProvider() const SAL_THROW((com::sun::star::uno::RuntimeException));
-
- protected:
- static rtl::OUString getErrorMessage(configuration::AbsolutePath const& _rAccessor, const RequestOptions& _aOptions);
-
- void SAL_CALL dispose() throw();
- public:
- void setDefaultLocale( com::sun::star::lang::Locale const & aLocale );
-
- RequestOptions const& getDefaultOptions() const {return m_aDefaultOptions;}
- uno::Reference< script::XTypeConverter > getTypeConverter() const {return m_xTypeConverter;}
- TreeManager * getNotifier() SAL_THROW(());
- uno::XInterface* getProviderInstance();
-
- // actual factory methods
- // the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildReadAccess( rtl::OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception));
- // the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildUpdateAccess(rtl::OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception));
- // factory methods
- uno::Reference<uno::XInterface> createReadAccess( uno::Sequence<uno::Any> const& aArgs) SAL_THROW((com::sun::star::uno::Exception));
- uno::Reference<uno::XInterface> createUpdateAccess( uno::Sequence<uno::Any> const& aArgs) SAL_THROW((com::sun::star::uno::Exception));
-
- private:
- bool initSession(const ContextReader& _rSettings);
- private:
- void implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
- void implInitFromProfile(sharable::Node * aProfile);
-
- void initFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
- void initFromProfile(sharable::Node * aProfile);
- };
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_PROVIDERIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/setaccess.cxx b/configmgr/source/api2/setaccess.cxx
deleted file mode 100644
index 8c964a140f8b..000000000000
--- a/configmgr/source/api2/setaccess.cxx
+++ /dev/null
@@ -1,185 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "setaccess.hxx"
-#include "accessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::getHierarchicalName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalName( getNode() );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::composeHierarchicalName( const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException)
-{
- return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-uno::Type SAL_CALL BasicSetAccess::getElementType( ) throw(uno::RuntimeException)
-{
- return configapi::implGetElementType( getNode() );
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicSetAccess::hasElements( ) throw(uno::RuntimeException)
-{
- return configapi::implHasElements( getNode() );
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetAccess::getExactName( const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- return configapi::implGetExactName( getNode(), rApproximateName);
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-css::beans::Property SAL_CALL BasicSetAccess::getAsProperty( ) throw(uno::RuntimeException)
-{
- return configapi::implGetAsProperty( getNode() );
-}
-
-// XPropertySetInfo
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< css::beans::Property > SAL_CALL BasicSetAccess::getProperties( ) throw (uno::RuntimeException)
-{
- return configapi::implGetProperties( getNode() );
-}
-
-css::beans::Property SAL_CALL BasicSetAccess::getPropertyByName( const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyByName( getNode(), aName );
-}
-
-sal_Bool SAL_CALL BasicSetAccess::hasPropertyByName( const rtl::OUString& name ) throw (uno::RuntimeException)
-{
- return configapi::implHasPropertyByName( getNode(), name );
-}
-
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicSetAccess::hasByName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicSetAccess::getByName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetByName( getNode(), sName );
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicSetAccess::getElementNames( ) throw( uno::RuntimeException)
-{
- return configapi::implGetElementNames( getNode() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicSetAccess::hasByHierarchicalName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByHierarchicalName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicSetAccess::getByHierarchicalName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- return configapi::implGetByHierarchicalName( getNode(), sName );
-}
-
-
-// XContainer
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetAccess::addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener );
-}
-
-void SAL_CALL BasicSetAccess::removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-
-//-----------------------------------------------------------------------------------
-// Set-specific interfaces
-//-----------------------------------------------------------------------------------
-
-// XTemplateContainer
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::getElementTemplateName( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetElementTemplateName( getNode() );
-}
-
-// XStringEscape
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::escapeString( const rtl::OUString& aString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException)
-{
- return aString;
-}
-
-rtl::OUString SAL_CALL BasicSetAccess::unescapeString( const rtl::OUString& aEscapedString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException)
-{
- return aEscapedString;
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/setaccess.hxx b/configmgr/source/api2/setaccess.hxx
deleted file mode 100644
index ba4a961cca05..000000000000
--- a/configmgr/source/api2/setaccess.hxx
+++ /dev/null
@@ -1,167 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETACCESS_HXX_
-#define CONFIGMGR_API_SETACCESS_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/util/XStringEscape.hpp>
-#include <cppuhelper/implbase9.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- namespace configapi { class NodeSetInfoAccess; }
-
- /** implements the (read-only) interfaces supported by a set node
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeAccess</type>.</p>
- */
- class BasicSetAccess
- : public ::cppu::ImplHelper9
- < css::container::XNameAccess
- , css::container::XHierarchicalName
- , css::container::XHierarchicalNameAccess
- , css::container::XContainer
- , css::beans::XExactName
- , css::beans::XProperty
- , css::beans::XPropertySetInfo
- , css::configuration::XTemplateContainer
- , css::util::XStringEscape
- >
- {
- protected:
- // Destructors
- virtual ~BasicSetAccess() {}
-
- public:
- // Interface methods
- // XHierarchicalName
- virtual rtl::OUString SAL_CALL
- getHierarchicalName( )
- throw(uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- composeHierarchicalName( const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
- uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- virtual uno::Type SAL_CALL
- getElementType( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasElements( )
- throw(uno::RuntimeException);
-
- // XNameAccess
- virtual uno::Any SAL_CALL
- getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getElementNames( )
- throw( uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- virtual uno::Any SAL_CALL
- getByHierarchicalName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByHierarchicalName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XContainer
- virtual void SAL_CALL
- addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XExactName
- virtual rtl::OUString SAL_CALL
- getExactName( const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- virtual css::beans::Property SAL_CALL
- getAsProperty( )
- throw(uno::RuntimeException);
-
- // XPropertySetInfo
- virtual uno::Sequence< css::beans::Property > SAL_CALL
- getProperties( )
- throw (uno::RuntimeException);
-
- virtual css::beans::Property SAL_CALL
- getPropertyByName( const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasPropertyByName( const rtl::OUString& name )
- throw (uno::RuntimeException);
-
- // XTemplateContainer
- rtl::OUString SAL_CALL
- getElementTemplateName( )
- throw(uno::RuntimeException);
-
- // XStringEscape
- rtl::OUString SAL_CALL
- escapeString( const rtl::OUString& aString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
-
- rtl::OUString SAL_CALL
- unescapeString( const rtl::OUString& aEscapedString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
-
- protected:
- virtual configapi::NodeSetInfoAccess& getNode() = 0;
- };
-
-}
-#endif // CONFIGMGR_API_SETACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/setobjects.cxx b/configmgr/source/api2/setobjects.cxx
deleted file mode 100644
index b32c1d108cdb..000000000000
--- a/configmgr/source/api2/setobjects.cxx
+++ /dev/null
@@ -1,547 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "setobjects.hxx"
-#include "comphelper/sequence.hxx"
-
-//........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OInnerSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerSetInfo::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerSetInfo::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerTreeSetUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerTreeSetUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* OInnerTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerValueSetUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerValueSetUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* OInnerValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementSetInfo::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementSetInfo::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementTreeSetUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementTreeSetUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* OSetElementTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementValueSetUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementValueSetUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* OSetElementValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementSetInfo::acquire( ) throw ()
-{
- BasicRootElement::acquire();
-}
-
-void SAL_CALL ORootElementSetInfo::release( ) throw ()
-{
- BasicRootElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicRootElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicRootElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicRootElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::RootElement& ORootElementSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementTreeSetUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementTreeSetUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* ORootElementTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementValueSetUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementValueSetUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* ORootElementValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/api2/setobjects.hxx b/configmgr/source/api2/setobjects.hxx
deleted file mode 100644
index 4f1ee0861c5a..000000000000
--- a/configmgr/source/api2/setobjects.hxx
+++ /dev/null
@@ -1,358 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETOBJECTS_HXX_
-#define CONFIGMGR_API_SETOBJECTS_HXX_
-
-#include "setaccess.hxx"
-#include "setupdate.hxx"
-#include "elementaccess.hxx"
-
-#include "apiaccessobj.hxx"
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
-
-//==========================================================================
-//= Inner Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are inner nodes and dynamic sets
-*/
- class OInnerSetInfo
- : public BasicInnerElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- OInnerSetInfo(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are inner nodes and dynamic sets of complex types (trees)
-*/
- class OInnerTreeSetUpdate
- : public BasicInnerElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- OInnerTreeSetUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are inner nodes and dynamic sets of simple types (values)
-*/
- class OInnerValueSetUpdate
- : public BasicInnerElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- OInnerValueSetUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-//==========================================================================
-//= Set Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are set elements and dynamic sets
-*/
- class OSetElementSetInfo
- : public BasicSetElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- OSetElementSetInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are set elements and dynamic sets of complex types (trees)
-*/
- class OSetElementTreeSetUpdate
- : public BasicSetElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- OSetElementTreeSetUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are set elements and dynamic sets of simple types (values)
-*/
- class OSetElementValueSetUpdate
- : public BasicSetElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- OSetElementValueSetUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-//==========================================================================
-//= Root Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are root nodes and dynamic sets
-*/
- class ORootElementSetInfo
- : public BasicRootElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- ORootElementSetInfo(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree,_xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::RootElement& getElementClass();
- private:
- configapi::OReadRootElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are root nodes and dynamic sets of complex types (trees)
-*/
- class ORootElementTreeSetUpdate
- : public BasicUpdateElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- ORootElementTreeSetUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are root nodes and dynamic sets of simple types (values)
-*/
- class ORootElementValueSetUpdate
- : public BasicUpdateElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- ORootElementValueSetUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree,_xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_SETOBJECTS_HXX_
-
-
diff --git a/configmgr/source/api2/setupdate.cxx b/configmgr/source/api2/setupdate.cxx
deleted file mode 100644
index 4a2d5f0071d0..000000000000
--- a/configmgr/source/api2/setupdate.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "setupdate.hxx"
-#include "accessimpl.hxx"
-#include "updateimpl.hxx"
-#include "apinodeupdate.hxx"
-#include "apitypes.hxx"
-#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// classes BasicSet / BasicValueSet
-//////////////////////////////////////////////////////////////////////////////////
-
-// XInterface joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicSet::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameContainer *>(this)
- , static_cast< css::container::XNameReplace *>(this)
- , static_cast< css::beans::XPropertyWithState *>(this)
- , static_cast< css::lang::XSingleServiceFactory *>(this)
- );
- }
- return aRet;
-}
-//..............................................................................
-
-uno::Any SAL_CALL BasicValueSet::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameContainer *>(this)
- , static_cast< css::container::XNameReplace *>(this)
- , static_cast< css::beans::XPropertyWithState *>(this)
- );
- }
- return aRet;
-}
-
-// XTypeProvider joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Type > SAL_CALL BasicSet::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- configapi::getReferenceType(static_cast< css::beans::XPropertyWithState *>(this)),
- configapi::getReferenceType(static_cast< css::lang::XSingleServiceFactory *>(this)),
- BasicSetAccess::getTypes());
-
- return aTypes.getTypes();
-}
-//..............................................................................
-
-uno::Sequence< uno::Type > SAL_CALL BasicValueSet::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- configapi::getReferenceType(static_cast< css::beans::XPropertyWithState *>(this)),
- BasicSetAccess::getTypes());
-
- return aTypes.getTypes();
-}
-
-//uno::Sequence< sal_Int8 > SAL_CALL BasicSet::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-//uno::Sequence< sal_Int8 > SAL_CALL BasicValueSet::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
-// safe write access
-//////////////////////////////////////////////////////////////////////////////////
-configapi::NodeTreeSetAccess& BasicSet::getSetNode()
-{
- configapi::NodeTreeSetAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update-interface missing.")),
- static_cast< css::container::XNameReplace * >(this)
- );
- }
- return *pAccess;
-}
-
-configapi::NodeValueSetAccess& BasicValueSet::getSetNode()
-{
- configapi::NodeValueSetAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update-interface missing.")),
- static_cast< css::container::XNameReplace* >(this)
- );
- }
- return *pAccess;
-}
-
-// New Interface methods
-// XNameReplace
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicSet::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getSetNode(), rName, rElement );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getSetNode(), rName, rElement );
-}
-
-// XNameContainer
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicSet::insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implInsertByName( getSetNode(), rName, rElement );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implInsertByName( getSetNode(), rName, rElement );
-}
-
-//----------------------------------------------------------------------------------
-void SAL_CALL BasicSet::removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveByName( getSetNode(), rName );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveByName( getSetNode(), rName );
-}
-
-// XPropertyWithState
-//////////////////////////////////////////////////////////////////////////////////
-
-css::beans::PropertyState SAL_CALL BasicSet::getStateAsProperty() throw (uno::RuntimeException)
-{
- return configapi::implGetStateAsProperty( getSetNode() );
-}
-//..............................................................................
-
-css::beans::PropertyState SAL_CALL BasicValueSet::getStateAsProperty() throw (uno::RuntimeException)
-{
- return configapi::implGetStateAsProperty( getSetNode() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetToDefaultAsProperty( getSetNode() );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetToDefaultAsProperty( getSetNode() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetDefaultAsProperty( getSetNode() );
-}
-//..............................................................................
-
-uno::Reference< uno::XInterface > SAL_CALL BasicValueSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetDefaultAsProperty( getSetNode() );
-}
-
-// XSingleServiceFactory (not for ValueSet)
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstance( )
- throw(uno::Exception, uno::RuntimeException)
-{
- return configapi::implCreateElement( getSetNode() );
-}
-
-//----------------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstanceWithArguments( const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
-{
- return configapi::implCreateElement( getSetNode(), aArguments );
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/setupdate.hxx b/configmgr/source/api2/setupdate.hxx
deleted file mode 100644
index 33656c49b08c..000000000000
--- a/configmgr/source/api2/setupdate.hxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETUPDATE_HXX_
-#define CONFIGMGR_API_SETUPDATE_HXX_
-
-#include "setaccess.hxx"
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
- namespace configapi { class NodeTreeSetAccess; class NodeValueSetAccess; }
-
-//==========================================================================
-//= BasicSet
-//==========================================================================
-
-/** base class for configuration nodes which are dynamic sets of complex types (trees)
-*/
- class BasicSet
- : public BasicSetAccess
- , public css::container::XNameContainer
- , public css::beans::XPropertyWithState
- , public css::lang::XSingleServiceFactory
- {
- protected:
- // Destructors
- virtual ~BasicSet() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicSetAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicSetAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicSetAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- virtual void SAL_CALL
- insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState
- virtual css::beans::PropertyState SAL_CALL
- getStateAsProperty( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setToDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XSingleServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException);
-
- protected:
- configapi::NodeTreeSetAccess& getSetNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess() = 0;
- };
-
-//==========================================================================
-//= BasicValueSet
-//==========================================================================
-
-/** class for configuration nodes which are dynamic sets of simple types (values)
-*/
- class BasicValueSet
- : public BasicSetAccess
- , public css::beans::XPropertyWithState
- , public css::container::XNameContainer
- {
- protected:
- // Destructors
- virtual ~BasicValueSet() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicSetAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicSetAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicSetAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- virtual void SAL_CALL
- insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState
- virtual css::beans::PropertyState SAL_CALL
- getStateAsProperty( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setToDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- configapi::NodeValueSetAccess& getSetNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess() = 0;
- };
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_VALUESETACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/translatechanges.cxx b/configmgr/source/api2/translatechanges.cxx
deleted file mode 100644
index 520bd04b36d8..000000000000
--- a/configmgr/source/api2/translatechanges.cxx
+++ /dev/null
@@ -1,283 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "translatechanges.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "apifactory.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
- namespace container = css::container;
-// ---------------------------------------------------------------------------------------------------
-
- namespace configuration
- {
- class NodeChange;
- class NodeChanges;
- class NodeRef;
- class NodeID;
- }
-// ---------------------------------------------------------------------------------------------------
-
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
- //interpreting NodeChanges
-// resolve the relative path from a given base to the changed node
-bool resolveChangeLocation(configuration::RelativePath& aPath, configuration::NodeChangeLocation const& aChange, rtl::Reference< configuration::Tree > const& aBaseTree, configuration::NodeRef const& aBaseNode)
-{
- OSL_ENSURE(aChange.isValidLocation(), "Trying to resolve against change location that wasn't set up properly");
-
- namespace Path = configuration::Path;
-
- rtl::Reference< configuration::Tree > aChangeBaseTree = aChange.getBaseTree();
-
- configuration::AbsolutePath aOuterBasePath = aBaseTree->getAbsolutePath(aBaseNode);
- configuration::AbsolutePath aChangeBasePath = aChangeBaseTree->getAbsolutePath(aChange.getBaseNode());
-
- std::vector<configuration::Path::Component>::const_reverse_iterator aChangeIt = aChangeBasePath.begin(), aChangeEnd = aChangeBasePath.end();
- std::vector<configuration::Path::Component>::const_reverse_iterator aOuterIt = aOuterBasePath.begin(), aOuterEnd = aOuterBasePath.end();
-
- // First by resolve the base node pathes
- while (aOuterIt != aOuterEnd && aChangeIt != aChangeEnd)
- {
- if ( ! Path::matches(*aOuterIt,*aChangeIt) ) return false; // mismatch
- ++aOuterIt;
- ++aChangeIt;
- }
-
- // Next consider the stored accessor
- if (aChangeIt != aChangeEnd) // stepping outward - prepend
- {
- Path::Rep aRemaining(aChangeIt, aChangeEnd);
-
- aPath = configuration::RelativePath(aRemaining).compose(aChange.getAccessor());
- }
- else if (aOuterIt == aOuterEnd) // exact match outside
- {
- aPath = aChange.getAccessor();
- }
- else //(aChangeIt == aChangeEnd) but outer left
- {
- configuration::RelativePath aAccessor = aChange.getAccessor();
- aChangeIt = aAccessor.begin();
- aChangeEnd = aAccessor.end();
-
- // resolve the outer path against the change accessor
- while (aOuterIt != aOuterEnd && aChangeIt != aChangeEnd)
- {
- if ( ! Path::matches(*aOuterIt,*aChangeIt) ) return false; // mismatch
- ++aOuterIt;
- ++aChangeIt;
- }
-
- if (aOuterIt == aOuterEnd)
- {
- Path::Rep aRemaining(aChangeIt, aChangeEnd);
-
- aPath = configuration::RelativePath( aRemaining );
- }
- }
-
- return (aOuterIt == aOuterEnd); // resolved completely and assigned ??
-
-}
-
-// ---------------------------------------------------------------------------------------------------
-// change path and base settings to start from the given base
-bool rebaseChange(configuration::NodeChangeLocation& aChange, rtl::Reference< configuration::Tree > const& _aBaseTreeRef)
-{
- return rebaseChange(aChange,_aBaseTreeRef,_aBaseTreeRef->getRootNode());
-}
-bool rebaseChange(configuration::NodeChangeLocation& aChange, rtl::Reference< configuration::Tree > const& _aBaseTreeRef, configuration::NodeRef const& aBaseNode)
-{
- OSL_ENSURE(aChange.isValidLocation(), "Trying to rebase change location that wasn't set up properly");
-
- rtl::Reference< configuration::Tree > aBaseTree(_aBaseTreeRef);
-
- configuration::RelativePath aNewPath;
- if (resolveChangeLocation(aNewPath,aChange,aBaseTree,aBaseNode))
- {
- aChange.setBase( aBaseTree, aBaseNode);
- aChange.setAccessor( aNewPath );
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------------------------------
-// resolve non-uno elements to Uno Objects
-bool resolveUnoObjects(UnoChange& aUnoChange, configuration::NodeChangeData const& aChange,
- Factory& rFactory)
-{
- if (aChange.isSetChange())
- {
- //Check we have ElementTree
- if ((aChange.element.newValue == NULL) &&
- (aChange.element.oldValue == NULL))
- {
- if( ( aChange.unoData.newValue.getValue()!=NULL) ||
- ( aChange.unoData.newValue.getValue()!=NULL))
- {
- return true;
- }
- else return false;
- }
-
- //Check if complex or simple type
- rtl::Reference< configuration::Tree > aTree = aChange.isRemoveSetChange()?
- aChange.getOldElementTree():
- aChange.getNewElementTree();
-
- configuration::NodeRef aNodeRef = aTree->getRootNode();
-
- if (configuration::isStructuralNode(aTree, aNodeRef))
- {
- uno::Reference<uno::XInterface> aNewUnoObject = rFactory.findUnoElement(aChange.getNewElementNodeID());
- uno::Reference<uno::XInterface> aOldUnoObject = rFactory.findUnoElement(aChange.getOldElementNodeID());
-
- bool bFound = aNewUnoObject.is() || aOldUnoObject.is();
- aUnoChange.newValue <<= aNewUnoObject;
- aUnoChange.oldValue <<= aOldUnoObject;
- return bFound;
- }
- else
- {
- aUnoChange.newValue = configuration::getSimpleElementValue(aTree, aNodeRef);
-
- if (aChange.isReplaceSetChange() )
- {
- rtl::Reference< configuration::Tree > aOldTree = aChange.getOldElementTree();
-
- aNodeRef = aOldTree->getRootNode();
- OSL_ENSURE(!configuration::isStructuralNode(aOldTree, aNodeRef), "resolveUnoObject types mismatch");
- aUnoChange.oldValue = configuration::getSimpleElementValue(aOldTree, aNodeRef);
- }
- bool bFound = aUnoChange.newValue.hasValue() || aUnoChange.oldValue.hasValue();
- return bFound;
- }
- }
- else if (aChange.isValueChange())
- {
- aUnoChange.newValue = aChange.unoData.newValue;
- aUnoChange.oldValue = aChange.unoData.oldValue;
- return true;
- }
- else
- {
- return false;
- }
-}
-// ---------------------------------------------------------------------------------------------------
-// resolve non-uno elements to Uno Objects inplace
-bool resolveToUno(configuration::NodeChangeData& aChange, Factory& rFactory)
-{
- struct UnoChange aUnoChange;
- if (resolveUnoObjects(aUnoChange,aChange, rFactory))
- {
- aChange.unoData.newValue = aUnoChange.newValue;
- aChange.unoData.oldValue = aUnoChange.oldValue;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------------------------------
-
-/// fill a change info from a NodeChangeInfo
-void fillChange(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo, rtl::Reference< configuration::Tree > const& aBaseTree, Factory& rFactory)
-{
- fillChange(rChange,aInfo,aBaseTree,aBaseTree->getRootNode(),rFactory);
-}
-/// fill a change info from a NodeChangeInfo
-void fillChange(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo, rtl::Reference< configuration::Tree > const& aBaseTree, configuration::NodeRef const& aBaseNode, Factory& rFactory)
-{
- configuration::RelativePath aRelativePath;
- if (!resolveChangeLocation(aRelativePath, aInfo.location, aBaseTree, aBaseNode))
- OSL_ENSURE(false, "WARNING: Change is not part of the given Tree");
-
- UnoChange aUnoChange;
-
- if (!resolveUnoObjects(aUnoChange, aInfo.change, rFactory))
- OSL_ENSURE(false, "WARNING: Cannot find out old/new UNO objects involved in change");
-
- rChange.Accessor <<= aRelativePath.toString();
- rChange.Element = aUnoChange.newValue;
- rChange.ReplacedElement = aUnoChange.oldValue;
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a change info from a NodeChangeInfo (base,path and uno objects are assumed to be resolved already)
-void fillChangeFromResolved(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo)
-{
- rChange.Accessor <<= aInfo.location.getAccessor().toString();
- rChange.Element = aInfo.change.unoData.newValue;
- rChange.ReplacedElement = aInfo.change.unoData.oldValue;
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a event from a NodeChangeInfo (uno objects are assumed to be resolved already)
-bool fillEventDataFromResolved(container::ContainerEvent& rEvent, configuration::NodeChangeInformation const& aInfo)
-{
- rEvent.Accessor <<= aInfo.location.getAccessor().getLocalName().getName();
- rEvent.Element = aInfo.change.unoData.newValue;
- rEvent.ReplacedElement = aInfo.change.unoData.oldValue;
-
- return !aInfo.isEmptyChange();
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a event from a NodeChangeInfo(uno objects are assumed to be resolved already)
-bool fillEventDataFromResolved(beans::PropertyChangeEvent& rEvent, configuration::NodeChangeInformation const& aInfo, bool bMore)
-{
- if (!aInfo.isValueChange())
- return false;
-
- rEvent.PropertyName = aInfo.location.getAccessor().getLocalName().getName();
-
- rEvent.NewValue = aInfo.change.unoData.newValue;
- rEvent.OldValue = aInfo.change.unoData.oldValue;
-
- rEvent.PropertyHandle = -1;
- rEvent.Further = bMore;
-
- return !aInfo.isEmptyChange();
-}
-// ---------------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------------------------------
-}
-
diff --git a/configmgr/source/api2/translatechanges.hxx b/configmgr/source/api2/translatechanges.hxx
deleted file mode 100644
index 3939333a5fbb..000000000000
--- a/configmgr/source/api2/translatechanges.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TRANSLATECHANGES_HXX_
-#define CONFIGMGR_API_TRANSLATECHANGES_HXX_
-
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/beans/XVetoableChangeListener.hpp>
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-#include <com/sun/star/container/XContainerListener.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-#include "rtl/ref.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
- namespace container = css::container;
-// ---------------------------------------------------------------------------------------------------
-
- namespace configuration
- {
- class NodeChangeInformation;
- class NodeChangeData;
- class NodeChangeLocation;
-
- //class NodeChange;
- //class NodeChanges;
- class Tree;
- class NodeRef;
- class NodeID;
- class RelativePath;
- }
-// ---------------------------------------------------------------------------------------------------
-
- namespace configapi
- {
- class NotifierImpl;
- class Factory;
-
- struct UnoChange { uno::Any newValue, oldValue; };
-
- //interpreting NodeChanges
- // resolve the relative path from a given base node to the changed node
- bool resolveChangeLocation( configuration::RelativePath& aPath,
- configuration::NodeChangeLocation const& aChange,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- configuration::NodeRef const& aBaseNode);
-
- // change path and base settings to start from the given base tree (root)
- bool rebaseChange( configuration::NodeChangeLocation& aChange,
- rtl::Reference< configuration::Tree > const& _aBaseTreeRef);
- // change path and base settings to start from the given base node
- bool rebaseChange( configuration::NodeChangeLocation& aChange,
- rtl::Reference< configuration::Tree > const& _aBaseTreeRef,
- configuration::NodeRef const& aBaseNode);
- // resolve non-uno elements to Uno Objects
- bool resolveUnoObjects(UnoChange& aUnoChange,
- configuration::NodeChangeData const& aChange,
- Factory& rFactory);
- // resolve non-uno elements to Uno Objects inplace
- bool resolveToUno(configuration::NodeChangeData& aChange,
- Factory& rFactory);
-
- // building events
-
- /// fill a change info from a NodeChangeInfo
- void fillChange(util::ElementChange& rChange,
- configuration::NodeChangeInformation const& aInfo,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- Factory& rFactory);
- /// fill a change info from a NodeChangeInfo
- void fillChange(util::ElementChange& rChange,
- configuration::NodeChangeInformation const& aInfo,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- configuration::NodeRef const& aBaseNode,
- Factory& rFactory);
- /// fill a change info from a NodeChangeInfo (base,path and uno objects are assumed to be resolved already)
- void fillChangeFromResolved(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo);
-
- /// fill a event from a NodeChangeInfo (uno objects are assumed to be resolved already)
- bool fillEventDataFromResolved(container::ContainerEvent& rEvent, configuration::NodeChangeInformation const& aInfo);
- /// fill a event from a NodeChangeInfo(uno objects are assumed to be resolved already) - returns false if this isn't a property change
- bool fillEventDataFromResolved(beans::PropertyChangeEvent& rEvent, configuration::NodeChangeInformation const& aInfo, bool bMore);
- }
-// ---------------------------------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_API_TRANSLATECHANGES_HXX_
diff --git a/configmgr/source/api2/treeiterators.cxx b/configmgr/source/api2/treeiterators.cxx
deleted file mode 100644
index a66c211d3b92..000000000000
--- a/configmgr/source/api2/treeiterators.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "treeiterators.hxx"
-
-#include "apitypes.hxx"
-#include "configpath.hxx"
-#include "attributes.hxx"
-#include "valueref.hxx"
-#include "propertyinfohelper.hxx"
-
-// .......................................................................
-namespace configmgr
-{
-// .......................................................................
- namespace configapi
- {
- // ===================================================================
- // = CollectNodeNames
- // ===================================================================
- // -------------------------------------------------------------------
- CollectPropertyInfo::Result CollectNodeNames::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- m_aList.push_back(aTree->getSimpleNodeName(aNode.getOffset()));
- return CONTINUE;
- }
-
- // -------------------------------------------------------------------
- CollectPropertyInfo::Result CollectNodeNames::handle(rtl::Reference< configuration::Tree > const&, configuration::ValueRef const& aNode)
- {
- m_aList.push_back(aNode.m_sNodeName);
- return CONTINUE;
- }
-
- // ===================================================================
- // = CollectPropertyInfo
- // ===================================================================
- // -------------------------------------------------------------------
- CollectNodeNames::Result CollectPropertyInfo::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- rtl::OUString aName = aTree->getSimpleNodeName(aNode.getOffset());
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = getUnoInterfaceType();
-
- m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree->hasNodeDefault(aNode)) );
- return CONTINUE;
- }
-
- // -------------------------------------------------------------------
- CollectNodeNames::Result CollectPropertyInfo::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode)
- {
- rtl::OUString aName = aNode.m_sNodeName;
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = aTree->getUnoType(aNode);
-
- m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree->hasNodeDefault(aNode)) );
- return CONTINUE;
- }
-// .......................................................................
- } // namespace configapi
-
-// .......................................................................
-} // namespace configmgr
-// .......................................................................
-
diff --git a/configmgr/source/api2/treeiterators.hxx b/configmgr/source/api2/treeiterators.hxx
deleted file mode 100644
index 42aaaae7fcb8..000000000000
--- a/configmgr/source/api2/treeiterators.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREEITERATORS_HXX_
-#define CONFIGMGR_TREEITERATORS_HXX_
-
-#include "tree.hxx"
-#include <com/sun/star/beans/Property.hpp>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-// .......................................................................
-namespace configmgr
-{
-// .......................................................................
- namespace configapi
- {
- // ===================================================================
- // = CollectNodeNames
- // ===================================================================
- class CollectNodeNames : public configuration::NodeVisitor
- {
- protected:
- std::vector<rtl::OUString> m_aList;
-
- public:
- CollectNodeNames() { }
-
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
-
- std::vector<rtl::OUString> const& list() const { return m_aList; }
- };
-
- // ===================================================================
- // = CollectPropertyInfo
- // ===================================================================
- class CollectPropertyInfo : public configuration::NodeVisitor
- {
- protected:
- std::vector<com::sun::star::beans::Property> m_aList;
-
- public:
- CollectPropertyInfo() { }
-
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
-
- std::vector<com::sun::star::beans::Property> const& list() const { return m_aList; }
- };
- }
-// .......................................................................
-} // namespace configmgr
-// .......................................................................
-
-#endif // _CONFIGMGR_TREEITERATORS_HXX_
-
diff --git a/configmgr/source/api2/updateimpl.cxx b/configmgr/source/api2/updateimpl.cxx
deleted file mode 100644
index 027a84a6ab4f..000000000000
--- a/configmgr/source/api2/updateimpl.cxx
+++ /dev/null
@@ -1,647 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updateimpl.hxx"
-#include "accessimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "nodechange.hxx"
-#include "configset.hxx"
-#include "configgroup.hxx"
-#include "confignotifier.hxx"
-#include "broadcaster.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
- namespace container = css::container;
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// Update methods
-//-----------------------------------------------------------------------------------
-
-// XNameReplace
-//-----------------------------------------------------------------------------------
-void implReplaceByName(NodeGroupAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- configuration::ValueRef aChildValue( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChildValue.isValid())
- {
- if (aTree->hasChildNode(aNode, aChildName))
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Node '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing child node not found by implementation");
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Value '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue(aChildValue, rElement);
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-// lock.clearForBroadcast();
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- catch (css::beans::PropertyVetoException& ex)
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Change was Vetoed: ") );
- throw lang::WrappedTargetException( sMessage += ex.Message, rNode.getUnoInstance(), uno::makeAny(ex) );
- }
-}
-//-----------------------------------------------------------------------------------
-
-void implReplaceByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- rtl::Reference< configuration::ElementTree > aElementTree = configapi::extractElementTree(rNode.getFactory(), rElement, rNode.getElementInfo());
- if (!aElementTree.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Replacing object was not created from this set's template") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateReplaceElement( aElement, aElementTree );
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(aChange); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- attachSetElement(rNode, aElementTree);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-//-----------------------------------------------------------------------------------
-
-void implReplaceByName(NodeValueSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateReplaceElement( aElement, rElement );
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(aChange); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XNameContainer
-//-----------------------------------------------------------------------------------
-void implInsertByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement)
- throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- if( aTree->hasElement(aNode,aChildName) )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is already present in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::ElementExistException( sMessage, xContext );
- }
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::Reference< configuration::ElementTree > aElementTree = configapi::extractElementTree(rNode.getFactory(), rElement, rNode.getElementInfo());
- if (!aElementTree.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set: ") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Inserted object was not created from this set's template") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateInsertElement(aChildName, aElementTree);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Adding a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- attachSetElement(rNode, aElementTree);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument( 1 );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-//-----------------------------------------------------------------------------------
-
-void implInsertByName(NodeValueSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement)
- throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- if( aTree->hasElement(aNode,aChildName) )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is already present in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::ElementExistException( sMessage, xContext );
- }
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateInsertElement(aChildName, rElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Adding a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument( 1 );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-//-----------------------------------------------------------------------------------
-void implRemoveByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateRemoveElement(aElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Removing a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- detachSetElement(rNode.getFactory(), aElement);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-//-----------------------------------------------------------------------------------
-void implRemoveByName(NodeValueSetAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement = aTree->getElement(aNode,aChildName);
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateRemoveElement(aElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Removing a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-//-----------------------------------------------------------------------------------
-
-// XPropertyWithState
-//-----------------------------------------------------------------------------------
-
-void implSetToDefaultAsProperty(NodeSetAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::SetDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChange aChange = aDefaulter.validateSetToDefaultState();
-
- const bool bLocal = true;
-
- if (aChange.test().isChange() )
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,bLocal));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
-
- throw lang::WrappedTargetException( sMessage += e.message(), xContext, uno::Any());
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- catch (lang::WrappedTargetException& ) { throw;}
- catch (uno::RuntimeException& ) { throw;}
- catch (uno::Exception& e)
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
-
- throw lang::WrappedTargetException( sMessage += e.Message, xContext, uno::makeAny(e));
- }
-}
-//-----------------------------------------------------------------------------------
-
-// XSingleServiceFactory
-//-----------------------------------------------------------------------------------
-uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode )
- throw(uno::Exception, uno::RuntimeException)
-{
- uno::Reference< uno::XInterface > xRet;
- try
- {
- GuardedNodeData<NodeSetAccess> lock( rNode ); // no provider lock needed ? => if template lock is separate - OK
-
- rtl::Reference< configuration::ElementTree > aNewElement( rNode.getElementFactory().instantiateTemplate(rNode.getElementInfo()) );
-
- uno::Any aAny = configapi::makeElement( rNode.getFactory(), aNewElement );
- if (!(aAny >>= xRet)) // no parent available
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicSetElement::getParent: could not extract parent - node is not an object");
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
-{
- { (void)aArguments; }
- OSL_ENSURE(aArguments.getLength() == 0, "ConfigurationContainer: createInstance: Arguments not supported - ignoring ...");
- return implCreateElement(rNode);
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/updateimpl.hxx b/configmgr/source/api2/updateimpl.hxx
deleted file mode 100644
index c8ed6f25c978..000000000000
--- a/configmgr/source/api2/updateimpl.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-#define CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (updating operation)
- */
- namespace configapi
- {
- class NodeSetAccess;
- class NodeTreeSetAccess;
- class NodeValueSetAccess;
- class NodeGroupAccess;
-
- // XNameReplace
- //---------------------------------------------------------------------
- void implReplaceByName(NodeGroupAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implReplaceByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implReplaceByName(NodeValueSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- //---------------------------------------------------------------------
- void implInsertByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implInsertByName(NodeValueSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveByName(NodeValueSetAccess& rNode, const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState - updating operation only
- //---------------------------------------------------------------------
- void implSetToDefaultAsProperty(NodeSetAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XSingleServiceFactory
- //---------------------------------------------------------------------
- uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode )
- throw(uno::Exception, uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException);
-
- //---------------------------------------------------------------------
- }
-
-}
-#endif // CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-
-
diff --git a/configmgr/source/backend/backendaccess.cxx b/configmgr/source/backend/backendaccess.cxx
deleted file mode 100644
index 6cc5eed84ff4..000000000000
--- a/configmgr/source/backend/backendaccess.cxx
+++ /dev/null
@@ -1,827 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendaccess.hxx"
-#include "logger.hxx"
-#include "matchlocale.hxx"
-#include "layermerge.hxx"
-#include "schemabuilder.hxx"
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDISPATCHER_HXX
-#include "updatedispatch.hxx"
-#endif // CONFIGMGR_BACKEND_UPDATEDISPATCHER_HXX
-#include "backendnotifier.hxx"
-#include "emptylayer.hxx"
-#include "filehelper.hxx"
-#include "simpleinteractionrequest.hxx"
-#include "configinteractionhandler.hxx"
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/configuration/backend/XCompositeLayer.hpp>
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/MergeRecoveryRequest.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/logfile.hxx>
-
-#include <cppuhelper/exc_hlp.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif //INCLUDED_VECTOR
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif //INCLUDED_ALGORITHM
-
-#define OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-#define RTL_LOGFILE_OU2A(rtlOUString) OU2A(rtlOUString)
-
-#define OUSTR(txt) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(txt) )
-
-namespace configmgr { namespace backend {
-//------------------------------------------------------------------------------
- namespace task = com::sun::star::task;
-
-inline
-uno::Reference<lang::XMultiServiceFactory> BackendAccess::getServiceFactory() const
-{
- return uno::Reference<lang::XMultiServiceFactory>(mContext->getServiceManager(),uno::UNO_QUERY_THROW);
-}
-//------------------------------------------------------------------------------
-
-BackendAccess::BackendAccess(
- const uno::Reference<backenduno::XBackend>& xBackend,
- const uno::Reference<uno::XComponentContext>& xContext)
- : mContext(xContext)
- , mBackend(xBackend)
- , mBinaryCache(xContext)
- {
- OSL_ENSURE(mContext.is(), "BackendAccess: Context is missing");
- if (!mContext.is())
- throw lang::NullPointerException(rtl::OUString::createFromAscii("BackendAccess: NULL Context passed"), NULL);
- if (!xBackend.is())
- throw lang::NullPointerException(OUSTR("Configuration: Trying to create backend access without backend"),NULL);
- if (!uno::Reference<backenduno::XSchemaSupplier>::query(xBackend).is())
- throw lang::NullPointerException(OUSTR("Configuration: No backend for schemas available"),NULL);
-
-
- mNotifier = new BackendChangeNotifier(xBackend);
- //Stored as uno::reference to facilitate sharing with MultiStratumBackend
- mXNotifier = mNotifier;
-
- //Create Binary Cache
- uno::Reference<backenduno::XBackendEntities> xBackendEntities = uno::Reference<backenduno::XBackendEntities>( mBackend, uno::UNO_QUERY) ;
- OSL_ENSURE(xBackendEntities.is(),"Backend does not provide entity information");
-
- if ( xBackendEntities.is() ) mBinaryCache.setOwnerEntity(xBackendEntities->getOwnerEntity());
-}
-//------------------------------------------------------------------------------
-
-BackendAccess::~BackendAccess() {}
-//------------------------------------------------------------------------------
-namespace
-{
-//------------------------------------------------------------------------------
-
- static inline
- bool findLocale(std::vector< com::sun::star::lang::Locale > const & seq, com::sun::star::lang::Locale const & loc)
- {
- std::vector< com::sun::star::lang::Locale >::const_iterator first = seq.begin();
- std::vector< com::sun::star::lang::Locale >::const_iterator last = seq.end();
- for ( ; first != last; ++first)
- if (localehelper::equalLocale(*first, loc))
- return true;
- return false;
- }
-//------------------------------------------------------------------------------
-
- static inline
- void addLocale( com::sun::star::lang::Locale const & aLocale, std::vector< com::sun::star::lang::Locale > & inoutLocales)
- {
- if (!findLocale(inoutLocales,aLocale))
- inoutLocales.push_back(aLocale);
- }
-//------------------------------------------------------------------------------
-
- static rtl::OUString toString(uno::Sequence< rtl::OUString > const & seq, sal_Unicode separator = ',')
- {
- rtl::OUStringBuffer buf;
-
- if (sal_Int32 const nCount = seq.getLength())
- {
- buf.append(seq[0]);
- for (sal_Int32 ix=1; ix < nCount; ++ix)
- buf.append(separator).append(seq[ix]);
- }
- else
- buf.appendAscii("<none>");
-
- return buf.makeStringAndClear();
- }
-//------------------------------------------------------------------------------
-
- static
- uno::Sequence< rtl::OUString > intersect(uno::Sequence< rtl::OUString > const & seq1, uno::Sequence< rtl::OUString > const & seq2)
- {
- sal_Int32 const len1 = seq1.getLength();
- uno::Sequence< rtl::OUString > aResult(len1);
-
- rtl::OUString const * const beg2 = seq2.getConstArray();
- rtl::OUString const * const end2 = beg2 + seq2.getLength();
-
- sal_Int32 ix = 0;
- for (sal_Int32 i1 = 0; i1 < len1; ++i1)
- {
- if (std::find(beg2,end2,seq1[i1]) != end2)
- aResult[ix++] = seq1[i1];
- }
- aResult.realloc(ix);
- return aResult;
- }
-//------------------------------------------------------------------------------
-} // anonymous namespace
-//------------------------------------------------------------------------------
-
-// helper used by the binary cache
-uno::Sequence< rtl::OUString >
- getAvailableLocales(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers)
-{
- uno::Sequence< rtl::OUString > aResult;
-
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<backenduno::XCompositeLayer> compositeLayer(
- pLayers [i], uno::UNO_QUERY) ;
-
- if (compositeLayer.is())
- {
- uno::Sequence<rtl::OUString> aLocales = compositeLayer->listSubLayerIds();
-
- if (aResult.getLength() == 0)
- {
- aResult = aLocales;
- }
- else
- {
- OSL_TRACE("Warning: multiple composite layers found. Detection of available locales is inaccurate.");
- // be defensive: only locales present in all composite layers are 'available'
- aResult= intersect(aResult,aLocales);
- }
- }
- }
- return aResult;
-}
-//------------------------------------------------------------------------------
-static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer);
-
-void BackendAccess::merge(
- MergedComponentData& aData,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 aNumLayers,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & inoutMergedLocales,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- LayerMergeHandler * pMerger = new LayerMergeHandler(mContext, aData, aTemplateProvider );
- uno::Reference<backenduno::XLayerHandler> xLayerMerger(pMerger);
-
- Logger logger(mContext);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::merge()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "merging %d layers", int(aNumLayers) );
-
- rtl::OUString const & aLanguage = aRequestedLocale.Language;
- bool const needAllLanguages = localehelper::isAnyLanguage(aLanguage);
-
- if (aLanguage.getLength() && !needAllLanguages)
- {
- if (!localehelper::isDefaultLanguage(aLanguage))
- addLocale(aRequestedLocale,inoutMergedLocales);
- }
- bool const needLocalizedData = needAllLanguages || !inoutMergedLocales.empty();
-
- if (logger.isLogging(LogLevel::FINEST))
- {
- if (!needLocalizedData)
- logger.finest("Starting merge with NO locales", "merge()","configmgr::Backend");
-
- else if (needAllLanguages)
- logger.finest("Starting merge for ALL locales", "merge()","configmgr::Backend");
-
- else
- logger.finest(OUSTR("Starting merge for locale(s): ") +
- toString(localehelper::makeIsoSequence(inoutMergedLocales)),
- "merge()","configmgr::Backend");
- }
-
- if (pLayersMerged) *pLayersMerged = 0;
-
- for (sal_Int32 i = 0 ; i < aNumLayers ; ++ i)
- {
- if (logger.isLogging(LogLevel::FINEST))
- logger.finest(OUSTR("+ Merging layer: ") + getLayerURL(pLayers[i]),
- "merge()","configmgr::Backend");
-
- pMerger->prepareLayer() ;
- pLayers [i]->readData(xLayerMerger) ;
-
- if (needLocalizedData)
- {
- uno::Reference<backenduno::XCompositeLayer> compositeLayer(
- pLayers [i], uno::UNO_QUERY) ;
-
- if (compositeLayer.is())
- {
- uno::Sequence<rtl::OUString> aSubLayerIds = compositeLayer->listSubLayerIds();
- logger.finest(OUSTR("++ Found locales: ") + toString(aSubLayerIds),
- "merge()","configmgr::Backend");
-
- for (sal_Int32 j = 0; j < aSubLayerIds.getLength(); ++j)
- {
- rtl::OUString const & aLocaleIso = aSubLayerIds[j];
- com::sun::star::lang::Locale aLocale = localehelper::makeLocale(aLocaleIso);
-
- // requesting de-CH, we accept de-CH and de, but not de-DE
- const localehelper::MatchQuality kMatchAccept = localehelper::MATCH_LANGUAGE_PLAIN;
-
- if (needAllLanguages || localehelper::isMatch(aLocale,inoutMergedLocales,kMatchAccept))
- {
- if(pMerger->prepareSublayer(aLocaleIso))
- {
- logger.finest(OUSTR("++ Merging sublayer for locale: ") + aLocaleIso,
- "merge()","configmgr::Backend");
- compositeLayer->readSubLayerData(xLayerMerger,aLocaleIso) ;
- addLocale(aLocale,inoutMergedLocales);
- }
- // else dropLocale(aLocale,inoutMergedLocales); ?
- }
- }
- }
- }
- if (pLayersMerged) ++*pLayersMerged;
- }
-}
-//------------------------------------------------------------------------------
-
-bool BackendAccess::readDefaultData( MergedComponentData & aComponentData,
- rtl::OUString const & aComponent,
- RequestOptions const & aOptions,
- bool bIncludeTemplates,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog1, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::readDefaultData()");
-
- Logger logger(mContext);
- const sal_Int32 detail = LogLevel::FINER;
- bool const bLogDetail = logger.isLogging(detail);
-
- rtl::OUString const aSchemaVersion = this->getSchemaVersion(aComponent);
-
- if (logger.isLogging(LogLevel::FINE))
- {
- rtl::OUStringBuffer aMsg;
- aMsg.appendAscii("Reading data for component \"").append(aComponent).appendAscii("\"");
- aMsg.appendAscii(" [version=").append(aSchemaVersion).appendAscii("]");
-
- logger.fine( aMsg.makeStringAndClear(), "readDefaultData()","configmgr::Backend");
- }
-
- com::sun::star::lang::Locale const aRequestedLocale = localehelper::makeLocale(aOptions.getLocale());
- std::vector< com::sun::star::lang::Locale > aKnownLocales;
-
- if (bLogDetail) logger.log(detail, "... attempt to read from binary cache", "readDefaultData()","configmgr::Backend");
- bool bCacheHit = mBinaryCache.readComponentData(aComponentData, getServiceFactory(),
- aComponent, aSchemaVersion,
- aOptions.getEntity(),
- aRequestedLocale, aKnownLocales,
- pLayers, nNumLayers, bIncludeTemplates);
-
- if (!bCacheHit)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::readDefaultData() - not in cache");
-
- if (bLogDetail) logger.log(detail, "... cache miss - need full merge", "readDefaultData()","configmgr::Backend");
- if (bLogDetail) logger.log(detail, "... reading schema", "readDefaultData()","configmgr::Backend");
- {
- SchemaBuilder *schemaBuilder = new SchemaBuilder( mContext, aComponent, aComponentData, aTemplateProvider );
- uno::Reference<backenduno::XSchemaHandler> schemaHandler = schemaBuilder ;
-
- uno::Reference<backenduno::XSchema> schema = this->getSchema(aComponent);
- schema->readSchema(schemaHandler) ;
- }
-
- if (bLogDetail) logger.log(detail, "... merging layers", "readDefaultData()","configmgr::Backend");
- this->merge(aComponentData, pLayers, nNumLayers, aRequestedLocale, aKnownLocales, aTemplateProvider, pLayersMerged );
- promoteToDefault(aComponentData);
-
- if (mBinaryCache.isCacheEnabled(aOptions.getEntity()))
- {
- if (bLogDetail) logger.log(detail, "... creating binary cache", "readDefaultData()","configmgr::Backend");
- bool bWriteSuccess = mBinaryCache.writeComponentData( aComponentData, getServiceFactory(),
- aComponent, aSchemaVersion,
- aOptions.getEntity(), aKnownLocales,
- pLayers, nNumLayers );
-
- if (!bWriteSuccess)
- {
- logger.info("Binary cache write failed - disabling binary cache","readDefaultData()","configmgr::Backend");
- mBinaryCache.disableCache();
- }
- }
- else if (bLogDetail)
- logger.log(detail, "... cache hit", "readDefaultData()","configmgr::Backend");
- }
- else if (pLayersMerged)
- *pLayersMerged = nNumLayers;
-
- return aComponentData.hasSchema();
-}
-//------------------------------------------------------------------------------
-
-static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer)
-{
- try
- {
- namespace beans = com::sun::star::beans;
- uno::Reference< beans::XPropertySet > xLayerProps( aLayer, uno::UNO_QUERY );
- if (xLayerProps.is())
- {
- uno::Any aPropVal = xLayerProps->getPropertyValue( OUSTR("URL") );
- rtl::OUString aResult;
- if (aPropVal >>= aResult)
- return aResult;
- }
- OSL_TRACE("Warning - Cannot get location of layer data\n");
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Warning - Configuration: Retrieving layer URL failed: [%s]\n", OU2A(e.Message));
- }
- // TODO: use better fallback, e.g. ServiceName
- const char * const aFallback = aLayer.is() ? "<Unknown Layer Type>" : "<NULL Layer>";
- return rtl::OUString::createFromAscii(aFallback);
-}
-//------------------------------------------------------------------------------
-static inline
-rtl::OUString getLayerIdentifier(const uno::Reference<backenduno::XLayer> & aLayer)
-{
- return getLayerURL(aLayer);
-}
-
-//------------------------------------------------------------------------------
-static void removeLayerData(uno::Reference< backenduno::XLayer > const & xLayer)
-{
- OSL_ASSERT(xLayer.is());
-
- uno::Reference< backenduno::XUpdatableLayer > xLayerRemover(xLayer,uno::UNO_QUERY);
- if (xLayerRemover.is())
- try
- {
- xLayerRemover->replaceWith(createEmptyLayer());
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Warning - Configuration: Could not clear Layer data. Error: [%s]\n", OU2A(e.Message));
- }
- else
- {
- if (! FileHelper::tryToRemoveFile(getLayerURL(xLayer),true))
- OSL_TRACE("Warning - Configuration: Could not remove broken user Layer data: [-Not Updatable-]\n");
- }
-}
-//------------------------------------------------------------------------------
-
-static void discardLayer(uno::Sequence<uno::Reference<backenduno::XLayer> >& layers, sal_Int32 nLayer)
-{
- OSL_ASSERT(0 <= nLayer && nLayer < layers.getLength());
- sal_Int32 nNewSize = layers.getLength() - 1;
-
- for (sal_Int32 i = nLayer; i<nNewSize; ++i)
- layers[i] = layers[i+1];
-
- layers.realloc(nNewSize);
-}
-//------------------------------------------------------------------------------
-
-namespace {
-
-class RecursiveHandler:
- public cppu::WeakImplHelper1< task::XInteractionHandler >
-{
-public:
- explicit RecursiveHandler(
- uno::Reference< task::XInteractionHandler > const & outer):
- m_outer(outer) {}
-
- virtual void SAL_CALL handle(
- uno::Reference< task::XInteractionRequest > const & request)
- throw (uno::RuntimeException)
- {
- backenduno::MergeRecoveryRequest req;
- if (request->getRequest() >>= req) {
- uno::Sequence< uno::Reference< task::XInteractionContinuation > >
- cs(request->getContinuations());
- for (sal_Int32 i = 0; i < cs.getLength(); ++i) {
- uno::Reference< task::XInteractionDisapprove > dis(
- cs[i], uno::UNO_QUERY);
- if (dis.is()) {
- dis->select();
- break;
- }
- }
- } else if (m_outer.is()) {
- m_outer->handle(request);
- }
- }
-
-private:
- RecursiveHandler(RecursiveHandler &); // not defined
- void operator =(RecursiveHandler &); // not defined
-
- virtual ~RecursiveHandler() {}
-
- uno::Reference< task::XInteractionHandler > m_outer;
-};
-
-}
-
-bool BackendAccess::approveRecovery(const uno::Any & aMergeException,
- const uno::Reference<backenduno::XLayer> & aBrokenLayer,
- bool bUserLayerData)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE | apihelper::CONTINUATION_DISAPPROVE;
-
- sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN;
-
- apihelper::ConfigurationInteractionHandler handler;
- try {
- uno::Reference< task::XInteractionHandler > h(handler.get());
- if (h.is()) {
- handler.setRecursive(new RecursiveHandler(h));
- rtl::Reference< apihelper::SimpleInteractionRequest > req(
- new apihelper::SimpleInteractionRequest(
- uno::makeAny(
- backenduno::MergeRecoveryRequest(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "Recover from configuration merge"
- " failure")),
- aBrokenLayer, aMergeException,
- getLayerIdentifier(aBrokenLayer),
- (bUserLayerData
- && (uno::Reference< backenduno::XUpdatableLayer >::query(aBrokenLayer).is()
- || FileHelper::fileExists(
- getLayerURL(aBrokenLayer)))))),
- k_supported_choices));
- h->handle(req.get());
- chosen = req->getResponse();
- }
- } catch (uno::Exception & e) {
- OSL_TRACE("Warning - Configuration: Interaction handler failed: [%s]\n", OU2A(e.Message));
- }
-
- switch (chosen)
- {
- case apihelper::CONTINUATION_APPROVE: return true;
- case apihelper::CONTINUATION_DISAPPROVE: return false;
- case apihelper::CONTINUATION_UNKNOWN: break;
-
- default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break;
- }
- // no choice available - default: approve, if user data
- return bUserLayerData;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > BackendAccess::getNodeData(const ComponentRequest& aRequest,
- ITemplateDataProvider *_aTemplateProvider,
- INodeDataListener *aListener)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString const component = aRequest.getComponentName();
- ITemplateDataProvider * const aTemplateProvider = _aTemplateProvider ? _aTemplateProvider : this;
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getNodeData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(component) );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > layers =
- this->getLayers(component, aRequest.getOptions()) ;
-
- sal_Int32 const k_NumUserLayers = 1;
-
- sal_Int32 nNumDefaultLayers = layers.getLength() - k_NumUserLayers;
- sal_Int32 nCurrentLayer( -1 );
- bool bDefaultRecoveryApproved = false;
-
- Logger logger(mContext);
- do try // loop to allow recovery from merge failures
- {
- MergedComponentData aComponentData;
- nCurrentLayer = -1;
-
- if (!this->readDefaultData(aComponentData, component, aRequest.getOptions(), true,
- layers.getConstArray(),nNumDefaultLayers,
- aTemplateProvider, &nCurrentLayer))
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(component);
- sMessage.appendAscii("\" contains no data. ");
-
- throw com::sun::star::container::NoSuchElementException(sMessage.makeStringAndClear(),mBackend);
- }
- OSL_ASSERT(nCurrentLayer == nNumDefaultLayers);
-
- sal_Int32 const nNumUserLayers = layers.getLength() - nNumDefaultLayers;
- if (nNumUserLayers > 0)
- {
- //Merge User layer (with all locales)
- logger.finer("... merging user layer", "getNodeData()","configmgr::Backend");
-
- std::vector< com::sun::star::lang::Locale > aLocales;
- merge(aComponentData,
- layers.getConstArray()+nNumDefaultLayers, nNumUserLayers,
- localehelper::getAnyLocale(), aLocales, aTemplateProvider );
-
- // mark this one as done
- ++nCurrentLayer;
- }
-
- logger.finer("Reading component data finished successfully", "getNodeData()","configmgr::Backend");
-
- ComponentInstance retCode(aComponentData.extractSchemaTree(),
- aComponentData.extractTemplatesTree(),
- aRequest.getComponentName()) ;
-
- //Register listener with notifier
- if(aListener)
- {
- mNotifier->addListener(aListener, aRequest);
- }
- return ResultHolder< ComponentInstance >(retCode) ;
- }
- catch (com::sun::star::container::NoSuchElementException &) { throw; }
- catch (com::sun::star::uno::RuntimeException &) { throw; }
- catch (uno::Exception & )
- {
- // can only recover if layer merging broke
- if (nCurrentLayer < 0 || layers.getLength() <= nCurrentLayer)
- throw;
-
- uno::Reference< backenduno::XLayer > xBrokenLayer = layers[nCurrentLayer];
-
- bool bUserLayerBroken = (nCurrentLayer == nNumDefaultLayers);
-
- if (!bDefaultRecoveryApproved || bUserLayerBroken)
- {
- logger.info("Parsing data layer failed. Requesting approval for automated recovery", "getNodeData()","configmgr::Backend");
- uno::Any theError = cppu::getCaughtException();
- if (!approveRecovery(theError,xBrokenLayer,bUserLayerBroken))
- cppu::throwException( theError );
- }
-
- // now do the recovery
- discardLayer(layers,nCurrentLayer);
- if (bUserLayerBroken)
- {
- logger.info("Recovering from broken user data layer - discarding the data", "getNodeData()","configmgr::Backend");
- removeLayerData(xBrokenLayer);
- }
- else
- {
- logger.info("Recovering from broken default layer - skipping", "getNodeData()","configmgr::Backend");
- bDefaultRecoveryApproved = true;
- --nNumDefaultLayers;
- }
- }
- while (true);
-}
-//------------------------------------------------------------------------------
-
-void BackendAccess::updateNodeData(const UpdateRequest& aUpdate)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString entity = aUpdate.getOptions().getEntity() ;
- rtl::OUString component =
- aUpdate.getUpdateRoot().getModuleName();
- uno::Reference<backenduno::XUpdateHandler> handler ;
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::updateNodeData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "updating component: %s", RTL_LOGFILE_OU2A(component) );
-
- if (entity.getLength() == 0) {
- handler = mBackend->getOwnUpdateHandler(component) ;
- }
- else { handler = mBackend->getUpdateHandler(component, entity) ; }
- UpdateDispatcher dispatcher(handler, aUpdate.getOptions().getLocale()) ;
-
- dispatcher.dispatchUpdate(aUpdate.getUpdateRoot(),
- *aUpdate.getUpdateData()) ;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > BackendAccess::getDefaultData(const NodeRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString const component = aRequest.getPath().getModuleName();
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getDefaultData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(aRequest.getPath().toString()) );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > const layers =
- this->getLayers(component, aRequest.getOptions()) ;
-
- sal_Int32 const nNumUserLayers = 1;
- sal_Int32 const nNumDefaultLayers = layers.getLength() - nNumUserLayers;
-
- MergedComponentData aComponentData;
-
- if (!this->readDefaultData(aComponentData, component, aRequest.getOptions(), false,
- layers.getConstArray(),nNumDefaultLayers,
- this))
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(component);
- sMessage.appendAscii("\" contains no default data. ");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,mBackend);
- }
-
- std::auto_ptr<ISubtree> aResultTree = aComponentData.extractSchemaTree();
-
- configuration::AbsolutePath aPath = aRequest.getPath();
- if( aPath.begin() != aPath.end())
- {
- for(std::vector<configuration::Path::Component>::const_reverse_iterator it=aPath.begin()+1,endIt=aPath.end();it!=endIt; ++it)
- {
- std::auto_ptr<INode> aChild=aResultTree->removeChild(it->getName());
- if(aChild.get()== NULL)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Element \"");
- sMessage.append(aPath.toString());
- sMessage.appendAscii("\" does not exist in the default data. ");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).finest(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,mBackend);
- }
-
- ISubtree *pChildAsSubtree = aChild->asISubtree();
- if(pChildAsSubtree == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BackendAccess::getDefaultData - Node Expected, Found Property: ").concat(it->getName());
- Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw backenduno::MalformedDataException(sMsg, mBackend, uno::Any());
- }
- aResultTree.reset(pChildAsSubtree);
- aChild.release();
- }
- }
-
- NodeInstance retCode(aResultTree, aRequest.getPath()) ;
- return ResultHolder< NodeInstance >(retCode) ;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< TemplateInstance > BackendAccess::getTemplateData(const TemplateRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString component = aRequest.getComponentName();
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getTemplateData()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(aRequest.getComponentName().toString()) ,
- aRequest.isComponentRequest() ? "*" : RTL_LOGFILE_OU2A(aRequest.getComponentName().toString()) );
-
- MergedComponentData aComponentData;
-
- {
- SchemaBuilder *schemaBuilder = new SchemaBuilder( mContext, component, aComponentData ) ;
- uno::Reference<backenduno::XSchemaHandler> handler = schemaBuilder ;
-
- uno::Reference<backenduno::XSchema> schema = this->getSchema(component);
-
- schema->readTemplates(handler) ;
- }
-
- TemplateInstance::Data aResultData;
- if (aRequest.isComponentRequest())
- {
- aResultData.reset( aComponentData.extractTemplatesTree().release() );
- }
- else
- {
- backenduno::TemplateIdentifier templateId ;
- templateId.Name = aRequest.getTemplateName();
- templateId.Component = aRequest.getComponentName();
-
- aResultData = aComponentData.extractTemplateNode(templateId.Name);
- }
-
- TemplateInstance retCode(aResultData,aRequest.getTemplateName(), aRequest.getComponentName()) ;
- return ResultHolder< TemplateInstance >(retCode) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const rtl::OUString& aComponent)
-{
- uno::Reference< backenduno::XSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY_THROW);
- OSL_ASSERT(xSchemaBackend.is());
-
- uno::Reference< backenduno::XSchema > xSchema = xSchemaBackend->getComponentSchema(aComponent) ;
- if (!xSchema.is())
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(aComponent);
- sMessage.appendAscii("\" is unknown. [No schema available]");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).warning(sMsg,"getSchema()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,xSchemaBackend);
- }
-
- return xSchema;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString BackendAccess::getSchemaVersion(const rtl::OUString& aComponent)
-{
- uno::Reference< backenduno::XVersionedSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY);
- if (xSchemaBackend.is())
- return xSchemaBackend->getSchemaVersion(aComponent);
- else
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence< uno::Reference<backenduno::XLayer> > BackendAccess::getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions)
-{
- rtl::OUString aEntity = aOptions.getEntity() ;
-
- if (aEntity.getLength() == 0)
- {
- // Use own entity instead
- return mBackend->listOwnLayers(aComponent) ;
- }
- else
- {
- return mBackend->listLayers(aComponent, aEntity) ;
- }
-}
-//------------------------------------------------------------------------------
-void BackendAccess::removeRequestListener(INodeDataListener *aListener,
- const ComponentRequest& aRequest)
- SAL_THROW(())
-{
-
- OSL_PRECOND(aListener, "ERROR: trying to remove a NULL listener");
- mNotifier->removeListener(aListener, aRequest);
-}
-//------------------------------------------------------------------------------
-} } // configmgr.backend
diff --git a/configmgr/source/backend/backendaccess.hxx b/configmgr/source/backend/backendaccess.hxx
deleted file mode 100644
index 9e8bfef86c05..000000000000
--- a/configmgr/source/backend/backendaccess.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
-#define CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
-
-#include "backendnotifier.hxx"
-#include "mergeddataprovider.hxx"
-#include "mergedcomponentdata.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/XSchema.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include "binarycache.hxx"
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Implementation of IMergedDataProvider handling the access
- to the configuration data.
- */
-class BackendAccess : public IMergedDataProvider
-{
- public :
- /**
- Constructor using an XBackend implementation and a
- service factory.
-
- @param xBackend backend used for access to data
- @param xContext uno context for instantiation of services
- */
- BackendAccess( const uno::Reference<backenduno::XBackend>& xBackend,
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~BackendAccess(void) ;
-
- // IMergedDataProvider
- virtual ResultHolder< ComponentInstance > getNodeData(const ComponentRequest& aRequest,
- ITemplateDataProvider* aTemplateProvider,
- INodeDataListener *aListener = NULL)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual void removeRequestListener(INodeDataListener *aListener,
- const ComponentRequest& aRequest)
- SAL_THROW(());
- virtual void updateNodeData(const UpdateRequest& aUpdate)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual ResultHolder< NodeInstance > getDefaultData(const NodeRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual ResultHolder< TemplateInstance > getTemplateData(const TemplateRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) ;
-
- private :
-
- /**
- Retrieves the schema of a component.
- */
- uno::Reference< backenduno::XSchema > getSchema(const rtl::OUString& aComponent) ;
-
- /**
- Retrieves the schema version of a component.
- */
- rtl::OUString getSchemaVersion(const rtl::OUString& aComponent) ;
-
- /**
- Retrieves the layers for a request.
- */
- uno::Sequence< uno::Reference<backenduno::XLayer> > getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions) ;
-
- /**
- Reads merged default data with a given number of layers.
- */
- bool readDefaultData( MergedComponentData & aComponentData,
- rtl::OUString const & aComponent,
- RequestOptions const & aOptions,
- bool bIncludeTemplates,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged = 0)
- SAL_THROW((com::sun::star::uno::Exception));
- /**
- Merges layers onto component data.
- */
- void merge(
- MergedComponentData& aData,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 aNumLayers,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & inoutMergedLocales,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged = 0)
- SAL_THROW((com::sun::star::uno::Exception));
- private :
- /**
- Decides if merging should be retried after an exception.
-
- @throws com::sun::star::uno::Exception
- if not approved
- */
- bool approveRecovery(
- const uno::Any & aMergeException,
- const uno::Reference<backenduno::XLayer> & aBrokenLayer,
- bool bUserLayerData)
- SAL_THROW((com::sun::star::uno::Exception));
-
- private :
- /** Get the factory used for service invocation */
- uno::Reference<lang::XMultiServiceFactory> getServiceFactory() const;
- /** UNO context to which this backend belongs */
- uno::Reference<uno::XComponentContext> mContext ;
- /** Backend being accessed */
- uno::Reference<backenduno::XBackend> mBackend ;
- /** Binary cache of default data */
- BinaryCache mBinaryCache;
- /** Manages Nofification from the Backends */
- uno::Reference<backenduno::XBackendChangesListener> mXNotifier;
-
- BackendChangeNotifier * mNotifier;
-
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
diff --git a/configmgr/source/backend/backendfactory.cxx b/configmgr/source/backend/backendfactory.cxx
deleted file mode 100644
index 46f3ce65186b..000000000000
--- a/configmgr/source/backend/backendfactory.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "backendfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "bootstrapcontext.hxx"
-#include "bootstrap.hxx"
-#include "backendaccess.hxx"
-#include "serviceinfohelper.hxx"
-#include "wrapexception.hxx"
-
-
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
- namespace backend
- {
-// -------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -------------------------------------------------------------------------
-const sal_Char k_DefaultBackendWrapper[] = "com.sun.star.comp.configuration.backend.SingleBackendAdapter";
-const sal_Char k_DefaultBackendService[] = "com.sun.star.comp.configuration.backend.LocalSingleBackend";
-
-// -------------------------------------------------------------------------
-const sal_Char k_DefaultBackendServiceAndImplName[] = K_DefaultBackendServiceAndImplName ;
-
-// -------------------------------------------------------------------------
-const sal_Char k_GenericBackendServiceAndImplName[] = "com.sun.star.configuration.backend.Backend" ;
-
-// -------------------------------------------------------------------------
-static sal_Char const * const k_BackendServiceNames [] =
-{
- k_DefaultBackendServiceAndImplName,
- k_GenericBackendServiceAndImplName,
- 0
-};
-// -------------------------------------------------------------------------
-static const ServiceRegistrationInfo k_DefaultBackendServiceInfo =
-{
- k_DefaultBackendServiceAndImplName,
- k_BackendServiceNames
-};
-// -------------------------------------------------------------------------
-static const ServiceRegistrationInfo k_GenericBackendServiceInfo =
-{
- k_GenericBackendServiceAndImplName,
- k_BackendServiceNames + 1
-};
-// -------------------------------------------------------------------------
-static const SingletonRegistrationInfo k_DefaultBackendSingletonInfo =
-{
- K_DefaultBackendSingletonName,
- k_DefaultBackendServiceAndImplName,
- k_DefaultBackendServiceAndImplName,
- & k_GenericBackendServiceInfo
-};
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-const SingletonRegistrationInfo * getDefaultBackendSingletonInfo()
-{
- return & k_DefaultBackendSingletonInfo;
-}
-// -------------------------------------------------------------------------
-
-const ServiceRegistrationInfo * getDefaultBackendServiceInfo()
-{
- return & k_DefaultBackendServiceInfo;
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> SAL_CALL
- getDefaultBackendSingleton( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xContext )
-{
- OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
-
- UnoContextTunnel aTunnel;
- aTunnel.passthru( xContext );
-
- uno::Reference<uno::XInterface> xResult;
-
- if (xContext.is())
- try
- {
- xContext->getValueByName(SINGLETON(K_DefaultBackendSingletonName))
- >>= xResult;
- }
- catch (uno::Exception & )
- {
- // to do: really use the tunneled failure when that is set properly
- if ( aTunnel.recoverFailure(true).hasValue() )
- {
- // have a failure, but can't recover it
- // -> try to regenerate
- instantiateDefaultBackend(xContext);
-
- OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
- }
- // cannot recover any failure
- throw;
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-static
-uno::Sequence< uno::Any > createInitArgs(ContextReader const & _aContext)
-{
- OSL_ASSERT(_aContext.hasBootstrapContext());
- uno::Sequence< uno::Any > aResult( 1 );
- aResult[0] <<= _aContext.getBootstrapContext();
- return aResult;
-}
-// -------------------------------------------------------------------------
-
-static
-inline
-uno::Reference< uno::XInterface > createService(ContextReader const & _aCtx, uno::Sequence< uno::Any > const & _aInitArgs, rtl::OUString const & _aSvc)
-{
- uno::Reference< lang::XMultiComponentFactory > xFactory = _aCtx.getServiceManager();
- OSL_ENSURE(xFactory.is(),"ERROR: ComponentContext has no service manager\n");
- if (!xFactory.is()) throw uno::RuntimeException( rtl::OUString::createFromAscii("ERROR: ComponentContext has no service manager\n"), NULL );
- return xFactory->createInstanceWithArgumentsAndContext( _aSvc, _aInitArgs, _aCtx.getBaseContext());
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > wrapSingleBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs, uno::Reference< backenduno::XMultiLayerStratum > const & _xWrappedBackend)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
-
- rtl::OUString aWrapperSvc = _aSettings.hasUnoBackendWrapper() ?
- _aSettings.getUnoBackendWrapper() :
- rtl::OUString::createFromAscii(k_DefaultBackendWrapper);
-
- OSL_ENSURE (aWrapperSvc.getLength(), "ERROR: No wrapper service for wrapped configuration");
- OSL_ENSURE (_xWrappedBackend.is(), "ERROR: No backend to wrap for wrapped configuration");
-
- sal_Int32 const nBaseArgsCount = _aInitArgs.getLength();
- uno::Sequence< uno::Any > aExtendedArgs( _aInitArgs );
- aExtendedArgs.realloc( nBaseArgsCount + 1 );
- aExtendedArgs[nBaseArgsCount] <<= _xWrappedBackend;
-
- return uno::Reference< backenduno::XBackend >::query( createService(_aSettings,aExtendedArgs,aWrapperSvc) );
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > createOfflineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
-
- uno::Reference< backenduno::XBackend > xResult;
- if ( _aSettings.hasUnoBackendWrapper() )
- {
- rtl::OUString const aWrapperSvc = _aSettings.getUnoBackendWrapper();
-
- xResult = uno::Reference< backenduno::XBackend >::query( createService(_aSettings,_aInitArgs,aWrapperSvc) );
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendService() || _aSettings.hasBootstrapContext());
-
- rtl::OUString const aBackendServiceName = _aSettings.hasUnoBackendService() ?
- _aSettings.getUnoBackendService() :
- rtl::OUString::createFromAscii(k_DefaultBackendService);
-
- uno::Reference< uno::XInterface > xResult =
- createService(_aSettings,_aInitArgs,aBackendServiceName);
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > createOnlineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ENSURE( _aSettings.isUnoBackend(), "ERROR - BackendFactory: For legacy backends use createSessionBackend()");
-
- uno::Reference< backenduno::XBackend > xResult;
-
- uno::Reference< uno::XInterface > xRealBackend = createRealBackend(_aSettings,_aInitArgs);
-
- if (_aSettings.hasUnoBackendWrapper())
- {
- // try wrapping a single backend
- uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
- if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
-
- // if we don't have one, try using it as unwrapped backend
- else
- xResult.set(xRealBackend, uno::UNO_QUERY);
- }
- else
- {
- // look for a direct implementation of XBackend
- xResult.set(xRealBackend, uno::UNO_QUERY);
- if (!xResult.is())
- {
- // try the default wrapper if we only have a single backend
- uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
- if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
-
- else
- OSL_ENSURE( !xRealBackend.is(), "Configuration Backend implements no known backend interface" );
- }
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static uno::Reference< backenduno::XBackend > createUnoBackend(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& _xCtx)
-{
- ContextReader aSettings(_xCtx);
- OSL_ENSURE( aSettings.isUnoBackend(), "ERROR - BackendFactory: Legacy backends are not supported any more");
-
- uno::Sequence< uno::Any > aArguments = createInitArgs(aSettings);
-
- sal_Bool bOffline = aSettings.hasOfflineSetting() ? aSettings.getOfflineSetting() : !aSettings.hasUnoBackendService();
-
- uno::Reference< backenduno::XBackend > xResult;
-
- if (!bOffline)
- xResult = createOnlineBackend (aSettings,aArguments);
-
- if (!xResult.is())
- xResult = createOfflineBackend(aSettings,aArguments);
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-// to do: tunnel and raise fully typed exception information (and use it in the get..Singleton wrappers)
- #define TUNNEL_ALL_EXCEPTIONS() \
- WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true )
-
-// -------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> SAL_CALL instantiateDefaultBackend( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xTargetContext )
-{
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- try
- {
- return uno::Reference< uno::XInterface >( createUnoBackend(xContext), uno::UNO_QUERY );
- }
- TUNNEL_ALL_EXCEPTIONS()
-
- OSL_ASSERT(!"unreached");
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-uno::Reference< backenduno::XBackend > BackendFactory::getUnoBackend()
-{
- return uno::Reference< backenduno::XBackend >::query( getDefaultBackendSingleton(m_xCtx) );
-}
-// -------------------------------------------------------------------------
-
-rtl::Reference<IMergedDataProvider> BackendFactory::createBackend()
-{
- rtl::Reference< IMergedDataProvider > xBackend;
-
- uno::Reference< backenduno::XBackend > xBackendService = this->getUnoBackend();
-
- if (xBackendService.is())
- xBackend = new BackendAccess(xBackendService, m_xCtx);
-
- return xBackend;
-}
-// -------------------------------------------------------------------------
-
-BackendFactory BackendFactory::instance(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx)
-{
- return BackendFactory(_xCtx);
-}
-
-//-----------------------------------------------------------------------------
- } // namespace
-//-----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/backend/backendnotifier.cxx b/configmgr/source/backend/backendnotifier.cxx
deleted file mode 100644
index 1f51eb56cb8e..000000000000
--- a/configmgr/source/backend/backendnotifier.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "backendnotifier.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-
-
-//----------------------------------------------------------------------------
-BackendChangeNotifier::BackendChangeNotifier(const uno::Reference<backenduno::XBackend>& _xBackend)
-: m_aMutex()
- ,m_aListeners()
- ,m_aBackend(_xBackend, uno::UNO_QUERY)
-{
-
-}
-// ---------------------------------------------------------------------------
-
-BackendChangeNotifier::~BackendChangeNotifier()
-{
- m_aListeners.clear();
-}
-// ---------------------------------------------------------------------------
-void SAL_CALL BackendChangeNotifier::componentDataChanged(const backenduno::ComponentChangeEvent& _aEvent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- rtl::OUString aComponentName = _aEvent.Component;
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter = m_aListeners.find(aComponentName);
- if(aIter != m_aListeners.end())
- {
- aIter->second.notifyListeners(aComponentName);
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL BackendChangeNotifier::disposing( lang::EventObject const & /*rSource*/ )
-throw (uno::RuntimeException)
-{
- osl::MutexGuard aListGuard(m_aMutex);
- if (m_aBackend.is())
- {
- m_aBackend.clear();
- }
- m_aListeners.clear();
-}
-// -----------------------------------------------------------------------------
-void BackendChangeNotifier::addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
-
- OSL_PRECOND(_xListener, "ERROR: trying to register a NULL listener");
- ComponentListener aComponentListener(_xListener, _aRequest.getOptions());
-
- const rtl::OUString aComponentName = _aRequest.getComponentName();
-
- //Check if we have a Listener registered for that Component
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter;
- aIter = m_aListeners.find(aComponentName);
- if (aIter == m_aListeners.end())
- {
- ComponentNotifier aComponentNotifier;
- aComponentNotifier.addListenerToList(aComponentListener);
- m_aListeners[aComponentName] = aComponentNotifier;
-
- //Now need to register Listener with MultiStratumBackend for that Component
- if (m_aBackend.is())
- {
- m_aBackend->addChangesListener(this, aComponentName);
- }
- }
- else
- {
- //Add Listener and Option to ComponentNotifier list
- aIter->second.addListenerToList(aComponentListener);
-
- }
-
-}
-// ---------------------------------------------------------------------------
-
-void BackendChangeNotifier::removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
- OSL_PRECOND(!m_aListeners.empty(),
- "BackendChangeNotifier:Cannot Remove Listener, no Listeners Registered");
- OSL_PRECOND(_xListener, "ERROR: trying to remove a NULL listener");
-
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter;
- rtl::OUString aComponentName = _aRequest.getComponentName();
-
- aIter = m_aListeners.find(aComponentName);
- if (aIter == m_aListeners.end())
- {
- OSL_TRACE("BackendChangeNotifier: removeListener: no listener registered for component %s",
- aComponentName.getStr());
- }
- else
- {
- ComponentListener aComponentListener(_xListener, _aRequest.getOptions());
- aIter->second.removeListenerFromList(aComponentListener);
- if (aIter->second.isListEmpty())
- {
- m_aListeners.erase(aIter);
- //Need all to de-register listeners from the lower layers
- if (m_aBackend.is())
- {
- m_aBackend->removeChangesListener(this, aComponentName);
- }
- }
- }
-
-}
-// ---------------------------------------------------------------------------
-ComponentNotifier::ComponentNotifier():m_aListenerList()
-{
-}
-// ---------------------------------------------------------------------------
-
-
-void ComponentNotifier::addListenerToList(const ComponentListener& _aListener)
-{
- m_aListenerList.push_back(_aListener);
- //REM TO REMOVE
- ComponentListener aListener = m_aListenerList.front();
-
-}
-// ---------------------------------------------------------------------------
-void ComponentNotifier::removeListenerFromList(const ComponentListener& _aListener)
-{
- OSL_PRECOND(!m_aListenerList.empty(),
- "ComponentNotifier:Cannot Remove Listener, no Listeners Registered");
-
- std::list<ComponentListener>::iterator aIter;
-
- //Remove first instance that matches in the list
- aIter = std::find(m_aListenerList.begin(), m_aListenerList.end(),_aListener);
- if(aIter != m_aListenerList.end())
- {
- m_aListenerList.erase(aIter);
- }
-}
-// ---------------------------------------------------------------------------
-void ComponentNotifier::notifyListeners(const rtl::OUString& _aComponent)
-{
-
- for( std::list<ComponentListener>::iterator aIter = m_aListenerList.begin();
- aIter != m_aListenerList.end(); aIter++)
- {
- ComponentRequest aRequest(_aComponent, (*aIter).m_aOptions);
-
- (*aIter).m_aListener->dataChanged(aRequest);
- }
-
-}
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/backendnotifier.hxx b/configmgr/source/backend/backendnotifier.hxx
deleted file mode 100644
index 78cd340624fc..000000000000
--- a/configmgr/source/backend/backendnotifier.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BACKEND_BACKENDNOTIFIER_HXX
-#define CONFIGMGR_BACKEND_BACKENDNOTIFIER_HXX
-
-#include "mergeddataprovider.hxx"
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-#ifndef INCLUDED_LIST
-#include <list>
-#define INCLUDED_LIST
-#endif
-
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// ---------------------------------------------------------------------------
- struct ComponentListener
- {
- explicit
- ComponentListener(INodeDataListener * _xListener, RequestOptions _aOptions):
- m_aListener( _xListener),
- m_aOptions(_aOptions)
- {}
-
- bool operator==(const ComponentListener& _aListener)const
- {
- return ( (&m_aListener == &_aListener.m_aListener)&&
- (compareRequestOptions(m_aOptions, _aListener.m_aOptions)== 0) );
-
- }
- INodeDataListener * m_aListener;
- RequestOptions m_aOptions;
- };
-
- /** Class used to store ComponentListener(listener and options)
- */
- class ComponentNotifier
- {
- public:
- ComponentNotifier();
- void addListenerToList(const ComponentListener& _aListener);
- void removeListenerFromList(const ComponentListener& _aListener);
- bool isListEmpty(){ return m_aListenerList.empty();}
- void notifyListeners(const rtl::OUString& _aComponent);
- private:
- std::list<ComponentListener> m_aListenerList;
- };
- // ---------------------------------------------------------------------------
- /** Interface providing a multicasting service for changes in the backend
- */
- class BackendChangeNotifier :public cppu::WeakImplHelper1<backenduno::XBackendChangesListener>
- {
- public:
- BackendChangeNotifier(const uno::Reference<backenduno::XBackend>& _xBackend);
- ~BackendChangeNotifier();
-
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- // notification support.
- /// register a listener for observing changes to the cached data
- void addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(());
- /// unregister a listener previously registered
- void removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(());
- private:
- osl::Mutex m_aMutex;
- std::map<rtl::OUString, ComponentNotifier> m_aListeners;
-
- /** Backend being accessed */
- uno::Reference<backenduno::XBackendChangesNotifier> m_aBackend ;
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/backend/backendstratalistener.hxx b/configmgr/source/backend/backendstratalistener.hxx
deleted file mode 100644
index c9ac5309d13d..000000000000
--- a/configmgr/source/backend/backendstratalistener.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BACKEND_BACKENDSTRATALISTENER_HXX
-#define CONFIGMGR_BACKEND_BACKENDSTRATALISTENER_HXX
-
-#include <com/sun/star/configuration/backend/XBackendChangesListener.hpp>
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include "backendnotifier.hxx"
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include "multistratumbackend.hxx"
-
-
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
- // --------------------------------------------------------------------------
- class BackendStrataListener: public cppu::WeakImplHelper1<backenduno::XBackendChangesListener>
- {
- public:
- BackendStrataListener(const MultiStratumBackend& aBackend);
- ~BackendStrataListener();
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- private:
- const MultiStratumBackend& mBackend ;
-
- };
-
-
-
- }
- // -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-#endif
diff --git a/configmgr/source/backend/basicimporthandler.cxx b/configmgr/source/backend/basicimporthandler.cxx
deleted file mode 100644
index 7d763c51d661..000000000000
--- a/configmgr/source/backend/basicimporthandler.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicimporthandler.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-BasicImportHandler::BasicImportHandler(
- uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity, const sal_Bool& bNotify)
-: m_bSendNotification(bNotify)
-, m_xBackend(xBackend)
-, m_aComponentName()
-, m_aEntity(aEntity)
-{
- OSL_ENSURE( m_xBackend.is(), "Creating an import handler without a target backend" );
-}
-// -----------------------------------------------------------------------------
-
-BasicImportHandler::~BasicImportHandler()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- BasicImportHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aComponentName = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- BasicImportHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if ( m_bSendNotification)
- {
- backenduno::ComponentChangeEvent aEvent;
- aEvent.Source=*this;
- aEvent.Component = m_aComponentName;
-
- uno::Reference<backenduno::XBackendChangesListener> xListener(m_xBackend, uno::UNO_QUERY);
- if( xListener.is())
- {
- xListener->componentDataChanged(aEvent);
- }
- else
- {
- OSL_ENSURE(false, "ImportMergeHandler: target backend does not support notifications");
- }
- }
- m_aComponentName = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-bool BasicImportHandler::startComponent( const rtl::OUString& aName )
-{
- if (hasComponent()) return false;
-
- m_aComponentName = aName;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-void BasicImportHandler::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException(sMsg, *this, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/basicimporthandler.hxx b/configmgr/source/backend/basicimporthandler.hxx
deleted file mode 100644
index f2c217b28baa..000000000000
--- a/configmgr/source/backend/basicimporthandler.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BASICIMPORTHANDLER_HXX
-#define CONFIGMGR_BACKEND_BASICIMPORTHANDLER_HXX
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class BasicImportHandler : public cppu::WeakImplHelper1< backenduno::XLayerHandler >
- {
- public:
- explicit
- BasicImportHandler(){}
-
- BasicImportHandler(uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity = rtl::OUString(), const sal_Bool& bNofity= sal_False);
- ~BasicImportHandler();
-
- // XLayerHandler subset - call these implementations from your derived class implementations
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- bool hasComponent() const { return m_aComponentName.getLength() != 0; }
- bool hasEntity() const { return m_aEntity.getLength() != 0; }
-
- rtl::OUString getComponent() const { return m_aComponentName; }
- rtl::OUString getEntity() const { return m_aEntity; }
- uno::Reference< backenduno::XBackend > getBackend() const { return m_xBackend; }
-
- bool startComponent( const rtl::OUString& aName );
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- /** If True, notification should be send to backend
- */
- sal_Bool m_bSendNotification;
- private:
- uno::Reference< backenduno::XBackend > const m_xBackend;
- rtl::OUString m_aComponentName;
- rtl::OUString const m_aEntity;
-
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/basicupdatemerger.cxx b/configmgr/source/backend/basicupdatemerger.cxx
deleted file mode 100644
index 67c47a24e9b4..000000000000
--- a/configmgr/source/backend/basicupdatemerger.cxx
+++ /dev/null
@@ -1,338 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicupdatemerger.hxx"
-#include "layerdefaultremover.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_ITERATOR
-#include <iterator>
-#define INCLUDED_ITERATOR
-#endif
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-BasicUpdateMerger::BasicUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer )
-: m_xSourceLayer(_xSourceLayer)
-, m_xResultHandler()
-, m_nNesting(0)
-, m_bSkipping(false)
-{
-}
-// -----------------------------------------------------------------------------
-
-BasicUpdateMerger::~BasicUpdateMerger()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::readData( uno::Reference< backenduno::XLayerHandler > const & _xResultHandler )
- throw ( backenduno::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!_xResultHandler.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - NULL output handler unexpected") );
- throw lang::NullPointerException(sMsg,*this);
- }
- if (!m_xSourceLayer.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - No source layer set") );
- throw lang::NullPointerException(sMsg,*this);
- }
-
- try
- {
- m_xResultHandler = new LayerDefaultRemover(_xResultHandler);
- m_xSourceLayer->readData( this );
- }
- catch (uno::Exception & )
- {
- m_xResultHandler.clear();
- throw;
- }
-
- m_xResultHandler.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_nNesting)
- raiseMalformedDataException("UpdateMerger: Cannot start layer - layer already in progress");
-
- m_bSkipping = false;
-
- m_xResultHandler->startLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_nNesting > 0)
- raiseMalformedDataException("UpdateMerger: Cannot end layer - data handling still in progress");
-
- this->flushContext();
-
- m_xResultHandler->endLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->overrideNode(aName, aAttributes, bClear);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addOrReplaceNode(aName, aAttributes);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->endNode();
-
- popLevel();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->dropNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->overrideProperty(aName, aAttributes, aType, bClear);
-
- pushLevel( rtl::OUString() ); // do not match context path to property names
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->endProperty();
-
- popLevel();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->setPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->setPropertyValueForLocale(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addProperty(aName, aAttributes, aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addPropertyWithValue(aName, aAttributes, aValue);
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException(sMsg, *this, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::startSkipping()
-{
- OSL_PRECOND( m_nNesting == 0, "BasicUpdateMerger: starting to skip, while already forwarding data");
- m_nNesting = 1;
- m_bSkipping = true;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: isHandling() is broken");
- OSL_POSTCOND( isSkipping(), "BasicUpdateMerger: isSkipping() is broken");
-}
-// -----------------------------------------------------------------------------
-
-
-void BasicUpdateMerger::pushLevel(rtl::OUString const & _aContext)
-{
- if (m_nNesting > 0)
- {
- ++m_nNesting;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if (m_nNesting < 0)
- {
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if (m_aSearchPath.empty())
- {
- ++m_nNesting;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if ( m_aSearchPath.back().equals(_aContext) ) // search path is reverse - see findContext()
- {
- OSL_ENSURE( m_nNesting == 0, "BasicUpdateMerger: level count while searching must be zero");
-
- m_aSearchPath.pop_back();
- }
- else // start forwarding
- {
- m_nNesting = 1;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- OSL_POSTCOND(!isSkipping(), "BasicUpdateMerger: skip flag set while searching " );
- }
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::popLevel()
-{
- OSL_PRECOND( isHandling(), "BasicUpdateMerger: ending a node that wasn't handled here");
- if (m_nNesting > 0)
- {
- if (--m_nNesting == 0)
- m_bSkipping = false;
- }
- else if (m_nNesting == 0) // ending a context level, but the context is not yet gone
- {
- OSL_ENSURE( !m_aSearchPath.empty(), "BasicUpdateMerger: flushing a context that was already found");
- flushContext();
- leaveContext();
- }
- else
- {
- OSL_ENSURE( m_aSearchPath.empty(), "BasicUpdateMerger: Left an unfinished context" );
- }
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::findContext(std::vector<rtl::OUString> const & _aContext)
-{
- // make the context a *reverse* copy of the context path
- OSL_PRECOND( ! isHandling(), "BasicUpdateMerger: starting context search while still handling data");
- m_aSearchPath.clear();
- m_aSearchPath.reserve(_aContext.size());
- std::copy( _aContext.rbegin(), _aContext.rend(), std::back_inserter(m_aSearchPath) );
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::leaveContext()
-{
- OSL_PRECOND( !isHandling(), "BasicUpdateMerger: ending the context while still handling data or seaching the context");
-
- // force
- m_nNesting = -1;
-
- OSL_POSTCOND( ! isSkipping(), "BasicUpdateMerger: ending the context node while still skipping data");
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: cannot mark context as being handled to the end.");
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::flushContext()
-{
- std::vector<rtl::OUString>::size_type nNesting = m_aSearchPath.size();
-
- while (!m_aSearchPath.empty())
- {
- m_xResultHandler->overrideNode(m_aSearchPath.back(), 0, false);
- m_aSearchPath.pop_back();
- }
- this->flushUpdate();
-
- while (nNesting > 0)
- {
- m_xResultHandler->endNode();
- --nNesting;
- }
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/basicupdatemerger.hxx b/configmgr/source/backend/basicupdatemerger.hxx
deleted file mode 100644
index 13e1940a86c6..000000000000
--- a/configmgr/source/backend/basicupdatemerger.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BASICUPDATEMERGER_HXX
-#define CONFIGMGR_BACKEND_BASICUPDATEMERGER_HXX
-
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class BasicUpdateMerger : public cppu::WeakImplHelper2< backenduno::XLayerHandler, backenduno::XLayer >
- {
- public:
- explicit
- BasicUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer);
- ~BasicUpdateMerger();
-
- // XLayerHandler
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XLayer
- protected:
- virtual void SAL_CALL
- readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException);
-
- // new overrideable
- private:
- /// write the whole update to the output
- virtual void flushUpdate() = 0;
-
- protected:
- bool isHandling() const { return m_nNesting != 0 || !m_aSearchPath.empty(); }
- bool isSkipping() const { return m_bSkipping; }
- void startSkipping();
-
- void findContext(std::vector<rtl::OUString> const & _aContext);
- void leaveContext();
-
- uno::Reference< backenduno::XLayerHandler > getResultWriter() const { return m_xResultHandler; };
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- private:
- void pushLevel(rtl::OUString const & _aLevel);
- void popLevel();
-
- void flushContext();
- private:
- uno::Reference< backenduno::XLayer > m_xSourceLayer;
- uno::Reference< backenduno::XLayerHandler > m_xResultHandler;
- std::vector<rtl::OUString> m_aSearchPath;
-
- sal_Int16 m_nNesting;
- bool m_bSkipping;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/binarycache.cxx b/configmgr/source/backend/binarycache.cxx
deleted file mode 100644
index 263c129c809d..000000000000
--- a/configmgr/source/backend/binarycache.cxx
+++ /dev/null
@@ -1,248 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binarycache.hxx"
-
-#include "binaryreadhandler.hxx"
-#include "binarywritehandler.hxx"
-
-#include "mergedcomponentdata.hxx"
-#include "filehelper.hxx"
-#include "typeconverter.hxx"
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-#include <osl/file.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- const rtl::OUString aSettingName(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheUrl"));
- // ---------------------------------------------------------------------------------------
- static inline bool isValidFileURL (rtl::OUString const& _sFileURL)
- {
- rtl::OUString sSystemPath;
- return _sFileURL.getLength() && (osl::File::E_None == osl::File::getSystemPathFromFileURL(_sFileURL, sSystemPath));
- }
- // -----------------------------------------------------------------------------
- // ---------------------------------------------------------------------------------------
- static
- bool implEnsureAbsoluteURL(rtl::OUString & _rsURL) // also strips embedded dots etc.
- {
- if (!_rsURL.getLength())
- return false;
-
- if (!isValidFileURL(_rsURL))
- {
- OSL_TRACE("Binary cache: File URL %s is invalid.",
- rtl::OUStringToOString(_rsURL,RTL_TEXTENCODING_ASCII_US).getStr());
- return false;
- }
-
- rtl::OUString sBasePath;
- OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
-
- rtl::OUString sAbsolute;
- if ( osl::File::E_None == osl::File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
- {
- _rsURL = sAbsolute;
- return isValidFileURL(_rsURL);
- }
- else
- {
- OSL_ENSURE(!isValidFileURL(_rsURL), "Could not get absolute file URL for valid URL");
- return false;
- }
- }
- // ---------------------------------------------------------------------------------------
- static const sal_Unicode kComponentSeparator = '.' ;
- static const sal_Unicode kPathSeparator = '/' ;
- static const char kBinarySuffix[] = ".dat" ;
-
- rtl::OUString BinaryCache::getCacheFileURL(const rtl::OUString& aComponent) const
- {
- rtl::OUStringBuffer retCode (mBaseURL);
- retCode.append(kPathSeparator) ;
- // retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- retCode.append(aComponent) ;
- retCode.appendAscii(RTL_CONSTASCII_STRINGPARAM(kBinarySuffix));
-
- rtl::OUString aResult = retCode.makeStringAndClear() ;
-
- if (isValidFileURL(aResult))
- {
- return aResult;
- }
- else
- {
- OSL_ENSURE(false, "Component File URL is invalid");
- return rtl::OUString();
- }
- }
- // -----------------------------------------------------------------------------
- BinaryCache::BinaryCache(const uno::Reference<uno::XComponentContext>& xContext )
- : mBaseURL()
- , mOwnerEntity()
- , mbCacheEnabled(false)
- {
-
- //initialise the base URL
- ContextReader aReader(xContext);
-
- rtl::OUString sCacheUrl;
- if (!aReader.isAdminService())
- {
- mbCacheEnabled = (aReader.getBestContext()->getValueByName(aSettingName) >>= sCacheUrl)
- && implEnsureAbsoluteURL(sCacheUrl);
- }
-
- if (mbCacheEnabled)
- {
- mBaseURL = sCacheUrl;
- if (!FileHelper::dirExists(sCacheUrl))
- {
- osl::File::RC errorCode = FileHelper::mkdirs(sCacheUrl);
- if (errorCode)
- {
-#if (OSL_DEBUG_LEVEL > 0)
- rtl::OString sURL = rtl::OUStringToOString(sCacheUrl,RTL_TEXTENCODING_ASCII_US);
- rtl::OString sErr = rtl::OUStringToOString(FileHelper::createOSLErrorString(errorCode),RTL_TEXTENCODING_ASCII_US);
- ::osl_trace("Configuration: Cannot create cache directory \"%s\". "
- "Error is %s [%d]",sURL.getStr(),sErr.getStr(),int(errorCode)) ;
-#endif
- mbCacheEnabled = false;
- }
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryCache::setOwnerEntity(const rtl::OUString & aOwnerEntity)
- {
- OSL_PRECOND(mOwnerEntity.getLength() == 0, "Owner entity of cache already set");
- mOwnerEntity = aOwnerEntity;
- }
- // -----------------------------------------------------------------------------
-
- void BinaryCache::disableCache()
- {
- mbCacheEnabled = false;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryCache::isCacheEnabled(rtl::OUString const & aEntity) const
- {
- if (!mbCacheEnabled) return false;
-
- // default entity is empty
- if (aEntity.getLength() == 0) return true;
-
- return aEntity.equals(mOwnerEntity);
- }
- // -----------------------------------------------------------------------------
- bool BinaryCache::readComponentData(MergedComponentData & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- bool bIncludeTemplates)
- {
- if (isCacheEnabled(aEntity))
- try
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::readComponentData() - enabled");
- BinaryReadHandler aCacheReader(getCacheFileURL(aComponent),aComponent,aFactory);
-
- // #i49148# Invalidate cache when schema version changes - using former 'owner' parameter for version
- if(aCacheReader.validateHeader(pLayers, nNumLayers, aSchemaVersion, aRequestedLocale, outKnownLocales))
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog1, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::readComponentData() - cache hit");
- aComponentData.setSchemaRoot( aCacheReader.readComponentTree() );
- if (bIncludeTemplates)
- aComponentData.setTemplatesTree( aCacheReader.readTemplatesTree() );
- return true;
- }
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Binary Cache read failed - exception: %s", rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- return false;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryCache::writeComponentData(MergedComponentData const & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- std::vector< com::sun::star::lang::Locale > const & aKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers)
- {
- if (isCacheEnabled(aEntity))
- try
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog3, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::writeComponentData() - enabled");
- BinaryWriteHandler aCacheWriter(getCacheFileURL(aComponent),aComponent, aFactory);
-
- //write data to cache
- // #i49148# Invalidate cache when schema version changes - using former 'owner' parameter for schema
- if (aCacheWriter.generateHeader(pLayers, nNumLayers, aSchemaVersion, aKnownLocales))
- {
- aCacheWriter.writeComponentTree(aComponentData.getSchemaTree());
- aCacheWriter.writeTemplatesTree(aComponentData.getTemplatesTree());
- return true;
- }
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration: Cache write failed - exception: %s", rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- return false;
- }
- // -----------------------------------------------------------------------------
-
- }
-// -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarycache.hxx b/configmgr/source/backend/binarycache.hxx
deleted file mode 100644
index 1e1035faca9f..000000000000
--- a/configmgr/source/backend/binarycache.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYCACHE_HXX
-#define CONFIGMGR_BINARYCACHE_HXX
-
-#include "matchlocale.hxx"
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star ;
- namespace uno = css::uno ;
- namespace lang = css::lang ;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
- class MergedComponentData;
-
- // -----------------------------------------------------------------------------
-
- class BinaryCache
- {
- public:
- explicit
- BinaryCache(const uno::Reference<uno::XComponentContext>& xContext);
-
- void setOwnerEntity(rtl::OUString const & aOwnerEntity);
- void disableCache();
-
- bool isCacheEnabled(rtl::OUString const & aEntity) const;
-
- rtl::OUString getCacheFileURL(rtl::OUString const & aComponent) const;
-
- bool readComponentData(MergedComponentData & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- bool bIncludeTemplates = true);
-
- bool writeComponentData(MergedComponentData const & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- std::vector< com::sun::star::lang::Locale > const & aKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers);
- private:
- rtl::OUString mBaseURL;
- rtl::OUString mOwnerEntity;
- bool mbCacheEnabled;
- };
-
- // -----------------------------------------------------------------------------------
- // helper for cache reader implementations - see backendaccess.cxx for implementation
- uno::Sequence< rtl::OUString >
- getAvailableLocales(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers);
- // -----------------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------------
-}
-
-#endif //
-
diff --git a/configmgr/source/backend/binaryreader.cxx b/configmgr/source/backend/binaryreader.cxx
deleted file mode 100644
index f1fa4dd03188..000000000000
--- a/configmgr/source/backend/binaryreader.cxx
+++ /dev/null
@@ -1,690 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binaryreader.hxx"
-#include "binarytype.hxx"
-#include "valuenode.hxx"
-#include "filehelper.hxx"
-#include "oslstream.hxx"
-
-
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XDataInputStream.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-#include <com/sun/star/io/BufferSizeExceededException.hpp>
-#include <com/sun/star/io/UnexpectedEOFException.hpp>
-
-#include <cppuhelper/implbase1.hxx>
-#include <osl/file.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include "tracer.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = com::sun::star::uno;
- namespace io = com::sun::star::io;
-
-
- // --------------------------------------------------------------------------
-
- inline rtl::OUString ErrorToMessage_Impl (osl::FileBase::RC eError)
- {
- return FileHelper::createOSLErrorString (eError);
- }
-
- // --------------------------------------------------------------------------
-
- class BinaryReader_Impl :
- public cppu::WeakImplHelper1< com::sun::star::io::XDataInputStream >
- {
- public:
- /** Construction.
- */
- explicit BinaryReader_Impl (rtl::OUString const & rFileUrl)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- /** XInputStream.
- */
- virtual sal_Int32 SAL_CALL readBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL readSomeBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL skipBytes (sal_Int32 nBytesToSkip)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL available()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL closeInput()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException);
-
-
- /** XDataInputStream.
- */
- virtual sal_Int8 SAL_CALL readBoolean()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int8 SAL_CALL readByte()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Unicode SAL_CALL readChar()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int16 SAL_CALL readShort()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL readLong()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int64 SAL_CALL readHyper()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual float SAL_CALL readFloat()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual double SAL_CALL readDouble()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL readUTF()
- throw (
- io::IOException, uno::RuntimeException);
-
- protected:
- /** Destruction.
- */
- virtual ~BinaryReader_Impl();
-
- private:
- sal_uInt32 checkAvail(); // may throw NotConnectedException
- sal_uInt32 getMaxAvail(sal_Int32 nRequest); // may throw NotConnectedException, BufferSizeExceededException
- sal_uInt8 const * readBuffer(sal_uInt32 nRequired); // may throw NotConnectedException, UnexpectedEOFException
- private:
- /** Representation.
- */
- sal_uInt8 * m_pBuffer;
- sal_uInt32 m_nLength;
- sal_uInt32 m_nOffset;
-
- /** Not implemented.
- */
- BinaryReader_Impl (const BinaryReader_Impl&);
- BinaryReader_Impl& operator= (const BinaryReader_Impl&);
- };
-
- // --------------------------------------------------------------------------
- static inline void checkIOError(osl::File::RC errcode)
- {
- if (errcode != osl::FileBase::E_None)
- {
- throw io::IOException (ErrorToMessage_Impl (errcode), NULL);
- }
- }
- static void raiseBufferError()
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("Cannot allocate Buffer: Too large");
- throw io:: BufferSizeExceededException(sMsg, NULL);
- }
- // -------------------------------------------------------------------------
- BinaryReader_Impl::BinaryReader_Impl (rtl::OUString const & rFileUrl)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- : m_pBuffer (0)
- , m_nLength (0)
- , m_nOffset (0)
- {
- osl::File aFile (rFileUrl);
-
- checkIOError( aFile.open (OpenFlag_Read) );
- sal_uInt64 nLength = 0;
- checkIOError( aFile.getSize (nLength) );
- if (nLength > 0xffffffff)
- raiseBufferError();
- m_nLength = sal_uInt32(nLength);
-
- sal_uInt8 *pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory (m_nLength));
- if (!pBuffer)
- raiseBufferError();
-
- sal_uInt64 nRead = 0;
- osl::File::RC result = aFile.read (pBuffer, nLength, nRead);
- if (result != osl::FileBase::E_None)
- {
- rtl_freeMemory (pBuffer);
- checkIOError( result );
- }
- if (nRead != nLength)
- {
- rtl_freeMemory (pBuffer);
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Could not read entire size of file: ");
- throw io::UnexpectedEOFException(sMsg.concat(rFileUrl),NULL);
- }
- m_pBuffer = pBuffer;
- }
-
- // --------------------------------------------------------------------------
-
- BinaryReader_Impl::~BinaryReader_Impl()
- {
- if (m_pBuffer) rtl_freeMemory (m_pBuffer);
- }
-
- // --------------------------------------------------------------------------
- // XInputStream implementation.
- // --------------------------------------------------------------------------
- sal_uInt32 BinaryReader_Impl::checkAvail ()
- {
- if (!m_pBuffer)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Stream is not open. No data available for reading.");
- throw io::NotConnectedException(sMsg,*this);
- }
- OSL_ASSERT(m_nLength >= m_nOffset);
- return m_nLength - m_nOffset;
- }
- // --------------------------------------------------------------------------
-
- sal_uInt32 BinaryReader_Impl::getMaxAvail (sal_Int32 nRequest)
- {
- if (nRequest < 0)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid read request - negative byte count requested.");
- throw io::BufferSizeExceededException(sMsg,*this);
- }
- sal_uInt32 const uRequest = sal_uInt32(nRequest);
- sal_uInt32 const uAvail = checkAvail ();
- return std::min(uRequest,uAvail);
- }
- // --------------------------------------------------------------------------
-
- sal_uInt8 const * BinaryReader_Impl::readBuffer (sal_uInt32 nRequest)
- {
- sal_uInt32 const nAvail = checkAvail ();
- if (nRequest > nAvail)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid file format - read past end-of-file.");
- throw io::UnexpectedEOFException(sMsg,*this);
- }
- sal_uInt8 const * pData = m_pBuffer + m_nOffset;
- m_nOffset += nRequest;
- return pData;
- }
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- sal_uInt32 nRead = getMaxAvail(nBytesToRead);
- if (nRead > 0)
- {
- rData.realloc (nRead);
- memcpy (rData.getArray(), readBuffer(nRead), nRead);
- }
- return sal_Int32(nRead);
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readSomeBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- return readBytes(rData,nBytesToRead);
- }
-
- // --------------------------------------------------------------------------
-
- void SAL_CALL BinaryReader_Impl::skipBytes (sal_Int32 nBytesToSkip)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- (void) readBuffer(sal_uInt32(nBytesToSkip));
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::available()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException)
- {
- const sal_uInt32 nMaxAvail = 0x7FFFFFFF;
- const sal_uInt32 nAvail = checkAvail();
- return sal_Int32(std::min(nAvail,nMaxAvail));
- }
-
- // --------------------------------------------------------------------------
-
- void SAL_CALL BinaryReader_Impl::closeInput()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException)
- {
- OSL_ENSURE(m_pBuffer,"BinaryCache - Closing stream that is already closed");
- if (m_pBuffer)
- {
- rtl_freeMemory (m_pBuffer);
- m_pBuffer = 0;
- }
- }
-
- // --------------------------------------------------------------------------
- // XDataInputStream implementation.
- // --------------------------------------------------------------------------
-
- sal_Int8 SAL_CALL BinaryReader_Impl::readBoolean()
- throw (io::IOException, uno::RuntimeException)
- {
- return this->readByte();
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int8 SAL_CALL BinaryReader_Impl::readByte()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int8 result = sal_Int8(*readBuffer(1));
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Unicode SAL_CALL BinaryReader_Impl::readChar()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Unicode result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Unicode(
- (sal_uInt16(pData[0]) << 8) |
- (sal_uInt16(pData[1]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int16 SAL_CALL BinaryReader_Impl::readShort()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int16 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int16(
- (sal_uInt16(pData[0]) << 8) |
- (sal_uInt16(pData[1]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readLong()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int32 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int64 SAL_CALL BinaryReader_Impl::readHyper()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int64 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int64(
- (sal_uInt64(pData[0]) << 56) |
- (sal_uInt64(pData[1]) << 48) |
- (sal_uInt64(pData[2]) << 40) |
- (sal_uInt64(pData[3]) << 32) |
- (sal_uInt64(pData[4]) << 24) |
- (sal_uInt64(pData[5]) << 16) |
- (sal_uInt64(pData[6]) << 8) |
- (sal_uInt64(pData[7]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- float SAL_CALL BinaryReader_Impl::readFloat()
- throw (io::IOException, uno::RuntimeException)
- {
- union { float f; sal_uInt32 n; } result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result.n);
-
- result.n = sal_uInt32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- return result.f;
- }
-
- // --------------------------------------------------------------------------
-
- double SAL_CALL BinaryReader_Impl::readDouble()
- throw (io::IOException, uno::RuntimeException)
- {
- union { double d; sal_uInt64 n; } result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result.n);
-
- result.n = sal_uInt64(
- (sal_uInt64(pData[0]) << 56) |
- (sal_uInt64(pData[1]) << 48) |
- (sal_uInt64(pData[2]) << 40) |
- (sal_uInt64(pData[3]) << 32) |
- (sal_uInt64(pData[4]) << 24) |
- (sal_uInt64(pData[5]) << 16) |
- (sal_uInt64(pData[6]) << 8) |
- (sal_uInt64(pData[7]) << 0) );
-
- return result.d;
- }
-
- // --------------------------------------------------------------------------
-
- rtl::OUString SAL_CALL BinaryReader_Impl::readUTF()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_uInt32 nLength;
-
- sal_uInt8 const * const pData = readBuffer(sizeof nLength);
-
- nLength = sal_uInt32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- bool bIsAscii = (nLength & binary::STR_ASCII_MASK) == binary::STR_ASCII_MASK;
- nLength &=~binary::STR_ASCII_MASK;
-
- rtl::OUString result;
- if (nLength != 0)
- {
- sal_Char const * const pUTF = reinterpret_cast<sal_Char const * >(readBuffer(nLength));
-
- sal_Int32 const nStrLength = sal_Int32(nLength);
- OSL_ASSERT(nStrLength >= 0);
-
- rtl_TextEncoding const enc = bIsAscii ? RTL_TEXTENCODING_ASCII_US : RTL_TEXTENCODING_UTF8;
-
- rtl_uString_internConvert(&result.pData, pUTF, nStrLength, enc,
- OSTRING_TO_OUSTRING_CVTFLAGS, NULL);
- }
-
- return result;
- }
-
- // --------------------------------------------------------------------------
- // BinaryReader implementation.
- // --------------------------------------------------------------------------
-
- BinaryReader::BinaryReader(rtl::OUString const & _sFileURL):
- m_sFileURL(_sFileURL) {}
-
- BinaryReader::~BinaryReader() {}
-
- bool BinaryReader::open()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- OSL_PRECOND(!m_xDataInputStream.is(),"Binary Reader: already open");
- if (m_xDataInputStream.is())
- return false;
-
- if (m_sFileURL.getLength() == 0)
- return false;
-
- if (!FileHelper::fileExists(m_sFileURL))
- return false;
-
- m_xDataInputStream.set(new BinaryReader_Impl (m_sFileURL));
- return true;
- }
-
- // --------------------------------------------------------------------------
-
- inline BinaryReader_Impl * BinaryReader::getDataInputStream()
- {
- OSL_ENSURE(m_xDataInputStream.is(),"Binary Cache: Reader was not opened - no input stream");
- return m_xDataInputStream.get();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Bool &_bValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _bValue = getDataInputStream()->readBoolean();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int8 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readByte();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int16 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readShort();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int32 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readLong();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int64 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readHyper();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(double &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readDouble();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(rtl::OUString& _aStr)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _aStr = getDataInputStream()->readUTF();
- }
-
- // -----------------------------------------------------------------------------
- template <class Element>
- void readSequence(BinaryReader& _rReader, uno::Sequence< Element > & aSequence)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // PRE: the Sequence must exist
- sal_Int32 nLength;
- _rReader.read(nLength);
-
- aSequence.realloc(nLength);
-
- Element* const pElement = aSequence.getArray(); // fill the hole array
- for(sal_Int32 i=0; i<nLength; ++i)
- {
- _rReader.read(pElement[i]); // read one element
- }
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read (uno::Sequence< sal_Int8 > &_aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readSequence(*this, _aValue);
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read (uno::Sequence< rtl::OUString > &_aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readSequence(*this, _aValue);
- }
-
- // --------------------------------------------------------------------------
-
- uno::Sequence< sal_Int8 > const * const for_binary = 0;
-
- #define CASE_READ_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- OSL_ENSURE( ::getCppuType(static_cast<DATA_TYPE const*>(0)).getTypeClass() == (TYPE_CLASS), "Typeclass does not match element type" ); \
- uno::Sequence< DATA_TYPE > aData; \
- readSequence(_rReader, aData); \
- _aValue <<= aData; \
- } break
-
- bool readSequenceValue (
- BinaryReader & _rReader,
- uno::Any & _aValue,
- uno::Type const & _aElementType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- switch(_aElementType.getTypeClass())
- {
- CASE_READ_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_READ_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_READ_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- case uno::TypeClass_SEQUENCE:
- if (_aElementType == ::getCppuType(for_binary))
- {
- uno::Sequence< sal_Int8 > aData;
- readSequence(_rReader, aData);
- _aValue <<= aData;
- break;
- }
- // else fall through
-
- default:
- OSL_ENSURE(false, "Unexpected type for sequence elements");
- return false;
- }
- return true;
- }
-
- #undef CASE_READ_SEQUENCE
-
- // --------------------------------------------------------------------------
-
-
- }
-}
diff --git a/configmgr/source/backend/binaryreader.hxx b/configmgr/source/backend/binaryreader.hxx
deleted file mode 100644
index 04dc3a1b74c3..000000000000
--- a/configmgr/source/backend/binaryreader.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYREADER_HXX
-#define CONFIGMGR_BINARYREADER_HXX
-
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace lang = css::lang;
- // -----------------------------------------------------------------------------
- class BinaryReader_Impl;
- class BinaryReader
- {
- rtl::OUString m_sFileURL;
-
- rtl::Reference<BinaryReader_Impl> m_xDataInputStream;
- public:
- explicit BinaryReader (rtl::OUString const & _sFileURL);
-
- ~BinaryReader();
-
- public:
- bool open() SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void read(sal_Bool &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int8 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int16 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int32 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int64 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(double &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(rtl::OUString& _aStr) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(uno::Sequence< sal_Int8 > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(uno::Sequence< rtl::OUString > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- inline BinaryReader_Impl * getDataInputStream();
- };
- // --------------------------------------------------------------------------
-
- bool readSequenceValue (
- BinaryReader & _rReader,
- uno::Any & _aValue,
- uno::Type const & _aElementType) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // --------------------------------------------------------------------------
- }
-}
-#endif
diff --git a/configmgr/source/backend/binaryreadhandler.cxx b/configmgr/source/backend/binaryreadhandler.cxx
deleted file mode 100644
index 60a0427a2b53..000000000000
--- a/configmgr/source/backend/binaryreadhandler.cxx
+++ /dev/null
@@ -1,687 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "binaryreadhandler.hxx"
-#include "binarycache.hxx"
-#include "binarytype.hxx"
-#include "simpletypehelper.hxx"
-#include "typeconverter.hxx"
-#include "treenodefactory.hxx"
-
-#include "tracer.hxx"
-#include <com/sun/star/io/WrongFormatException.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
-
- namespace css = com::sun::star;
- namespace io = css::io;
- namespace util = css::util;
-
- // -----------------------------------------------------------------------------
- BinaryReadHandler::BinaryReadHandler(rtl::OUString const & _aFileURL,
- rtl::OUString const & _aComponentName,
- uno::Reference<lang::XMultiServiceFactory> const & )
- : m_BinaryReader(_aFileURL)
- , m_aNodeFactory()
- , m_aComponentName(_aComponentName)
- {
- }
- // -----------------------------------------------------------------------------
- BinaryReadHandler::~BinaryReadHandler()
- {
- }
- // -----------------------------------------------------------------------------
-
- static inline
- bool isRequestingNoLocale(com::sun::star::lang::Locale const & aRequestedLocale)
- {
- rtl::OUString const & aLanguage = aRequestedLocale.Language;
- return aLanguage.getLength() == 0 || localehelper::isDefaultLanguage(aLanguage);
- }
- // -----------------------------------------------------------------------------
-
- static
- bool supportsLocale(uno::Sequence< rtl::OUString > const & aStoredLocales, rtl::OUString const & aRequestedLocale)
- {
- for (sal_Int32 ix=0; ix<aStoredLocales.getLength(); ++ix)
- if (aStoredLocales[ix].equalsIgnoreAsciiCase(aRequestedLocale))
- return true;
-
- return false;
- }
- // -----------------------------------------------------------------------------
-
- static
- bool supportsAll(uno::Sequence< rtl::OUString > const & aStoredLocales, uno::Sequence< rtl::OUString > const & aRequestedLocales)
- {
- for (sal_Int32 jx=0; jx<aRequestedLocales.getLength(); ++jx)
- if (!supportsLocale(aStoredLocales,aRequestedLocales[jx]))
- return false;
-
- return true;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryReadHandler::verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- {
- try
- {
- //Open the reader
- sal_Int16 nMagic, nVersion;
- m_BinaryReader.read(nMagic);
- m_BinaryReader.read(nVersion);
- if (nMagic !=binary::CFG_BINARY_MAGIC || nVersion != binary::CFG_BINARY_VERSION )
- return false;
-
- rtl::OUString aSchemaVersion;
- m_BinaryReader.read(aSchemaVersion);
- if (!aSchemaVersion.equals(_aSchemaVersion))
- return false;
-
- uno::Sequence< rtl::OUString > aAvailableLocales;
- uno::Sequence< rtl::OUString > aKnownLocales;
- m_BinaryReader.read(aKnownLocales);
- m_BinaryReader.read(aAvailableLocales);
- outKnownLocales = localehelper::makeLocaleSequence(aKnownLocales);
-
- if (isRequestingNoLocale(aRequestedLocale))
- {
- // any existing combination of locales (including none) is valid
- }
- else if (!localehelper::designatesAllLocales(aRequestedLocale))
- {
- // one particular locale requested
- rtl::OUString const aIsoLocale = localehelper::makeIsoLocale(aRequestedLocale);
- if (!supportsLocale(aKnownLocales,aIsoLocale))
- {
- // a locale we didn't load previously
- return false;
- }
- else if (! supportsLocale(aAvailableLocales,aIsoLocale))
- {
- // a locale we handled by fallback previously
- uno::Sequence< rtl::OUString > aNewlyAvailableLocales =
- getAvailableLocales(pLayers,nNumLayers);
-
- // ... and that has become available now
- if (supportsLocale(aNewlyAvailableLocales,aIsoLocale))
- return false;
-
- // ... or other new locales have been added
- if (!supportsAll(aAvailableLocales,aNewlyAvailableLocales))
- return false;
- }
- }
- else
- {
- uno::Sequence< rtl::OUString > aNewlyAvailableLocales =
- getAvailableLocales(pLayers,nNumLayers);
-
- // not all locales were requested yet
- if (!supportsAll(aKnownLocales,aNewlyAvailableLocales))
- return false;
-
- // new locales have been added
- if (!supportsAll(aAvailableLocales,aNewlyAvailableLocales))
- return false;
- }
-
- rtl::OUString aComponentName;
- m_BinaryReader.read(aComponentName);
- if (!aComponentName.equals(m_aComponentName))
- return false;
-
- return true;
- }
- catch (uno::Exception &)
- {
- CFG_TRACE_INFO("Binary Cache can't be used");
- return false;
- }
- }
- // -----------------------------------------------------------------------------
- bool BinaryReadHandler::isUptodate(const std::vector<rtl::OUString> & _timeStamps)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int32 nNumBinaryLayers;
- m_BinaryReader.read(nNumBinaryLayers);
- if (nNumBinaryLayers < 0 || sal_uInt32(nNumBinaryLayers) != _timeStamps.size())
- return false;
-
- for ( std::vector<rtl::OUString>::const_iterator it = _timeStamps.begin();
- it != _timeStamps.end();
- ++it)
- {
- rtl::OUString binaryTimeStamp;
- m_BinaryReader.read(binaryTimeStamp);
- if ( ! it->equals(binaryTimeStamp) )
- {
- return false;
- }
- }
-
- return true;
- }
- // -----------------------------------------------------------------------------
- binary::NodeType::Type BinaryReadHandler::readNodeType()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = binary::NodeType::invalid;
-
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- sal_uInt8 const nRightValue( nValue );
- if ( (nRightValue & binary::NodeType::nodetype_mask) == nRightValue )
- eType = binary::NodeType::Type(nRightValue);
-
- if (eType == binary::NodeType::invalid)
- {
- OSL_ENSURE(false, "unknown or unhandled node type");
- throw io::WrongFormatException();
- }
-
- return eType;
- }
-
- // -----------------------------------------------------------------------------
- binary::ValueFlags::Type BinaryReadHandler::readValueFlags(bool& bSeq, bool& bHasValue, bool& bHasDefault )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- sal_uInt8 const nRightValue( nValue );
- binary::ValueFlags::Type eType = binary::ValueFlags::Type(nRightValue & binary::ValueFlags::basictype_mask);
- if ( eType >= binary::ValueFlags::val_invalid)
- {
- OSL_ENSURE(false, "unknown or unhandled value type");
- throw io::WrongFormatException();
- }
-
-
- if (nRightValue & binary::ValueFlags::seq)
- bSeq = true;
- else
- bSeq = false;
-
- if (nRightValue & binary::ValueFlags::first_value_NULL)
- bHasValue = false;
- else
- bHasValue = true;
-
- if (nRightValue & binary::ValueFlags::second_value_NULL)
- bHasDefault = false;
- else
- bHasDefault = true;
-
- return eType;
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryReadHandler::readName(rtl::OUString &_aString)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- m_BinaryReader.read (_aString);
- }
-
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readAttributes(node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- _aAttributes.setState( node::State(nValue & 0x03) );
-
- _aAttributes.setAccess( nValue & 0x04 ? true : false, nValue & 0x08 ? true : false);
-
- _aAttributes.setNullable(nValue & 0x10 ? true : false);
- _aAttributes.setLocalized(nValue & 0x20 ? true : false);
- if(nValue & 0x40 )
- {
- _aAttributes.markMandatory();
- }
- if(nValue & 0x80)
- {
- _aAttributes.markRemovable();
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryReadHandler::readGroup(rtl::OUString &_aName, node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readAttributes(_aAttributes);
- readName(_aName);
- }
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readSet(rtl::OUString &_aName, node::Attributes &_aAttributes,
- rtl::OUString &_sInstanceName, rtl::OUString &_sInstanceModule)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readAttributes(_aAttributes);
- readName(_aName);
- readName(_sInstanceName);
- readName(_sInstanceModule);
- }
-
- // -----------------------------------------------------------------------------
- template <class T>
- inline
- void readAsAny(BinaryReader& rBinaryReader, uno::Any & _aValue, uno::Type& _aType, T& _aVar)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- rBinaryReader.read(_aVar);
- _aValue <<= _aVar;
- _aType = _aValue.getValueType();
- }
-
- // -----------------------------------------------------------------------------
- uno::Type convertValueTypeToType(binary::ValueFlags::Type eBasicValueType, bool bSeq)
- {
- uno::Type aType;
-
- if (!bSeq)
- {
- switch(eBasicValueType)
- {
- // --------------- Simple types ---------------
-
- case binary::ValueFlags::val_boolean:
- aType = SimpleTypeHelper::getBooleanType();
- break;
- case binary::ValueFlags::val_int16:
- aType = SimpleTypeHelper::getShortType();
- break;
- case binary::ValueFlags::val_int32:
- aType = SimpleTypeHelper::getIntType();
- break;
- case binary::ValueFlags::val_int64:
- aType = SimpleTypeHelper::getLongType();
- break;
- case binary::ValueFlags::val_double:
- aType = SimpleTypeHelper::getDoubleType();
- break;
- case binary::ValueFlags::val_string:
- aType = SimpleTypeHelper::getStringType();
- break;
- case binary::ValueFlags::val_binary:
- aType = SimpleTypeHelper::getBinaryType();
- break;
- case binary::ValueFlags::val_any:
- aType = SimpleTypeHelper::getAnyType();
- break;
- default:
- OSL_ENSURE(false,"Invalid value type");
- break;
- }
- }
- else
- {
- // ------------ Sequences ------------
- switch(eBasicValueType)
- {
- case binary::ValueFlags::val_boolean:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
- break;
- case binary::ValueFlags::val_int16:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
- break;
- case binary::ValueFlags::val_int32:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
- break;
- case binary::ValueFlags::val_int64:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
- break;
- case binary::ValueFlags::val_double:
- aType = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
- break;
- case binary::ValueFlags::val_string:
- aType = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
- break;
- case binary::ValueFlags::val_binary:
- aType = ::getCppuType(static_cast<uno::Sequence< uno::Sequence< sal_Int8 > > const*>(0));
- break;
- default:
- OSL_ENSURE(false,"Invalid sequence value type");
- break;
- }
- }
-
- return aType;
- }
-
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readValue(rtl::OUString &_aName, node::Attributes &_aAttributes,
- uno::Any& _aValue, uno::Any& _aDefaultValue,uno::Type& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- bool bSeq = false;
- bool bHasValue = false;
- bool bHasDefault = false;
-
- binary::ValueFlags::Type eBasicType = readValueFlags(bSeq, bHasValue, bHasDefault);
- readAttributes(_aAttributes);
- readName(_aName);
-
- if (!bSeq && (bHasValue || bHasDefault))
- {
- switch(eBasicType)
- {
- case binary::ValueFlags::val_any:
- {
- OSL_ENSURE(false,"Node of type Any cannot have value");
- throw io::WrongFormatException();
- }
- case binary::ValueFlags::val_string:
- {
- rtl::OUString aStr;
- if (bHasValue)
- readAsAny(m_BinaryReader, _aValue, _aType, aStr);
- if (bHasDefault)
- readAsAny(m_BinaryReader, _aDefaultValue, _aType, aStr);
- break;
- }
- case binary::ValueFlags::val_boolean:
- {
- sal_Bool nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int16:
- {
- sal_Int16 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int32:
- {
- sal_Int32 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int64:
- {
- sal_Int64 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_double:
- {
- double nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader, _aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_binary:
- {
- uno::Sequence< sal_Int8 > aValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, aValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, aValue);
- break;
- }
- default:
- OSL_ENSURE(false, "Invalid value type");
- throw io::WrongFormatException();
- }
- }
- else
- {
- _aType = convertValueTypeToType(eBasicType, bSeq);
- if (_aType == uno::Type())
- throw io::WrongFormatException();
- }
-
- if(bSeq)
- {
- OSL_ASSERT(_aType.getTypeClass() == uno::TypeClass_SEQUENCE);
- uno::Type const aElementType = getSequenceElementType(_aType);
- if (bHasValue)
- readSequenceValue(m_BinaryReader, _aValue, aElementType );
-
- if(bHasDefault)
- readSequenceValue(m_BinaryReader, _aDefaultValue, aElementType );
- }
-
- }
- // -----------------------------------------------------------------------------
- std::auto_ptr<ISubtree> BinaryReadHandler::readComponentTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = this->readNodeType();
-
- if (eType != binary::NodeType::component)
- {
- // TODO: search for component tree
- OSL_ENSURE(false, "binary Cache: unexpected tree type for component data");
- throw io::WrongFormatException();
- }
-
- return readToplevelTree();
- }
- // -----------------------------------------------------------------------------
- std::auto_ptr<ISubtree> BinaryReadHandler::readTemplatesTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = this->readNodeType();
-
- if (eType != binary::NodeType::templates)
- {
- // TODO: search for templates tree
- OSL_ENSURE(false, "binary Cache: unexpected tree type for template data");
- throw io::WrongFormatException();
- }
-
- return readToplevelTree();
- }
- // -----------------------------------------------------------------------------
-
- std::auto_ptr<ISubtree> BinaryReadHandler::readToplevelTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- std::auto_ptr<ISubtree> pTree;
-
- rtl::OUString aName;
- node::Attributes aAttributes;
- const bool not_extensible = false;
-
- binary::NodeType::Type eType = this->readNodeType();
- switch (eType)
- {
- case binary::NodeType::groupnode:
- {
- this->readGroup(aName, aAttributes);
- pTree = m_aNodeFactory.createGroup(aName,not_extensible,aAttributes);
- break;
- }
- case binary::NodeType::setnode:
- {
- backenduno::TemplateIdentifier aTemplate;
- this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component);
- pTree = m_aNodeFactory.createSet(aName,aTemplate,not_extensible,aAttributes);
- break;
- }
- case binary::NodeType::nodata:
- break;
-
- default:
- OSL_ENSURE(false, "binary Cache - cannot read data: unexpected node type for tree");
- throw io::WrongFormatException();
-
- }
-
- if (pTree.get() != NULL)
- {
- readChildren(*pTree);
-
- //read terminating stop node
- eType = this->readNodeType();
- OSL_ENSURE(binary::NodeType::stop == eType, "Missing stop node to mark end of tree");
- }
- return pTree;
- }
-
-
- // -----------------------------------------------------------------------------
- bool BinaryReadHandler::validateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
-
- //Check here if the file exists
- if (!m_BinaryReader.open())
- return false;
-
- if(!this->verifyFileHeader(pLayers, nNumLayers, _aSchemaVersion, aRequestedLocale, outKnownLocales))
- return false;
-
- //Check if layers are uptodate
- std::vector <rtl::OUString> timeStamps(nNumLayers);
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY);
- if (xTimeStamp.is())
- {
- rtl::OUString aTimeStamp = xTimeStamp->getTimestamp();
- timeStamps[i] = aTimeStamp;
- }
- }
-
- return this->isUptodate(timeStamps);
- }
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readChildren(ISubtree & rTree )
- {
- OSL_ASSERT(!binary::NodeType::stop); // loop stops at stop node
- while (binary::NodeType::Type eType = this->readNodeType())
- {
- rtl::OUString aName;
- node::Attributes aAttributes;
- const bool not_extensible = false;
- switch (eType)
- {
- case binary::NodeType::groupnode:
- {
- this->readGroup(aName, aAttributes);
-
- std::auto_ptr<ISubtree> pNewNode = m_aNodeFactory.createGroup(aName, not_extensible, aAttributes);
- if (pNewNode.get() == NULL)
- {
- OSL_ENSURE(false, "Error: factory returned NULL group node - skipping");
- continue;
- }
-
- readChildren( *pNewNode );
- rTree.addChild(base_ptr(pNewNode));
- break;
- }
- case binary::NodeType::setnode:
- {
- backenduno::TemplateIdentifier aTemplate;
- this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component);
-
- std::auto_ptr<ISubtree> pNewSetNode = m_aNodeFactory.createSet(aName,aTemplate,not_extensible,aAttributes);
- if (pNewSetNode.get() == NULL)
- {
- OSL_ENSURE(false, "Error: factory returned NULL set node - skipping");
- continue;
- }
-
- readChildren( *pNewSetNode );
- rTree.addChild(base_ptr(pNewSetNode));
- break;
- }
- case binary::NodeType::valuenode:
- {
- uno::Any aValue;
- uno::Any aDefaultValue;
- uno::Type aType;
-
- this->readValue(aName, aAttributes, aValue, aDefaultValue, aType);
-
- OTreeNodeFactory & rValueFactory = m_aNodeFactory.getNodeFactory();
-
- std::auto_ptr<ValueNode> pValueNode;
- if (aValue.hasValue() || aDefaultValue.hasValue())
- {
- pValueNode = rValueFactory.createValueNode(aName,aValue, aDefaultValue, aAttributes);
- }
- else
- {
- pValueNode = rValueFactory.createNullValueNode(aName,aType, aAttributes);
- }
-
- rTree.addChild(base_ptr(pValueNode));
- break;
- }
- default:
- OSL_ENSURE(false, "Binary cache: Invalid node type");
- throw io::WrongFormatException();
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binaryreadhandler.hxx b/configmgr/source/backend/binaryreadhandler.hxx
deleted file mode 100644
index d237fee3ceb6..000000000000
--- a/configmgr/source/backend/binaryreadhandler.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYREADHANDLER_HXX
-#define CONFIGMGR_BINARYREADHANDLER_HXX
-
-#include "binaryreader.hxx"
-#include "componentdatahelper.hxx"
-#include "valuenode.hxx"
-#include "binarytype.hxx"
-#include "attributes.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/io/IOException.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif // INCLUDED_MEMORY
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
-
- class BinaryReadHandler
- {
- BinaryReader m_BinaryReader;
- ComponentDataFactory m_aNodeFactory;
- rtl::OUString m_aComponentName;
-
- public:
- BinaryReadHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory);
- ~BinaryReadHandler();
-
- bool validateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- std::auto_ptr<ISubtree> readComponentTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- std::auto_ptr<ISubtree> readTemplatesTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- std::auto_ptr<ISubtree> readToplevelTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readChildren(ISubtree & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- bool verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales);
-
- bool isUptodate(const std::vector<rtl::OUString> & _timeStamps)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readChildNodes(ISubtree & rSubTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- binary::NodeType::Type readNodeType()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- binary::ValueFlags::Type readValueFlags(bool& bSeq, bool& hasValue, bool& hasDefault )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readAttributes(node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readGroup(rtl::OUString &_aName, node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readSet(rtl::OUString &_aName, node::Attributes &_aAttributes,
- rtl::OUString &_sInstanceName, rtl::OUString &_sInstanceModule)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readValue(rtl::OUString &_aName, node::Attributes &_aAttributes,
- uno::Any& _aValue, uno::Any& _aDefaultValue,uno::Type& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readName(rtl::OUString &_aString)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- };
- // ---------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}// namespace configmgr
-#endif
diff --git a/configmgr/source/backend/binarytype.hxx b/configmgr/source/backend/binarytype.hxx
deleted file mode 100644
index d335aabb4508..000000000000
--- a/configmgr/source/backend/binarytype.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef CONFIGMGR_BINARYTYPE_HXX
-#define CONFIGMGR_BINARYTYPE_HXX
-
-#include <sal/types.h>
-
-namespace configmgr
-{
- namespace binary
- {
- const sal_uInt32 STR_ASCII_MASK = 0x80000000;
- const sal_Int16 CFG_BINARY_MAGIC = 10001;
- const sal_Int16 CFG_BINARY_VERSION = 3;
-
- namespace ValueFlags
- {
- enum Type
- {
- val_any, // = 0
- val_string, // = 1
- val_boolean, // = 2
- val_int16, // = 3
- val_int32, // = 4
- val_int64, // = 5
- val_double, // = 6
- val_binary, // = 7
- val_invalid, // = 8
-
- //Sequence Flag
- seq = 0x10,
-
- //Pairstate Flags
- first_value_NULL = 0x20,
- second_value_NULL = 0x40,
-
- //Masks
- basictype_mask = 0x0F,
- valuetype_mask = 0x1F,
- pairstate_mask = first_value_NULL | second_value_NULL
- };
- }
-
- namespace NodeType
- {
- enum Type
- {
- //Node Type Identifiers
- stop = 0,
- valuenode = 0x20,
- groupnode = 0x40,
- setnode = 0x80,
- component = 0x60,
- templates = 0xA0,
- nodata = 0xC0,
- invalid = 0xE0,
-
- nodetype_mask = 0xE0
- };
- }
- }
-}
-#endif
diff --git a/configmgr/source/backend/binarywritehandler.cxx b/configmgr/source/backend/binarywritehandler.cxx
deleted file mode 100644
index 7a09857258cc..000000000000
--- a/configmgr/source/backend/binarywritehandler.cxx
+++ /dev/null
@@ -1,489 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "binarywritehandler.hxx"
-#include "binarycache.hxx"
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include "typeconverter.hxx"
-#include "simpletypehelper.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
-
- namespace css = com::sun::star;
- namespace util = css::util ;
-
- // -----------------------------------------------------------------------------
-
- BinaryWriteHandler::BinaryWriteHandler( rtl::OUString const & _aFileURL,
- rtl::OUString const & _aComponentName,
- uno::Reference<lang::XMultiServiceFactory> const & _aFactory)
- : m_BinaryWriter(_aFileURL,_aFactory)
- , m_aComponentName(_aComponentName)
- {
-
- }
- // -----------------------------------------------------------------------------
- static
- binary::ValueFlags::Type convertTypeToValueType(uno::Type const& _aType)
- {
- binary::ValueFlags::Type eType = binary::ValueFlags::val_invalid;
- uno::TypeClass const aClass = _aType.getTypeClass();
- switch(aClass)
- {
- case uno::TypeClass_ANY:
- eType = binary::ValueFlags::val_any;
- break;
- case uno::TypeClass_BOOLEAN:
- eType = binary::ValueFlags::val_boolean;
- break;
- case uno::TypeClass_SHORT:
- eType = binary::ValueFlags::val_int16;
- break;
- case uno::TypeClass_LONG:
- eType = binary::ValueFlags::val_int32;
- break;
- case uno::TypeClass_HYPER:
- eType = binary::ValueFlags::val_int64;
- break;
- case uno::TypeClass_DOUBLE:
- eType = binary::ValueFlags::val_double;
- break;
- case uno::TypeClass_STRING:
- eType = binary::ValueFlags::val_string;
- break;
- case uno::TypeClass_SEQUENCE:
- if (_aType == SimpleTypeHelper::getBinaryType())
- {
- eType = binary::ValueFlags::val_binary;
- }
- else
- {
- uno::Type aType = configmgr::getSequenceElementType(_aType);
- eType = convertTypeToValueType(aType);
-
- OSL_ENSURE(!(eType & binary::ValueFlags::seq), "Binary Writer - Invalid value type: Multiple nesting of sequences");
- eType = binary::ValueFlags::Type( eType | binary::ValueFlags::seq );
- }
- break;
- default:
- OSL_ENSURE(false, "Binary Writer - Invalid value type: not supported");
- break;
- }
- return eType;
- }
-
- // -----------------------------------------------------------------------------
- template <class T>
- inline /* make performance crew happy ;-) */
- void writeDirectly(BinaryWriter& _rWriter, T const& _aVal)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _rWriter.write(_aVal);
- }
- // -----------------------------------------------------------------------------
- static
- inline
- void writeDirectly(BinaryWriter& _rWriter, uno::Sequence<sal_Int8> const& _aBinary);
- // -----------------------------------------------------------------------------
- template <class T>
- inline /* make performance crew happy ;-) */
- void writeFromAny(BinaryWriter& _rWriter,uno::Any const& _aValue, T& _aVar)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- OSL_VERIFY(_aValue >>= _aVar ); // "Invalid Any for value"
- writeDirectly(_rWriter,_aVar);
- }
- // -----------------------------------------------------------------------------
-
- template <class Element>
- void writeSequence(BinaryWriter& _rWriter, uno::Sequence< Element > const& aSequence)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int32 const nLength = aSequence.getLength();
- _rWriter.write(nLength);
-
- for(sal_Int32 i=0; i<nLength; ++i)
- {
- writeDirectly(_rWriter, aSequence[i]);
- }
- }
- // -----------------------------------------------------------------------------
- static
- inline
- void writeDirectly(BinaryWriter& _rWriter, uno::Sequence<sal_Int8> const& _aBinary)
- {
- writeSequence(_rWriter,_aBinary);
- }
- // -----------------------------------------------------------------------------
- #define CASE_WRITE_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- uno::Sequence< DATA_TYPE > aData; \
- OSL_ASSERT( ::getCppuType(aData.getConstArray()).getTypeClass() == (TYPE_CLASS) ); \
- OSL_VERIFY( _aValue >>= aData ); \
- writeSequence(_rWriter,aData); \
- } break
-
- // -----------------------------------------------------------------------------
- static
- void writeSequenceValue(BinaryWriter& _rWriter, uno::Any const& _aValue, uno::Type const& aElementType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- switch(aElementType.getTypeClass())
- {
- CASE_WRITE_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SEQUENCE, uno::Sequence<sal_Int8> );
-
- default:
- OSL_ENSURE(false, "Unexpected typeclass for sequence elements");
- break;
- }
- }
- #undef CASE_WRITE_SEQUENCE
-
- // -----------------------------------------------------------------------------
- static
- void writeSimpleValue(BinaryWriter& _rWriter, uno::Any const& _aValue, uno::Type const& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // PRE: Header must be written
- uno::TypeClass aDestinationClass = _aType.getTypeClass();
- switch (aDestinationClass)
- {
- case uno::TypeClass_BOOLEAN:
- {
- sal_Bool bValue = sal_False;
- writeFromAny(_rWriter, _aValue, bValue);
- break;
- }
- case uno::TypeClass_BYTE:
- {
- sal_Int8 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_SHORT:
- {
- sal_Int16 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_LONG:
- {
- sal_Int32 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_HYPER:
- {
- sal_Int64 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_DOUBLE:
- {
- double nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_STRING:
- {
- rtl::OUString aStr;
- writeFromAny(_rWriter, _aValue, aStr);
- break;
- }
- case uno::TypeClass_SEQUENCE:
- {
- OSL_ENSURE (_aType == SimpleTypeHelper::getBinaryType(),"Unexpected sequence as simple type");
- uno::Sequence<sal_Int8> aBinary;
- writeFromAny(_rWriter, _aValue, aBinary);
- break;
- }
- default:
- OSL_ENSURE(false, "Unexpected typeclass for simple value");
- break;
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeValue(uno::Any const& _aValue)
- {
- bool bSeq;
- uno::Type aTargetType = getBasicType(_aValue.getValueType(), bSeq);
-
- if (!bSeq)
- {
- writeSimpleValue(m_BinaryWriter,_aValue, aTargetType);
- }
- else
- {
- writeSequenceValue(m_BinaryWriter,_aValue, aTargetType);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeFileHeader( rtl::OUString const & _aSchemaVersion,
- const uno::Sequence<rtl::OUString> & aKnownLocales,
- const uno::Sequence<rtl::OUString> & aDataLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- m_BinaryWriter.write(binary::CFG_BINARY_MAGIC);
- m_BinaryWriter.write(binary::CFG_BINARY_VERSION);
- m_BinaryWriter.write(_aSchemaVersion);
- writeSequence(m_BinaryWriter,aKnownLocales);
- writeSequence(m_BinaryWriter,aDataLocales);
- m_BinaryWriter.write(m_aComponentName);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeGroupNode(rtl::OUString const& _aName,node::Attributes const& _aAttributes )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeSetNode(rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
- m_BinaryWriter.write(_aTemplateName);
- m_BinaryWriter.write(_aTemplateModule);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeLayerInfoList(uno::Reference<backenduno::XLayer> const * pLayers, sal_Int32 nNumLayers)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
-
- m_BinaryWriter.write(nNumLayers);
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY);
-
- rtl::OUString aTimeStamp = xTimeStamp.is() ? xTimeStamp->getTimestamp() : rtl::OUString();
- m_BinaryWriter.write(aTimeStamp);
- }
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeNodeType(binary::NodeType::Type _eType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue = static_cast< sal_Int8 >( _eType );
- m_BinaryWriter.write(nValue);
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeAttributes(node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue = static_cast< sal_Int8 >( _aAttributes.state() );
-
- OSL_ASSERT(0 <= nValue && nValue <= 3);
-
- OSL_ENSURE(!_aAttributes.isReadonly() || !_aAttributes.isFinalized(),"Unexpected attribute mix: node is both read-only and finalized");
-
- nValue |= (_aAttributes.isReadonly() ? 1 : 0) << 2;
- nValue |= (_aAttributes.isFinalized() ? 1 : 0) << 3;
-
- nValue |= (_aAttributes.isNullable() ? 1 : 0) << 4;
- nValue |= (_aAttributes.isLocalized() ? 1 : 0) << 5;
-
- nValue |= (_aAttributes.isMandatory() ? 1 : 0) << 6;
- nValue |= (_aAttributes.isRemovable() ? 1 : 0) << 7;
-
- m_BinaryWriter.write(nValue);
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeValueNode(rtl::OUString const& _aName,
- node::Attributes const& _aAttributes,
- uno::Type const& _aType,
- uno::Any const& _aUserValue,
- uno::Any const& _aDefaultValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- //write value flags
- binary::ValueFlags::Type eType = convertTypeToValueType(_aType);
- sal_Int8 nValueType = sal_Int8(eType);
-
- bool hasUserValue = _aUserValue.hasValue();
- bool hasDefault = _aDefaultValue.hasValue();
-
- if (!hasUserValue) nValueType |= binary::ValueFlags::first_value_NULL;
- if (!hasDefault) nValueType |= binary::ValueFlags::second_value_NULL;
-
- m_BinaryWriter.write(nValueType);
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
-
- if(hasUserValue)
- {
- OSL_ENSURE(_aUserValue.getValueType() == _aType, "Type mismatch in value node");
- writeValue(_aUserValue);
- }
- if(hasDefault)
- {
- OSL_ENSURE(_aDefaultValue.getValueType() == _aType, "Type mismatch in value node");
- writeValue(_aDefaultValue);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeStop()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nStopValue = 0;
- m_BinaryWriter.write(nStopValue);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeComponentTree(const ISubtree * _pComponentTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- this->writeNodeType(binary::NodeType::component);
- if (_pComponentTree)
- {
- this->writeTree(*_pComponentTree);
- this->writeStop();
- }
- else
- {
- this->writeNodeType(binary::NodeType::nodata);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeTemplatesTree(const ISubtree * _pTemplatesTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- this->writeNodeType(binary::NodeType::templates);
- if (_pTemplatesTree)
- {
- this->writeTree(*_pTemplatesTree);
- this->writeStop();
- }
- else
- {
- this->writeNodeType(binary::NodeType::nodata);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeTree(const ISubtree & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if ( rTree.isSetNode() )
- {
- this->writeNodeType(binary::NodeType::setnode);
- this->writeSetNode( rTree.getName(),
- rTree.getElementTemplateName(),
- rTree.getElementTemplateModule(),
- rTree.getAttributes());
- }
- else
- {
- this->writeNodeType(binary::NodeType::groupnode);
- this->writeGroupNode( rTree.getName(), rTree.getAttributes() );
- }
-
- // process children
- this->applyToChildren(rTree);
-
- this->writeStop();
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::handle(const ISubtree & rTree)
- {
- writeTree(rTree);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::handle(const ValueNode & rValue)
- {
- this->writeNodeType(binary::NodeType::valuenode);
-
- this->writeValueNode( rValue.getName(),
- rValue.getAttributes(),
- rValue.getValueType(),
- rValue.getUserValue(),
- rValue.getDefault() );
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryWriteHandler::generateHeader(const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& aEntity,
- const std::vector< com::sun::star::lang::Locale > & aKnownLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- //Open the writer
- if (!m_BinaryWriter.open())
- return false;
-
- this->writeFileHeader( aEntity,
- localehelper::makeIsoSequence(aKnownLocales),
- getAvailableLocales(pLayers,nNumLayers) );
-
- this->writeLayerInfoList(pLayers, nNumLayers);
- return true;
- }
- // -----------------------------------------------------------------------------
-
- }
- // -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarywritehandler.hxx b/configmgr/source/backend/binarywritehandler.hxx
deleted file mode 100644
index 9934d56056c8..000000000000
--- a/configmgr/source/backend/binarywritehandler.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYWRITEHANDLER_HXX
-#define CONFIGMGR_BINARYWRITEHANDLER_HXX
-
-#include "valuenode.hxx"
-#include "binarywriter.hxx"
-#include "binarytype.hxx"
-#include "attributes.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/io/IOException.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
- class BinaryWriteHandler : private NodeAction
- {
- BinaryWriter m_BinaryWriter;
- rtl::OUString m_aComponentName;
-
- public:
- BinaryWriteHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory);
-
- bool generateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& aEntity,
- const std::vector< com::sun::star::lang::Locale > & aKnownLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeComponentTree(const ISubtree * _pComponentTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- void writeTemplatesTree(const ISubtree * _pTemplatesTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- private:
- void writeTree(ISubtree const & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // Node Action
- virtual void handle(ISubtree const & aSubtree);
- virtual void handle(ValueNode const & aValue);
- private:
- void writeFileHeader( rtl::OUString const & _aSchemaVersion,
- const uno::Sequence<rtl::OUString> & aKnownLocales,
- const uno::Sequence<rtl::OUString> & aDataLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeLayerInfoList(uno::Reference<backenduno::XLayer> const * pLayers, sal_Int32 nNumlayers)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeGroupNode(rtl::OUString const& _aName,node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeValueNode(rtl::OUString const& _aName,
- node::Attributes const& _aAttributes,
- uno::Type const& _aType,
- uno::Any const& _aUserValue,
- uno::Any const& _aDefaultValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeSetNode(rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeAttributes(node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeNodeType(binary::NodeType::Type _eType)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeStop()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeValue( uno::Any const& _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- };
- // ---------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}// namespace configmgr
-#endif
diff --git a/configmgr/source/backend/binarywriter.cxx b/configmgr/source/backend/binarywriter.cxx
deleted file mode 100644
index c06a05173824..000000000000
--- a/configmgr/source/backend/binarywriter.cxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binarywriter.hxx"
-#include "valuenode.hxx"
-#include "filehelper.hxx"
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include "oslstream.hxx"
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-#include "typeconverter.hxx"
-#include "binarytype.hxx"
-#include "simpletypehelper.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = com::sun::star::uno;
- namespace io = com::sun::star::io;
-
- BinaryWriter::BinaryWriter(rtl::OUString const &_aFileURL, uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider)
- : m_aFileURL(_aFileURL)
- , m_xServiceProvider(_xServiceProvider)
- , m_xDataOutputStream()
- {}
-
- bool BinaryWriter::open() SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if (m_aFileURL.getLength() == 0)
- return false;
-
- OSL_ENSURE(!m_xDataOutputStream.is(), "Binary Writer: already open");
- if ( m_xDataOutputStream.is())
- return false;
-
- if (FileHelper::fileExists(m_aFileURL))
- {
- if (osl::File::RC errorCode = osl::File::remove(m_aFileURL))
- {
- // creating the file will fail later
- OSL_TRACE("Binary Cache: Cannot remove existing file [%d]",int(errorCode));
- }
- }
- else
- {
- //create missing directories
- rtl::OUString parentDirectory = FileHelper::getParentDir(m_aFileURL) ;
-
- if (osl::File::RC errorCode = FileHelper::mkdirs(parentDirectory))
- {
- // creating the file will fail later
- OSL_TRACE("Binary Cache: Cannot create package cache directory [%d]",int(errorCode));
- }
- }
-
- uno::Reference<io::XOutputStream> xOutput = new BufferedFileOutputStream(m_aFileURL, true, 1024);
-
- uno::Reference< io::XActiveDataSource > xFormattingStream(
- m_xServiceProvider->createInstance(ASCII("com.sun.star.io.DataOutputStream")),
- uno::UNO_QUERY_THROW);
-
- xFormattingStream->setOutputStream(xOutput);
-
- m_xDataOutputStream.set(xFormattingStream, uno::UNO_QUERY_THROW);
-
- OSL_ASSERT(m_xDataOutputStream.is());
- return m_xDataOutputStream.is();
- }
-
- void BinaryWriter::close() SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if (m_xDataOutputStream.is())
- m_xDataOutputStream->closeOutput();
-
- m_xDataOutputStream.clear();
- }
-
- BinaryWriter::~BinaryWriter()
- {
- try
- {
- close();
- }
- catch (uno::Exception& e)
- {
- (void)e;
- OSL_ENSURE(false, rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- void BinaryWriter::write(sal_Bool _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write one byte
- m_xDataOutputStream->writeBoolean(_aValue);
- }
- void BinaryWriter::write(sal_Int8 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write one byte
- m_xDataOutputStream->writeByte(_aValue);
- }
- void BinaryWriter::write(sal_Int16 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write two bytes
- m_xDataOutputStream->writeShort(_aValue);
- }
- void BinaryWriter::write(sal_Int32 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write four byte
- m_xDataOutputStream->writeLong(_aValue);
- }
- void BinaryWriter::write(sal_Int64 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write eight byte
- m_xDataOutputStream->writeHyper(_aValue);
- }
- void BinaryWriter::write(double _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write eight byte
- m_xDataOutputStream->writeDouble(_aValue);
- }
-
- // -----------------------------------------------------------------------------
- bool isAsciiEncoding(rtl::OUString const& _aStr)
- {
- const sal_Unicode *pStr = _aStr.getStr();
- sal_Int32 nLen = _aStr.getLength();
- while (nLen--)
- {
- if (*pStr++ > 127)
- return false;
- }
- return true;
- }
-
- // -----------------------------------------------------------------------------
- void BinaryWriter::write(rtl::OUString const& _aStr)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // @@@ OBinaryBaseReader_Impl::readUTF() @@@
-
- rtl::OString aUTF;
- // to fasten the conversion for ascii data, we mask the length
- bool bIsAscii = isAsciiEncoding(_aStr);
- if (bIsAscii)
- rtl_uString2String (
- &(aUTF.pData), _aStr.getStr(), _aStr.getLength(),
- RTL_TEXTENCODING_ASCII_US, OUSTRING_TO_OSTRING_CVTFLAGS);
- else
- rtl_uString2String (
- &(aUTF.pData), _aStr.getStr(), _aStr.getLength(),
- RTL_TEXTENCODING_UTF8, OUSTRING_TO_OSTRING_CVTFLAGS);
-
- sal_Int32 nLength = aUTF.getLength();
- uno::Sequence<sal_Int8> aData (nLength);
- memcpy (aData.getArray(), aUTF.getStr(), nLength);
-
- OSL_ENSURE((nLength & binary::STR_ASCII_MASK) == 0,"String too long");
- if (bIsAscii)
- {
- nLength |= binary::STR_ASCII_MASK;
- OSL_ASSERT((nLength & binary::STR_ASCII_MASK) == binary::STR_ASCII_MASK);
- OSL_ASSERT(sal_Int32(nLength & ~binary::STR_ASCII_MASK) == aData.getLength());
- }
- m_xDataOutputStream->writeLong (nLength);
-
- m_xDataOutputStream->writeBytes (aData);
- }
-
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarywriter.hxx b/configmgr/source/backend/binarywriter.hxx
deleted file mode 100644
index 03f035947bf9..000000000000
--- a/configmgr/source/backend/binarywriter.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYWRITER_HXX
-#define CONFIGMGR_BINARYWRITER_HXX
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace lang = css::lang;
- // -----------------------------------------------------------------------------
-
- class BinaryWriter
- {
- rtl::OUString m_aFileURL;
-
- uno::Reference<lang::XMultiServiceFactory> m_xServiceProvider;
- uno::Reference< io::XDataOutputStream > m_xDataOutputStream;
-
- public:
- BinaryWriter(rtl::OUString const& m_aFilename, uno::Reference<lang::XMultiServiceFactory> const& _rxServiceProvider);
-
- ~BinaryWriter();
- bool open() SAL_THROW( (io::IOException, uno::RuntimeException) );
- void close() SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // Type writer
- void write(sal_Bool _bValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int8 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int16 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int32 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int64 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(double _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(rtl::OUString const& _aStr) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- };
- } //namespace backend
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/backend/componentdatahelper.cxx b/configmgr/source/backend/componentdatahelper.cxx
deleted file mode 100644
index 766213c35b89..000000000000
--- a/configmgr/source/backend/componentdatahelper.cxx
+++ /dev/null
@@ -1,614 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "componentdatahelper.hxx"
-#include "treenodefactory.hxx"
-#include "typeconverter.hxx"
-#include "strdecl.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/NoSupportException.hpp>
-#include <com/sun/star/lang/IllegalAccessException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
-#include <com/sun/star/beans/IllegalTypeException.hpp>
-#include <com/sun/star/beans/PropertyExistException.hpp>
-#include <com/sun/star/beans/UnknownPropertyException.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(str) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace container = ::com::sun::star::container;
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext()
-, m_aExpectedComponentName(rtl::OUString())
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName()
-, m_aTemplateProvider( aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName( aExpectedComponentName )
-, m_aTemplateProvider( aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext(DataBuilderContext const & aBaseContext, uno::XInterface * _pContext)
-: m_aLogger(aBaseContext.m_aLogger)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName()
-, m_aTemplateProvider( aBaseContext.m_aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::~DataBuilderContext( )
-{
-
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseMalformedDataException(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- m_aLogger.error(sMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sMessage, m_pContext, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseIllegalTypeException(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- beans::IllegalTypeException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("Illegal Type: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseIllegalArgumentException(sal_Char const * _pText, sal_Int16 _nPos) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- lang::IllegalArgumentException e(sMessage, m_pContext, _nPos);
-
- rtl::OUString const sFullMessage = OUSTR("Illegal Argument: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseNoSuchElementException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- container::NoSuchElementException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("No Such Node: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseElementExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- container::ElementExistException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("Node Already Exists: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raisePropertyExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- beans::PropertyExistException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("No Such Property: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::makeMessageWithPath(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii(_pText);
-
- sMessage.appendAscii(" [@").append(getNodeParentagePath()).appendAscii("] ");
-
- return sMessage.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii(_pText);
-
- if (_aName.getLength() != 0)
- sMessage.appendAscii(" [").append(getNodePath(_aName)).appendAscii("] ");
- else
- sMessage.appendAscii(" [@").append(getNodeParentagePath()).appendAscii("] ");
-
- return sMessage.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-const sal_Unicode k_pathsep = '/';
-
-rtl::OUString DataBuilderContext::getNodeParentagePath() const
-{
- rtl::OUStringBuffer path;
-
- for (Stack< ISubtree * >::bottomup_iterator it = m_aParentStack.begin_up();
- it != m_aParentStack.end_up(); ++it)
- {
- OSL_ASSERT(*it);
- path.append(k_pathsep).append((**it).getName());
- }
-
- return path.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::getNodePath(rtl::OUString const & aNodeName) const
-{
- rtl::OUStringBuffer path( getNodeParentagePath() );
-
- path.append(k_pathsep).append(aNodeName);
-
- return path.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isDone() const
-{
- OSL_ENSURE(m_aParentStack.empty() || hasActiveComponent(),"DataBuilderContext:Inconsistent Activity state");
-
- return m_aParentStack.empty();
-}
-// -----------------------------------------------------------------------------
-
-ISubtree & DataBuilderContext::implGetCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Operation requires open parent node.");
-
- OSL_ENSURE( m_aParentStack.top(), "NULL tree on node-stack" );
-
- return *m_aParentStack.top();
-}
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isWritable(INode const * pNode) const
- SAL_THROW(())
-{
- OSL_PRECOND(pNode,"Unexpected NULL node pointer");
- return pNode->getAttributes().isWritable();
-
-}
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isRemovable(ISubtree const * pItem) const
- SAL_THROW(())
-{
- OSL_PRECOND(pItem,"Unexpected NULL item pointer");
- return pItem->getAttributes().isRemovable();
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::getTemplateComponent( const backenduno::TemplateIdentifier& aItemType ) const
-{
- if (aItemType.Component.getLength() != 0)
- return aItemType.Component;
-
- else
- return getActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::completeComponent( const backenduno::TemplateIdentifier& aItemType ) const
-{
- backenduno::TemplateIdentifier aComplete(aItemType);
- if (aComplete.Component.getLength() == 0)
- aComplete.Component = getActiveComponent();
-
- return aComplete;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::getCurrentItemType() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
- if (!pCurrentSet || !pCurrentSet->isSetNode())
- raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
-
- backenduno::TemplateIdentifier aCompleteType;
-
- aCompleteType.Name = pCurrentSet->getElementTemplateName();
- aCompleteType.Component = pCurrentSet->getElementTemplateModule();
-
- return aCompleteType;
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::getValidItemType(backenduno::TemplateIdentifier const & aItemType) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
- if (!pCurrentSet || !pCurrentSet->isSetNode())
- raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
-
- backenduno::TemplateIdentifier aCompleteType = completeComponent( aItemType );
-
- // for now only a single item-type is supported
- if (aCompleteType.Name != pCurrentSet->getElementTemplateName())
- raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set");
-
- if (aCompleteType.Component != pCurrentSet->getElementTemplateModule())
- raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set (component mismatch)");
-
- return aCompleteType;
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::addNodeToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
-
- if (this->findChild(_aNode->getName()))
- raiseElementExistException("Component Builder Context: The node to be added does already exist", _aNode->getName());
-
- return getCurrentParent().addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
-
- if (this->findChild(_aNode->getName()))
- raisePropertyExistException("Component Builder Context: The property to be added does already exist", _aNode->getName());
-
- return getCurrentParent().addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-ValueNode * DataBuilderContext::addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
- OSL_PRECOND(!_bMayReplace || _aNode->getAttributes().isReplacedForUser(), "Wrong status for added property");
-
- if (this->findChild(_aNode->getName()))
- {
- // We currently may get a 'replace', when overriding an added property
- if (_bMayReplace && getCurrentParent().isSetNode())
- {
- getCurrentParent().removeChild(_aNode->getName());
- _aNode->modifyState(node::isReplaced);
- }
- else
-
- raisePropertyExistException("Component Builder Context: The property to be added does already exist", _aNode->getName());
- }
- return getCurrentParent().addChild( base_ptr(_aNode) )->asValueNode();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::markCurrentMerged()
-{
- Stack< ISubtree * >::topdown_iterator it = m_aParentStack.begin_down(), end = m_aParentStack.end_down();
- for ( ;it != end && (*it)->isDefault(); ++it)
- (*it)->modifyState( node::isMerged );
-
-#if OSL_DEBUG_LEVEL > 0
- for ( ;it != end; ++it)
- OSL_ENSURE(!(*it)->isDefault(),"Found a default node in ancestry of a merged change");
-#endif
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isProperty(INode * pProp) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(pProp, "ERROR: Unexpected NULL node");
-
- if (pProp == NULL)
- {
- rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to inspect NULL node",rtl::OUString() );
- throw uno::RuntimeException( sMsg, m_pContext );
- }
-
- if ( ISubtree * pTree = pProp->asISubtree() )
- return isLocalizedValueSet( *pTree );
-
- OSL_ASSERT(dynamic_cast< ValueNode * >(pProp) != 0);
- return true;
-}
-// -----------------------------------------------------------------------------
-
-INode * DataBuilderContext::findChild(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- return getCurrentParent().getChild(_aName);
-}
-// -----------------------------------------------------------------------------
-
-INode * DataBuilderContext::findProperty(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- INode * pResult = findChild(_aName);
- if (pResult && !isProperty(pResult))
- {
- raiseMalformedDataException("Component Builder Context: Found an existing inner node, where a property was expected");
- }
- return pResult;
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::findNode(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- INode * pResult = findChild(_aName);
-
- if (!pResult)
- return NULL;
-
- if (!isNode(pResult))
- raiseMalformedDataException("Component Builder Context: Found an existing property, where an inner node was expected");
-
- OSL_ASSERT(dynamic_cast< ISubtree * >(pResult) != 0);
- return pResult->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::pushNode(ISubtree * pTree)
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Entering a node without having an active component");
- OSL_PRECOND(pTree, "ERROR: Pushing a NULL tree");
-
- if (pTree == NULL)
- {
- rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to push NULL tree",rtl::OUString() );
- throw uno::RuntimeException( sMsg, m_pContext );
- }
- m_aParentStack.push(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::popNode()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Leaving a node without having an active component");
- if (m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Unmatched end of node");
-
- OSL_ENSURE( m_aParentStack.top(), "NULL tree on node-stack" );
-
- m_aParentStack.pop();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::startActiveComponent(rtl::OUString const & _aComponent)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!hasActiveComponent(), "Component Builder Context: Component is already active");
- OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Starting Component/Template while inside a node");
-
- if (!m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Starting component while node is still open");
-
- if (m_aExpectedComponentName.getLength()!=0)
- {
- if (m_aExpectedComponentName.compareTo ( _aComponent)!= 0 )
- raiseMalformedDataException("Invalid Component Data: Component name does not match request");
- }
- m_aActiveComponent = _aComponent;
-
- OSL_POSTCOND(hasActiveComponent(), "Component Builder Context: Could not start Component/Template");
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::endActiveComponent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND( hasActiveComponent(), "Component Builder Context: No Component active");
- OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Ending Component/Template while inside a node");
-
- if (!m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Ending component while node is still open");
-
- m_aActiveComponent = rtl::OUString();
-
- OSL_POSTCOND(!hasActiveComponent(), "Component Builder Context: Could not end Component/Template");
-}
-// -----------------------------------------------------------------------------
-ResultHolder< TemplateInstance > DataBuilderContext::getTemplateData (TemplateRequest const & _aRequest )
-{
- return(m_aTemplateProvider->getTemplateData (_aRequest));
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-ComponentDataFactory::ComponentDataFactory()
-: m_rNodeFactory( getDefaultTreeNodeFactory() )
-{
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createGroup( rtl::OUString const & _aName,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const
-{
- if (_bExtensible)
- {
- return getNodeFactory().createSetNode( _aName,
- toTemplateName(TYPE_ANY,false),
- TEMPLATE_MODULE_NATIVE_VALUE,
- _aAttributes );
- }
- else
- {
- return getNodeFactory().createGroupNode( _aName,
- _aAttributes );
- }
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createSet(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aItemType,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const
-{
- OSL_ENSURE(!_bExtensible, "DataBuilderContext: Unimplemented feature: Extensible Set node");
- if (_bExtensible)
- return std::auto_ptr<ISubtree>();
-
- return getNodeFactory().createSetNode( _aName,
- _aItemType.Name,
- _aItemType.Component,
- _aAttributes );
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createLocalizedContainer( rtl::OUString const & _aName,
- uno::Type const & _aValueType,
- node::Attributes const & _aAttributes) const
-{
- node::Attributes aLocalizedAttributes(_aAttributes);
- aLocalizedAttributes.setLocalized (true);
-
- return getNodeFactory().createSetNode( _aName,
- toTemplateName(_aValueType),
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- aLocalizedAttributes );
-
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-namespace
-{
- DECLARE_CONSTASCII_USTRING(INSTANCE_MARKER);
- IMPLEMENT_CONSTASCII_USTRING(INSTANCE_MARKER, "instantiate@");
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createPlaceHolder(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aInstanceType) const
-{
- return getNodeFactory().createSetNode( _aName,
- INSTANCE_MARKER + _aInstanceType.Name,
- _aInstanceType.Component,
- node::Attributes());
-}
-// -----------------------------------------------------------------------------
-
-bool ComponentDataFactory::isInstancePlaceHolder(ISubtree const & _aInstanceTree)
-{
- return !! _aInstanceTree.getElementTemplateName().match(INSTANCE_MARKER);
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier ComponentDataFactory::getInstanceType(ISubtree const & _aInstanceTree)
-{
- OSL_ENSURE( isInstancePlaceHolder(_aInstanceTree), "Instance placeholder tree expected" );
-
- backenduno::TemplateIdentifier aResult;
-
- if (isInstancePlaceHolder(_aInstanceTree))
- {
- aResult.Name = _aInstanceTree.getElementTemplateName().copy( INSTANCE_MARKER.getLength() );
- aResult.Component = _aInstanceTree.getElementTemplateModule();
- }
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/componentdatahelper.hxx b/configmgr/source/backend/componentdatahelper.hxx
deleted file mode 100644
index 53f6200f822a..000000000000
--- a/configmgr/source/backend/componentdatahelper.hxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_BACKEND_COMPONENTDATAHELPER_HXX
-#define CONFIGMGR_BACKEND_COMPONENTDATAHELPER_HXX
-
-#include "valuenode.hxx"
-#include "utility.hxx"
-#include "stack.hxx"
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#include "mergeddataprovider.hxx"
-#ifndef CONFIGMGR_LOGGER_HXX_
-#include "logger.hxx"
-#endif
-#include "request.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class DataBuilderContext
- {
- Logger m_aLogger;
- Stack< ISubtree * > m_aParentStack;
- rtl::OUString m_aActiveComponent;
- uno::XInterface * m_pContext;
- rtl::OUString m_aExpectedComponentName;
- ITemplateDataProvider * m_aTemplateProvider;
- public:
- explicit DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext);
- DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext , ITemplateDataProvider* aTemplateProvider = NULL);
- DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName,ITemplateDataProvider* aTemplateProvider = NULL );
- DataBuilderContext(DataBuilderContext const & aBaseContext, uno::XInterface * _pContext);
- ~DataBuilderContext();
-
- bool isDone() const;
-
- bool hasActiveComponent() const { return m_aActiveComponent.getLength() != 0; }
- rtl::OUString getActiveComponent() const { return m_aActiveComponent; }
-
- ISubtree & getCurrentParent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent(); }
-
- ISubtree const & getCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent(); }
-
- node::Attributes getCurrentAttributes() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent().getAttributes(); }
-
- ITemplateDataProvider * getTemplateProvider() const
- { return m_aTemplateProvider; }
-
- rtl::OUString getTemplateComponent(backenduno::TemplateIdentifier const & aItemType ) const;
-
- backenduno::TemplateIdentifier completeComponent(backenduno::TemplateIdentifier const & aItemType ) const;
-
- backenduno::TemplateIdentifier getCurrentItemType() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- backenduno::TemplateIdentifier getValidItemType(backenduno::TemplateIdentifier const & aItemType) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void startActiveComponent(rtl::OUString const & _aComponent)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void endActiveComponent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool isProperty(INode * pProp) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- bool isNode(INode * pNode) const SAL_THROW((com::sun::star::uno::RuntimeException))
- { return !isProperty(pNode); }
-
- void pushNode(ISubtree * pTree)
- SAL_THROW((com::sun::star::uno::RuntimeException));
- void popNode()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- INode * findProperty(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ISubtree * findNode(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool isWritable(INode const * pNode) const
- SAL_THROW(());
- bool isRemovable(ISubtree const * pItem) const
- SAL_THROW(());
-
- ISubtree * addNodeToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ISubtree * addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ValueNode * addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace = false)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void markCurrentMerged();
-
- // Logging support
- Logger const & getLogger() const { return m_aLogger; }
-
- rtl::OUString getNodeParentagePath() const;
- rtl::OUString getNodePath(rtl::OUString const & aNodeName) const;
-
- // Exception support
- void raiseMalformedDataException (sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseIllegalArgumentException (sal_Char const * _pText, sal_Int16 _nPos = 0) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseElementExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseNoSuchElementException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raisePropertyExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseIllegalTypeException (sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ResultHolder< TemplateInstance > getTemplateData (TemplateRequest const & _aRequest );
- private:
- INode * findChild(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- rtl::OUString makeMessageWithPath(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- rtl::OUString makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- ISubtree & implGetCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- };
-// -----------------------------------------------------------------------------
-
- class ComponentDataFactory
- {
- OTreeNodeFactory & m_rNodeFactory;
- public:
- ComponentDataFactory();
-
- ComponentDataFactory(OTreeNodeFactory & _rNodeFactory)
- : m_rNodeFactory(_rNodeFactory)
- {}
-
- public:
- OTreeNodeFactory& getNodeFactory() const { return m_rNodeFactory; }
-
- std::auto_ptr<ISubtree> createGroup(rtl::OUString const & _aName,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createSet( rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & aItemType,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createLocalizedContainer(rtl::OUString const & _aName,
- uno::Type const & _aValueType,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createPlaceHolder(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aInstanceType) const;
-
- static bool isInstancePlaceHolder(ISubtree const & _aInstanceTree);
- static backenduno::TemplateIdentifier getInstanceType(ISubtree const & _aInstanceTree);
- };
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/emptylayer.cxx b/configmgr/source/backend/emptylayer.cxx
deleted file mode 100644
index b0f9bf2799f7..000000000000
--- a/configmgr/source/backend/emptylayer.cxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "emptylayerimpl.hxx"
-#include "emptylayer.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- uno::Reference< backenduno::XLayer > createEmptyLayer()
- {
- return new EmptyLayer();
- }
- // -----------------------------------------------------------------------------
-
- bool checkEmptyLayer(uno::Reference< backenduno::XLayer > const & xLayer )
- {
- OSL_ENSURE(xLayer.is(),"Unexpected NULL Layer");
- if (!xLayer.is()) return false;
-
- RequireEmptyLayer * const pChecker = new RequireEmptyLayer;
- uno::Reference< backenduno::XLayerHandler > xChecker(pChecker);
-
- try
- {
- xLayer->readData(xChecker);
- }
- catch (uno::Exception &)
- {
- OSL_ENSURE(!pChecker->wasEmpty(), "Checking for empty layer: exception occurred after empty layer was ended");
- }
-
- return pChecker->wasEmpty();
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- EmptyLayer::~EmptyLayer( )
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL
- EmptyLayer::readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (aHandler.is())
- {
- aHandler->startLayer();
- aHandler->endLayer();
- }
- else
- throw lang::NullPointerException(rtl::OUString::createFromAscii("EmptyLayer: Null Handler"),*this);
- }
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- RequireEmptyLayer::RequireEmptyLayer()
- : m_bStarted(false)
- , m_bInvalid(false)
- , m_bEmpty(false)
- {
- }
- // -----------------------------------------------------------------------------
-
- RequireEmptyLayer::~RequireEmptyLayer( )
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::startLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- m_bInvalid = false;
- m_bEmpty = false;
-
- if (m_bStarted) fail("Layer started twice");
- m_bStarted = true;
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- if (!m_bStarted) fail("Layer was not started");
- m_bEmpty = !m_bInvalid;
- m_bStarted = false;
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::overrideNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, sal_Bool /*bClear*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addOrReplaceNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addOrReplaceNodeFromTemplate( const rtl::OUString& /*aName*/, const backenduno::TemplateIdentifier& /*aTemplate*/, sal_Int16 /*aAttributes*/)
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endNode( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::dropNode( const rtl::OUString& /*aName*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addPropertyWithValue( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Any& /*aValue*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::overrideProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/, sal_Bool /*bClear*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endProperty( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::setPropertyValue( const uno::Any& /*aValue*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::setPropertyValueForLocale( const uno::Any& /*aValue*/, const rtl::OUString& /*aLocale*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void RequireEmptyLayer::fail(sal_Char const * pMsg)
- {
- if (!m_bStarted & !m_bInvalid) pMsg = "Layer was not started";
- m_bInvalid = true;
- m_bStarted = false;
-
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/emptylayerimpl.hxx b/configmgr/source/backend/emptylayerimpl.hxx
deleted file mode 100644
index 0c22e3355376..000000000000
--- a/configmgr/source/backend/emptylayerimpl.hxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_EMPTYLAYERIMPL_HXX
-#define CONFIGMGR_BACKEND_EMPTYLAYERIMPL_HXX
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
- // -----------------------------------------------------------------------------
-
- class EmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayer>
- {
- public:
- virtual ~EmptyLayer();
-
- // XLayer
- public:
- virtual void SAL_CALL
- readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException);
- };
- // -----------------------------------------------------------------------------
-
- class RequireEmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- RequireEmptyLayer();
- virtual ~RequireEmptyLayer();
-
- bool wasEmpty() const { return m_bEmpty; }
- bool wasInvalid() const { return m_bInvalid; }
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- private:
- void failNotEmpty() { fail("layer is not empty"); }
- void fail(sal_Char const * pMsg);
-
- private:
- bool m_bStarted;
- bool m_bInvalid;
- bool m_bEmpty;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
diff --git a/configmgr/source/backend/importmergehandler.cxx b/configmgr/source/backend/importmergehandler.cxx
deleted file mode 100644
index cf85e973efc4..000000000000
--- a/configmgr/source/backend/importmergehandler.cxx
+++ /dev/null
@@ -1,296 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "importmergehandler.hxx"
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <rtl/ustrbuf.hxx>
-
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace beans = ::com::sun::star::beans;
-
-// -----------------------------------------------------------------------------
-
-ImportMergeHandler::ImportMergeHandler(
- uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode, rtl::OUString const & aEntity, sal_Bool const & bNotify )
-: BasicImportHandler(xTargetBackend,aEntity, bNotify)
-, m_xOutputHandler()
-, m_mode(mode)
-{
-}
-// -----------------------------------------------------------------------------
-
-void ImportMergeHandler::failNotStarted()
-{
- OSL_ENSURE(!hasComponent(), "Import handler after failure to create output handler or after closing");
- raiseMalformedDataException("configmgr::backend::ImportHandler: Trying to generate output before identifying the target component");
-}
-// -----------------------------------------------------------------------------
-
-inline bool ImportMergeHandler::isStarted() const
-{
- return !! m_xOutputHandler.is();
-}
-// -----------------------------------------------------------------------------
-
-inline void ImportMergeHandler::checkStarted()
-{
- if (!isStarted()) failNotStarted();
-}
-// -----------------------------------------------------------------------------
-
-inline uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::getOutputHandler()
-{
- checkStarted();
- return m_xOutputHandler;
-}
-// -----------------------------------------------------------------------------
-
-static
-bool setHandlerProperty(uno::Reference< uno::XInterface > const & xHandler, char const * property, sal_Bool value)
-{
- OSL_ASSERT(property);
- uno::Reference< lang::XInitialization > xInitHandler( xHandler, uno::UNO_QUERY );
- if (xHandler.is())
- try
- {
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[0] <<= beans::NamedValue( rtl::OUString::createFromAscii(property), uno::makeAny(value) );
- xInitHandler->initialize(aArgs);
- return true;
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration Import Handler - Could not set output handler property '%s': %s\n",
- property,rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
-
- OSL_ENSURE(false, "Output Handler does not support expected property" );
- }
- else
- {
- OSL_TRACE("Configuration Import Handler - Could not set output handler property '%s': %s\n",
- property,"Object does not support expected interface");
-
- OSL_ENSURE(false, "Output Handler does not support expected interface" );
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::createOutputHandler()
-{
- OSL_PRECOND( hasComponent(), "Trying to create output-handler for Import Merger without setting a component first") ;
- rtl::OUString const aComponentName = this->getComponent();
-
- uno::Reference< backenduno::XUpdateHandler > xOutputHandler;
- try
- {
- xOutputHandler = hasEntity() ? getBackend()->getUpdateHandler(aComponentName,getEntity())
- : getBackend()->getOwnUpdateHandler(aComponentName);
- }
- catch (lang::NoSupportException & e)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Could not get output handler for component ").append(aComponentName);
- sMessage.appendAscii(": Backend does not support updates - ").append( e.Message );
-
- throw lang::WrappedTargetException(sMessage.makeStringAndClear(), *this, uno::makeAny(e));
- }
- catch (lang::IllegalArgumentException & e)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Could not get output handler for component ").append(aComponentName);
- sMessage.appendAscii(" due to a backend exception: ").append( e.Message );
-
- throw lang::WrappedTargetException(sMessage.makeStringAndClear(), *this, uno::makeAny(e));
- }
-
- if (!xOutputHandler.is())
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Cannot import. ERROR - The backend returns a NULL handler for component ")
- .append(aComponentName).append( sal_Unicode('.') );
-
- throw uno::RuntimeException(sMessage.makeStringAndClear(), *this);
- }
-
- switch (m_mode)
- {
- case merge: break;
- case copy: setHandlerProperty(xOutputHandler,"Truncate", sal_True); break;
- case no_overwrite: setHandlerProperty(xOutputHandler,"Overwrite",sal_False); break;
-
- default: OSL_ASSERT(false); break;
- }
-
- return xOutputHandler;
-}
-// -----------------------------------------------------------------------------
-
-// XLayerHandler
-
-void SAL_CALL ImportMergeHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_xOutputHandler.clear();
-
- BasicImportHandler::startLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (isStarted())
- try
- {
- getOutputHandler()->endUpdate();
- }
- catch (lang::IllegalAccessException & iae)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: "));
- throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae));
- }
-
- BasicImportHandler::endLayer();
- m_xOutputHandler.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isStarted() && startComponent(aName))
- try
- {
- (m_xOutputHandler = createOutputHandler())->startUpdate( );
- }
- catch (lang::IllegalAccessException & iae)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: "));
- throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae));
- }
-
- OSL_ENSURE(!bClear,"'clear' operation not supported properly on import");
-
- bool bReset = (m_mode != merge) || bClear; // is not relevant for no_overwrite,but might be cheaper there
- getOutputHandler()->modifyNode(aName,aAttributes,aAttributes,bReset);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceNode(aName,aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceNodeFromTemplate(aName,aAttributes,aTemplate);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->endNode();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->removeNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- (void) bClear; // avoid warning about unused parameter
- OSL_ENSURE(!bClear,"'clear' operation not supported on import");
- getOutputHandler()->modifyProperty(aName,aAttributes,aAttributes,aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->setPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->setPropertyValueForLocale(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceProperty(aName, aAttributes, aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplacePropertyWithValue(aName, aAttributes, aValue);
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/importmergehandler.hxx b/configmgr/source/backend/importmergehandler.hxx
deleted file mode 100644
index 74803a445392..000000000000
--- a/configmgr/source/backend/importmergehandler.hxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_IMPORTMERGEHANDLER_HXX
-#define CONFIGMGR_BACKEND_IMPORTMERGEHANDLER_HXX
-
-#include "basicimporthandler.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class ImportMergeHandler : public BasicImportHandler
- {
- public:
- enum Mode
- {
- merge, // merge as update into existing data
- copy, // reset existing data first -> copy imported data
- no_overwrite // copy/merge only if no data is in the layer
- };
-
- explicit
- ImportMergeHandler(uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode,
- rtl::OUString const & aEntity = rtl::OUString(), sal_Bool const & bNotify = sal_False);
-
- // XLayerHandler
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
- private:
- bool isStarted() const;
- void checkStarted();
- void failNotStarted();
-
- uno::Reference< backenduno::XUpdateHandler > getOutputHandler();
-
- uno::Reference< backenduno::XUpdateHandler > createOutputHandler();
- private:
- uno::Reference< backenduno::XUpdateHandler > m_xOutputHandler;
- Mode m_mode;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/importsvc.cxx b/configmgr/source/backend/importsvc.cxx
deleted file mode 100644
index 01af7e0e7811..000000000000
--- a/configmgr/source/backend/importsvc.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "importsvc.hxx"
-#include "importmergehandler.hxx"
-#include "backendfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/beans/NamedValue.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aMergeImporterServices[] =
-{
- "com.sun.star.configuration.backend.MergeImporter",
- 0,
- "com.sun.star.configuration.backend.Importer",
- 0
-};
-const ServiceImplementationInfo aMergeImporterSI =
-{
- "com.sun.star.comp.configuration.backend.MergeImporter",
- aMergeImporterServices, aMergeImporterServices + 2
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getMergeImportServiceInfo()
-{ return getRegistrationInfo(& aMergeImporterSI); }
-// -----------------------------------------------------------------------------
-
-MergeImportService::MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: ImportService(_xContext, &aMergeImporterSI)
-{
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateMergeImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new MergeImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayerHandler > MergeImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity)
-{
- if (!xBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend, ImportMergeHandler::merge, aEntity, m_bSendNotification) );
-
- return aHandler;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aCopyImporterServices[] =
-{
- "com.sun.star.configuration.backend.CopyImporter",
- 0,
- "com.sun.star.configuration.backend.Importer",
- 0
-};
-const ServiceImplementationInfo aCopyImporterSI =
-{
- "com.sun.star.comp.configuration.backend.CopyImporter",
- aCopyImporterServices, aCopyImporterServices + 2
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getCopyImportServiceInfo()
-{ return getRegistrationInfo(& aCopyImporterSI); }
-// -----------------------------------------------------------------------------
-
-CopyImportService::CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: ImportService(_xContext, &aCopyImporterSI)
-{
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateCopyImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new CopyImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayerHandler > CopyImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity)
-{
- if (!xBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- ImportMergeHandler::Mode aMode = m_bOverwrite ? ImportMergeHandler::copy : ImportMergeHandler::no_overwrite;
- uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend,aMode,aEntity) );
-
- return aHandler;
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool CopyImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite")))
- {
- return (aValue >>= m_bOverwrite);
- }
-
- return ImportService::setImplementationProperty(aName,aValue);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-ImportService::ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo )
-: m_bSendNotification(false)
-, m_aMutex()
-, m_xContext(_xContext)
-, m_xDestinationBackend()
-, m_aServiceInfo(aSvcInfo)
-{
- if (!m_xContext.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context"));
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-ImportService::~ImportService()
-{}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XBackend > ImportService::createDefaultBackend() const
-{
- return BackendFactory::instance( m_xContext ).getUnoBackend();
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool ImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Notify")))
- {
- return (aValue >>= m_bSendNotification);
- }
-
- return false;
-}
-// -----------------------------------------------------------------------------
-
-// XInitialize
-
-void SAL_CALL
- ImportService::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Importer"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
-
- for (sal_Int16 i = 0; i < nCount; ++i)
- {
- beans::NamedValue aExtraArg;
- if (aArguments[i] >>= aExtraArg)
- {
- OSL_VERIFY( setImplementationProperty(aExtraArg.Name, aExtraArg.Value) );
-
- continue;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Importer"
- "- NamedValue expected"));
- throw lang::IllegalArgumentException(sMessage,*this,i+1);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-// XLayerImporter
-
-uno::Reference< backenduno::XBackend > SAL_CALL
- ImportService::getTargetBackend( )
- throw (uno::RuntimeException)
-{
- uno::Reference< backenduno::XBackend > xRet;
- {
- osl::MutexGuard aGuard(m_aMutex);
- xRet = m_xDestinationBackend;
- }
-
- if (!xRet.is())
- {
- xRet = createDefaultBackend();
-
- osl::MutexGuard aGuard(m_aMutex);
- if (!m_xDestinationBackend.is())
- m_xDestinationBackend = xRet;
- }
- return xRet;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::setTargetBackend( const uno::Reference< backenduno::XBackend >& aBackend )
- throw (lang::NullPointerException, uno::RuntimeException)
-{
- if (!aBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to set a NULL backend") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- osl::MutexGuard aGuard(m_aMutex);
- m_xDestinationBackend = aBackend;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::importLayer( const uno::Reference< backenduno::XLayer >& aLayer )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend() );
- aLayer->readData( aInputHandler );
-
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend(), aEntity );
- aLayer->readData( aInputHandler );
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- ImportService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- ImportService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- ImportService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/importsvc.hxx b/configmgr/source/backend/importsvc.hxx
deleted file mode 100644
index 2450c329dfef..000000000000
--- a/configmgr/source/backend/importsvc.hxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_IMPORTSVC_HXX
-#define CONFIGMGR_BACKEND_IMPORTSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase3.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/backend/XLayerImporter.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class ImportService : public ::cppu::WeakImplHelper3<
- backenduno::XLayerImporter,
- lang::XInitialization,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo);
- ~ImportService();
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XLayerImporter
- virtual uno::Reference< backenduno::XBackend > SAL_CALL
- getTargetBackend( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setTargetBackend( const uno::Reference< backenduno::XBackend >& aBackend )
- throw (lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importLayer( const uno::Reference< backenduno::XLayer >& aLayer )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException);
- protected:
- uno::Reference< backenduno::XBackend > createDefaultBackend() const;
-
- //uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
-
- virtual sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue);
- /** Notify backend of import */
- sal_Bool m_bSendNotification;
- private:
- // is pure virtual to allow different import services
- virtual uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity = rtl::OUString()) = 0;
-
- private:
- osl::Mutex m_aMutex;
- uno::Reference< uno::XComponentContext > m_xContext;
- uno::Reference< backenduno::XBackend > m_xDestinationBackend;
-
-
- ServiceInfoHelper m_aServiceInfo;
-
- ServiceInfoHelper const & getServiceInfo() const { return m_aServiceInfo; }
- };
-// -----------------------------------------------------------------------------
-
- class MergeImportService : public ImportService
- {
- public:
- explicit MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- private:
- uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity);
- };
-// -----------------------------------------------------------------------------
-
- class CopyImportService : public ImportService
- {
- public:
- explicit CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- private:
- uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity);
- sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue);
- private:
- sal_Bool m_bOverwrite;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerdefaultremover.cxx b/configmgr/source/backend/layerdefaultremover.cxx
deleted file mode 100644
index a773f5770f30..000000000000
--- a/configmgr/source/backend/layerdefaultremover.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerdefaultremover.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- // -----------------------------------------------------------------------------
-
- LayerDefaultRemover::LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler)
- :m_xResultHandler(_xResultHandler)
- {
- }
- // -----------------------------------------------------------------------------
-
- LayerDefaultRemover::~LayerDefaultRemover( )
- {
- }
- // -----------------------------------------------------------------------------
-
- bool LayerDefaultRemover::hasPendingProperty()
- {
- return m_aPropName.Name.getLength()!=0;
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::clearPendingProperty()
- {
- m_aPropName = PropertyStruct();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- clearPendingProperty();
- m_xResultHandler->startLayer();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (!m_aNodeStack.empty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal node started operation";
- raiseMalformedDataException(pMsg);
- }
- m_xResultHandler->endLayer();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (aAttributes == 0 && !bClear)
- {
- m_aNodeStack.push_back(aName);
- }
- else
- {
- playBackNodeStack();
- m_xResultHandler->overrideNode(aName,aAttributes,bClear);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addOrReplaceNode(aName, aAttributes);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addOrReplaceNodeFromTemplate(aName,aTemplate,aAttributes);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (m_aNodeStack.empty())
- {
- m_xResultHandler->endNode();
- }
- else
- {
- m_aNodeStack.pop_back();
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->dropNode(aName);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addProperty (aName,aAttributes,aType);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addPropertyWithValue(aName,aAttributes,aValue);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (aAttributes != 0 || bClear)
- {
- m_aPropName.Name=rtl::OUString();
- playBackNodeStack();
- m_xResultHandler->overrideProperty(aName,aAttributes,aType,bClear);
- }
- else
- {
- m_aPropName.Name = aName;
- m_aPropName.Type = aType;
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- clearPendingProperty();
- }
- else
- m_xResultHandler->endProperty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack(true);
- m_xResultHandler->setPropertyValue(aValue);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack(true);
- m_xResultHandler->setPropertyValueForLocale(aValue,aLocale);
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::playBackNodeStack(bool bPlayProperty)
- {
- if (!bPlayProperty && hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if ( !hasPendingProperty() && bPlayProperty && !m_aNodeStack.empty() )
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal Operation: Operation requires a started property";
- raiseMalformedDataException(pMsg);
- }
- if (!m_aNodeStack.empty())
- {
- for (std::vector<rtl::OUString>::iterator aIter = m_aNodeStack.begin();
- aIter != m_aNodeStack.end(); aIter++)
- {
- m_xResultHandler->overrideNode(*aIter, 0,false);
- }
- m_aNodeStack.clear();
- }
- if (bPlayProperty)
- {
- if (hasPendingProperty())
- {
- m_xResultHandler->overrideProperty(m_aPropName.Name,0,m_aPropName.Type,false);
- clearPendingProperty();
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::raiseMalformedDataException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerdefaultremover.hxx b/configmgr/source/backend/layerdefaultremover.hxx
deleted file mode 100644
index 20dba567f7dc..000000000000
--- a/configmgr/source/backend/layerdefaultremover.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERDECORATOR_HXX
-#define CONFIGMGR_XML_LAYERDECORATOR_HXX
-
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
- // -----------------------------------------------------------------------------
-
- class LayerDefaultRemover : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- explicit
- LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler);
- virtual ~LayerDefaultRemover();
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- void playBackNodeStack( bool bPlayProperty=false);
- void raiseMalformedDataException(sal_Char const * pMsg);
- inline bool hasPendingProperty();
- inline void clearPendingProperty();
- private:
- uno::Reference< backenduno::XLayerHandler > m_xResultHandler;
- std::vector<rtl::OUString> m_aNodeStack;
- struct PropertyStruct
- {
- rtl::OUString Name;
- uno::Type Type;
- }m_aPropName;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
diff --git a/configmgr/source/backend/layermerge.cxx b/configmgr/source/backend/layermerge.cxx
deleted file mode 100644
index e15ad932494c..000000000000
--- a/configmgr/source/backend/layermerge.cxx
+++ /dev/null
@@ -1,1036 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layermerge.hxx"
-#include "treenodefactory.hxx"
-#include "matchlocale.hxx"
-#include "valuetypeconverter.hxx"
-#include "typeconverter.hxx"
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
- namespace SchemaAttribute = backenduno::SchemaAttribute;
- namespace NodeAttribute = backenduno::NodeAttribute;
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-//#if OSL_DEBUG_LEVEL > 0
-// currently not used in debug builds
-#if 0
- static void check_if_complete(uno::Reference< uno::XComponentContext > const & _xContext)
- {
- MergedComponentData aData;
-
- uno::Reference< backenduno::XLayerHandler >
- test(new LayerMergeHandler(_xContext, aData));
- }
-#endif
-
-// -----------------------------------------------------------------------------
-
-struct LayerMergeHandler::Converter
-{
- explicit
- Converter(uno::Reference< uno::XComponentContext > const & xContext);
-
- uno::Any convertValue(uno::Type const & _aTargetType, uno::Any const & _aValue);
-
- static uno::Reference< com::sun::star::script::XTypeConverter > createTCV(uno::Reference< uno::XComponentContext > const & xContext);
-
- ValueConverter m_aConverter;
- bool m_bConvertData;
-};
-// -----------------------------------------------------------------------------
-LayerMergeHandler::LayerMergeHandler(uno::Reference< uno::XComponentContext > const & xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider )
-: m_rData(_rData)
-//, m_aContext(xContext,static_cast<backenduno::XLayerHandler*>(this),aTemplateProvider )
-, m_aContext(xContext)
-, m_aFactory()
-, m_aLocale()
-, m_pProperty(NULL)
-, m_pConverter( new Converter(xContext) )
-, m_nSkipping(0)
-, m_bSublayer(false)
-{
- m_aContext = DataBuilderContext(xContext,static_cast<backenduno::XLayerHandler*>(this),aTemplateProvider );
- OSL_ENSURE( m_rData.hasSchema(), "Creating layer merger without default data" );
-}
-// -----------------------------------------------------------------------------
-
-LayerMergeHandler::~LayerMergeHandler( )
-{
- delete m_pConverter;
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::prepareLayer()
-{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer or schema not terminated properly");
- if (!isDone())
- m_aContext.getLogger().error("Previous layer or schema not terminated properly", "prepareLayer()", "configmgr::LayerMergeHandler");
-
- m_aLocale = localehelper:: getDefaultLanguage();
- m_bSublayer = false;
-
- promoteToDefault(m_rData);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerMergeHandler::prepareSublayer(rtl::OUString const & aLocale)
-{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer not terminated properly");
- if (!isDone())
- m_aContext.getLogger().error("Previous layer not terminated properly", "prepareSublayer()", "configmgr::LayerMergeHandler");
-
- m_aLocale = aLocale;
- m_bSublayer = (aLocale.getLength() != 0);
-
- return m_bSublayer;
-}
-// -----------------------------------------------------------------------------
-
-namespace
-{
- struct CheckRestrictedAccessVisitor : NodeAction
- {
- node::Access m_access;
-
- CheckRestrictedAccessVisitor(node::Access _access) : m_access(_access) {}
-
- void handle(ValueNode const & _aNode) { check(_aNode); }
-
- void handle(ISubtree const & _aNode)
- {
- node::Access aNext = check(_aNode);
- CheckRestrictedAccessVisitor(aNext).applyToChildren(_aNode);
- }
-
- node::Access check(INode const & _aNode)
- {
- node::Attributes const aFoundAttr = _aNode.getAttributes();
- node::Access const aFoundAccess = aFoundAttr.getAccess();
- OSL_ENSURE(m_access <= aFoundAccess, "Subnode has more access than its parent");
-
- return aFoundAccess;
- }
- };
-// --------------------
- struct RestrictAccessVisitor : NodeModification
- {
- node::Access m_access;
-
- RestrictAccessVisitor(bool _bFinalize)
- : m_access(_bFinalize ? node::accessFinal : node::accessReadonly)
- {}
-
- void handle(ValueNode & _aNode) { restrict(_aNode); }
-
- void handle(ISubtree & _aNode)
- {
- if (restrict(_aNode))
- this->applyToChildren(_aNode);
- else
- OSL_DEBUG_ONLY(CheckRestrictedAccessVisitor(m_access).applyToNode(_aNode));
- }
-
- bool restrict(INode & _aNode)
- {
- node::Attributes const aFoundAttr = _aNode.getAttributes();
-
- if (aFoundAttr.getAccess() >= m_access) return false; // already restricted enough
-
- _aNode.modifyAccess(m_access);
- return true;
- }
- };
-}
-// -----------------------------------------------------------------------------
-void LayerMergeHandler::propagateAttributes(ISubtree & _rParent)
-{
- node::Attributes aAttributes = _rParent.getAttributes();
-
- if (aAttributes.isReadonly() || aAttributes.isFinalized())
- RestrictAccessVisitor(aAttributes.isWritable()).applyToChildren(_rParent);
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes LayerMergeHandler::makePropertyAttributes(sal_Int16 aSchemaAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- const sal_uInt16 k_allPropertySchemaAttributes =
- SchemaAttribute::REQUIRED;
-
- if ((aSchemaAttributes & k_allPropertySchemaAttributes) !=
- (aSchemaAttributes & SchemaAttribute::MASK))
- {
- sal_Char const * pMsg = (aSchemaAttributes & SchemaAttribute::LOCALIZED) ?
- "Layer merging: Cannot add localized property to extensible node" :
- "Layer merging: Unreckognized Schema Attribute for new Property" ;
-
- m_aContext.raiseIllegalArgumentException(pMsg,2);
- }
- OSL_ASSERT( !(aSchemaAttributes & SchemaAttribute::LOCALIZED) ); // check the check
-
- node::Attributes aAttributes = m_aContext.getCurrentAttributes();
-
- if (aSchemaAttributes & SchemaAttribute::REQUIRED)
- aAttributes.setNullable (false);
-
- //Set state, removable and mandatory attribute flags
- aAttributes.setState(node::isAdded);
- aAttributes.setRemovability(true,true);
-
-
- return aAttributes;
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::checkPropertyType(uno::Type const & _aType)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- if (pValue->getValueType() != _aType)
- {
- if (pValue->getValueType().getTypeClass() == uno::TypeClass_ANY)
- {
- OSL_ENSURE( pValue->isNull(), "Layer merging: Non-null 'any' value" );
-
- if (_aType != uno::Type())
- OSL_VERIFY( pValue->setValueType(_aType) );
-
- else
- {
- OSL_TRACE("Layer merging: Illegal property type: VOID overriding ANY");
- m_aContext.getLogger().warning("Illegal property type: VOID overriding ANY - ignoring",
- "checkPropertyType()", "configmgr::LayerMergeHandler");
- // m_aContext.raiseIllegalTypeException("Layer merging: Illegal property type: VOID overriding ANY");
- }
- }
- else if (_aType == uno::Type() && m_pConverter)
- m_pConverter->m_bConvertData = true;
-
- else
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: types does not match");
- }
- }
- else if (ISubtree *localisedSet = m_pProperty->asISubtree()) {
- // We're dealing with localised data.
- uno::Type valueType = parseTemplateName(
- localisedSet->getElementTemplateName()) ;
-
- if (valueType != _aType) {
- if (valueType.getTypeClass() == uno::TypeClass_ANY) {
- if (_aType == uno::Type()) {
- // VOID value
- m_aContext.raiseIllegalTypeException(
- "Layer merging: VOID value for localised ANY type") ;
- }
- // TODO Could we have to set the localised data type?
- }
- else if (_aType == uno::Type() && m_pConverter) {
- m_pConverter->m_bConvertData = sal_True ;
- }
- else {
- m_aContext.raiseIllegalTypeException("Layer merging: property value does not match localised type") ;
- }
- }
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::setValueAndCheck(ValueNode& _rValueNode, uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (_aValue.hasValue() && m_pConverter && m_pConverter->m_bConvertData)
- {
- uno::Any aConvertedValue = m_pConverter->convertValue(_rValueNode.getValueType(),_aValue);
- if (!aConvertedValue.hasValue())
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: cannot convert data to type of property");
-
- if (! _rValueNode.setValue(aConvertedValue) )
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: converted type does not match");
- }
- else if (! _rValueNode.setValue(_aValue) )
- {
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: type does not match");
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (ISubtree * pLocalizedCont = pProperty->asISubtree())
- {
- OSL_ENSURE(isLocalizedValueSet(*pLocalizedCont),"Layer merging: property node is not a value");
-
- if (INode * pLocale = pLocalizedCont->getChild(_aLocale))
- {
- if (ValueNode * pLocValue = pLocale->asValueNode())
- {
- setValueAndCheck(*pLocValue,_aValue);
- }
- else
- {
- OSL_ENSURE(false,"Layer merging: Localized subnode is not a value");
- m_aContext.getLogger().error("Localized subnode is not a value - ignoring data",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- }
- }
- else {
- node::Attributes attributes = pLocalizedCont->getAttributes() ;
- uno::Type valueType = parseTemplateName(
- pLocalizedCont->getElementTemplateName()) ;
-
- attributes.setLocalized(false) ;
- OSL_ENSURE(valueType != uno::Type(),
- "Cannot determine type for localised value") ;
- std::auto_ptr<ValueNode> localisedValue =
- m_aFactory.getNodeFactory().createNullValueNode(_aLocale,
- valueType,
- attributes) ;
-
- if (_aValue.hasValue()) {
- setValueAndCheck(*localisedValue, _aValue) ;
- }
- pLocalizedCont->addChild(base_ptr(localisedValue)) ;
- }
- }
-
- else if (ValueNode * pValue = pProperty->asValueNode())
- {
- OSL_ENSURE(false, "Layer merging: Got locale-dependent value for non-localized node");
- m_aContext.getLogger().error("Got locale-dependent value for non-localized node",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- setValueAndCheck(*pValue,_aValue);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for localized node");
- m_aContext.getLogger().error("Unknown node type for localized node",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- setValueAndCheck(*pValue,_aValue);
- }
-
- else if (ISubtree * pLocalizedCont = m_pProperty->asISubtree())
- {
- setLocalizedValue(pLocalizedCont,_aValue,m_aLocale);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for property");
- m_aContext.getLogger().error("Unknown node type for property",
- "applyPropertyValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (_aLocale.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Locale string is empty");
-
- if (ISubtree * pLocalizedCont = m_pProperty->asISubtree())
- {
- setLocalizedValue(pLocalizedCont,_aValue, _aLocale);
- }
-
- else if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- //OSL_ENSURE(false, "Layer merging: Got locale-dependent value for non localized node");
- setValueAndCheck(*pValue,_aValue);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for localized property");
- m_aContext.getLogger().error("Unknown node type for localized property",
- "applyPropertyValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyAttributes(INode * pNode, sal_Int16 aNodeAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- sal_Int16 const k_allNodeAttributes =
- NodeAttribute::MANDATORY |
- NodeAttribute::FINALIZED |
- NodeAttribute::READONLY;
-
- if ((aNodeAttributes & k_allNodeAttributes) !=
- (aNodeAttributes & NodeAttribute::MASK))
- {
- sal_Char const * pMsg =
- "Layer merging: Unreckognized Node Attribute" ;
-
- m_aContext.raiseIllegalArgumentException(pMsg,2);
- }
-
- if (aNodeAttributes & NodeAttribute::READONLY)
- {
- OSL_ENSURE(!(aNodeAttributes & NodeAttribute::FINALIZED),
- "Layer merging: Warning: Node is both read-only and finalized");
- if (aNodeAttributes & NodeAttribute::FINALIZED)
- m_aContext.getLogger().warning("Node is both read-only and finalized - treating as readonly",
- "applyAttributes()", "configmgr::LayerMergeHandler");
-
- pNode->modifyAccess(node::accessReadonly);
- }
- else if (aNodeAttributes & NodeAttribute::FINALIZED)
- {
- pNode->modifyAccess(node::accessFinal);
- }
-
- if ( m_aContext.isNode(pNode) )
- {
- if (aNodeAttributes & NodeAttribute::MANDATORY)
- {
- pNode->markMandatory();
- }
- }
- else if (aNodeAttributes) // do this only if there actually was something to do
- {
- if (ISubtree * pLocCont = pNode->asISubtree())
- {
- OSL_ENSURE(isLocalizedValueSet(*pLocCont),"Layer merging: Property subtree must be a localized value set");
- propagateAttributes(*pLocCont);
- }
- }
-
-
-}
-// -----------------------------------------------------------------------------
-
-static
-void doLogRejection(sal_Int16 loglevel, DataBuilderContext const & aContext,
- INode * pNode, bool bMandatory)
-{
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Rejecting override: Node/Property ")
- .append(aContext.getNodePath(pNode->getName()))
- .appendAscii(" is ").appendAscii(bMandatory ? "mandatory" : "finalized")
- .appendAscii(" in a prior layer.");
-
- aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(),
- bMandatory ? "addOrReplace/dropNode()" : "startOverride()",
- "configmgr::LayerMergeHandler");
-}
-
-static inline
-void logRejection(DataBuilderContext const & aContext, INode * pNode, bool bMandatory=false)
-{
- const sal_Int16 loglevel = LogLevel::INFO;
- if (aContext.getLogger().isLogging(loglevel))
- {
- doLogRejection(loglevel, aContext, pNode, bMandatory);
- }
-}
-// -----------------------------------------------------------------------------
-
-bool LayerMergeHandler::startOverride(INode * pNode, sal_Bool bClear) /* ensure writable, mark merged */
- SAL_THROW(())
-{
- OSL_PRECOND(pNode,"startOverride: non-NULL base node required");
- if (!m_aContext.isWritable(pNode))
- {
- // #i41700# write-protection is enforced, unless merging localizations
- if (!m_bSublayer)
- {
- logRejection(m_aContext,pNode);
- return false;
- }
- else
- OSL_ASSERT(m_aLocale.getLength() != 0);
- }
-
- OSL_ENSURE(!bClear,"'clear' operation is not yet supported");
- if (bClear)
- m_aContext.getLogger().warning("'clear' operation is not yet supported",
- "startOverride()", "configmgr::LayerMergeHandler");
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::ensureUnchanged(INode const * pNode) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- // to do: change state handling to detect this within sets
- OSL_PRECOND(pNode,"INTERNAL ERROR: Unexpected NULL node pointer");
-
- if (!this->isInSublayer())
- if (pNode->getAttributes().state() == node::isMerged)
- m_aContext.raiseMalformedDataException("Layer merging: Duplicate node or property in this layer");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// XLayerHandler
-
-void SAL_CALL LayerMergeHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- ISubtree * pSchema = m_rData.getSchemaTree();
- OSL_ENSURE(pSchema,"No base data to merge layer into");
-
- if (!pSchema)
- {
- m_aContext.getLogger().error("No schema data for merging layer", "startLayer", "configmgr::LayerMergeHandler");
- throw uno::RuntimeException(rtl::OUString::createFromAscii("Layer merging: No data to merge with"),*this);
- }
-
- m_aContext.startActiveComponent(pSchema->getName());
-
- m_pProperty = NULL;
- m_nSkipping = 0;
-
- OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
- OSL_POSTCOND( m_aContext.isDone(), "Layer merging: newly started component is not empty");
- OSL_POSTCOND( !this->isSkipping(), "Layer merging: newly started component is in skipping state");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- m_aContext.raiseMalformedDataException("Layer merging: Unmatched data being skipped was not terminated properly.");
-
- m_aContext.endActiveComponent();
-
- m_bSublayer = false;
-
- OSL_POSTCOND( !m_aContext.hasActiveComponent(), "Layer merging: could not clear active component");
- OSL_POSTCOND( m_aContext.isDone(), "Layer merging: could not finish processing");
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND( m_aContext.hasActiveComponent(), "Layer merging: active component is not set");
- OSL_PRECOND( m_aContext.isDone(), "Layer merging: node is not root");
-
- if (m_aContext.getActiveComponent() != aName)
- m_aContext.raiseIllegalArgumentException("Layer merging: Name of layer being merged does not match component name",1);
-
- // check the argument
- if (ISubtree * pSchema = m_rData.getSchemaTree())
- {
- OSL_ENSURE(pSchema->getName() == aName,"Schema name does not match active component");
-
- ensureUnchanged(pSchema);
-
- if (startOverride(pSchema,bClear))
- {
- applyAttributes(pSchema,aAttributes);
-
- m_aContext.pushNode(pSchema);
-
- OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
- OSL_POSTCOND( !m_aContext.isDone(), "Layer merging: could not start component");
- }
- else
- this->skipNode();
- }
- else
- {
- OSL_ENSURE(false,"No base data to merge layer into");
- m_aContext.getLogger().warning("No component data in schema for merging layer",
- "overrideNode() [for layer root]", "configmgr::LayerMergeHandler");
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-static inline
-sal_Int16 getOverrideViolationLogLevel(bool bIsSublayer)
-{ return bIsSublayer ? LogLevel::FINER : LogLevel::INFO; }
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::implOverrideNode(
- ISubtree * node, sal_Int16 attributes, bool clear)
-{
- ensureUnchanged(node);
- if (startOverride(node, clear)) {
- applyAttributes(node, attributes);
- m_aContext.pushNode(node);
- } else {
- skipNode();
- }
-}
-
-void SAL_CALL LayerMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- }
- else if (m_aContext.isDone())
- {
- this->overrideLayerRoot(aName,aAttributes,bClear);
- }
- else if (ISubtree * pNode = m_aContext.findNode(aName))
- {
- implOverrideNode(pNode, aAttributes, bClear);
- }
- else // ignore non-matched data
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Node ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be overridden does not exist - skipping");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "overrideNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseNoSuchElementException("Layer merging: The node to be overridden does not exist.",aName);
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::implAddOrReplaceNode( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree * pReplacedNode = m_aContext.findNode(aName);
- if (pReplacedNode)
- {
- if ((aAttributes & NodeAttribute::FUSE) == 0) {
- this->ensureUnchanged(pReplacedNode);
-
- if (!m_aContext.isRemovable(pReplacedNode))
- {
- logRejection(m_aContext,pReplacedNode,true);
- this->skipNode();
- return;
- }
- } else {
- implOverrideNode(
- pReplacedNode, aAttributes & ~NodeAttribute::FUSE, false);
- return;
- }
- }
-
- std::auto_ptr<INode> apNewInstance;
- if (aTemplate.Component == m_aContext.getActiveComponent())
- {
- apNewInstance = m_rData.instantiateTemplate(aName, aTemplate.Name);
- }
- else
- {
- TemplateRequest aTemplateRequest(aTemplate.Name, aTemplate.Component);
- apNewInstance = m_aContext.getTemplateData( aTemplateRequest ).extractDataAndClear();
- if (apNewInstance.get())
- apNewInstance->setName( aName );
- }
-
- if (NULL == apNewInstance.get())
- m_aContext.raiseNoSuchElementException("Layer merging: Cannot instantiate template.", aTemplate.Name);
-
- applyAttributes(apNewInstance.get(), aAttributes & ~NodeAttribute::FUSE);
- //Set removable flag
- apNewInstance->markRemovable();
-
- m_aContext.markCurrentMerged();
-
- if (pReplacedNode) m_aContext.getCurrentParent().removeChild( aName );
-
- INode * pAddedInstance = m_aContext.getCurrentParent().addChild( apNewInstance );
-
- m_aContext.pushNode(pAddedInstance->asISubtree());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- return;
- }
-
- implAddOrReplaceNode( aName, m_aContext.getCurrentItemType(), aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- return;
- }
-
- // TODO: correct argument position (from 2 to 3) for an illegal argument exception wrt attributes
- implAddOrReplaceNode( aName, m_aContext.getValidItemType(aTemplate), aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->leaveSkippedNode())
- return;
-
- this->propagateAttributes(m_aContext.getCurrentParent());
-
- m_aContext.popNode();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_aContext.getCurrentParent().isSetNode())
- m_aContext.raiseMalformedDataException("Layer merging: Removing child nodes is only possible in set nodes.");
-
- if (ISubtree * pDropped = m_aContext.findNode(aName))
- {
- this->ensureUnchanged(pDropped);
- if (!m_aContext.isRemovable(pDropped))
- {
- logRejection(m_aContext,pDropped,true);
- return;
- }
- }
- else
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Node ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be removed does not exist - ignoring");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "dropNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseNoSuchElementException("Layer merging: The node to be removed does not exist.",aName);
- }
- m_aContext.markCurrentMerged();
- m_aContext.getCurrentParent().removeChild(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- }
- else if (INode * pProp = m_aContext.findProperty(aName))
- {
- ensureUnchanged(pProp);
-
- if (startOverride(pProp,bClear))
- {
- applyAttributes(pProp,aAttributes);
-
- m_pProperty = pProp;
-
- checkPropertyType(aType);
- }
- else
- this->skipNode();
- }
- else // ignore non-matched data
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Property ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be overridden does not exist - skipping");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "overrideNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseUnknownPropertyException("Layer merging: The property to be overridden does not exist.",aName);
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->leaveSkippedNode())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Ending a property that wasn't started.");
-
- if (ISubtree * pLocalizedSet = m_pProperty->asISubtree())
- this->propagateAttributes(*pLocalizedSet);
-
- m_pProperty = NULL;
- if (m_pConverter) m_pConverter->m_bConvertData = false;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- // TODO: add type validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes & SchemaAttribute::MASK);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createNullValueNode(aName,aType,aValueAttributes);
-
- applyAttributes(aPropertyValue.get(),aAttributes & NodeAttribute::MASK);
-
- // can be a replace for dynamic properties (current update limitation)
- m_aContext.markCurrentMerged();
- m_aContext.addPropertyToCurrent(aPropertyValue, true);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes & SchemaAttribute::MASK);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(aName,aValue,aValueAttributes);
-
- applyAttributes(aPropertyValue.get(),aAttributes & NodeAttribute::MASK);
-
- // can be a replace for dynamic properties (current update limitation)
- m_aContext.markCurrentMerged();
- m_aContext.addPropertyToCurrent(aPropertyValue, true);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Overriding a value without a property.");
-
- OSL_ASSERT( !m_pProperty->getAttributes().isReplacedForUser() );
- m_pProperty->modifyState( node::isMerged );
- m_aContext.markCurrentMerged();
-
- applyPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, rtl::OUString const & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Overriding a (localized) value without a property.");
-
- OSL_ASSERT( !m_pProperty->getAttributes().isReplacedForUser() );
- m_pProperty->modifyState( node::isMerged );
- m_aContext.markCurrentMerged();
-
- applyPropertyValue(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-uno::Reference< com::sun::star::script::XTypeConverter >
- LayerMergeHandler::Converter::createTCV(uno::Reference< uno::XComponentContext > const & xContext)
-{
- OSL_ENSURE(xContext.is(),"Cannot create TypeConverter for LayerMergeHandler without a Context");
-
- uno::Reference< lang::XMultiComponentFactory > xFactory = xContext->getServiceManager();
- OSL_ENSURE(xFactory.is(),"Cannot create TypeConverter for LayerMergeHandler without a ServiceManager");
-
- uno::Reference< com::sun::star::script::XTypeConverter > xTCV;
- if (xFactory.is())
- {
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- xTCV = uno::Reference< com::sun::star::script::XTypeConverter >::query(xFactory->createInstanceWithContext(k_sTCVService,xContext));
- }
- return xTCV;
-}
-// -----------------------------------------------------------------------------
-
-LayerMergeHandler::Converter::Converter(uno::Reference< uno::XComponentContext > const & xContext)
-: m_aConverter( createTCV(xContext) )
-, m_bConvertData(false)
-{
-}
-// -----------------------------------------------------------------------------
-static
-inline
-uno::Type getBinaryDataType()
-{
- uno::Sequence< sal_Int8 > const * const forBinary = 0;
- return ::getCppuType(forBinary);
-}
-// -----------------------------------------------------------------------------
-
-uno::Any LayerMergeHandler::Converter::convertValue(uno::Type const & _aTargetType, uno::Any const & _aValue)
-{
- OSL_ENSURE( m_bConvertData, "Unexpected: Calling convert data, when data conversion is not active");
- OSL_ENSURE( _aValue.hasValue(), "Unexpected: Calling convert data, when data to convert is VOID");
-
- if (_aTargetType == _aValue.getValueType()) return _aValue;
-
- m_aConverter.reset(_aTargetType);
-
- if (m_aConverter.isList())
- {
- uno::Sequence< rtl::OUString > aStringList;
- if (_aValue >>= aStringList)
- return m_aConverter.convertListToAny(aStringList);
- }
-
- rtl::OUString aContent;
- if (_aValue >>= aContent)
- return m_aConverter.convertToAny(aContent);
-
-
- OSL_ENSURE(false, "Cannot convert typed value (not a string)");
-
- return uno::Any();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
- static inline bool isFinal(node::Attributes const& _aAttributes)
- {
- return _aAttributes.isFinalized() || _aAttributes.isReadonly();
- }
- // --------------------------------- AttributeSetter ---------------------------------
-
- class DefaultPromoter : NodeModification
- {
- public:
- explicit
- DefaultPromoter()
- {}
-
- void adjustAccess(INode& _rNode);
-
- using NodeModification::applyToNode;
- private:
- void handle(ValueNode& _rValueNode);
- void handle(ISubtree& _rSubtree);
- };
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::adjustAccess(INode& _rNode)
- {
- _rNode.promoteAccessToDefault();
- }
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::handle(ValueNode& _rValueNode)
- {
- _rValueNode.promoteToDefault();
- adjustAccess(_rValueNode);
- }
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::handle(ISubtree& _rSubtree)
- {
- _rSubtree.markAsDefault();
- this->applyToChildren(_rSubtree);
- adjustAccess(_rSubtree);
- }
-//--------------------------------------------------------------------------
-
-}
-// -----------------------------------------------------------------------------
-void promoteToDefault(MergedComponentData & _rTree)
-{
- if (ISubtree * pTreeData = _rTree.getSchemaTree())
- DefaultPromoter().applyToNode(*pTreeData);
-
- else
- OSL_ENSURE(false,"No Data to promote to default");
-
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layermerge.hxx b/configmgr/source/backend/layermerge.hxx
deleted file mode 100644
index 55e511f63c50..000000000000
--- a/configmgr/source/backend/layermerge.hxx
+++ /dev/null
@@ -1,188 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERMERGE_HXX
-#define CONFIGMGR_BACKEND_LAYERMERGE_HXX
-
-#include "mergedcomponentdata.hxx"
-#include "componentdatahelper.hxx"
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class LayerMergeHandler
- : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- explicit
- LayerMergeHandler(uno::Reference< uno::XComponentContext > const & _xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider = NULL);
- virtual ~LayerMergeHandler();
-
- // prepare merging
- void prepareLayer();
- bool prepareSublayer(rtl::OUString const & aLocale);
-
- // checking the result
- bool isDone() const { return m_aContext.isDone(); }
- bool isInSublayer() const { return m_bSublayer; }
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- void propagateAttributes(ISubtree & _rParent);
-
- node::Attributes makePropertyAttributes(sal_Int16 aSchemaAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void checkPropertyType(uno::Type const & _aType)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyPropertyValue(uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyAttributes(INode * pNode, sal_Int16 aNodeAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool startOverride(INode * pNode, sal_Bool bClear) /* check if writable, mark merged */
- SAL_THROW(());
-
- void implOverrideNode(
- ISubtree * node, sal_Int16 attributes, bool clear);
-
- void implAddOrReplaceNode(const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void ensureUnchanged(INode const * pNode) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void setValueAndCheck(ValueNode & _rValueNode, uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- private:
- void skipNode() { ++m_nSkipping; }
- bool isSkipping() const { return m_nSkipping != 0; }
- bool leaveSkippedNode() { return m_nSkipping && m_nSkipping--; }
- private:
- struct Converter;
- MergedComponentData & m_rData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
- rtl::OUString m_aLocale;
- INode * m_pProperty;
- Converter * m_pConverter;
-
- sal_uInt32 m_nSkipping;
- bool m_bSublayer;
- };
-// -----------------------------------------------------------------------------
-
- /// change attributes and states of the tree to make it a proper default layer
- void promoteToDefault(MergedComponentData & _rTree);
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdate.cxx b/configmgr/source/backend/layerupdate.cxx
deleted file mode 100644
index 894bb7c549ce..000000000000
--- a/configmgr/source/backend/layerupdate.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdate.hxx"
-#include "updatedata.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdate::LayerUpdate()
-: m_xContextNode()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate::LayerUpdate(LayerUpdate const & _aOther)
-: m_xContextNode(_aOther.m_xContextNode)
-, m_aContextPath(_aOther.m_aContextPath)
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate::~LayerUpdate()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate & LayerUpdate::operator =(LayerUpdate const & _aOther)
-{
- m_xContextNode = _aOther.m_xContextNode;
- return *this;
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdate::setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode)
-{
- m_xContextNode = _xContextNode;
- if (_xContextNode.is())
- makeContextPath(_xContextNode->getName());
-
- else
- m_aContextPath.clear();
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdate::makeContextPath(rtl::OUString const & _aPath)
-{
- configuration::AbsolutePath const aParsedPath = configuration::AbsolutePath::parse(_aPath);
-
- m_aContextPath.clear();
- m_aContextPath.reserve( aParsedPath.getDepth() );
- for (std::vector<configuration::Path::Component>::const_reverse_iterator it = aParsedPath.begin(); it != aParsedPath.end(); ++it)
- {
- m_aContextPath.push_back( it->getName() );
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<NodeUpdate> LayerUpdate::getContextNode() const
-{
- return m_xContextNode;
-}
-// -----------------------------------------------------------------------------
-
-std::vector<rtl::OUString> const & LayerUpdate::getContextPath() const
-{
- OSL_PRECOND( m_xContextNode.is(), "Cannot get context path without context node" );
-
- return m_aContextPath;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layerupdate.hxx b/configmgr/source/backend/layerupdate.hxx
deleted file mode 100644
index ee1384c62958..000000000000
--- a/configmgr/source/backend/layerupdate.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATE_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATE_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class NodeUpdate;
-
- class LayerUpdate
- {
- public:
- LayerUpdate();
- LayerUpdate(LayerUpdate const & _aOther);
- ~LayerUpdate();
- LayerUpdate & operator =(LayerUpdate const & _aOther);
- public:
- bool isEmpty() const { return ! m_xContextNode.is(); }
-
- rtl::Reference<NodeUpdate> getContextNode() const;
- std::vector<rtl::OUString> const & getContextPath() const;
-
- void setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode);
-
- private:
- void makeContextPath(rtl::OUString const & _aContextPath);
-
- private:
- rtl::Reference<NodeUpdate> m_xContextNode;
- std::vector<rtl::OUString> m_aContextPath;
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatebuilder.cxx b/configmgr/source/backend/layerupdatebuilder.cxx
deleted file mode 100644
index 6f1d4807f2fb..000000000000
--- a/configmgr/source/backend/layerupdatebuilder.cxx
+++ /dev/null
@@ -1,299 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatebuilder.hxx"
-#include "updatedata.hxx"
-#include "layerupdate.hxx"
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdateBuilder::LayerUpdateBuilder()
-: m_aUpdate()
-, m_pCurrentNode(NULL)
-, m_pCurrentProp(NULL)
-{
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateBuilder::clear()
-{
- m_pCurrentProp = NULL;
- m_pCurrentNode = NULL;
- m_aUpdate = LayerUpdate();
-
- OSL_POSTCOND( this->isEmpty(), "LayerUpdateBuilder: Could not reset the stored update.");
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate const & LayerUpdateBuilder::result() const
-{
- OSL_ENSURE(this->isComplete(),
- "LayerUpdateBuilder: There is no result to retrieve"
- " - building the data is still in progress.");
-
- return m_aUpdate;
-}
-// -----------------------------------------------------------------------------
-
-inline
-LayerUpdate & LayerUpdateBuilder::data()
-{
- return m_aUpdate;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::init()
-{
- if (m_pCurrentNode) return false;
-
- LayerUpdate & update = data();
- m_pCurrentNode = new NodeModification(NULL, rtl::OUString(), 0, 0, false);
- update.setContextNode(m_pCurrentNode);
-
- OSL_ENSURE(m_pCurrentProp == NULL, "LayerUpdateBuilder: Internal error: got a current property for a new context");
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeUpdate * pNewNode = new NodeModification(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_bReset);
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- m_pCurrentNode = pNewNode;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeUpdate * pNewNode = _pTemplate ?
- new NodeReplace(m_pCurrentNode,_aName,_nFlags,_pTemplate->Name,_pTemplate->Component) :
- new NodeReplace(m_pCurrentNode,_aName,_nFlags);
-
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- m_pCurrentNode = pNewNode;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finishNode()
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- if (m_pCurrentProp || !m_pCurrentNode) return false;
-
- m_pCurrentNode = m_pCurrentNode->getParent();
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::removeNode(rtl::OUString const & _aName)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeDrop * pNewNode = new NodeDrop(m_pCurrentNode,_aName);
-
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyUpdate * pNewProp = new PropertyUpdate(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_aType);
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- m_pCurrentProp = pNewProp;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::setPropertyValue(uno::Any const & _aValue)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->setValue(_aValue);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->setValueFor(_aLocale, _aValue);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetPropertyValue()
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->resetValue();
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetPropertyValueForLocale(rtl::OUString const & _aLocale)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->resetValueFor(_aLocale);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finishProperty()
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
- if (!m_pCurrentProp) return false;
- m_pCurrentProp->finishValue();
-
- OSL_ASSERT(m_pCurrentNode == m_pCurrentProp->getParent());
-
- m_pCurrentProp = NULL;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aType);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aValue);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetProperty(rtl::OUString const & _aName)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyReset * pNewProp = new PropertyReset(m_pCurrentNode,_aName);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finish()
-{
- if (!this->finishNode()) return false;
-
- return m_pCurrentNode == NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isEmpty() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return m_aUpdate.isEmpty();
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isActive() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return m_pCurrentNode != 0;
-}
-// -----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool LayerUpdateBuilder::isComplete() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return !m_aUpdate.isEmpty() && m_pCurrentNode == NULL;
-}
-#endif
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isPropertyActive() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- OSL_ENSURE(m_pCurrentNode || !m_pCurrentProp, "LayerUpdateBuilder: Invariant violation: got a current property without a node");
- return m_pCurrentProp != 0;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layerupdatebuilder.hxx b/configmgr/source/backend/layerupdatebuilder.hxx
deleted file mode 100644
index c86d18628935..000000000000
--- a/configmgr/source/backend/layerupdatebuilder.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEBUILDER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEBUILDER_HXX
-
-#include "layerupdate.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <rtl/ustring.hxx>
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- struct TemplateIdentifier;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class NodeUpdate;
- class PropertyUpdate;
-
- class LayerUpdateBuilder
- {
- LayerUpdate m_aUpdate;
- NodeUpdate * m_pCurrentNode;
- PropertyUpdate * m_pCurrentProp;
- public:
- LayerUpdateBuilder();
-
- public:
- /// initialize the update
- bool init();
-
- bool modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset);
- bool replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate = NULL);
- bool finishNode();
-
- bool removeNode(rtl::OUString const & _aName);
-
- bool modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType);
- bool setPropertyValue(uno::Any const & _aValue);
- bool setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale);
- bool resetPropertyValue();
- bool resetPropertyValueForLocale(rtl::OUString const & _aLocale);
- bool finishProperty();
-
- bool addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType);
- bool addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue);
- bool resetProperty(rtl::OUString const & _aName);
-
- bool finish();
- void clear();
-
- bool isEmpty() const;
- bool isActive() const;
-#if OSL_DEBUG_LEVEL > 0
- bool isComplete() const;
-#endif
- bool isPropertyActive() const;
-
- LayerUpdate const & result() const;
- private:
- LayerUpdate & data();
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatehandler.cxx b/configmgr/source/backend/layerupdatehandler.cxx
deleted file mode 100644
index 22786e912a7e..000000000000
--- a/configmgr/source/backend/layerupdatehandler.cxx
+++ /dev/null
@@ -1,313 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatehandler.hxx"
-#include "layerupdatemerger.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/beans/PropertyExistException.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( str ) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateUpdateMerger
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LayerUpdateHandler( xContext );
-}
-
-// -----------------------------------------------------------------------------
-
-LayerUpdateHandler::LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext)
-: UpdateService(_xContext)
-, m_aBuilder()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdateHandler::~LayerUpdateHandler()
-{
-}
-// -----------------------------------------------------------------------------
-inline
-void LayerUpdateHandler::checkBuilder(bool _bForProperty)
-{
- if ( m_aBuilder.isEmpty() )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - no update is in progress");
-
- if ( !m_aBuilder.isActive() )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - no context for update available");
-
- if ( m_aBuilder.isPropertyActive() != _bForProperty )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - a property is in progress");
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raiseNodeChangedBeforeException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raisePropChangedBeforeException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raisePropExistsException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- com::sun::star::beans::PropertyExistException e(sMsg,*this);
-
- throw backenduno::MalformedDataException(sMsg,*this, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-// XUpdateHandler
-void SAL_CALL
- LayerUpdateHandler::startUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- this->checkSourceLayer();
- if (!m_aBuilder.init())
- raiseMalformedDataException("LayerUpdateHandler: Cannot start update - update is already in progress");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.finish())
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish update - a node is still open.");
-
- uno::Reference< backenduno::XLayer > xMergedLayer( LayerUpdateMerger::getMergedLayer(this->getSourceLayer(), m_aBuilder.result()) );
-
- m_aBuilder.clear();
-
- this->writeUpdatedLayer(xMergedLayer);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.modifyNode(aName,aAttributes,aAttributeMask,bReset))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start node modification - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.replaceNode(aName,aAttributes,NULL))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start added/replaced node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.replaceNode(aName,aAttributes,&aTemplate))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start added/replaced node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.finishNode())
- {
- OSL_ENSURE(m_aBuilder.isPropertyActive() || !m_aBuilder.isActive(), "LayerUpdateHandler: Unexpected failure mode for finishNode");
- if (m_aBuilder.isPropertyActive())
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish node update - open property has not been ended.");
- else
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish node update - no node has been started.");
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::removeNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.removeNode(aName))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot remove node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type & aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(false);
-
- if (!m_aBuilder.modifyProperty(aName,aAttributes,aAttributeMask, aType))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot start property modification - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.setPropertyValue(aValue) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.setPropertyValueForLocale(aValue,aLocale) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetPropertyValue( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.resetPropertyValue() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetPropertyValueForLocale( const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.resetPropertyValueForLocale(aLocale) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY ( m_aBuilder.finishProperty() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.resetProperty(aName))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot reset property - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.addNullProperty(aName,aAttributes,aType))
- raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed).");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.addProperty(aName,aAttributes,aValue))
- raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed).");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::removeProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // treat 'remove' as 'reset'. (Note: does not verify that this actually amounts to dropping the property)
- if (!m_aBuilder.resetProperty(aName))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot remove property - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerupdatehandler.hxx b/configmgr/source/backend/layerupdatehandler.hxx
deleted file mode 100644
index 8a02870f4dfd..000000000000
--- a/configmgr/source/backend/layerupdatehandler.hxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "updatesvc.hxx"
-#include "layerupdatebuilder.hxx"
-#include "utility.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class LayerUpdateBuilder;
-
- class LayerUpdateHandler: private boost::noncopyable, public UpdateService
- {
- public:
- explicit
- LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext);
-
- ~LayerUpdateHandler();
-
- // XUpdateHandler
- virtual void SAL_CALL
- startUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetPropertyValue( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetPropertyValueForLocale( const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- LayerUpdateBuilder & getUpdateBuilder();
-
- void checkBuilder(bool _bForProperty = false);
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- void raiseNodeChangedBeforeException(sal_Char const * pMsg);
- void raisePropChangedBeforeException(sal_Char const * pMsg);
- void raisePropExistsException(sal_Char const * pMsg);
-
- private:
- LayerUpdateBuilder m_aBuilder;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatemerger.cxx b/configmgr/source/backend/layerupdatemerger.cxx
deleted file mode 100644
index 94c6ae37ec4a..000000000000
--- a/configmgr/source/backend/layerupdatemerger.cxx
+++ /dev/null
@@ -1,512 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatemerger.hxx"
-#include "layerupdatebuilder.hxx"
-#include "updatedata.hxx"
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdateMerger::LayerUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate)
-: BasicUpdateMerger(_xSourceLayer)
-, m_aLayerUpdate(_aLayerUpdate)
-, m_xCurrentNode()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdateMerger::~LayerUpdateMerger()
-{
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateMerger::flushUpdate()
-{
- OSL_ENSURE(!BasicUpdateMerger::isHandling(), "LayerUpdateMerger: Unexpected: flushing data, while base implementation is active");
- OSL_ENSURE(m_xCurrentNode.is(),"LayerUpdateMerger: No data for flushing.");
-
- if (m_xCurrentNode.is())
- {
- m_xCurrentNode->writeChildrenToLayer(getResultWriter().get());
- m_xCurrentNode.clear();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- BasicUpdateMerger::startLayer();
-
- m_xCurrentNode = m_aLayerUpdate.getContextNode();
-
- BasicUpdateMerger::findContext(m_aLayerUpdate.getContextPath());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- BasicUpdateMerger::endLayer();
-
- OSL_ENSURE(!m_xCurrentNode.is(), "Path being updated not found in data - update not written");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::overrideNode(aName, aAttributes, bClear);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::overrideNode(aName, aAttributes, bClear);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->overrideNode(aName, pNodeUpdate->updateFlags(aAttributes), bClear);
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addOrReplaceNode(aName, aAttributes);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addOrReplaceNode(aName, aAttributes);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->addOrReplaceNode(aName, pNodeUpdate->updateFlags(aAttributes));
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->addOrReplaceNodeFromTemplate(aName, aTemplate, pNodeUpdate->updateFlags(aAttributes));
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::endNode();
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- // write unhandled so far changes
- m_xCurrentNode->writeChildrenToLayer( getResultWriter().get() );
-
- rtl::Reference<NodeUpdate> xParent( m_xCurrentNode->getParent() );
-
- if (xParent.is())
- getResultWriter()->endNode();
-
- else
- BasicUpdateMerger::leaveContext();
-
- m_xCurrentNode = xParent;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::dropNode(aName);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (xUpdate.is())
- {
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate())
- {
- if (pNodeUpdate-> getOperation() == NodeUpdate::replace)
- {
- xUpdate->writeToLayer( getResultWriter().get() );
- return;
- }
- else
- {
- malformedUpdate("LayerUpdateMerger: Applying modification to dropped node");
- }
- }
- }
-
- getResultWriter()->dropNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::overrideProperty(aName, aAttributes, aType, bClear);
- return;
- }
-
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::overrideProperty(aName, aAttributes, aType, bClear);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- OSL_ENSURE( aType == pPropUpdate->getValueType() ||
- aType == uno::Type() ||
- pPropUpdate->getValueType() == uno::Type(),
- "Error in update merger: type mismatch overriding property ...");
-
- getResultWriter()->overrideProperty(aName, pPropUpdate->updateFlags(aAttributes), aType, bClear);
- m_xCurrentProp.set(pPropUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::endProperty();
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: Ending property that wasn't started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // write unhandled so far values
- m_xCurrentProp->writeValuesToLayer( getResultWriter().get() );
-
- getResultWriter()->endProperty();
-
- m_xCurrentProp.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::setPropertyValue(aValue);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- if (!m_xCurrentProp->hasChange())
- {
- BasicUpdateMerger::setPropertyValue(aValue);
- return;
- }
-
-#ifndef CFG_UPDATEMERGER_BATCHWRITE_PROPERTIES
- if (m_xCurrentProp->hasValue())
- {
- getResultWriter()->setPropertyValue(m_xCurrentProp->getValue());
- }
- else
- {
- OSL_ENSURE(m_xCurrentProp->hasReset(),"LayerUpdateMerger: ERROR: Unknown change type in PropertyUpdate");
- // write nothing to result
- }
-
- // mark handled
- m_xCurrentProp->removeValue();
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::setPropertyValueForLocale(aValue, aLocale);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- if (!m_xCurrentProp->hasChangeFor(aLocale))
- {
- BasicUpdateMerger::setPropertyValueForLocale(aValue, aLocale);
- return;
- }
-
-#ifndef CFG_UPDATEMERGER_BATCHWRITE_PROPERTIES
- if (m_xCurrentProp->hasValueFor(aLocale))
- {
- getResultWriter()->setPropertyValueForLocale(m_xCurrentProp->getValueFor(aLocale),aLocale);
- }
- else
- {
- OSL_ENSURE(m_xCurrentProp->hasResetFor(aLocale),"LayerUpdateMerger: ERROR: Unknown change type in PropertyUpdate");
- // write nothing to result
- }
-
- // mark handled
- m_xCurrentProp->removeValueFor(aLocale);
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addProperty(aName, aAttributes, aType);
- return;
- }
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addProperty(aName, aAttributes, aType);
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- if (pPropUpdate->hasValue() && pPropUpdate->getValue().hasValue())
- {
- // TODO: validate value-type
- uno::Any aNewValue = pPropUpdate->getValue();
- OSL_ASSERT( aNewValue.hasValue() );
-
- if (aNewValue.getValueType() != aType)
- malformedUpdate("LayerUpdateMerger: cannot do type conversion while writing updates");
-
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aNewValue);
- }
- else
- {
- // TODO: validate type
- if (pPropUpdate->getValueType() != aType && pPropUpdate->getValueType() != uno::Type())
- malformedUpdate("LayerUpdateMerger: types for property update do not match");
-
- OSL_ENSURE(!pPropUpdate->hasReset(),"Warning: resetting the value of an added property is undefined - reverting to NULL");
- getResultWriter()->addProperty(aName, pPropUpdate->updateFlags(aAttributes), aType);
- }
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addPropertyWithValue(aName, aAttributes, aValue);
- return;
- }
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addPropertyWithValue(aName, aAttributes, aValue);
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- if (!pPropUpdate->hasChange()) // attribute change only
- {
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aValue);
- }
- else if (pPropUpdate->hasReset())
- {
- // write nothing
- }
- else if (pPropUpdate->getValue().hasValue()) // setting to non-NULL value
- {
- OSL_ASSERT(pPropUpdate->hasValue());
-
- // TODO: validate value-type
- uno::Any aNewValue = pPropUpdate->getValue();
-
- if (aNewValue.getValueType() != aValue.getValueType())
- malformedUpdate("LayerUpdateMerger: cannot do type conversion while writing updates");
-
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aNewValue);
- }
- else // setting to null value
- {
- OSL_ASSERT(pPropUpdate->hasValue());
-
- // TODO: validate type
- if (pPropUpdate->getValueType() != aValue.getValueType() && pPropUpdate->getValueType() != uno::Type())
- malformedUpdate("LayerUpdateMerger: types for property update do not match");
-
- getResultWriter()->addProperty(aName, pPropUpdate->updateFlags(aAttributes), aValue.getValueType());
- }
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateMerger::malformedUpdate(sal_Char const * pMsg)
-{
- { (void)pMsg; }
- OSL_ENSURE(false,pMsg);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerupdatemerger.hxx b/configmgr/source/backend/layerupdatemerger.hxx
deleted file mode 100644
index 2636b3974266..000000000000
--- a/configmgr/source/backend/layerupdatemerger.hxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
-
-#include "basicupdatemerger.hxx"
-#include "layerupdate.hxx"
-#include <rtl/ref.hxx>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- class NodeUpdate;
- class PropertyUpdate;
-
- class LayerUpdateMerger : protected BasicUpdateMerger
- {
- public:
- static uno::Reference< backenduno::XLayer > getMergedLayer(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate)
- { return new LayerUpdateMerger(_xSourceLayer, _aLayerUpdate); }
-
- public:
- explicit
- LayerUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate);
-
- ~LayerUpdateMerger();
-
-
- // XLayerHandler overrides
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- // BasicUpdateMerger
- virtual void flushUpdate();
- private:
- void malformedUpdate(sal_Char const * pMsg);
- private:
- LayerUpdate m_aLayerUpdate;
- rtl::Reference<NodeUpdate> m_xCurrentNode;
- rtl::Reference<PropertyUpdate> m_xCurrentProp;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/makefile.mk b/configmgr/source/backend/makefile.mk
deleted file mode 100644
index 2b0f223701da..000000000000
--- a/configmgr/source/backend/makefile.mk
+++ /dev/null
@@ -1,77 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=backend
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/mergedcomponentdata.obj \
- $(SLO)$/componentdatahelper.obj \
- $(SLO)$/schemabuilder.obj \
- $(SLO)$/layermerge.obj \
- $(SLO)$/updatesvc.obj \
- $(SLO)$/layerupdatehandler.obj \
- $(SLO)$/basicupdatemerger.obj \
- $(SLO)$/layerupdatemerger.obj \
- $(SLO)$/layerupdatebuilder.obj \
- $(SLO)$/layerupdate.obj \
- $(SLO)$/updatedata.obj \
- $(SLO)$/updatedispatch.obj \
- $(SLO)$/singlebackendadapter.obj \
- $(SLO)$/backendaccess.obj \
- $(SLO)$/backendfactory.obj \
- $(SLO)$/importsvc.obj \
- $(SLO)$/basicimporthandler.obj \
- $(SLO)$/importmergehandler.obj \
- $(SLO)$/layerdefaultremover.obj \
- $(SLO)$/emptylayer.obj \
- $(SLO)$/binarywriter.obj \
- $(SLO)$/binaryreader.obj \
- $(SLO)$/binarywritehandler.obj \
- $(SLO)$/binaryreadhandler.obj \
- $(SLO)$/binarycache.obj \
- $(SLO)$/backendnotifier.obj \
- $(SLO)$/backendstratalistener.obj \
- $(SLO)$/multistratumbackend.obj \
-
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/backend/mergedcomponentdata.cxx b/configmgr/source/backend/mergedcomponentdata.cxx
deleted file mode 100644
index b79223da37d0..000000000000
--- a/configmgr/source/backend/mergedcomponentdata.cxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "mergedcomponentdata.hxx"
-#include "treenodefactory.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-MergedComponentData::MergedComponentData( )
-: m_pSchemaTree()
-, m_pTemplatesTree()
-{
-
-}
-// -----------------------------------------------------------------------------
-
-MergedComponentData::~MergedComponentData( )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-void MergedComponentData::clear( )
-{
- m_pTemplatesTree.reset();
- m_pSchemaTree.reset();
-}
-// -----------------------------------------------------------------------------
-
-bool MergedComponentData::hasSchema()const
-{
- return m_pSchemaTree.get() != NULL;
-}
-// -----------------------------------------------------------------------------
-
-
-bool MergedComponentData::hasTemplates() const
-{
- return m_pTemplatesTree.get() != NULL;
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString MergedComponentData::getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const
-{
- return _aTemplateName.Name;
-}
-// -----------------------------------------------------------------------------
-
-bool MergedComponentData::hasTemplate(rtl::OUString const & _aTemplateName) const
-{
- return m_pTemplatesTree.get() != NULL &&
- m_pTemplatesTree->getChild( _aTemplateName ) != NULL;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> MergedComponentData::extractSchemaTree()
-{
- return m_pSchemaTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> MergedComponentData::extractTemplatesTree()
-{
- return m_pTemplatesTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<INode> MergedComponentData::extractTemplateNode(rtl::OUString const & _aTemplateName)
-{
- if (m_pTemplatesTree.get() == NULL)
- return std::auto_ptr<INode>();
-
- return m_pTemplatesTree->removeChild(_aTemplateName);
-}
-// -----------------------------------------------------------------------------
-
-ISubtree const * MergedComponentData::findTemplate(rtl::OUString const & _aTemplateName) const
-{
- INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName);
-
- ISubtree const * pTemplateTree = pTemplateNode ? pTemplateNode->asISubtree() : NULL;
-
- OSL_ENSURE(pTemplateTree || !pTemplateNode, "ERROR: Template is not a subtree");
-
- return pTemplateTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<INode> MergedComponentData::instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const
-{
- if (INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName))
- {
- std::auto_ptr<INode> aResult = pTemplateNode->clone();
- aResult->setName(_aName);
- return aResult;
- }
- else
- {
- return std::auto_ptr<INode>();
- }
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * MergedComponentData::setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot)
-{
- OSL_PRECOND(_aSchemaRoot.get(),"ERROR: Setting a NULL schema root.");
- OSL_PRECOND(!hasSchema(),"ERROR: Schema root already set");
-
- m_pSchemaTree = _aSchemaRoot;
-
- return m_pSchemaTree.get();
-}
-// -----------------------------------------------------------------------------
-void MergedComponentData::setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree)
-{
- OSL_PRECOND(!hasTemplates(),"ERROR: Template Tree already set");
- m_pTemplatesTree = _aTemplateTree;
-}
-// -----------------------------------------------------------------------------
-ISubtree * MergedComponentData::addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate)
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL template");
-
- if (!m_pTemplatesTree.get())
- {
- m_pTemplatesTree = getDefaultTreeNodeFactory().createGroupNode( aTemplate.Component, node::Attributes() );
- }
- else
- {
- OSL_ENSURE(m_pTemplatesTree->getName().equals(aTemplate.Component),
- "Template Component names do not match");
- }
-
- return m_pTemplatesTree->addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/mergedcomponentdata.hxx b/configmgr/source/backend/mergedcomponentdata.hxx
deleted file mode 100644
index af6d1eddd52c..000000000000
--- a/configmgr/source/backend/mergedcomponentdata.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
-#define CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
-
-#include "valuenode.hxx"
-
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class MergedComponentData
- {
- public:
- MergedComponentData();
- ~MergedComponentData();
-
- bool hasSchema() const;
- bool hasTemplates() const;
- bool hasTemplate(rtl::OUString const & _aTemplateName) const;
-
- rtl::OUString getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const;
-
- ISubtree const * getSchemaTree() const { return m_pSchemaTree.get(); }
- ISubtree const * getTemplatesTree() const { return m_pTemplatesTree.get(); }
- ISubtree const * findTemplate(rtl::OUString const & _aTemplateName) const;
-
- ISubtree * getSchemaTree() { return m_pSchemaTree.get(); }
- ISubtree * getTemplatesTree() { return m_pTemplatesTree.get(); }
-
- std::auto_ptr<INode> instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const;
-
- void clear();
-
- ISubtree * setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot);
- ISubtree * addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate);
- void setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree);
-
- std::auto_ptr<ISubtree> extractSchemaTree();
- std::auto_ptr<ISubtree> extractTemplatesTree();
- std::auto_ptr<INode> extractTemplateNode(rtl::OUString const & _aTemplateName);
- private:
- std::auto_ptr<ISubtree> m_pSchemaTree;
- std::auto_ptr<ISubtree> m_pTemplatesTree;
-
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/multistratumbackend.cxx b/configmgr/source/backend/multistratumbackend.cxx
deleted file mode 100644
index 79f1b50b72cc..000000000000
--- a/configmgr/source/backend/multistratumbackend.cxx
+++ /dev/null
@@ -1,931 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "multistratumbackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "backendstratalistener.hxx"
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-#include "simpleinteractionrequest.hxx"
-#include "configinteractionhandler.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/StratumCreationException.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include <cppuhelper/exc_hlp.hxx>
-
-#include <stdio.h>
-
-//==============================================================================
-#define OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-//==============================================================================
-
-namespace {
-
-namespace css = com::sun::star;
-
-}
-
-namespace configmgr { namespace backend {
-
-//==============================================================================
-static const rtl::OUString kSchemaServiceParam(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "SchemaSupplier"));
-
-static const rtl::OUString kStrataServiceParam(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "Strata"));
-
-static const rtl::OUString kEntity(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"EntityLayer")) ;
-
-static const rtl::OUString kAdminModeFlag(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_ADMINFLAG)) ;
-
-static const rtl::OUString kThisOwnerEntity(
- RTL_CONSTASCII_USTRINGPARAM("<ThisOwnerEntity>")) ;
-
-//------------------------------------------------------------------------------
-bool checkOptionalArg(rtl::OUString& aArg)
- {
- if (aArg.getLength() && aArg[0] == sal_Unicode('?'))
- {
- aArg = aArg.copy(1);
- return true;
- }
- else
- {
- return false;
- }
- }
-//------------------------------------------------------------------------------
-void parseStrataInfo(const rtl::OUString aServiceList,
- std::vector< std::pair<rtl::OUString, rtl::OUString> >& aServiceInfoList,
- const uno::Reference<uno::XInterface>& pContext)
-{
- sal_Int32 nNextToken =0;
- sal_Int32 nLength = aServiceList.getLength();
-
- do
- {
- rtl::OUString aServiceName =aServiceList.getToken(0, ':',nNextToken);
- if((nNextToken ==-1)||(aServiceName.getLength()==0))
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed Strata Service specified")),
- pContext, uno::Any()) ;
- }
- rtl::OUString aServiceData = aServiceList.getToken(0, ';',nNextToken);
-
- std::pair<rtl::OUString, rtl::OUString> aServiceInfo(aServiceName,aServiceData);
- aServiceInfoList.push_back(aServiceInfo);
- }
- while (nNextToken >= 0 && nNextToken < nLength ) ;
-}
-//------------------------------------------------------------------------------
-MultiStratumBackend::MultiStratumBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY_THROW)
- ,mListenerList()
-{
-
-}
-//------------------------------------------------------------------------------
-
-MultiStratumBackend::~MultiStratumBackend()
-{
-}
-//------------------------------------------------------------------------------
-bool MultiStratumBackend::checkOkState()
-{
- if (!mSchemaSupplier.is())
- {
- if(rBHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Backends already disposed")),*this);
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Object was never Initialised")),*this);
- }
- }
- return true;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL MultiStratumBackend::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backenduno::BackendSetupException) {
-
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to MultiStratumBackend")),
- *this, 0) ;
- }
-
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
-
- try
- {
- //Initialize Backends
- initializeSchemaSupplier (context);
- initializeBackendStrata(context);
-
- sal_Bool bAdminMode = false;
- context->getValueByName(kAdminModeFlag) >>= bAdminMode;
-
- if (bAdminMode)
- {
- // find given entity
- rtl::OUString sDefaultEntity;
- if ( (context->getValueByName(kEntity) >>= sDefaultEntity) && sDefaultEntity.getLength() )
- {
- for (sal_uInt32 i = 0; i < mBackendStrata.size(); i++)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[i], uno::UNO_QUERY );
- if (xEntities.is()&& xEntities->supportsEntity(sDefaultEntity))
- {
- mBackendStrata.resize(i+1);
- mOwnerEntity = sDefaultEntity;
- break;
- }
- }
- }
- else
- {
- mBackendStrata.resize(1);
- }
- }
-
- if(mOwnerEntity.getLength()==0)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities(
- mBackendStrata[mBackendStrata.size()-1], uno::UNO_QUERY );
- if (xEntities.is())
- {
- mOwnerEntity = xEntities->getOwnerEntity();
- }
- else
- {
- mOwnerEntity = kThisOwnerEntity;
- }
- }
- mStrataListener = new BackendStrataListener(*this);
-
- }
- catch(uno::Exception& )
- {
- mSchemaSupplier.clear();
- mBackendStrata.clear() ;
-
- throw;
- }
-
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::initializeSchemaSupplier(const uno::Reference<uno::XComponentContext>& aContext)
-{
-
- rtl::OUString aServiceName;
-
- aContext->getValueByName(kSchemaServiceParam) >>= aServiceName;
- uno::Sequence< uno::Any > aInitArgs( 1 );
- aInitArgs[0] <<= aContext;
- mSchemaSupplier = uno::Reference<backenduno::XSchemaSupplier>::query(mFactory->createInstanceWithArguments(aServiceName,aInitArgs)) ;
- if (!mSchemaSupplier.is())
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Could not create Schema Supplier service")),
- *this, uno::Any()) ;
-
- }
-}
-//------------------------------------------------------------------------------
-static
-bool approveRecovery(const backenduno::StratumCreationException & aError)
-{
- sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE ; //| apihelper::CONTINUATION_DISAPPROVE;
-
- sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN;
-
- apihelper::ConfigurationInteractionHandler handler;
- try {
- uno::Reference< css::task::XInteractionHandler > h(handler.get());
- if (h.is()) {
- rtl::Reference< apihelper::SimpleInteractionRequest > req(
- new apihelper::SimpleInteractionRequest(
- uno::makeAny(aError), k_supported_choices));
- h->handle(req.get());
- chosen = req->getResponse();
- }
- } catch (uno::Exception & e) {
- OSL_TRACE("Warning - Configuration: Interaction handler failed: [%s]\n", OU2A(e.Message));
- }
-
- switch (chosen)
- {
- case apihelper::CONTINUATION_APPROVE: return true;
- case apihelper::CONTINUATION_DISAPPROVE: return false;
- case apihelper::CONTINUATION_UNKNOWN: break;
-
- default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break;
- }
- // no choice available - default: disapprove
- return false;
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::initializeBackendStrata(const uno::Reference<uno::XComponentContext>& aContext)
-{
-
- rtl::OUString sStrata;
- //Get Strata
- aContext->getValueByName(kStrataServiceParam) >>= sStrata;
- if(sStrata.getLength()==0)
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: No Strata Services Specified")),
- *this, uno::Any()) ;
-
- }
-
- //need to parse the Strata to extract service names and data location
- std::vector< std::pair<rtl::OUString, rtl::OUString> > aServiceInfoList;
- parseStrataInfo(sStrata,aServiceInfoList,*this);
-
- for (std::vector< std::pair<rtl::OUString, rtl::OUString> >::const_iterator it = aServiceInfoList.begin(); it != aServiceInfoList.end(); ++it)
- {
- uno::Sequence< uno::Any > aInitArgs( 1 );
- rtl::OUString sServiceName = it->first;
- const rtl::OUString& sServiceData = it->second;
- aInitArgs[0] <<= sServiceData;
- uno::Reference <uno::XInterface> xBackend;
- bool bOptional = checkOptionalArg(sServiceName);
-
- try
- {
- xBackend= mFactory->createInstanceWithArguments(sServiceName,aInitArgs);
- }
- catch (uno::Exception& exception)
- {
- if(!bOptional)
- {
- static const sal_Char sErrContext[] = "MultiStratumBackend: Could not create Backend Stratum Service: ";
- rtl::OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext));
- rtl::OUString const sMessage = sContext.concat(exception.Message);
-
- backenduno::StratumCreationException error(sMessage,*this,
- ::cppu::getCaughtException(),
- sServiceName,sServiceData);
- if (!approveRecovery(error))
- throw error;
- }
-
- }
- if (xBackend.is())
- {
- mBackendStrata.push_back(xBackend) ;
- }
- }
-}
-//---------------------------------------------------------------------------------------------
-// XBackendEntities
-rtl::OUString SAL_CALL
- MultiStratumBackend::getOwnerEntity( )
- throw (uno::RuntimeException)
-{
-
- if (checkOkState())
- {
- return mOwnerEntity;
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getAdminEntity()
- throw (uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[0], uno::UNO_QUERY );
- if(xEntities.is())
- {
- return xEntities->getAdminEntity();
- }
- else
- {
- return rtl::OUString();
- }
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException)
-{
-
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- return true;
- }
- }
- return false;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
-
-
- if (aEntity.equals(aOtherEntity))
- {
- return true;
- }
-
- if (checkOkState())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- return xEntities->isEqualEntity(aEntity,aOtherEntity);
- }
- }
- return false;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getSchemaVersion(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
- uno::Reference<backenduno::XVersionedSchemaSupplier> xVersionSupplier(mSchemaSupplier,uno::UNO_QUERY);
- if (xVersionSupplier.is())
- return xVersionSupplier->getSchemaVersion(aComponent) ;
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XSchema> SAL_CALL
- MultiStratumBackend::getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
- return mSchemaSupplier->getComponentSchema(aComponent) ;
- }
- return NULL;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- MultiStratumBackend::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return listLayers(aComponent, mOwnerEntity ) ;
- }
- return uno::Sequence<uno::Reference<backenduno::XLayer> >() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- MultiStratumBackend::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return getUpdateHandler(aComponent, mOwnerEntity) ;
- }
- return NULL;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- MultiStratumBackend::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- sal_Int32 nNumSupportedLayers = mBackendStrata.size();
- if(aEntity != mOwnerEntity)
- {
- nNumSupportedLayers = findSupportingStratum(aEntity);
- }
- return searchSupportingStrata(nNumSupportedLayers,aEntity,aComponent);
- }
- return uno::Sequence<uno::Reference<backenduno::XLayer> >();
-}
-//------------------------------------------------------------------------------
-sal_Int32 MultiStratumBackend::findSupportingStratum(const rtl::OUString& aEntity)
-{
- sal_Int32 nNumLayers = mBackendStrata.size();
- for (std::vector< uno::Reference <uno::XInterface> >::reverse_iterator it = mBackendStrata.rbegin(); it != mBackendStrata.rend(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- {
- return nNumLayers;
- }
- }
- nNumLayers--;
- }
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("\n MultiStratumBackend: No Backend supports Entity: \"");
- sMsg.append(aEntity);
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),
- *this, 0) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<uno::Reference<backenduno::XLayer> >
- MultiStratumBackend::searchSupportingStrata(sal_Int32 nNumLayers,
- rtl::OUString aEntity,
- const rtl::OUString& aComponent)
-{
- uno::Sequence<uno::Reference<backenduno::XLayer> > aLayers;
- std::vector<uno::Reference<backenduno::XLayer> > aBackendLayers;
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Sequence<uno::Reference<backenduno::XLayer> > aMultiLayers;
- uno::Reference< backenduno::XBackendEntities > xEntities(mBackendStrata[i], uno::UNO_QUERY );
-
- uno::Reference<backenduno::XBackend> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- if (xEntities.is())
- {
- if( !xEntities->supportsEntity(aEntity))
- {
- aEntity = xEntities->getOwnerEntity();
- }
- aMultiLayers = xBackend->listLayers(aComponent, aEntity) ;
- }
- else
- {
- aMultiLayers = xBackend->listOwnLayers(aComponent);
- }
- }
- else
- {
- uno::Reference<backenduno::XMultiLayerStratum> xMultiLayerStratum(
- mBackendStrata[i], uno::UNO_QUERY) ;
-
- if (xMultiLayerStratum.is())
- {
- if (xEntities.is())
- {
- if( !xEntities->supportsEntity(aEntity))
- {
- aEntity = xEntities->getOwnerEntity();
- }
- aMultiLayers = xMultiLayerStratum->getLayers(
- xMultiLayerStratum->listLayerIds(aComponent, aEntity),
- rtl::OUString()) ;
-
- }
- else
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: XMultiLayerStratum must support XBackendEntities")),
- *this, uno::Any()) ;
- }
-
- }
- else
- {
- uno::Reference<backenduno::XSingleLayerStratum> xSingleLayerStratum(
- mBackendStrata[i], uno::UNO_REF_QUERY_THROW) ;
- if (xSingleLayerStratum.is())
- {
- uno::Reference<backenduno::XLayer> xLayer = xSingleLayerStratum->getLayer( aComponent, rtl::OUString());
- //Could be an empty layer
- if (xLayer.is())
- {
- aBackendLayers.push_back(xLayer);
- }
- }
- }
- }
- // There might be non-existent layers in the list if there's no
- // actual data associated to a given layer id. Hence we have to
- // compress the list.
- for (sal_Int32 j = 0 ; j < aMultiLayers.getLength() ; ++j)
- {
- if (aMultiLayers [j].is())
- {
- aBackendLayers.push_back( aMultiLayers[j]);
- }
- }
- }
- aLayers.realloc(aBackendLayers.size());
- for (sal_uInt32 k =0; k < aBackendLayers.size();k++)
- {
- aLayers[k] = aBackendLayers[k];
- }
- return aLayers;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- MultiStratumBackend::getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
-
- sal_Int32 nNumSupportedLayers = mBackendStrata.size();
- rtl::OUString aUsedEntity;
-
- if(aEntity != mOwnerEntity)
- {
- nNumSupportedLayers = findSupportingStratum(aEntity);
- aUsedEntity = aEntity;
- }
- else
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[mBackendStrata.size()-1], uno::UNO_QUERY );
- if (xEntities.is())
- {
- aUsedEntity = xEntities->getOwnerEntity();
- }
- }
- sal_Int32 nStrataIndex = nNumSupportedLayers -1;
-
- uno::Reference<backenduno::XBackend> xBackend(
- mBackendStrata[nStrataIndex], uno::UNO_QUERY) ;
- uno::Reference< uno::XInterface > xHandler;
- if(xBackend.is())
- {
- if (aUsedEntity.getLength()==0)
- {
- xHandler = xBackend->getOwnUpdateHandler(aComponent) ;
- return uno::Reference<backenduno::XUpdateHandler>(xHandler,uno::UNO_REF_QUERY_THROW);
- }
- else
- {
- xHandler = xBackend->getUpdateHandler(aComponent, aUsedEntity) ;
- return uno::Reference<backenduno::XUpdateHandler>(xHandler,uno::UNO_REF_QUERY_THROW);
- }
- }
- else
- {
-
- uno::Sequence<uno::Any> arguments(1) ;
-
- uno::Reference< backenduno::XMultiLayerStratum > xMultiLayerStratum
- (mBackendStrata[nStrataIndex], uno::UNO_QUERY );
- if(xMultiLayerStratum.is())
- {
- arguments [0] <<= xMultiLayerStratum->getUpdatableLayer(
- xMultiLayerStratum->getUpdateLayerId(aComponent,aUsedEntity));
- }
- else
- {
- uno::Reference< backenduno::XSingleLayerStratum > xSingleLayerStratum(
- mBackendStrata[nStrataIndex], uno::UNO_REF_QUERY_THROW );
-
- arguments [0] <<= xSingleLayerStratum->getUpdatableLayer(aComponent);
-
- }
-
- if(!xHandler.is())
- {
- try
- {
- const rtl::OUString kUpdateMerger(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.LayerUpdateMerger")) ;
-
-
- if(!mFactory.is())
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Service Factory already dispoed")),*this);
- }
-
- xHandler = mFactory->createInstanceWithArguments(kUpdateMerger, arguments);
- }
- catch (uno::RuntimeException & )
- {throw;}
- catch (uno::Exception & e)
- {
- const rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration MultiStratumBackend: Cannot create UpdateMerger - error message: ")) ;
- throw uno::RuntimeException(sMessage.concat(e.Message),*this);
- }
- }
- return uno::Reference<backenduno::XUpdateHandler>(xHandler, uno::UNO_REF_QUERY_THROW) ;
- }
- }
- return NULL;
-}
-// ---------------------------------------------------------------------------
-// ComponentHelper
-void SAL_CALL MultiStratumBackend::disposing()
-{
- osl::MutexGuard aGuard(mMutex);
- if (mFactory.is())
- {
- mFactory.clear();
- }
- if (mSchemaSupplier.is())
- {
- uno::Reference< lang::XComponent> xComp( mSchemaSupplier, uno::UNO_QUERY);
- if (xComp.is())
- {
- xComp->dispose();
- }
- if (mSchemaSupplier.is())
- {
- mSchemaSupplier.clear();
- }
- }
- if (!mBackendStrata.empty())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< lang::XComponent> xComp( *it, uno::UNO_QUERY );
- if (xComp.is())
- {
- try
- {
- xComp->dispose();
- }
- catch(uno::Exception &){}
- }
- }
- mBackendStrata.clear();
-
- }
-
- }
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kBackendService = "com.sun.star.configuration.backend.Backend" ;
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.MultiStratumBackend" ;
-
-static sal_Char const * const kServiceNames [] =
-{
- kBackendService,
- 0
-} ;
-static const ServiceImplementationInfo kServiceInfo =
-{
- kImplementation,
- kServiceNames,
- 0
-} ;
-
-const ServiceRegistrationInfo *getMultiStratumBackendServiceInfo()
-{
- return getRegistrationInfo(&kServiceInfo) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
- instantiateMultiStratumBackend(const uno::Reference< uno::XComponentContext >& xContext)
-{
- return *new MultiStratumBackend(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(kImplementation)) ;
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<rtl::OUString> SAL_CALL
- MultiStratumBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-//------------------------------------------------------------------------------
-void SAL_CALL MultiStratumBackend::addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if(checkOkState())
- {
-
- mListenerList.insert( ListenerList::value_type(aComponent, xListener));
- //Now register with lower layers
- for (sal_uInt32 i = 0 ; i < mBackendStrata.size() ; ++ i)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- xBackend->addChangesListener(mStrataListener, aComponent);
- }
- }
- }
-}
-//------------------------------------------------------------------------------
-void SAL_CALL MultiStratumBackend::removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& /*xListner*/,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if(checkOkState())
- {
- sal_Int32 nCount = mListenerList.count(aComponent);
- if (nCount == 0)
- {
- OSL_TRACE("MultiStratumBackend: removeListener: no listener registered for component %s"
- , aComponent.getStr());
- }
- else
- {
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- mListenerList.erase(aIter);
- if (nCount == 1)
- {
- //Deregister Listener from strata backend if they support notification
- for (sal_uInt32 i = 0 ; i < mBackendStrata.size(); ++ i)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- xBackend->removeChangesListener(mStrataListener, aComponent);
- }
- }
- }
- }
- }
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- try
- {
- notifyListeners( aEvent);
-
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- throw lang::WrappedTargetRuntimeException(e.Message, *this, uno::makeAny(e));
- }
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::disposing( lang::EventObject const & /*rSource*/ )
- throw (::com::sun::star::uno::RuntimeException)
-{}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::notifyListeners(const backenduno::ComponentChangeEvent& aEvent)const
-{
- //fire off notification to all registered listeners for specific Component
- ListenerList::const_iterator aIter;
- rtl::OUString aComponentName = aEvent.Component;
- if (mListenerList.empty())
- {
- OSL_TRACE("MultiStratumBackend: notifyListeners: no listeners registered for component %s",
- aComponentName.getStr());
- }
- else
- {
- aIter = mListenerList.begin();
- do{
- if (aIter->first == aComponentName)
- {
- aIter->second->componentDataChanged(aEvent);
- }
- aIter++;
- }while (aIter != mListenerList.end());
- }
- }
-//------------------------------------------------------------------------------
-} } // configmgr.backend
-
diff --git a/configmgr/source/backend/multistratumbackend.hxx b/configmgr/source/backend/multistratumbackend.hxx
deleted file mode 100644
index b7bb53e3a8e8..000000000000
--- a/configmgr/source/backend/multistratumbackend.hxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
-#define CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesListener.hpp>
-#include <cppuhelper/compbase7.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Class implementing the Backend service for multibackend access.
- It creates the required backends and coordinates access to them.
- */
-class MultiStratumBackend : public cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo > {
- public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- MultiStratumBackend(
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~MultiStratumBackend() ;
-
- // XInitialize
- virtual void SAL_CALL initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backenduno::BackendSetupException) ;
-
- // XVersionedSchemaSupplier
- virtual rtl::OUString
- SAL_CALL getSchemaVersion(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backenduno::XSchema>
- SAL_CALL getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw ( backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
- // XBackendChangesListener
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
-
- void notifyListeners(const backenduno::ComponentChangeEvent& aEvent) const;
- protected:
- // ComponentHelper
- virtual void SAL_CALL disposing();
- private :
- /** Initialize the schema supplier backend
-
- */
- void initializeSchemaSupplier(const uno::Reference<uno::XComponentContext>& aContext);
-
- /** Initialize strata(SingleLayer or MultiLayer) backend
- */
- void initializeBackendStrata(const uno::Reference<uno::XComponentContext>& aContext);
-
- /** Get Layers from Backend Strata
- */
- uno::Sequence<uno::Reference<backenduno::XLayer> >
- searchSupportingStrata(sal_Int32 nNumLayer,
- rtl::OUString aEntity,
- const rtl::OUString& aComponent) ;
-
-
- /** Find the Stratum that supports the specified Entity
- * @return Number of Supported Strata
- */
- sal_Int32 findSupportingStratum(const rtl::OUString& aEntity) ;
-
-
- /**
- Check state of MultiStratumBackend -
- @return true if not disposed/uninitialized
- */
- bool checkOkState();
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
-
- uno::Reference<backenduno::XSchemaSupplier> mSchemaSupplier ;
- /** list of all backends */
- std::vector< uno::Reference <uno::XInterface> > mBackendStrata;
-
- rtl::OUString mOwnerEntity;
-
- /** Helper object that listens to the Strata Backends */
- uno::Reference<backenduno::XBackendChangesListener> mStrataListener;
- /** List of higher level listeners */
- typedef std::multimap< rtl::OUString, uno::Reference<backenduno::XBackendChangesListener> > ListenerList;
- ListenerList mListenerList;
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
diff --git a/configmgr/source/backend/schemabuilder.cxx b/configmgr/source/backend/schemabuilder.cxx
deleted file mode 100644
index 8059aca9eecb..000000000000
--- a/configmgr/source/backend/schemabuilder.cxx
+++ /dev/null
@@ -1,536 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "schemabuilder.hxx"
-#include "treenodefactory.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
- namespace SchemaAttribute = backenduno::SchemaAttribute;
-// -----------------------------------------------------------------------------
-//#if OSL_DEBUG_LEVEL > 0
-// currently not used in debug builds
-#if 0
- static void check_if_complete(MergedComponentData & md, uno::Reference< uno::XComponentContext > const & xContext)
- {
- uno::Reference< backenduno::XSchemaHandler >
- test(new SchemaBuilder(xContext, rtl::OUString(),md,NULL));
- }
-#endif
-// -----------------------------------------------------------------------------
-
-SchemaBuilder::SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider )
-: m_aData(rData)
-, m_aContext(xContext)
-//, m_aContext(xContext,static_cast<backenduno::XSchemaHandler*>(this), aExpectedComponentName, aTemplateProvider )
-, m_aFactory()
-{
- m_aContext = DataBuilderContext(xContext,static_cast<backenduno::XSchemaHandler*>(this), aExpectedComponentName, aTemplateProvider );
-}
-// -----------------------------------------------------------------------------
-
-SchemaBuilder::~SchemaBuilder( )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// XSchemaHandler
-
-void SAL_CALL SchemaBuilder::startSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!this->isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Unexpected Restart of Schema");
-
- m_aData.clear();
-
- OSL_ASSERT(!m_aContext.hasActiveComponent());
- OSL_ASSERT( m_aContext.isDone());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!this->isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Unexpected End of Schema");
-
- substituteInstances();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::importComponent( const rtl::OUString& /*aName*/ )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- //OSL_TRACE("WARNING: Configuration schema parser: Cross-component references are not yet supported\n");
-}
-// -----------------------------------------------------------------------------
-
-
-void SAL_CALL SchemaBuilder::startComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_aData.hasSchema())
- m_aContext.raiseElementExistException("Schema builder: The component schema is already loaded", rtl::OUString());
-
- m_aContext.startActiveComponent(aName);
-
- std::auto_ptr<ISubtree> apSchema =
- m_aFactory.createGroup(aName,0,getComponentRootAttributes());
-
- ISubtree * pSchema = m_aData.setSchemaRoot(apSchema);
-
- m_aContext.pushNode(pSchema);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endComponent( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- m_aContext.endActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-bool SchemaBuilder::isExtensible(sal_Int16 aSchemaAttributes)
-{
- sal_Int16 const aValidAttributes = aSchemaAttributes & SchemaAttribute::EXTENSIBLE;
-
- if (aValidAttributes != aSchemaAttributes)
- m_aContext.raiseIllegalArgumentException("Schema builder: Illegal attribute specified for node.",2);
-
- return (aValidAttributes != 0);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (aTemplate.Component.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1);
-
- m_aContext.startActiveComponent(aTemplate.Component);
-
- if (m_aData.hasTemplate(aTemplate.Name))
- m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
-
- rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTemplateTree =
- m_aFactory.createGroup(aName,bExtensible,getTemplateBaseAttributes());
-
- ISubtree * pTree = m_aData.addTemplate(aTemplateTree,aTemplate);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (aTemplate.Component.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1);
-
- m_aContext.startActiveComponent(aTemplate.Component);
-
- if (m_aData.hasTemplate(aTemplate.Name))
- m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
-
- rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate);
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTemplateTree =
- m_aFactory.createSet( aName,aFullType,bExtensible,getTemplateBaseAttributes());
-
- ISubtree * pTree = m_aData.addTemplate(aTemplateTree,aTemplate);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endTemplate( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- m_aContext.endActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startGroup( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTree = m_aFactory.createGroup(aName,bExtensible,getNodeAttributes());
-
- ISubtree * pTree = m_aContext.addNodeToCurrent(aTree);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTree = m_aFactory.createSet(aName,aFullType,bExtensible,getNodeAttributes());
-
- ISubtree * pTree = m_aContext.addNodeToCurrent(aTree);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- if (m_aContext.isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Incorrect Termination");
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::makePropertyAttributes(sal_Int16 aSchemaAttributes) const
-{
- const sal_uInt16 c_AllPropertyAttributes =
- SchemaAttribute::REQUIRED | SchemaAttribute::LOCALIZED;
-
- if ((aSchemaAttributes & c_AllPropertyAttributes) != aSchemaAttributes)
- m_aContext.raiseIllegalArgumentException("SchemaBuilder: Unreckognized Attribute for Property",2);
-
- node::Attributes aAttributes = getNodeAttributes();
-
- if (aSchemaAttributes & SchemaAttribute::REQUIRED)
- aAttributes.setNullable (false);
-
- return aAttributes;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // TODO: add type validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes);
-
- if (aAttributes & SchemaAttribute::LOCALIZED)
- {
- std::auto_ptr<ISubtree> aLocalizedProp =
- m_aFactory.createLocalizedContainer(aName,aType,aValueAttributes);
-
- m_aContext.addLocalizedToCurrent(aLocalizedProp);
- }
- else
- {
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createNullValueNode(aName,aType,aValueAttributes);
-
- m_aContext.addPropertyToCurrent(aPropertyValue);
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // TODO: add parameter validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes);
-
- if (aAttributes & SchemaAttribute::LOCALIZED)
- {
- std::auto_ptr<ISubtree> aLocalizedProp =
- m_aFactory.createLocalizedContainer(aName,aDefaultValue.getValueType(),aValueAttributes);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(localehelper::getDefaultLanguage(),aDefaultValue,aValueAttributes);
-
- aLocalizedProp->addChild( base_ptr(aPropertyValue) );
-
- m_aContext.addLocalizedToCurrent(aLocalizedProp);
- }
- else
- {
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(aName,aDefaultValue,aValueAttributes);
-
-
- m_aContext.addPropertyToCurrent( aPropertyValue);
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aTemplate);
-
- std::auto_ptr<ISubtree> aPlaceHolder =
- m_aFactory.createPlaceHolder(aName,aFullType);
-
- m_aContext.addNodeToCurrent(aPlaceHolder);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addItemType( const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if ( m_aContext.getCurrentParent().getElementTemplateName() != aItemType.Name ||
- m_aContext.getCurrentParent().getElementTemplateModule() != m_aContext.getTemplateComponent(aItemType) )
- {
- OSL_ENSURE(false, "SchemaBuilder: Multiple ItemTypes for Sets are currently not supported");
- m_aContext.raiseMalformedDataException("SchemaBuilder: Unsupported Feature: Multiple ItemTypes for Sets");
- }
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getNodeAttributes() const
-{
- node::Attributes aResult = m_aContext.getCurrentAttributes();
- aResult.setState( node::isDefault );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getComponentRootAttributes()
-{
- node::Attributes aResult;
- aResult.setState( node::isDefault );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getTemplateBaseAttributes()
-{
- node::Attributes aResult;
- aResult.setState( node::isReplaced );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-namespace
-{
- class SubstitutionHelper : NodeModification
- {
- MergedComponentData & m_rData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
-
- std::vector< rtl::OUString > m_aReplacementList;
- std::vector< ISubtree const * > m_aTemplateStack;
- public:
- SubstitutionHelper(DataBuilderContext const & aBaseContext, MergedComponentData & _rData, uno::XInterface * _pContext)
- : m_rData(_rData)
- , m_aContext(aBaseContext,_pContext)
- , m_aReplacementList()
- , m_aTemplateStack()
- {}
-
- void substituteInData();
- private:
- void substituteInComponent(ISubtree * _pComponent);
- void substituteInNode(ISubtree & _rNode);
- void substituteInList();
-
- void substitute(rtl::OUString const & _aName);
-
- virtual void handle(ValueNode&);
- virtual void handle(ISubtree&);
- };
-}
-// -----------------------------------------------------------------------------
-
-void SchemaBuilder::substituteInstances()
-{
- SubstitutionHelper helper(m_aContext, m_aData, static_cast<backenduno::XSchemaHandler*>(this));
-
- helper.substituteInData();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
- void SubstitutionHelper::substituteInData()
- {
- if (m_rData.hasTemplates())
- substituteInComponent(m_rData.getTemplatesTree());
-
- if (m_rData.hasSchema())
- substituteInComponent(m_rData.getSchemaTree());
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInComponent(ISubtree * _pComponent)
- {
- OSL_ENSURE(_pComponent,"ERROR: Trying to substitute in NULL component");
-
- if (_pComponent)
- {
- m_aContext.startActiveComponent(_pComponent->getName());
- this->substituteInNode(*_pComponent);
- m_aContext.endActiveComponent();
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInNode(ISubtree & _rNode)
- {
- std::vector< rtl::OUString > aSaveInstances;
- aSaveInstances.swap(m_aReplacementList);
-
- // todo: own stack to check against infinite recursion
- m_aContext.pushNode(&_rNode);
-
- this->applyToChildren(_rNode); // fill the list
-
- this->substituteInList();
-
- m_aContext.popNode();
-
- aSaveInstances.swap(m_aReplacementList);
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInList()
- {
- for(std::vector< rtl::OUString >::iterator it = m_aReplacementList.begin();
- it != m_aReplacementList.end(); ++it)
- {
- this->substitute(*it);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substitute(rtl::OUString const & _aName)
- {
-
- ISubtree & rParent = m_aContext.getCurrentParent();
-
- std::auto_ptr<INode> pReplacedNode = rParent.removeChild(_aName);
- OSL_ASSERT( pReplacedNode.get() != NULL );
-
- ISubtree * pReplacedInstance = pReplacedNode->asISubtree();
- OSL_ASSERT( pReplacedInstance != NULL );
-
- backenduno::TemplateIdentifier aTemplateName = m_aFactory.getInstanceType(*pReplacedInstance);
- if (aTemplateName.Component == m_aContext.getActiveComponent())
- {
- if (ISubtree const * pTemplate = m_rData.findTemplate(aTemplateName.Name))
- {
- std::vector< ISubtree const * >::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end();
- if (std::find(beg,end,pTemplate) != end)
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template is recursive");
-
- m_aTemplateStack.push_back(pTemplate);
-
- std::auto_ptr< INode > pTemplateInstance = pTemplate->clone();
-
- pTemplateInstance->setName(_aName);
- // TODO: adjust state/attributes here (?)
-
- ISubtree * pAddedTree = rParent.addChild(pTemplateInstance)->asISubtree();
-
- OSL_ENSURE(pAddedTree, "Could not obtain added template instance");
-
- this->substituteInNode(*pAddedTree);
-
- m_aTemplateStack.pop_back();
- }
- else
- {
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template not found");
- }
- }
- //Import Template from different component
- else
- {
- TemplateRequest aTemplateRequest(aTemplateName.Name,
- aTemplateName.Component );
- ResultHolder< TemplateInstance > aResult = m_aContext.getTemplateData( aTemplateRequest );
-
- std::auto_ptr<INode> pTemplateInstance = aResult.extractDataAndClear();
- pTemplateInstance->setName(_aName);
-
- // Add template instance - must be a tree as any template
- OSL_VERIFY(
- rParent.addChild(pTemplateInstance)->asISubtree() );
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::handle(ValueNode&)
- {
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::handle(ISubtree& _rTree)
- {
- if (m_aFactory.isInstancePlaceHolder(_rTree))
- m_aReplacementList.push_back(_rTree.getName());
-
- else
- substituteInNode(_rTree);
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/schemabuilder.hxx b/configmgr/source/backend/schemabuilder.hxx
deleted file mode 100644
index 69becb1d6895..000000000000
--- a/configmgr/source/backend/schemabuilder.hxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_SCHEMABUILDER_HXX
-#define CONFIGMGR_BACKEND_SCHEMABUILDER_HXX
-
-#include "mergedcomponentdata.hxx"
-#include "componentdatahelper.hxx"
-#include "mergeddataprovider.hxx"
-#include <com/sun/star/configuration/backend/XSchemaHandler.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class SchemaBuilder
- : public cppu::WeakImplHelper1<backenduno::XSchemaHandler>
- {
- public:
- SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider = NULL );
- virtual ~SchemaBuilder();
-
- // checking the result
- bool isDone() const { return m_aContext.isDone(); }
-
- MergedComponentData & result();
- MergedComponentData const & result() const;
-
- // XSchemaHandler
- public:
- virtual void SAL_CALL
- startSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endComponent( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endTemplate( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startGroup( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addItemType( const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- static node::Attributes getComponentRootAttributes();
- static node::Attributes getTemplateBaseAttributes();
- node::Attributes getNodeAttributes() const;
- node::Attributes makePropertyAttributes(sal_Int16 aSchemaAttributes) const;
-
- bool isExtensible(sal_Int16 aSchemaAttributes);
-
- void substituteInstances();
- private:
- MergedComponentData & m_aData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/singlebackendadapter.cxx b/configmgr/source/backend/singlebackendadapter.cxx
deleted file mode 100644
index 6a119c81cdab..000000000000
--- a/configmgr/source/backend/singlebackendadapter.cxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "singlebackendadapter.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-namespace configmgr { namespace backend {
-
-//==============================================================================
-
-SingleBackendAdapter::SingleBackendAdapter(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-SingleBackendAdapter::~SingleBackendAdapter(void) {}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SingleBackendAdapter::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception) {
-
- uno::Any const * const pParams = aParameters.getConstArray();
- sal_Int32 nCount = aParameters.getLength();
-
- for (sal_Int32 ix = 0; ix < nCount; ++ix)
- {
- if (pParams[ix] >>= mBackend) break;
- }
-
- if (!mBackend.is())
- {
- throw com::sun::star::configuration::CannotLoadConfigurationException(
- rtl::OUString::createFromAscii("Online SingleBackend Adapter: Cannot operate without real (Single)Backend"),
- *this);
- }
-}
-//------------------------------------------------------------------------------
-static inline rtl::OUString getSingleLayerDummyEntity()
-{ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")); }
-//------------------------------------------------------------------------------
-bool SingleBackendAdapter::checkOkState()
-{
- if (!mBackend.is())
- {
- if(rBHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Backend already disposed")),*this);
- }
- else
- {
- throw backenduno::BackendAccessException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this,uno::Any() );
- }
- }
- return true;
-}
-
-//------------------------------------------------------------------------------
-
-// XBackendEntities
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getOwnerEntity( )
- throw (uno::RuntimeException)
-{
- if (mBackend.is())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
-
- return xEntities->getOwnerEntity();
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this);
- }
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getAdminEntity( )
- throw (uno::RuntimeException)
-{
- if (mBackend.is())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->getAdminEntity();
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this);
- }
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->supportsEntity(aEntity);
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->isEqualEntity(aEntity,aOtherEntity);
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XSchema> SAL_CALL
- SingleBackendAdapter::getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return mBackend->getComponentSchema(aComponent) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SingleBackendAdapter::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return listLayers(aComponent, this->getOwnerEntity()) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SingleBackendAdapter::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return getUpdateHandler(aComponent, this->getOwnerEntity()) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SingleBackendAdapter::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XMultiLayerStratum > xBackend( mBackend, uno::UNO_REF_QUERY_THROW );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > retCode =
- xBackend->getLayers(xBackend->listLayerIds(aComponent, aEntity),
- rtl::OUString()) ;
-
- // There might be non-existent layers in the list if there's no
- // actual data associated to a given layer id. Hence we have to
- // compress the list.
- sal_Int32 maxLayer = 0 ;
-
- for (sal_Int32 i = 0 ; i < retCode.getLength() ; ++ i)
- {
- if (retCode [i].is())
- {
- if (i != maxLayer) { retCode [maxLayer] = retCode [i] ; }
- ++ maxLayer ;
- }
- }
- retCode.realloc(maxLayer) ;
- return retCode ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SingleBackendAdapter::getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XMultiLayerStratum > xBackend( mBackend, uno::UNO_REF_QUERY_THROW );
-
- uno::Sequence<uno::Any> arguments(1) ;
-
- arguments [0] <<= xBackend->getUpdatableLayer(
- xBackend->getUpdateLayerId(aComponent,
- aEntity)) ;
- uno::Reference< uno::XInterface > xHandler;
- try
- {
- const rtl::OUString kUpdateMerger(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.LayerUpdateMerger")) ;
-
- xHandler = mFactory->createInstanceWithArguments(kUpdateMerger, arguments);
- }
- catch (uno::RuntimeException & )
- {throw;}
- catch (uno::Exception & e)
- {
- const rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration SingleBackendAdapter: Cannot create UpdateMerger - error message: ")) ;
- throw uno::RuntimeException(sMessage.concat(e.Message),*this);
- }
-
- return uno::Reference<backenduno::XUpdateHandler>(xHandler, uno::UNO_REF_QUERY_THROW) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kBackendService = "com.sun.star.configuration.backend.Backend" ;
-static const sal_Char * const kAdapterService = "com.sun.star.configuration.backend.BackendAdapter" ;
-static const sal_Char * const kOnlineService = "com.sun.star.configuration.backend.OnlineBackend" ;
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.SingleBackendAdapter" ;
-
-static sal_Char const * const kServiceNames [] =
-{
- kOnlineService,
- kAdapterService,
- 0,
- kBackendService,
- 0
-} ;
-static const ServiceImplementationInfo kServiceInfo =
-{
- kImplementation,
- kServiceNames,
- kServiceNames + 3
-} ;
-
-const ServiceRegistrationInfo *getSingleBackendAdapterServiceInfo()
-{
- return getRegistrationInfo(&kServiceInfo) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
- instantiateSingleBackendAdapter(const uno::Reference< uno::XComponentContext >& xContext)
-{
- return *new SingleBackendAdapter(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL
- SingleBackendAdapter::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.backend
-
diff --git a/configmgr/source/backend/singlebackendadapter.hxx b/configmgr/source/backend/singlebackendadapter.hxx
deleted file mode 100644
index 391434ecf597..000000000000
--- a/configmgr/source/backend/singlebackendadapter.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
-#define CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/XSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase5.hxx>
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Class implementing the Backend service for remote access.
- It just transfers calls to a SingleBackend implementation.
- */
-class SingleBackendAdapter : public cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo > {
- public :
- /**
- Service constructor from a service factory.
-
- @param aFactory service factory
- */
- SingleBackendAdapter(
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~SingleBackendAdapter(void) ;
-
- // XInitialize
- virtual void SAL_CALL initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backenduno::XSchema>
- SAL_CALL getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw ( backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName(void)
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
- protected :
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
- /** Remote backend that the offline cache is handling */
- uno::Reference<backenduno::XSchemaSupplier> mBackend ;
- /* checks if object is in initialized and undisposed state */
- bool checkOkState();
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
diff --git a/configmgr/source/backend/updatedata.cxx b/configmgr/source/backend/updatedata.cxx
deleted file mode 100644
index 9e6484e09aab..000000000000
--- a/configmgr/source/backend/updatedata.cxx
+++ /dev/null
@@ -1,455 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updatedata.hxx"
-
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-#include <iterator>
-#include <algorithm>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-ElementUpdate::ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask)
-: NamedUpdate(_aName)
-, m_pParent(_pParent)
-, m_nFlags(_nFlags)
-, m_nFlagsMask(_nFlagsMask)
-{
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 ElementUpdate::updateFlags(sal_Int16 _nFlags) const
-{
- return (_nFlags & ~m_nFlagsMask) | (m_nFlags & m_nFlagsMask);
-}
-// -----------------------------------------------------------------------------
-
-NodeUpdate * ElementUpdate::asNodeUpdate(bool )
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-PropertyUpdate * ElementUpdate::asPropertyUpdate()
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeUpdate::NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op)
-: ElementUpdate(_pParent,_aName,_nFlags, _nFlagsMask)
-, m_aNodes()
-, m_aProperties()
-, m_aRemovedElements()
-, m_op(_op)
-{
-}
-// -----------------------------------------------------------------------------
-
-NodeUpdate * NodeUpdate::asNodeUpdate(bool _bMerged)
-{
- return (!_bMerged || m_op == modify
- || (updateFlags() & backenduno::NodeAttribute::FUSE) != 0)
- ? this : NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool NodeUpdate::addNodeUpdate(rtl::Reference<ElementUpdate> const & _aNode)
-{
- OSL_PRECOND( _aNode.is(), "ERROR: NodeUpdate: Trying to add NULL node.");
- OSL_PRECOND( _aNode->getParent() == this, "ERROR: NodeUpdate: Node being added has wrong parent.");
- OSL_ENSURE(m_aNodes.find(_aNode->getName()) == m_aNodes.end(),
- "NodeUpdate: Child node being added already exists in this node.");
-
- return m_aNodes.insert( ElementList::value_type(_aNode->getName(),_aNode) ).second;
-}
-// -----------------------------------------------------------------------------
-
-bool NodeUpdate::addPropertyUpdate(rtl::Reference<ElementUpdate> const & _aProp)
-{
- OSL_PRECOND( _aProp.is(), "ERROR: NodeUpdate: Trying to add NULL property.");
- OSL_PRECOND( _aProp->getParent() == this, "ERROR: NodeUpdate: Property being added has wrong parent.");
- OSL_ENSURE(m_aProperties.find(_aProp->getName()) == m_aProperties.end(),
- "NodeUpdate: Property being added already exists in this node.");
-
- return m_aProperties.insert( ElementList::value_type(_aProp->getName(),_aProp) ).second;
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::removeNodeByName(rtl::OUString const & _aName)
-{
- ElementList::iterator it = m_aNodes.find(_aName);
- OSL_ENSURE(it != m_aNodes.end(),
- "NodeUpdate: Child node being removed is not in this node.");
-
- if (it != m_aNodes.end())
- {
- m_aRemovedElements.insert(*it);
- m_aNodes.erase(it);
- }
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::removePropertyByName (rtl::OUString const & _aName)
-{
- ElementList::iterator it = m_aProperties.find(_aName);
- OSL_ENSURE(it != m_aProperties.end(),
- "NodeUpdate: Property being removed is not in this node.");
-
- if (it != m_aProperties.end())
- {
- m_aRemovedElements.insert(*it);
- m_aProperties.erase(it);
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<ElementUpdate> NodeUpdate::getNodeByName(rtl::OUString const & _aName) const
-{
- ElementList::const_iterator it = m_aNodes.find(_aName);
-
- return it != m_aNodes.end() ? it->second : rtl::Reference<ElementUpdate>();
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<ElementUpdate> NodeUpdate::getPropertyByName (rtl::OUString const & _aName) const
-{
- ElementList::const_iterator it = m_aProperties.find(_aName);
-
- return it != m_aProperties.end() ? it->second : rtl::Reference<ElementUpdate>();
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::writeChildrenToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- for (ElementList::const_iterator itP = beginProperties(); itP != endProperties(); ++itP)
- itP->second->writeToLayer(_pLayer);
-
- for (ElementList::const_iterator itN = beginNodes(); itN != endNodes(); ++itN)
- itN->second->writeToLayer(_pLayer);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeModification::NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlagsMask, _bReset ? reset : modify)
-{
-}
-// -----------------------------------------------------------------------------
-
-void NodeModification::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- if ( this->getOperation() == reset && // if we have an empty
- !this->changedFlags() && // 'reset' node, that means
- !this->hasChildren() ) // we need to write
- return; // nothing
-
- _pLayer->overrideNode( this->getName(), this->updateFlags(), false );
- this->writeChildrenToLayer(_pLayer);
- _pLayer->endNode();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace)
-, m_aTemplateName()
-, m_aTemplateComponent()
-{
-}
-// -----------------------------------------------------------------------------
-
-NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace)
-, m_aTemplateName(_aTemplateName)
-, m_aTemplateComponent(_aTemplateComponent)
-{
-}
-// -----------------------------------------------------------------------------
-
-bool NodeReplace::hasTemplate() const
-{
- return m_aTemplateName.getLength() != 0;
-}
-// -----------------------------------------------------------------------------
-
-void NodeReplace::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- if (this->hasTemplate())
- {
- backenduno::TemplateIdentifier aTemplate( m_aTemplateName, m_aTemplateComponent );
- _pLayer->addOrReplaceNodeFromTemplate( this->getName(), aTemplate, this->updateFlags() );
- }
- else
- _pLayer->addOrReplaceNode( this->getName(), this->updateFlags() );
-
- this->writeChildrenToLayer(_pLayer);
- _pLayer->endNode();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeDrop::NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName)
-: ElementUpdate(_pParent,_aName,0,0)
-{
-}
-// -----------------------------------------------------------------------------
-
-void NodeDrop::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- _pLayer->dropNode(this->getName());
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-PropertyUpdate::PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlagsMask)
-, m_aValues()
-, m_aType(_aType)
-{}
-// -----------------------------------------------------------------------------
-
-PropertyUpdate * PropertyUpdate::asPropertyUpdate()
-{
- return this;
-}
-// -----------------------------------------------------------------------------
-
-static uno::Any makeResetMarker()
-{
- uno::Reference< backenduno::XLayerHandler > xNull;
- return uno::makeAny(xNull);
-}
-// -----------------------------------------------------------------------------
-
-inline bool PropertyUpdate::isResetMarker(uno::Any const & _aValue)
-{
- OSL_ENSURE( _aValue.getValueTypeClass() != uno::TypeClass_INTERFACE ||
- _aValue == makeResetMarker() && _aValue.getValueType() == makeResetMarker().getValueType(),
- "Unexpected any: Interface reference will be taken as reset marker");
-
- return _aValue.getValueTypeClass() == uno::TypeClass_INTERFACE;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any const & PropertyUpdate::getResetMarker()
-{
- static uno::Any const aMarker = makeResetMarker();
-
- OSL_ASSERT( isResetMarker(aMarker) );
-
- return aMarker;
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate)
-{
- OSL_PRECOND( !isResetMarker(_aValueUpdate), "PropertyUpdate: ERROR: Trying to set a reset marker as regular value" );
-
- OSL_ENSURE(m_aValues.find(_aLocale) == m_aValues.end(),
- "PropertyUpdate: Locale being added already has a value in this property.");
-
- if (_aValueUpdate.hasValue())
- {
- if (m_aType.getTypeClass() == uno::TypeClass_ANY)
- m_aType = _aValueUpdate.getValueType();
-
- else
- OSL_ENSURE( m_aType == _aValueUpdate.getValueType() ||
- m_aType == uno::Type(),
- "ValueType mismatch in PropertyUpdate");
- }
- return m_aValues.insert( ValueList::value_type(_aLocale,_aValueUpdate) ).second;
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::resetValueFor(rtl::OUString const & _aLocale)
-{
- OSL_ENSURE(m_aValues.find(_aLocale) == m_aValues.end(),
- "PropertyUpdate: Locale being reset already has a value in this property.");
-
- return m_aValues.insert( ValueList::value_type(_aLocale,getResetMarker()) ).second;
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::removeValueFor(rtl::OUString const & _aLocale)
-{
- OSL_ENSURE(m_aValues.find(_aLocale) != m_aValues.end(),
- "PropertyUpdate: Locale being removed is not in this node.");
-
- m_aValues.erase(_aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::finishValue()
-{
- if (m_aType.getTypeClass() == uno::TypeClass_ANY)
- m_aType = uno::Type();
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasValueFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end() && ! isResetMarker(it->second);
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasResetFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end() && isResetMarker(it->second);
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasChangeFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end();
-}
-// -----------------------------------------------------------------------------
-
-uno::Any PropertyUpdate::getValueFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- OSL_ENSURE(it != m_aValues.end() && !isResetMarker(it->second),
- "PropertyUpdate: Should not call getValue() unless hasValue() returns true" );
-
- return it != m_aValues.end() && !isResetMarker(it->second) ? it->second : uno::Any();
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue)
-{
- OSL_ASSERT(_pLayer);
- if ( !isResetMarker(_aValue) )
- _pLayer->setPropertyValue(_aValue);
-
- // else - to reset - do nothing
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale)
-{
- OSL_ASSERT(_pLayer);
- if (_aLocale == this->primarySlot())
- this->writeValueToLayer(_pLayer,_aValue);
-
- else if ( !isResetMarker(_aValue) )
- _pLayer->setPropertyValueForLocale(_aValue,_aLocale);
-
- // else - to reset - do nothing
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValuesToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- for (ValueList::const_iterator itV = beginValues(); itV != endValues(); ++itV)
- this->writeValueToLayerFor(_pLayer, itV->second, itV->first);
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- _pLayer->overrideProperty( this->getName(), this->updateFlags(), this->m_aType, false );
- this->writeValuesToLayer(_pLayer);
- _pLayer->endProperty();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-
-PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlags)
-, m_aValueType(_aType)
-, m_aValue()
-{
-
-}
-// -----------------------------------------------------------------------------
-
-PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlags)
-, m_aValueType(_aValue.getValueType())
-, m_aValue(_aValue)
-{
-}
-// -----------------------------------------------------------------------------
-
-void PropertyAdd::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- if (this->hasValue())
- _pLayer->addPropertyWithValue(this->getName(),this->updateFlags(),this->getValue());
- else
- _pLayer->addProperty(this->getName(),this->updateFlags(),this->getValueType());
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-PropertyReset::PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName)
-: ElementUpdate(_pParent,_aName,0,0)
-{
-}
-// -----------------------------------------------------------------------------
-
-void PropertyReset::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- (void) _pLayer; // avoid warning about unused parameter
- OSL_ASSERT(_pLayer);
- // skip - nothing to write
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/updatedata.hxx b/configmgr/source/backend/updatedata.hxx
deleted file mode 100644
index c38ee0f857a8..000000000000
--- a/configmgr/source/backend/updatedata.hxx
+++ /dev/null
@@ -1,266 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDATA_HXX
-#define CONFIGMGR_BACKEND_UPDATEDATA_HXX
-
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class ElementUpdate;
- class NodeUpdate;
- class NodeModification;
- class NodeReplace;
- class NodeDrop;
- class PropertyUpdate;
- class PropertyAdd;
- class PropertyReset;
-
-// -----------------------------------------------------------------------------
-
- class NamedUpdate : public salhelper::SimpleReferenceObject
- {
- rtl::OUString const m_aName;
-
- protected:
- explicit
- NamedUpdate(rtl::OUString const & _aName)
- : m_aName(_aName)
- {}
-
- ~NamedUpdate() {};
-
- public:
- rtl::OUString const & getName() const { return m_aName; }
- };
-// -----------------------------------------------------------------------------
- class ElementUpdate : public NamedUpdate
- {
- NodeUpdate * m_pParent;
- sal_Int16 m_nFlags;
- sal_Int16 m_nFlagsMask;
- protected:
- ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask);
-
- public:
- virtual NodeUpdate * asNodeUpdate(bool _bMerged = false);
- virtual PropertyUpdate * asPropertyUpdate();
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer) = 0;
-
- public:
- NodeUpdate * getParent() const { return m_pParent; }
-
- sal_Int16 changedFlags() const { return m_nFlagsMask; }
- sal_Int16 updateFlags(sal_Int16 _nFlags = 0) const;
-
- };
-// -----------------------------------------------------------------------------
-
- class NodeUpdate : public ElementUpdate
- {
- typedef std::map< rtl::OUString, rtl::Reference<ElementUpdate> > ElementList;
- public:
- enum Op { modify, reset, replace };
-
- protected:
- NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op);
-
- virtual NodeUpdate * asNodeUpdate(bool _bMerged);
-
- public:
- bool addNodeUpdate (rtl::Reference<ElementUpdate> const & _aNode);
- bool addPropertyUpdate (rtl::Reference<ElementUpdate> const & _aProp);
- void removeNodeByName (rtl::OUString const & _aName);
- void removePropertyByName (rtl::OUString const & _aName);
-
- Op getOperation() const { return m_op; }
-
- rtl::Reference<ElementUpdate> getNodeByName (rtl::OUString const & _aName) const;
- rtl::Reference<ElementUpdate> getPropertyByName (rtl::OUString const & _aName) const;
-
- ElementList::const_iterator beginNodes() const { return m_aNodes.begin(); }
- ElementList::const_iterator endNodes() const { return m_aNodes.end(); };
- ElementList::const_iterator beginProperties() const { return m_aProperties.begin(); };
- ElementList::const_iterator endProperties() const { return m_aProperties.end(); };
-
- bool hasChildren() const { return !m_aNodes.empty() || !m_aProperties.empty(); }
-
- void writeChildrenToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- ElementList m_aNodes;
- ElementList m_aProperties;
- ElementList m_aRemovedElements;
- Op m_op;
- };
-// -----------------------------------------------------------------------------
-
- class NodeModification : public NodeUpdate
- {
- public:
- NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset);
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class NodeReplace : public NodeUpdate
- {
- public:
- NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags);
- NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent);
-
- bool hasTemplate() const;
- rtl::OUString getTemplateName() const { return m_aTemplateName; }
- rtl::OUString getTemplateComponent() const { return m_aTemplateComponent; }
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- rtl::OUString m_aTemplateName;
- rtl::OUString m_aTemplateComponent;
- };
-// -----------------------------------------------------------------------------
-
- class NodeDrop : public ElementUpdate
- {
- public:
- NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName);
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class PropertyUpdate : public ElementUpdate
- {
- typedef std::map< rtl::OUString, uno::Any > ValueList;
-
- ValueList m_aValues;
- uno::Type m_aType;
- public:
- PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType);
-
- bool setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate);
- bool resetValueFor(rtl::OUString const & _aLocale);
- void removeValueFor(rtl::OUString const & _aLocale);
-
- bool setValue(uno::Any const & _aValueUpdate) { return setValueFor(primarySlot(), _aValueUpdate); }
- bool resetValue() { return resetValueFor(primarySlot()); }
- void removeValue() { removeValueFor(primarySlot()); }
-
- void finishValue();
-
- uno::Type const & getValueType() const { return m_aType; }
-
- bool hasValueFor(rtl::OUString const & _aLocale) const;
- bool hasValue() const { return hasValueFor(primarySlot()); }
-
- bool hasResetFor(rtl::OUString const & _aLocale) const;
- bool hasReset() const { return hasResetFor(primarySlot()); }
-
- bool hasChangeFor(rtl::OUString const & _aLocale) const;
- bool hasChange() const { return hasChangeFor(primarySlot()); }
-
- uno::Any getValueFor(rtl::OUString const & _aLocale) const;
- uno::Any getValue() const { return getValueFor(primarySlot()); }
-
- ValueList::const_iterator beginValues() const { return m_aValues.begin(); }
- ValueList::const_iterator endValues() const { return m_aValues.end(); }
-
- void writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale);
- void writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue);
- void writeValuesToLayer(backenduno::XLayerHandler * _pLayer);
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- rtl::OUString primarySlot() const { return rtl::OUString(); }
-
- static uno::Any const & getResetMarker();
- static inline bool isResetMarker(uno::Any const & _aValue);
-
- virtual PropertyUpdate * asPropertyUpdate();
- };
-// -----------------------------------------------------------------------------
-
- class PropertyAdd : public ElementUpdate
- {
- uno::Type m_aValueType;
- uno::Any m_aValue;
- public:
- PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType);
- PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue);
-
- bool hasValue() const { return !! m_aValue.hasValue(); }
- uno::Any const & getValue() const { return m_aValue; }
- uno::Type const & getValueType() const { return m_aValueType; }
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class PropertyReset : public ElementUpdate
- {
- public:
- PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName);
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/updatedispatch.cxx b/configmgr/source/backend/updatedispatch.cxx
deleted file mode 100644
index 5ff8057d9889..000000000000
--- a/configmgr/source/backend/updatedispatch.cxx
+++ /dev/null
@@ -1,496 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treefragment.hxx"
-#include "updatedispatch.hxx"
-#include "configpath.hxx"
-#include "node.hxx"
-#include "matchlocale.hxx"
-
-#include <com/sun/star/configuration/backend/XUpdateHandler.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-UpdateDispatcher::UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale)
-: m_pContextPath(NULL)
-, m_xUpdateHandler(_xUpdateHandler)
-, m_aLocale(_aLocale)
-, m_aElementName()
-, m_bInValueSet(false)
-, m_bInLocalizedValues(false)
-{
-}
-// -----------------------------------------------------------------------------
-
-UpdateDispatcher::~UpdateDispatcher()
-{
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::dispatchUpdate(configuration::AbsolutePath const & _aRootPath, SubtreeChange const& _anUpdate)
-{
- if (!m_xUpdateHandler.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("ERROR: Cannot dispatch update - no handler found") );
- throw uno::RuntimeException(sMsg,NULL);
- }
-
- OSL_PRECOND( !_aRootPath.isRoot(), "Cannot apply update, where root is outside a component" );
-
- OSL_PRECOND( m_pContextPath == NULL, "Update Dispatcher already has a context path" );
- if (!_aRootPath.getParentPath().isRoot())
- {
- OSL_ENSURE(false,"Obsolete functionality used: starting update with non-empty context");
- m_pContextPath = &_aRootPath;
- }
-
- this->startUpdate();
- this->applyToChange(_anUpdate);
- this->endUpdate();
-
- m_pContextPath = NULL;
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::startUpdate()
-{
- m_xUpdateHandler->startUpdate();
- m_bInValueSet = false;
- m_bInLocalizedValues = false;
- m_aElementName = rtl::OUString();
-
- if (m_pContextPath)
- {
- std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end();
-
- OSL_ASSERT(it != stop);
- --stop;
-
- for ( ; it != stop; ++it)
- {
- m_xUpdateHandler->modifyNode(it->getName(),0,0,false);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::endUpdate()
-{
- if (m_pContextPath)
- {
- std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end();
-
- OSL_ASSERT(it != stop);
- --stop;
-
- for ( ; it != stop; ++it)
- {
- m_xUpdateHandler->endNode();
- }
- }
- m_xUpdateHandler->endUpdate();
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(ValueChange const& aValueNode)
-{
- // special case: doing members of a localized property (as set)
- if (m_bInLocalizedValues)
- {
- rtl::OUString aLocale = aValueNode.getNodeName();
-
- if (aLocale.getLength())
- {
- if ( aValueNode.isToDefault() )
- m_xUpdateHandler->resetPropertyValueForLocale( aLocale );
- else
- m_xUpdateHandler->setPropertyValueForLocale( aValueNode.getNewValue(), aLocale );
- }
- else
- {
- if ( aValueNode.isToDefault() )
- m_xUpdateHandler->resetPropertyValue( );
- else
- m_xUpdateHandler->setPropertyValue( aValueNode.getNewValue() );
- }
- return;
- }
-
- // normal case: updating a single property
- switch (aValueNode.getMode())
- {
- case ValueChange::wasDefault:
- if (aValueNode.isReplacedValue())
- {
-
- OSL_ENSURE(m_bInValueSet, "UpdateDispatcher: Cannot add/replace a value in a nonextensible node");
- OSL_ENSURE(!aValueNode.isLocalizedValue(), "UpdateDispatcher: Cannot add a localized value in a layer");
-
- sal_Int16 nAttr = getUpdateAttributes(aValueNode.getAttributes(),true);
-
- if (aValueNode.getNewValue().hasValue())
- {
- m_xUpdateHandler->addOrReplacePropertyWithValue( aValueNode.getNodeName(),
- nAttr,
- aValueNode.getNewValue());
- }
- else
- {
- m_xUpdateHandler->addOrReplaceProperty( aValueNode.getNodeName(),
- nAttr,
- aValueNode.getValueType());
- }
-
- break;
- }
- // else fall thru to changeValue case
-
- case ValueChange::changeValue:
- {
- sal_Int16 nAttr = getUpdateAttributes(aValueNode.getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(aValueNode.getAttributes());
-
- m_xUpdateHandler->modifyProperty( aValueNode.getNodeName(),
- nAttr, nAttrMask,
- aValueNode.getValueType() );
-
- if (aValueNode.isLocalizedValue() && m_aLocale.getLength())
- {
- m_xUpdateHandler->setPropertyValueForLocale( aValueNode.getNewValue(), m_aLocale );
- }
- else
- {
- m_xUpdateHandler->setPropertyValue( aValueNode.getNewValue() );
- }
-
- m_xUpdateHandler->endProperty();
- }
- break;
-
- case ValueChange::setToDefault:
- m_xUpdateHandler->resetProperty( aValueNode.getNodeName() );
- break;
-
- case ValueChange::changeDefault:
- OSL_ENSURE(false, "Illegal mode in ValueChange");
- break;
-
- default:
- OSL_ENSURE(false, "Illegal mode in ValueChange");
- break;
- };
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(AddNode const& aAddNode)
-{
- rtl::Reference< data::TreeSegment > aAddedTree = aAddNode.getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "AddNode has no new data -> cannot add anything");
-
- OSL_ENSURE( ((m_bInValueSet||m_bInLocalizedValues) == aAddedTree->fragment->nodes[0].isValue()),
- "Found added subtree in value set (extensible group)\n" );
-
- this->visitTree(aAddedTree->fragment);
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(RemoveNode const& aRemoveNode)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: Removing values for a specific locale is currently not supported");
-
- rtl::Reference< data::TreeSegment > aRemovedTree = aRemoveNode.getRemovedTree();
-
- OSL_ENSURE( !aRemovedTree.is() ||
- ((m_bInValueSet||m_bInLocalizedValues) == aRemovedTree->fragment->nodes[0].isValue()),
- "Found removed subtree in value set (extensible group)\n" );
-
- if (m_bInLocalizedValues)
- OSL_TRACE("configmgr: UpdateDispatcher - Removing value for locale ignored");
-
- else if (m_bInValueSet)
- m_xUpdateHandler->removeProperty( aRemoveNode.getNodeName() );
-
- else
- m_xUpdateHandler->removeNode( aRemoveNode.getNodeName() );
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(SubtreeChange const& aSubtree)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete subtree");
- OSL_ENSURE( !m_bInValueSet, "UpdateDispatcher: A dynamic property cannot be a complete subtree");
-
- sal_Int16 nAttr = getUpdateAttributes(aSubtree.getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(aSubtree.getAttributes());
-
- if (isLocalizedValueSet(aSubtree))
- {
- m_xUpdateHandler->modifyProperty( aSubtree.getNodeName(),
- nAttr, nAttrMask,
- uno::Type() );
-
- m_bInLocalizedValues = true;
- this->applyToChildren(aSubtree);
- m_bInLocalizedValues = false;
-
- m_xUpdateHandler->endProperty();
- }
-
- else
- {
- m_xUpdateHandler->modifyNode( aSubtree.getNodeName(),
- nAttr, nAttrMask,
- aSubtree.isToDefault() );
-
- m_bInValueSet = isValueSet(aSubtree);
- this->applyToChildren(aSubtree);
- m_bInValueSet = false;
-
- m_xUpdateHandler->endNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::ValueNode * node)
-{
- rtl::OUString aName;
-
- // special case: doing members of a localized property (as set)
- if (m_bInLocalizedValues)
- {
- // the node name is the locale
- rtl::OUString aLocale;
- OSL_VERIFY(testReplacedAndGetName(sharable::node(node), aLocale)); // "Adding a localized subvalue but not as root of element tree"
-
- if (aLocale.getLength() && ! localehelper::isDefaultLanguage(aLocale))
- {
- m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), aLocale);
- }
- else
- {
- m_xUpdateHandler->setPropertyValue(node->getValue());
- }
- }
- else if (testReplacedAndGetName(sharable::node(node), aName) && sharable::node(node)->getAttributes().isRemovable()) // we must be inside a set of values
- {
-
- OSL_ENSURE(!node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer .");
-
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- if (!node->isNull())
- {
- m_xUpdateHandler->addOrReplacePropertyWithValue( aName,
- nAttr,
- node->getValue());
- }
- else
- {
- m_xUpdateHandler->addOrReplaceProperty( aName,
- nAttr,
- node->getValueType());
- }
- }
- else // normal case: updating a single property //Inserting set
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, node->getValueType() );
-
- if (node->info.isLocalized() && m_aLocale.getLength())
- {
- m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), m_aLocale);
- }
- else
- {
- m_xUpdateHandler->setPropertyValue(node->getValue());
- }
-
- m_xUpdateHandler->endProperty();
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::GroupNode * node)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete group");
-
- rtl::OUString aName;
-
- if ( testReplacedAndGetName(sharable::node(node), aName) )
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- m_xUpdateHandler->addOrReplaceNode( aName, nAttr );
-
- this->visitChildren(node);
-
- m_xUpdateHandler->endNode();
- }
- else
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false );
-
- this->visitChildren(node);
-
- m_xUpdateHandler->endNode();
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::SetNode * node)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete set");
-
- rtl::OUString aName;
-
- if ( testReplacedAndGetName(sharable::node(node), aName) )
- {
- OSL_ENSURE( !node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer." );
-
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- m_xUpdateHandler->addOrReplaceNode( aName, nAttr );
-
- this->visitElements(node);
-
- m_xUpdateHandler->endNode();
- }
- else
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- if (node->info.isLocalized())
- {
- m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, uno::Type() );
-
- m_bInLocalizedValues = true;
- this->visitElements(node);
- m_bInLocalizedValues = false;
-
- m_xUpdateHandler->endProperty();
- }
-
- else
- {
- m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false );
-
- this->visitElements(node);
-
- m_xUpdateHandler->endNode();
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName)
-{
- if (m_aElementName.getLength())
- {
- OSL_ENSURE( node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found orphaned 'element' name for inner node");
- _aName = m_aElementName;
- m_aElementName = rtl::OUString();
- return true;
- }
- else
- {
- OSL_ENSURE(!node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found no 'element' name for fragment root node");
- _aName = node->getName();
- return false;
- }
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::TreeFragment * tree)
-{
- m_aElementName = tree->getName();
- bool done = SetVisitor::handle(tree); // dispatch to root node
- m_aElementName = rtl::OUString(); // clear - just to be safe
- return done;
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 UpdateDispatcher::getUpdateAttributes(node::Attributes const & _aAttributes, bool bAdded)
-{
- namespace NodeAttribute = backenduno::NodeAttribute;
-
- // no support for post-creation attribute changes yet
- if (!bAdded)
- {
- OSL_ENSURE( getUpdateAttributeMask(_aAttributes) == 0,
- "Incomplete support for attribute changes" );
- return 0;
- }
-
- sal_Int16 nResult = 0;
-
- if (_aAttributes.isReadonly())
- nResult = NodeAttribute::READONLY;
-
- if (_aAttributes.isFinalized())
- nResult |= NodeAttribute::FINALIZED;
-
- if (!_aAttributes.isNullable())
- nResult |= NodeAttribute::MANDATORY;
-
- return nResult;
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 UpdateDispatcher::getUpdateAttributeMask(node::Attributes const & /*_aAttributes*/)
-{
- // no support for post-creation attribute changes yet
- return 0;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/updatedispatch.hxx b/configmgr/source/backend/updatedispatch.hxx
deleted file mode 100644
index 139c3aee02fc..000000000000
--- a/configmgr/source/backend/updatedispatch.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDISPATCH_HXX
-#define CONFIGMGR_BACKEND_UPDATEDISPATCH_HXX
-
-#include "change.hxx"
-#include "nodevisitor.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XUpdateHandler;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace configuration
- {
- class AbsolutePath;
- }
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class UpdateDispatcher: private boost::noncopyable, private ChangeTreeAction, private data::SetVisitor
- {
- public:
- UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale);
- ~UpdateDispatcher();
-
- void dispatchUpdate(configuration::AbsolutePath const & _aRootPath, SubtreeChange const& _anUpdate);
-
- protected:
- using data::NodeVisitor::handle;
-
- private:
- void startUpdate();
- void endUpdate();
-
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree) ;
-
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
- virtual bool handle(sharable::TreeFragment * tree);
- private:
- sal_Int16 getUpdateAttributes(node::Attributes const & _aAttributes, bool bAdded);
- sal_Int16 getUpdateAttributeMask(node::Attributes const & _aAttributes);
-
- bool testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName);
- private:
- configuration::AbsolutePath const * m_pContextPath;
- uno::Reference< backenduno::XUpdateHandler > m_xUpdateHandler;
- rtl::OUString m_aLocale;
- rtl::OUString m_aElementName;
- bool m_bInValueSet;
- bool m_bInLocalizedValues;
- };
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/updatesvc.cxx b/configmgr/source/backend/updatesvc.cxx
deleted file mode 100644
index dca013e5c1b9..000000000000
--- a/configmgr/source/backend/updatesvc.cxx
+++ /dev/null
@@ -1,278 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updatesvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "emptylayer.hxx"
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aUpdateMergerServices[] =
-{
- "com.sun.star.configuration.backend.LayerUpdateMerger",
- 0
-};
-const ServiceImplementationInfo aUpdateMergerSI =
-{
- "com.sun.star.comp.configuration.backend.LayerUpdateMerger",
- aUpdateMergerServices,
- 0
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getUpdateMergerServiceInfo()
-{ return getRegistrationInfo(& aUpdateMergerSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper UpdateService::getServiceInfo()
-{
- return & aUpdateMergerSI;
-}
-// -----------------------------------------------------------------------------
-
-
-UpdateService::UpdateService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(),uno::UNO_QUERY)
-, m_aSourceMode(merge)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Context has no service manager (or missing interface)"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-
-void SAL_CALL
- UpdateService::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Update Merger"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
-
- for (sal_Int16 i = 0; i < nCount; ++i)
- {
- uno::Reference< backenduno::XUpdatableLayer > xUpdLayer;
- if (aArguments[i] >>= xUpdLayer)
- {
- m_xSourceLayer = xUpdLayer.get();
- m_xLayerWriter.clear();
-
- OSL_ASSERT( uno::Reference< backenduno::XUpdatableLayer >::query(m_xSourceLayer).is() || !xUpdLayer.is() );
-
- continue;
- }
-
- if (aArguments[i] >>= m_xSourceLayer)
- continue;
-
- if (aArguments[i] >>= m_xLayerWriter)
- continue;
-
- beans::NamedValue aExtraArg;
- if (aArguments[i] >>= aExtraArg)
- {
- OSL_VERIFY( setImplementationProperty(aExtraArg.Name, aExtraArg.Value) );
-
- continue;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Update Merger"
- "- XLayer, XLayerHandler or XUpdatableLayer expected"));
- throw lang::IllegalArgumentException(sMessage,*this,i);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-sal_Bool UpdateService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite")))
- {
- sal_Bool bOverwrite = sal_False;
- if (aValue >>= bOverwrite)
- {
- if (!bOverwrite)
- m_aSourceMode = protect;
-
- else if (protect == m_aSourceMode)
- m_aSourceMode = merge;
-
- return true;
- }
- }
-
- else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Truncate")))
- {
- sal_Bool bTruncate = sal_False;
- if (aValue >>= bTruncate)
- {
- if (!bTruncate)
- m_aSourceMode = merge;
-
- else if (merge == m_aSourceMode)
- m_aSourceMode = truncate;
-
- return true;
- }
- }
-
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateService::validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::IllegalAccessException) )
-{
- switch (m_aSourceMode)
- {
- case merge: // TODO: check for readonly layer
- return true;
-
- case protect: if (!checkEmptyLayer(m_xSourceLayer))
- raiseIllegalAccessException("UpdateService: Layer already exists");
- // else fall through
-
- case truncate: return false;
-
- default: OSL_ASSERT(!"not reached");
- return true;
- }
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayer > UpdateService::getSourceLayer() SAL_THROW( (lang::IllegalAccessException) )
-{
- if ( validateSourceLayerAndCheckNotEmpty() )
- return m_xSourceLayer;
- else
- return createEmptyLayer();
-}
-// -----------------------------------------------------------------------------
-
-void UpdateService::raiseIllegalAccessException(sal_Char const * pMsg)
- SAL_THROW( (lang::IllegalAccessException) )
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw lang::IllegalAccessException(sMsg,*this);
-}
-// -----------------------------------------------------------------------------
-
-void UpdateService::writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer)
-{
- OSL_ENSURE( _xLayer.is(), "UpdateService: Trying to write NULL XLayer");
-
- if (!_xLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger - Internal error: trying to write a NULL Layer"));
- throw uno::RuntimeException(sMessage,*this);
- }
-
- // use our layer writer, if we have one
- if ( m_xLayerWriter.is() )
- {
- _xLayer->readData( m_xLayerWriter );
- return;
- }
-
- // look for an updatable layer otherwise
- uno::Reference< backenduno::XUpdatableLayer > xUpdLayer(m_xSourceLayer, uno::UNO_QUERY);
- if (xUpdLayer.is())
- {
- xUpdLayer->replaceWith( _xLayer );
- return;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger: Cannot write merge results - no recipient available."));
- throw uno::RuntimeException(sMessage,*this);
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-::rtl::OUString SAL_CALL
- UpdateService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- UpdateService::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- UpdateService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/updatesvc.hxx b/configmgr/source/backend/updatesvc.hxx
deleted file mode 100644
index a44e39df6b17..000000000000
--- a/configmgr/source/backend/updatesvc.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATESVC_HXX
-#define CONFIGMGR_BACKEND_UPDATESVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/backend/XUpdateHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
- class XLayer;
-} } } } }
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class UpdateService : public ::cppu::WeakImplHelper3<
- lang::XInitialization,
- lang::XServiceInfo,
- backenduno::XUpdateHandler
- >
- {
- public:
- explicit
- UpdateService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- void checkSourceLayer() SAL_THROW( (lang::IllegalAccessException) )
- { validateSourceLayerAndCheckNotEmpty(); }
-
- uno::Reference< backenduno::XLayer > getSourceLayer() SAL_THROW( (lang::IllegalAccessException) );
-
- void writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer);
-
- virtual sal_Bool setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue);
-
- void raiseIllegalAccessException(sal_Char const * pMsg)
- SAL_THROW( (lang::IllegalAccessException) );
-
- private:
- bool validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::IllegalAccessException) );
-
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
- uno::Reference< backenduno::XLayer > m_xSourceLayer;
- uno::Reference< backenduno::XLayerHandler > m_xLayerWriter;
- enum { merge, truncate, protect } m_aSourceMode;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backendhelper/backendlayerhelper.cxx b/configmgr/source/backendhelper/backendlayerhelper.cxx
deleted file mode 100644
index 455fa4b48bb7..000000000000
--- a/configmgr/source/backendhelper/backendlayerhelper.cxx
+++ /dev/null
@@ -1,361 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "backendlayerhelper.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-
-namespace configmgr { namespace backendhelper {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-uno::Type toType(const ::rtl::OUString& _rType)
- {
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean")))
- aRet = ::getBooleanCppuType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short")))
- aRet = ::getCppuType(static_cast<sal_Int16 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int")))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer")))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long")))
- aRet = ::getCppuType(static_cast<sal_Int64 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double")))
- aRet = ::getCppuType(static_cast<double const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string")))
- aRet = ::getCppuType(static_cast<rtl::OUString const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("any")))
- aRet = ::getCppuType(static_cast<uno::Any const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
-
-//------------------------------------------------------------------------------
-
-IOONode::IOONode(const rtl::OUString& sName):
- mName(sName)
-{
-}
-
-//------------------------------------------------------------------------------
-OOProperty::OOProperty(
- const rtl::OUString& sName,const rtl::OUString& sPropType,
- const uno::Any& aPropValue,sal_Bool bProtected)
- :IOONode(sName), mPropType(sPropType), mPropValue(aPropValue),
- mbProtected(bProtected)
-{
-}
-//------------------------------------------------------------------------------
-OONode::OONode(const rtl::OUString& sName)
- :IOONode(sName)
-{
-}
-
-OONode::OONode()
- :IOONode(rtl::OUString())
-{
-}
-IOONode* OONode::addChild(IOONode* aChild)
-{
- mChildList.push_back(aChild);
- return aChild;
-}
-const std::vector<IOONode*>& OONode::getChildren()
-{
- return mChildList;
-}
-
-IOONode* OONode::getChild(const rtl::OUString& aChildName)
-{
- for (sal_uInt32 i=0; i< mChildList.size();++i)
- {
- if (mChildList[i]->getName() == aChildName)
- return mChildList[i];
- }
- return NULL;
-}
-OONode::~OONode()
-{
- for (sal_uInt32 i=0; i< mChildList.size();++i)
- {
- delete mChildList[i];
- }
- mChildList.clear();
-}
-//------------------------------------------------------------------------------
- sal_Bool addChildrenToNodeTree(
- OONode * aNode,
- sal_Int32 nNextToken,
- const backend::PropertyInfo& aPropInfo,
- const uno::Reference<uno::XInterface>& xContext)
-{
- do
- {
- rtl::OUString aName = aPropInfo.Name.getToken(0, '/',nNextToken);
- if (aName.getLength() == 0)
- {
- throw backend::MalformedDataException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed OpenOffice Key specified")),
- xContext, uno::Any()) ;
- }
- //Check if Property -> nNextToken == -1
- if(nNextToken != -1)
- {
- //check if child already exists
- IOONode* aChildNode= aNode->getChild(aName);
- if (aChildNode == NULL)
- {
- aChildNode = new OONode(aName);
- if (aChildNode != 0)
- {
- aNode->addChild( aChildNode);
- }
- }
-
- sal_Bool bFinished =addChildrenToNodeTree(
- aChildNode->getComposite(),
- nNextToken,
- aPropInfo,
- xContext);
- //Check that if you have finished parsing string therefore no
- //more children
- if (bFinished)
- break;
- }
- else
- {
- //Add Property
- IOONode* aProperty = new OOProperty(aName,
- aPropInfo.Type,
- aPropInfo.Value,
- aPropInfo.Protected);
- if (aProperty != 0)
- {
- aNode->addChild( aProperty);
- }
- //Return finished is true when you are finished parsing the string
- if( nNextToken == -1)
- {
- return sal_True;
- }
- }
- }
- while (nNextToken >= 0 ) ;
- return sal_True;
-}
-//------------------------------------------------------------------------------
-void processChildren(
- std::vector<IOONode*> aChildList,
- const uno::Reference<backend::XLayerHandler>& xHandler)
-{
- for(sal_uInt32 i=0; i <aChildList.size(); ++i)
- {
- OONode * aTestOONode = aChildList[i]->getComposite();
- if (aTestOONode)
- {
- xHandler->overrideNode(aTestOONode->getName(),0,false);
- processChildren(aTestOONode->getChildren(),xHandler);
- xHandler->endNode();
- }
- else
- {
- OOProperty* aProperty = aChildList[i]->asOOProperty();
- sal_Int16 aAttributes = aProperty->isProtected() ? 256:0;
- //Convert Type either simple or list
- uno::Type aType = toType( aProperty->getType());
-
- xHandler->overrideProperty(aProperty->getName(),
- aAttributes,
- aType,
- false);
-
- xHandler->setPropertyValue(aProperty->getValue());
- xHandler->endProperty();
- }
-
- }
-}
-//------------------------------------------------------------------------------
-void buildNodeTree(
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos,
- const uno::Reference<uno::XInterface>& xContext,
- OONode& aNodeTree)
-{
- sal_Int32 nNextToken =0;
- rtl::OUString aName = aPropertyInfos[0].Name.getToken(0, '/',nNextToken);
- if((nNextToken ==-1)||(aName.getLength()==0))
- {
- throw backend::MalformedDataException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed OpenOffice Key specified")),
- xContext, uno::Any()) ;
-
- }
- aNodeTree.setName(aName);
- sal_Int32 size = aPropertyInfos.getLength();
- for (sal_Int32 i =0; i < size; ++i)
- {
- addChildrenToNodeTree(&aNodeTree, nNextToken,aPropertyInfos[i],xContext);
- }
-
-}
-//------------------------------------------------------------------------------
-BackendLayerHelper::BackendLayerHelper(
- const uno::Reference<uno::XComponentContext>& /*xContext*/)
- :cppu::WeakComponentImplHelper2<backend::XLayerContentDescriber, lang::XServiceInfo>(mMutex)
-{
-}
-//------------------------------------------------------------------------------
-
-BackendLayerHelper::~BackendLayerHelper(void) {}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BackendLayerHelper::
- getBackendLayerHelperName(void)
-{
- static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber")) ;
-
- return kImplementationName ;
-}
-//------------------------------------------------------------------------------
-void SAL_CALL BackendLayerHelper::describeLayer(
- const uno::Reference< backend::XLayerHandler >& xHandler,
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos )
- throw (lang::NullPointerException,
- backend::MalformedDataException,
- uno::RuntimeException)
-
-
-
-{
- OONode aNodeTree;
- buildNodeTree(aPropertyInfos, *this, aNodeTree);
-
- //Descirbe the Layer to the XHandler Object
- xHandler->startLayer();
- xHandler->overrideNode(aNodeTree.getName(),0,false);
- std::vector<IOONode*> aChildList = aNodeTree.getChildren();
- processChildren(aChildList,xHandler);
- xHandler->endNode();
- xHandler->endLayer();
-
-
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BackendLayerHelper::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendLayerHelperName() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL BackendLayerHelper::
- getBackendLayerHelperServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LayerDescriber")) ;
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BackendLayerHelper::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getBackendLayerHelperServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL BackendLayerHelper::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return getBackendLayerHelperServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-} // backendhelper
-} // configmgr
diff --git a/configmgr/source/backendhelper/backendlayerhelper.hxx b/configmgr/source/backendhelper/backendlayerhelper.hxx
deleted file mode 100644
index 1e90160fc057..000000000000
--- a/configmgr/source/backendhelper/backendlayerhelper.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-#define CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-namespace configmgr { namespace backendhelper {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-//------------------------------------------------------------------------------
-
-/**
- * Implements the LayerContentDescriber service.
- * Describes a set of configuration data to an XLayerHandler
- * Object
- */
-class BackendLayerHelper : public cppu::WeakComponentImplHelper2<backend::XLayerContentDescriber, lang::XServiceInfo> {
-public :
- /**
- Service constructor from a service factory.
- @param xContext component context
- */
- BackendLayerHelper(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~BackendLayerHelper(void) ;
-
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
-
- //XLayerContentDescriber
- virtual void SAL_CALL
- describeLayer( const uno::Reference< backend::XLayerHandler >& xHandler,
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos )
- throw (lang::NullPointerException,
- backend::MalformedDataException,
- uno::RuntimeException);
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendLayerHelperName(void) ;
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendLayerHelperServiceNames(void) ;
-private:
- osl::Mutex mMutex;
-
-} ;
-//------------------------------------------------------------------------------
-class OONode;
-class OOProperty;
-
-/**
- Base class for representing OO properties and nodes
-*/
-class IOONode
-{
-public:
- virtual OONode* getComposite(){return NULL;}
- virtual ~IOONode(){};
- virtual OOProperty* asOOProperty(){return NULL;}
- rtl::OUString getName(){return mName;}
- void setName(const rtl::OUString& sName){mName = sName;}
-protected:
- IOONode(const rtl::OUString& sName);
-private:
- rtl::OUString mName;
-};
-//------------------------------------------------------------------------------
-class OONode :public IOONode
-{
-public:
-
- OONode(const rtl::OUString& sName);
- OONode();
- ~OONode();
-
- IOONode* addChild(IOONode* aChild);
- OONode* getComposite(){return this;}
- const std::vector<IOONode*>& getChildren();
- IOONode* getChild(const rtl::OUString& aChildName);
-
-private:
- std::vector<IOONode*> mChildList;
-};
-//------------------------------------------------------------------------------
-class OOProperty :public IOONode
-{
-public:
- OOProperty(const rtl::OUString& sName,
- const rtl::OUString& sPropType,
- const uno::Any& aPropValue,
- sal_Bool bProtected);
- ~OOProperty(){};
-
- const rtl::OUString& getType(){return mPropType;}
- uno::Any getValue(){return mPropValue;}
- sal_Bool isProtected(){return mbProtected;}
- OOProperty* asOOProperty(){return this;}
-
-private:
- rtl::OUString mPropType;
- uno::Any mPropValue;
- sal_Bool mbProtected;
-};
-//------------------------------------------------------------------------------
-
-
-} } // configmgr.backendhelper
-
-#endif // CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-
-
diff --git a/configmgr/source/backendhelper/behelper.uno.xml b/configmgr/source/backendhelper/behelper.uno.xml
deleted file mode 100644
index a160360c5ec2..000000000000
--- a/configmgr/source/backendhelper/behelper.uno.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice/DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>behelper.uno</module-name>
- <component-description>
- <author>Sarah Smith</author>
- <name>com.sun.star.comp.configuration.backend.LayerDescriber</name>
- <description>Describes the contents of a Layer to an XLayerHandler object. The contents of the layer
-is contained in a sequence of PropertyInfo structs</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>C++</language>
- <status value="final"/>
- <supported-services>com.sun.star.configuration.backend.LayerDescriber</supported-services>
- <type>com.sun.star.configuration.backend.XLayerContentDescriber</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.uno.Any</type>
- <type>com.sun.star.uno.Sequence</type>
- </component-description>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/source/backendhelper/componentdf.cxx b/configmgr/source/backendhelper/componentdf.cxx
deleted file mode 100644
index e94645fbcaa3..000000000000
--- a/configmgr/source/backendhelper/componentdf.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendlayerhelper.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-
-//==============================================================================
-
-static com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createBackendLayerHelper(
- const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& aContext) {
- return * new configmgr::backendhelper::BackendLayerHelper(aContext) ;
-}
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createBackendLayerHelper,
- configmgr::backendhelper::BackendLayerHelper::getBackendLayerHelperName,
- configmgr::backendhelper::BackendLayerHelper::getBackendLayerHelperServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
-component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void *aServiceManager, void *aRegistryKey)
-{
- return cppu::component_writeInfoHelper(aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void *component_getFactory(
- const sal_Char *aImplementationName, void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/configmgr/source/backendhelper/exports.dxp b/configmgr/source/backendhelper/exports.dxp
deleted file mode 100644
index 9630d7e06768..000000000000
--- a/configmgr/source/backendhelper/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/source/backendhelper/makefile.mk b/configmgr/source/backendhelper/makefile.mk
deleted file mode 100644
index 5559d0ef01c9..000000000000
--- a/configmgr/source/backendhelper/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=behelper
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/backendlayerhelper.obj \
- $(SLO)$/componentdf.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: Backend Helper
-
-# --- Targets ---
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
new file mode 100644
index 000000000000..bb77039dcc8f
--- /dev/null
+++ b/configmgr/source/broadcaster.cxx
@@ -0,0 +1,237 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/container/XContainerListener.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XChangesListener.hpp"
+#include "osl/diagnose.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+void Broadcaster::addDisposeNotification(
+ css::uno::Reference< css::lang::XEventListener > const & listener,
+ css::lang::EventObject const & event)
+{
+ disposeNotifications_.push_back(DisposeNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementReplacedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementReplacedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementInsertedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementInsertedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementRemovedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementRemovedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addPropertyChangeNotification(
+ css::uno::Reference< css::beans::XPropertyChangeListener > const & listener,
+ css::beans::PropertyChangeEvent const & event)
+{
+ propertyChangeNotifications_.push_back(
+ PropertyChangeNotification(listener, event));
+}
+
+void Broadcaster::addPropertiesChangeNotification(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ listener,
+ css::uno::Sequence< css::beans::PropertyChangeEvent > const & event)
+{
+ propertiesChangeNotifications_.push_back(
+ PropertiesChangeNotification(listener, event));
+}
+
+void Broadcaster::addChangesNotification(
+ css::uno::Reference< css::util::XChangesListener > const & listener,
+ css::util::ChangesEvent const & event)
+{
+ changesNotifications_.push_back(ChangesNotification(listener, event));
+}
+
+void Broadcaster::send() {
+ bool exception = false;
+ for (DisposeNotifications::iterator i(disposeNotifications_.begin());
+ i != disposeNotifications_.end(); ++i) {
+ try {
+ i->listener->disposing(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementInsertedNotifications_.begin());
+ i != containerElementInsertedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementInserted(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementRemovedNotifications_.begin());
+ i != containerElementRemovedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementRemoved(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementReplacedNotifications_.begin());
+ i != containerElementReplacedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementReplaced(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (PropertyChangeNotifications::iterator i(
+ propertyChangeNotifications_.begin());
+ i != propertyChangeNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->propertyChange(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (PropertiesChangeNotifications::iterator i(
+ propertiesChangeNotifications_.begin());
+ i != propertiesChangeNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->propertiesChange(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ChangesNotifications::iterator i(changesNotifications_.begin());
+ i != changesNotifications_.end(); ++i) {
+ try {
+ i->listener->changesOccurred(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ if (exception) { //TODO
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr exceptions during listener notification")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Broadcaster::DisposeNotification::DisposeNotification(
+ css::uno::Reference< css::lang::XEventListener > const & theListener,
+ css::lang::EventObject const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::ContainerNotification::ContainerNotification(
+ css::uno::Reference< css::container::XContainerListener > const &
+ theListener,
+ css::container::ContainerEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::PropertyChangeNotification::PropertyChangeNotification(
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ theListener,
+ css::beans::PropertyChangeEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::PropertiesChangeNotification::PropertiesChangeNotification(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ theListener,
+ css::uno::Sequence< css::beans::PropertyChangeEvent > const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::ChangesNotification::ChangesNotification(
+ css::uno::Reference< css::util::XChangesListener > const & theListener,
+ css::util::ChangesEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+}
diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx
new file mode 100644
index 000000000000..95c4b1fac49b
--- /dev/null
+++ b/configmgr/source/broadcaster.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/container/ContainerEvent.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/util/ChangesEvent.hpp"
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ class XPropertiesChangeListener;
+ class XPropertyChangeListener;
+ }
+ namespace container { class XContainerListener; }
+ namespace lang { class XEventListener; }
+ namespace util { class XChangesListener; }
+} } }
+
+namespace configmgr {
+
+class Access;
+
+class Broadcaster: private boost::noncopyable {
+public:
+ void addDisposeNotification(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & listener,
+ com::sun::star::lang::EventObject const & event);
+
+ void addContainerElementInsertedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addContainerElementRemovedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addContainerElementReplacedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addPropertyChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & listener,
+ com::sun::star::beans::PropertyChangeEvent const & event);
+
+ void addPropertiesChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const & listener,
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > const & event);
+
+ void addChangesNotification(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & listener,
+ com::sun::star::util::ChangesEvent const & event);
+
+ void send();
+
+private:
+ struct DisposeNotification {
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ listener;
+ com::sun::star::lang::EventObject event;
+
+ DisposeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener > const & theListener,
+ com::sun::star::lang::EventObject const & theEvent);
+ };
+
+ struct ContainerNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > listener;
+ com::sun::star::container::ContainerEvent event;
+
+ ContainerNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const &
+ theListener,
+ com::sun::star::container::ContainerEvent const & theEvent);
+ };
+
+ struct PropertyChangeNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > listener;
+ com::sun::star::beans::PropertyChangeEvent event;
+
+ PropertyChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const &
+ theListener,
+ com::sun::star::beans::PropertyChangeEvent const & theEvent);
+ };
+
+ struct PropertiesChangeNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > listener;
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > event;
+
+ PropertiesChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ theListener,
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > const & theEvent);
+ };
+
+ struct ChangesNotification {
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ listener;
+ com::sun::star::util::ChangesEvent event;
+
+ ChangesNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XChangesListener > const & theListener,
+ com::sun::star::util::ChangesEvent const & theEvent);
+ };
+
+ typedef std::vector< DisposeNotification > DisposeNotifications;
+
+ typedef std::vector< ContainerNotification > ContainerNotifications;
+
+ typedef std::vector< PropertyChangeNotification >
+ PropertyChangeNotifications;
+
+ typedef std::vector< PropertiesChangeNotification >
+ PropertiesChangeNotifications;
+
+ typedef std::vector< ChangesNotification > ChangesNotifications;
+
+ DisposeNotifications disposeNotifications_;
+ ContainerNotifications containerElementInsertedNotifications_;
+ ContainerNotifications containerElementRemovedNotifications_;
+ ContainerNotifications containerElementReplacedNotifications_;
+ PropertyChangeNotifications propertyChangeNotifications_;
+ PropertiesChangeNotifications propertiesChangeNotifications_;
+ ChangesNotifications changesNotifications_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
new file mode 100644
index 000000000000..ef2b213d4ef1
--- /dev/null
+++ b/configmgr/source/childaccess.cxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/container/XChild.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "rtl/uuid.h"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "rootaccess.hxx"
+#include "setnode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() {
+ static css::uno::Sequence< sal_Int8 > id;
+ if (id.getLength() == 0) {
+ css::uno::Sequence< sal_Int8 > uuid(16);
+ rtl_createUuid(
+ reinterpret_cast< sal_uInt8 * >(uuid.getArray()), 0, false);
+ id = uuid;
+ }
+ return id;
+}
+
+ChildAccess::ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node):
+ Access(components), root_(root), parent_(parent), name_(name), node_(node),
+ inTransaction_(false)
+{
+ OSL_ASSERT(root.is() && parent.is() && node.is());
+}
+
+ChildAccess::ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Node > const & node):
+ Access(components), root_(root), node_(node), inTransaction_(false)
+{
+ OSL_ASSERT(root.is() && node.is());
+}
+
+Path ChildAccess::getAbsolutePath() {
+ OSL_ASSERT(getParentAccess().is());
+ Path path(getParentAccess()->getAbsolutePath());
+ path.push_back(name_);
+ return path;
+}
+
+Path ChildAccess::getRelativePath() {
+ Path path;
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ path = parent->getRelativePath();
+ }
+ path.push_back(name_);
+ return path;
+}
+
+rtl::OUString ChildAccess::getRelativePathRepresentation() {
+ rtl::OUStringBuffer path;
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ path.append(parent->getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ }
+ path.append(Data::createSegment(node_->getTemplateName(), name_));
+ return path.makeStringAndClear();
+}
+
+rtl::Reference< Node > ChildAccess::getNode() {
+ return node_;
+}
+
+bool ChildAccess::isFinalized() {
+ return node_->getFinalized() != Data::NO_LAYER ||
+ (parent_.is() && parent_->isFinalized());
+}
+
+rtl::OUString ChildAccess::getNameInternal() {
+ return name_;
+}
+
+rtl::Reference< RootAccess > ChildAccess::getRootAccess() {
+ return root_;
+}
+
+rtl::Reference< Access > ChildAccess::getParentAccess() {
+ return parent_;
+}
+
+void ChildAccess::acquire() throw () {
+ Access::acquire();
+}
+
+void ChildAccess::release() throw () {
+ Access::release();
+}
+
+css::uno::Reference< css::uno::XInterface > ChildAccess::getParent()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return static_cast< cppu::OWeakObject * >(parent_.get());
+}
+
+void ChildAccess::setParent(css::uno::Reference< css::uno::XInterface > const &)
+ throw (css::lang::NoSupportException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ throw css::lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("setParent")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Int64 ChildAccess::getSomething(
+ css::uno::Sequence< sal_Int8 > const & aIdentifier)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return aIdentifier == getTunnelId()
+ ? reinterpret_cast< sal_Int64 >(this) : 0;
+}
+
+void ChildAccess::bind(
+ rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name)
+ throw ()
+{
+ OSL_ASSERT(
+ !parent_.is() && root.is() && parent.is() && name.getLength() != 0);
+ root_ = root;
+ parent_ = parent;
+ name_ = name;
+}
+
+void ChildAccess::unbind() throw () {
+ OSL_ASSERT(parent_.is());
+ parent_->releaseChild(name_);
+ parent_.clear();
+ inTransaction_ = true;
+}
+
+void ChildAccess::committed() {
+ inTransaction_ = false;
+}
+
+void ChildAccess::setNode(rtl::Reference< Node > const & node) {
+ node_ = node;
+}
+
+void ChildAccess::setProperty(
+ css::uno::Any const & value, Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ Type type = TYPE_ERROR;
+ bool nillable = false;
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(node_.get());
+ type = prop->getStaticType();
+ nillable = prop->isNillable();
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ rtl::OUString locale(getRootAccess()->getLocale());
+ if (!Components::allLocales(locale)) {
+ rtl::Reference< ChildAccess > child(getChild(locale));
+ if (child.is()) {
+ child->setProperty(value, localModifications);
+ } else {
+ insertLocalizedValueChild(
+ locale, value, localModifications);
+ }
+ return;
+ }
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode * >(getParentNode().get());
+ type = locprop->getStaticType();
+ nillable = locprop->isNillable();
+ }
+ break;
+ default:
+ break;
+ }
+ checkValue(value, type, nillable);
+ getParentAccess()->markChildAsModified(this);
+ changedValue_.reset(new css::uno::Any(value));
+ localModifications->add(getRelativePath());
+}
+
+css::uno::Any ChildAccess::asValue() {
+ if (changedValue_.get() != 0) {
+ return *changedValue_;
+ }
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ return dynamic_cast< PropertyNode * >(node_.get())->getValue(
+ getComponents());
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ rtl::OUString locale(getRootAccess()->getLocale());
+ if (!Components::allLocales(locale)) {
+ // Find best match using an adaption of RFC 4647 lookup matching
+ // rules, removing "-" or "_" delimited segments from the end;
+ // defaults are the empty string locale, the "en-US" locale, the
+ // first child (if any), or a nil value (even though it may be
+ // illegal for the given property), in that order:
+ rtl::Reference< ChildAccess > child;
+ for (;;) {
+ child = getChild(locale);
+ if (child.is() || locale.getLength() == 0) {
+ break;
+ }
+ sal_Int32 i = locale.getLength() - 1;
+ while (i > 0 && locale[i] != '-' && locale[i] != '_') {
+ --i;
+ }
+ locale = locale.copy(0, i);
+ }
+ if (!child.is()) {
+ child = getChild(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")));
+ if (!child.is()) {
+ std::vector< rtl::Reference< ChildAccess > > all(
+ getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
+ }
+ }
+ return child.is() ? child->asValue() : css::uno::Any();
+ }
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ return dynamic_cast< LocalizedValueNode * >(node_.get())->getValue();
+ default:
+ break;
+ }
+ return css::uno::makeAny(
+ css::uno::Reference< css::uno::XInterface >(
+ static_cast< cppu::OWeakObject * >(this)));
+}
+
+void ChildAccess::commitChanges(bool valid, Modifications * globalModifications)
+{
+ OSL_ASSERT(globalModifications != 0);
+ commitChildChanges(valid, globalModifications);
+ if (valid && changedValue_.get() != 0) {
+ Path path(getAbsolutePath());
+ getComponents().addModification(path);
+ globalModifications->add(path);
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ dynamic_cast< PropertyNode * >(node_.get())->setValue(
+ Data::NO_LAYER, *changedValue_);
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ dynamic_cast< LocalizedValueNode * >(node_.get())->setValue(
+ Data::NO_LAYER, *changedValue_);
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ changedValue_.reset();
+}
+
+ChildAccess::~ChildAccess() {
+ osl::MutexGuard g(lock);
+ if (parent_.is()) {
+ parent_->releaseChild(name_);
+ }
+}
+
+void ChildAccess::addTypes(std::vector< css::uno::Type > * types) const {
+ OSL_ASSERT(types != 0);
+ types->push_back(cppu::UnoType< css::container::XChild >::get());
+ types->push_back(cppu::UnoType< css::lang::XUnoTunnel >::get());
+}
+
+void ChildAccess::addSupportedServiceNames(
+ std::vector< rtl::OUString > * services)
+{
+ OSL_ASSERT(services != 0);
+ services->push_back(
+ getParentNode()->kind() == Node::KIND_GROUP
+ ? rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupElement"))
+ : rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetElement")));
+}
+
+css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Any res(Access::queryInterface(aType));
+ return res.hasValue()
+ ? res
+ : cppu::queryInterface(
+ aType, static_cast< css::container::XChild * >(this),
+ static_cast< css::lang::XUnoTunnel * >(this));
+}
+
+}
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
new file mode 100644
index 000000000000..c1cb14896978
--- /dev/null
+++ b/configmgr/source/childaccess.hxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
+
+#include "sal/config.h"
+
+#include <memory>
+#include <vector>
+
+#include "com/sun/star/container/XChild.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+ class Type;
+ class XInterface;
+} } } }
+
+namespace configmgr {
+
+class Components;
+class Modifications;
+class Node;
+class RootAccess;
+
+class ChildAccess:
+ public Access, public com::sun::star::container::XChild,
+ public com::sun::star::lang::XUnoTunnel
+{
+public:
+ static com::sun::star::uno::Sequence< sal_Int8 > getTunnelId();
+
+ ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node);
+
+ ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Node > const & node);
+
+ virtual Path getAbsolutePath();
+
+ virtual Path getRelativePath();
+
+ virtual rtl::OUString getRelativePathRepresentation();
+
+ virtual rtl::Reference< Node > getNode();
+
+ virtual bool isFinalized();
+
+ virtual rtl::OUString getNameInternal();
+
+ virtual rtl::Reference< RootAccess > getRootAccess();
+
+ virtual rtl::Reference< Access > getParentAccess();
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ 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(
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ const &)
+ throw (
+ com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getSomething(
+ com::sun::star::uno::Sequence< sal_Int8 > const & aIdentifier)
+ throw (com::sun::star::uno::RuntimeException);
+
+ void bind(
+ rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name)
+ throw ();
+
+ void unbind() throw ();
+
+ bool isInTransaction() const { return inTransaction_; }
+
+ void committed();
+
+ void setNode(rtl::Reference< Node > const & node);
+
+ void setProperty(
+ com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ com::sun::star::uno::Any asValue();
+
+ void commitChanges(bool valid, Modifications * globalModifications);
+
+private:
+ virtual ~ChildAccess();
+
+ virtual void addTypes(
+ std::vector< com::sun::star::uno::Type > * types) const;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services);
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ rtl::Reference< RootAccess > root_;
+ rtl::Reference< Access > parent_; // null iff free node
+ rtl::OUString name_;
+ rtl::Reference< Node > node_;
+ std::auto_ptr< com::sun::star::uno::Any > changedValue_;
+ bool inTransaction_;
+ // to determine if a free node can be inserted underneath some root
+};
+
+}
+
+#endif
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
new file mode 100644
index 000000000000..51a1a6547d9b
--- /dev/null
+++ b/configmgr/source/components.cxx
@@ -0,0 +1,652 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+#include <list>
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.hxx"
+#include "rtl/bootstrap.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "components.hxx"
+#include "data.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "parsemanager.hxx"
+#include "rootaccess.hxx"
+#include "writemodfile.hxx"
+#include "xcdparser.hxx"
+#include "xcuparser.hxx"
+#include "xcsparser.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+struct UnresolvedListItem {
+ rtl::OUString name;
+ rtl::Reference< ParseManager > manager;
+
+ UnresolvedListItem(
+ rtl::OUString const & theName,
+ rtl::Reference< ParseManager > theManager):
+ name(theName), manager(theManager) {}
+};
+
+typedef std::list< UnresolvedListItem > UnresolvedList;
+
+void parseXcsFile(rtl::OUString const & url, int layer, Data * data,
+ Modifications * modifications)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException))
+{
+ OSL_ASSERT(modifications == 0); (void) modifications;
+ OSL_VERIFY(
+ rtl::Reference< ParseManager >(
+ new ParseManager(url, new XcsParser(layer, data)))->parse());
+}
+
+void parseXcuFile(
+ rtl::OUString const & url, int layer, Data * data,
+ Modifications * modifications)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException))
+{
+ OSL_VERIFY(
+ rtl::Reference< ParseManager >(
+ new ParseManager(url, new XcuParser(layer, data, modifications)))->
+ parse());
+}
+
+rtl::OUString expand(rtl::OUString const & str) {
+ rtl::OUString s(str);
+ rtl::Bootstrap::expandMacros(s); //TODO: detect failure
+ return s;
+}
+
+static bool singletonCreated = false;
+static Components * singleton; // leaks
+
+}
+
+void Components::initSingleton(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ OSL_ASSERT(context.is());
+ if (!singletonCreated) {
+ singletonCreated = true;
+ singleton = new Components(context);
+ }
+}
+
+Components & Components::getSingleton() {
+ OSL_ASSERT(singletonCreated);
+ if (singleton == 0) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr no Components singleton")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return *singleton;
+}
+
+bool Components::allLocales(rtl::OUString const & locale) {
+ return locale.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"));
+}
+
+rtl::Reference< Node > Components::resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const
+{
+ return data_.resolvePathRepresentation(
+ pathRepresentation, path, finalizedLayer);
+}
+
+rtl::Reference< Node > Components::getTemplate(
+ int layer, rtl::OUString const & fullName) const
+{
+ return data_.getTemplate(layer, fullName);
+}
+
+void Components::addRootAccess(rtl::Reference< RootAccess > const & access) {
+ roots_.insert(access.get());
+}
+
+void Components::removeRootAccess(RootAccess * access) {
+ roots_.erase(access);
+}
+
+void Components::initGlobalBroadcaster(
+ Modifications const & modifications,
+ rtl::Reference< RootAccess > const & exclude, Broadcaster * broadcaster)
+{
+ //TODO: Iterate only over roots w/ listeners:
+ for (WeakRootSet::iterator i(roots_.begin()); i != roots_.end(); ++i) {
+ rtl::Reference< RootAccess > root;
+ if ((*i)->acquireCounting() > 1) {
+ root.set(*i); // must not throw
+ }
+ (*i)->releaseNondeleting();
+ if (root.is()) {
+ if (root != exclude) {
+ Path path(root->getAbsolutePath());
+ Modifications::Node const * mods = &modifications.getRoot();
+ for (Path::iterator j(path.begin()); j != path.end(); ++j) {
+ Modifications::Node::Children::const_iterator k(
+ mods->children.find(*j));
+ if (k == mods->children.end()) {
+ mods = 0;
+ break;
+ }
+ mods = &k->second;
+ }
+ //TODO: If the complete tree of which root is a part is deleted,
+ // or replaced, mods will be null, but some of the listeners
+ // from within root should probably fire nonetheless:
+ if (mods != 0) {
+ root->initBroadcaster(*mods, broadcaster);
+ }
+ }
+ }
+ }
+}
+
+void Components::addModification(Path const & path) {
+ data_.modifications.add(path);
+}
+
+void Components::writeModifications() {
+ writeModFile(*this, getModificationFileUrl(), data_);
+}
+
+void Components::insertExtensionXcsFile(
+ bool shared, rtl::OUString const & fileUri)
+{
+ try {
+ parseXcsFile(fileUri, shared ? 9 : 13, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "insertExtensionXcsFile does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void Components::insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri, Modifications * modifications)
+{
+ OSL_ASSERT(modifications != 0);
+ try {
+ parseXcuFile(fileUri, shared ? 10 : 14, &data_, modifications);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "insertExtensionXcuFile does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+css::beans::Optional< css::uno::Any > Components::getExternalValue(
+ rtl::OUString const & descriptor)
+{
+ sal_Int32 i = descriptor.indexOf(' ');
+ if (i <= 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad external value descriptor ")) +
+ descriptor),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ //TODO: Do not make calls with mutex locked:
+ rtl::OUString name(descriptor.copy(0, i));
+ ExternalServices::iterator j(externalServices_.find(name));
+ if (j == externalServices_.end()) {
+ css::uno::Reference< css::uno::XInterface > service;
+ try {
+ service = css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context_->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(name, context_);
+ } catch (css::uno::RuntimeException &) {
+ // Assuming these exceptions are real errors:
+ throw;
+ } catch (css::uno::Exception & e) {
+ // Assuming these exceptions indicate that the service is not
+ // installed:
+ OSL_TRACE(
+ "createInstance(%s) failed with %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ css::uno::Reference< css::beans::XPropertySet > propset;
+ if (service.is()) {
+ propset = css::uno::Reference< css::beans::XPropertySet >(
+ service, css::uno::UNO_QUERY_THROW);
+ }
+ j = externalServices_.insert(
+ ExternalServices::value_type(name, propset)).first;
+ }
+ css::beans::Optional< css::uno::Any > value;
+ if (j->second.is()) {
+ try {
+ if (!(j->second->getPropertyValue(descriptor.copy(i + 1)) >>=
+ value))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot obtain external value through ")) +
+ descriptor),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } catch (css::beans::UnknownPropertyException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unknwon external value descriptor ID: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ } catch (css::lang::WrappedTargetException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot obtain external value: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ return value;
+}
+
+Components::Components(
+ css::uno::Reference< css::uno::XComponentContext > const & context):
+ context_(context)
+{
+ OSL_ASSERT(context.is());
+/*SB*/try{
+ parseXcsXcuLayer(
+ 0,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/registry"))));
+ parseModuleLayer(
+ 2,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/share/registry/modules"))));
+ parseResLayer(
+ 3,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/registry"))));
+ parseXcsXcuLayer(
+ 4,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$BRAND_BASE_DIR/share/registry"))));
+ parseModuleLayer(
+ 6,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$BRAND_BASE_DIR/share/registry/modules"))));
+ parseXcsXcuLayer( //TODO: migrate
+ 7,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/registry"))));
+ parseXcsXcuIniLayer(
+ 9,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/configmgr.ini"))));
+ parseXcsXcuLayer( //TODO: migrate
+ 11,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_USER_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/registry"))));
+ parseXcsXcuIniLayer(
+ 13,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_USER_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/configmgr.ini"))));
+/*SB*/}catch(css::uno::Exception&e){fprintf(stderr,"caught <%s>\n",rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_UTF8).getStr());throw;}
+ try {
+ parseModificationLayer();
+ } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+ // Silently ignore unreadable parts of a corrupted
+ // registrymodifications.xcu file, instead of completely preventing OOo
+ // from starting:
+ OSL_TRACE(
+ "configmgr error reading user modification layer: %s",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+}
+
+Components::~Components() {}
+
+void Components::parseFiles(
+ int layer, rtl::OUString const & extension,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & url, bool recursive)
+{
+ osl::Directory dir(url);
+ switch (dir.open()) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_NOENT:
+ if (!recursive) {
+ return;
+ }
+ // fall through
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot open directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ for (;;) {
+ osl::DirectoryItem i;
+ osl::FileBase::RC rc = dir.getNextItem(i, SAL_MAX_UINT32);
+ if (rc == osl::FileBase::E_NOENT) {
+ break;
+ }
+ if (rc != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot iterate directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ osl::FileStatus stat(
+ FileStatusMask_Type | FileStatusMask_FileName |
+ FileStatusMask_FileURL);
+ if (i.getFileStatus(stat) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot stat in directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (stat.getFileType() == osl::FileStatus::Directory) { //TODO: symlinks
+ parseFiles(layer, extension, parseFile, stat.getFileURL(), true);
+ } else {
+ rtl::OUString file(stat.getFileName());
+ if (file.getLength() >= extension.getLength() &&
+ file.match(extension, file.getLength() - extension.getLength()))
+ {
+ try {
+ (*parseFile)(stat.getFileURL(), layer, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ }
+}
+
+void Components::parseFileList(
+ int layer,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & urls, rtl::Bootstrap const & ini)
+{
+ for (sal_Int32 i = 0;;) {
+ rtl::OUString url(urls.getToken(0, ' ', i));
+ if (url.getLength() != 0) {
+ ini.expandMacrosFrom(url); //TODO: detect failure
+ try {
+ (*parseFile)(url, layer, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ if (i == -1) {
+ break;
+ }
+ }
+}
+
+void Components::parseXcdFiles(int layer, rtl::OUString const & url) {
+ osl::Directory dir(url);
+ switch (dir.open()) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_NOENT:
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot open directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ UnresolvedList unres;
+ XcdParser::Dependencies deps;
+ for (;;) {
+ osl::DirectoryItem i;
+ osl::FileBase::RC rc = dir.getNextItem(i, SAL_MAX_UINT32);
+ if (rc == osl::FileBase::E_NOENT) {
+ break;
+ }
+ if (rc != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot iterate directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ osl::FileStatus stat(
+ FileStatusMask_Type | FileStatusMask_FileName |
+ FileStatusMask_FileURL);
+ if (i.getFileStatus(stat) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot stat in directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
+ rtl::OUString file(stat.getFileName());
+ if (file.getLength() >= RTL_CONSTASCII_LENGTH(".xcd") &&
+ file.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(".xcd"),
+ file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")))
+ {
+ rtl::OUString name(
+ file.copy(
+ 0, file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")));
+ rtl::Reference< ParseManager > manager;
+ try {
+ manager = new ParseManager(
+ stat.getFileURL(), new XcdParser(layer, deps, &data_));
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (manager->parse()) {
+ deps.insert(name);
+ } else {
+ unres.push_back(UnresolvedListItem(name, manager));
+ }
+ }
+ }
+ }
+ while (!unres.empty()) {
+ bool resolved = false;
+ for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) {
+ if (i->manager->parse()) {
+ deps.insert(i->name);
+ unres.erase(i++);
+ resolved = true;
+ } else {
+ ++i;
+ }
+ }
+ if (!resolved) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xcd: unresolved dependencies in ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+}
+
+void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) {
+ parseXcdFiles(layer, url);
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcs")),
+ &parseXcsFile,
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/schema")), false);
+ parseFiles(
+ layer + 1, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile,
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/data")), false);
+}
+
+void Components::parseXcsXcuIniLayer(int layer, rtl::OUString const & url) {
+ //TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the
+ // global function"
+ rtl::Bootstrap ini(url);
+ rtl::OUString urls;
+ if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls))
+ {
+ parseFileList(layer, &parseXcsFile, urls, ini);
+ }
+ if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls))
+ {
+ parseFileList(layer + 1, &parseXcuFile, urls, ini);
+ }
+}
+
+void Components::parseModuleLayer(int layer, rtl::OUString const & url) {
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile, url, false);
+}
+
+void Components::parseResLayer(int layer, rtl::OUString const & url) {
+ rtl::OUString resUrl(
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/res")));
+ parseXcdFiles(layer, resUrl);
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile, resUrl, false);
+}
+
+rtl::OUString Components::getModificationFileUrl() const {
+ return expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap")
+ ":UserInstallation}/user/registrymodifications.xcu")));
+}
+
+void Components::parseModificationLayer() {
+ try {
+ parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, &data_, 0);
+ } catch (css::container::NoSuchElementException &) {
+ OSL_TRACE(
+ "configmgr user registrymodifications.xcu does not (yet) exist");
+ // Migrate old user layer data (can be removed once migration is no
+ // longer relevant; also see hack for xsi namespace in XmlReader
+ // constructor):
+ parseFiles(
+ Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap")
+ ":UserInstallation}/user/registry/data"))),
+ false);
+ }
+}
+
+}
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
new file mode 100644
index 000000000000..8523b02cbbaf
--- /dev/null
+++ b/configmgr/source/components.hxx
@@ -0,0 +1,151 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <set>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "rtl/ref.hxx"
+
+#include "data.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace beans { class XPropertySet; }
+ namespace uno {
+ class Any;
+ class XComponentContext;
+ }
+} } }
+namespace rtl {
+ class Bootstrap;
+ class OUString;
+}
+
+namespace configmgr {
+
+class Broadcaster;
+class Modifications;
+class Node;
+class RootAccess;
+
+class Components: private boost::noncopyable {
+public:
+ static void initSingleton(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ static Components & getSingleton();
+
+ static bool allLocales(rtl::OUString const & locale);
+
+ rtl::Reference< Node > resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const;
+
+ rtl::Reference< Node > getTemplate(
+ int layer, rtl::OUString const & fullName) const;
+
+ void addRootAccess(rtl::Reference< RootAccess > const & access);
+
+ void removeRootAccess(RootAccess * access);
+
+ void initGlobalBroadcaster(
+ Modifications const & modifications,
+ rtl::Reference< RootAccess > const & exclude,
+ Broadcaster * broadcaster);
+
+ void addModification(Path const & path);
+
+ void writeModifications();
+
+ void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri);
+
+ void insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri,
+ Modifications * modifications);
+
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ getExternalValue(rtl::OUString const & descriptor);
+
+private:
+ Components(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ ~Components();
+
+ void parseFiles(
+ int layer, rtl::OUString const & extension,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & url, bool recursive);
+
+ void parseFileList(
+ int layer,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & urls, rtl::Bootstrap const & ini);
+
+ void parseXcdFiles(int layer, rtl::OUString const & url);
+
+ void parseXcsXcuLayer(int layer, rtl::OUString const & url);
+
+ void parseXcsXcuIniLayer(int layer, rtl::OUString const & url);
+
+ void parseModuleLayer(int layer, rtl::OUString const & url);
+
+ void parseResLayer(int layer, rtl::OUString const & url);
+
+ rtl::OUString getModificationFileUrl() const;
+
+ void parseModificationLayer();
+
+ typedef std::set< RootAccess * > WeakRootSet;
+
+ typedef
+ std::map<
+ rtl::OUString,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet > >
+ ExternalServices;
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ context_;
+ Data data_;
+ WeakRootSet roots_;
+ ExternalServices externalServices_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
new file mode 100644
index 000000000000..a89540a88158
--- /dev/null
+++ b/configmgr/source/configurationprovider.cxx
@@ -0,0 +1,519 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/lang/XLocalizable.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/DeploymentException.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XFlushListener.hpp"
+#include "com/sun/star/util/XFlushable.hpp"
+#include "com/sun/star/util/XRefreshListener.hpp"
+#include "com/sun/star/util/XRefreshable.hpp"
+#include "comphelper/locale.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/compbase5.hxx"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/interfacecontainer.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "sal/types.h"
+#include "rtl/ref.hxx"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "components.hxx"
+#include "configurationprovider.hxx"
+#include "lock.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr { namespace configuration_provider {
+
+namespace {
+
+namespace css = com::sun::star;
+
+char const accessServiceName[] =
+ "com.sun.star.configuration.ConfigurationAccess";
+char const updateAccessServiceName[] =
+ "com.sun.star.configuration.ConfigurationUpdateAccess";
+
+void badNodePath() {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider expects a"
+ " single, non-empty, string nodepath argument")),
+ 0);
+}
+
+typedef
+ cppu::WeakComponentImplHelper5<
+ css::lang::XServiceInfo, css::lang::XMultiServiceFactory,
+ css::util::XRefreshable, css::util::XFlushable,
+ css::lang::XLocalizable >
+ ServiceBase;
+
+class Service:
+ private osl::Mutex, public ServiceBase, private boost::noncopyable
+{
+public:
+ Service(
+ css::uno::Reference< css::uno::XComponentContext > const context,
+ rtl::OUString const & locale):
+ ServiceBase(*static_cast< osl::Mutex * >(this)), context_(context),
+ locale_(locale)
+ {
+ OSL_ASSERT(context.is());
+ }
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return configuration_provider::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return configuration_provider::getSupportedServiceNames(); }
+ //TODO: DefaultProvider?
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ rtl::OUString const & aServiceSpecifier)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArguments(
+ rtl::OUString const & ServiceSpecifier,
+ css::uno::Sequence< css::uno::Any > const & Arguments)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getAvailableServiceNames() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL refresh() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL flush() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLocale(css::lang::Locale const & eLocale)
+ throw (css::uno::RuntimeException);
+
+ virtual css::lang::Locale SAL_CALL getLocale()
+ throw (css::uno::RuntimeException);
+
+ css::uno::Reference< css::uno::XComponentContext > context_;
+ rtl::OUString locale_;
+};
+
+css::uno::Reference< css::uno::XInterface > Service::createInstance(
+ rtl::OUString const & aServiceSpecifier)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArguments(
+ aServiceSpecifier, css::uno::Sequence< css::uno::Any >());
+}
+
+css::uno::Reference< css::uno::XInterface >
+Service::createInstanceWithArguments(
+ rtl::OUString const & ServiceSpecifier,
+ css::uno::Sequence< css::uno::Any > const & Arguments)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ rtl::OUString nodepath;
+ rtl::OUString locale;
+ for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
+ css::beans::NamedValue v1;
+ css::beans::PropertyValue v2;
+ rtl::OUString name;
+ css::uno::Any value;
+ if (Arguments[i] >>= v1) {
+ name = v1.Name;
+ value = v1.Value;
+ } else if (Arguments[i] >>= v2) {
+ name = v2.Name;
+ value = v2.Value;
+ } else if (Arguments.getLength() == 1 && (Arguments[i] >>= nodepath)) {
+ // For backwards compatibility, allow a single string argument that
+ // denotes nodepath.
+ if (nodepath.getLength() == 0) {
+ badNodePath();
+ }
+ break;
+ } else {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " expects NamedValue or PropertyValue arguments")),
+ 0);
+ }
+ // For backwards compatibility, allow "nodepath" and "Locale" in any
+ // case:
+ if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("nodepath")))
+ {
+ if (nodepath.getLength() != 0 || !(value >>= nodepath) ||
+ nodepath.getLength() == 0)
+ {
+ badNodePath();
+ }
+ } else if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("locale")))
+ {
+ if (locale.getLength() != 0 || !(value >>= locale) ||
+ locale.getLength() == 0)
+ {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " expects at most one, non-empty, string Locale"
+ " argument")),
+ 0);
+ }
+ }
+ }
+ if (nodepath.getLength() == 0) {
+ badNodePath();
+ }
+ // For backwards compatibility, allow a notepath that misses the leading
+ // slash:
+ if (nodepath[0] != '/') {
+ nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath;
+ }
+ if (locale.getLength() == 0) {
+ //TODO: should the Access use the dynamically changing locale_ instead?
+ locale = locale_;
+ if (locale.getLength() == 0) {
+ locale = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"));
+ }
+ }
+ bool update;
+ if (ServiceSpecifier.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(accessServiceName)))
+ {
+ update = false;
+ } else if (ServiceSpecifier.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(updateAccessServiceName)))
+ {
+ update = true;
+ } else {
+ throw css::uno::Exception(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider does not"
+ " support service ")) +
+ ServiceSpecifier),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ osl::MutexGuard guard(lock);
+ Components::initSingleton(context_);
+ Components & components = Components::getSingleton();
+ rtl::Reference< RootAccess > root(
+ new RootAccess(components, nodepath, locale, update));
+ if (root->isValue()) {
+ throw css::uno::Exception(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider: there is"
+ " a leaf value at nodepath ")) +
+ nodepath),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ components.addRootAccess(root);
+ return static_cast< cppu::OWeakObject * >(root.get());
+}
+
+css::uno::Sequence< rtl::OUString > Service::getAvailableServiceNames()
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< rtl::OUString > names(2);
+ names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(accessServiceName));
+ names[1] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(updateAccessServiceName));
+ return names;
+}
+
+void Service::refresh() throw (css::uno::RuntimeException) {
+ //TODO
+ cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
+ cppu::UnoType< css::util::XRefreshListener >::get());
+ if (cont != 0) {
+ css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
+ cont->notifyEach(&css::util::XRefreshListener::refreshed, ev);
+ }
+}
+
+void Service::addRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.addListener(
+ cppu::UnoType< css::util::XRefreshListener >::get(), l);
+}
+
+void Service::removeRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.removeListener(
+ cppu::UnoType< css::util::XRefreshListener >::get(), l);
+}
+
+void Service::flush() throw (css::uno::RuntimeException) {
+ //TODO
+ cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
+ cppu::UnoType< css::util::XFlushListener >::get());
+ if (cont != 0) {
+ css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
+ cont->notifyEach(&css::util::XFlushListener::flushed, ev);
+ }
+}
+
+void Service::addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.addListener(cppu::UnoType< css::util::XFlushListener >::get(), l);
+}
+
+void Service::removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.removeListener(
+ cppu::UnoType< css::util::XFlushListener >::get(), l);
+}
+
+void Service::setLocale(css::lang::Locale const & eLocale)
+ throw (css::uno::RuntimeException)
+{
+ osl::MutexGuard guard(lock);
+ locale_ = comphelper::Locale(
+ eLocale.Language, eLocale.Country, eLocale.Variant).toISO();
+}
+
+css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) {
+ osl::MutexGuard guard(lock);
+ css::lang::Locale loc;
+ if (locale_.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"))) {
+ loc.Language = locale_;
+ } else if (locale_.getLength() != 0) {
+ try {
+ comphelper::Locale l(locale_);
+ loc.Language = l.getLanguage();
+ loc.Country = l.getCountry();
+ loc.Variant = l.getVariant();
+ } catch (comphelper::Locale::MalFormedLocaleException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("MalformedLocaleException: ")) +
+ e.Message),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ }
+ return loc;
+}
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() == 0) {
+ css::uno::Reference< css::uno::XInterface > instance;
+ if (!(Context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/"
+ "com.sun.star.configuration.theDefaultProvider")))
+ >>= instance) ||
+ !instance.is())
+ {
+ throw css::uno::DeploymentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "component context fails to supply singleton"
+ " com.sun.star.configuration.theDefaultProvider")),
+ Context);
+ }
+ return instance;
+ } else {
+ rtl::OUString locale;
+ for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
+ css::beans::NamedValue v1;
+ css::beans::PropertyValue v2;
+ rtl::OUString name;
+ css::uno::Any value;
+ if (Arguments[i] >>= v1) {
+ name = v1.Name;
+ value = v1.Value;
+ } else if (Arguments[i] >>= v2) {
+ name = v2.Name;
+ value = v2.Value;
+ } else {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " factory expects NamedValue or PropertyValue"
+ " arguments")),
+ 0);
+ }
+ // For backwards compatibility, allow "Locale" in any case:
+ if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("locale")))
+ {
+ if (locale.getLength() != 0 || !(value >>= locale) ||
+ locale.getLength() == 0)
+ {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration."
+ "ConfigurationProvider factory expects at most"
+ " one, non-empty, string Locale argument")),
+ 0);
+ }
+ } else {
+ //TODO
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " factory: unknown argument ")) + name,
+ 0);
+ }
+ }
+ return static_cast< cppu::OWeakObject * >(new Service(Context, locale));
+ }
+}
+
+}
+
+css::uno::Reference< css::uno::XInterface > createDefault(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ return static_cast< cppu::OWeakObject * >(
+ new Service(context, rtl::OUString()));
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.ConfigurationProvider"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory >
+createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/configurationprovider.hxx b/configmgr/source/configurationprovider.hxx
new file mode 100644
index 000000000000..4a8c38383774
--- /dev/null
+++ b/configmgr/source/configurationprovider.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONPROVIDER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XSingleComponentFactory; }
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace configuration_provider {
+
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > createDefault(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx
new file mode 100644
index 000000000000..ffd7174c0ad7
--- /dev/null
+++ b/configmgr/source/configurationregistry.cxx
@@ -0,0 +1,950 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/Property.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/registry/InvalidRegistryException.hpp"
+#include "com/sun/star/registry/InvalidValueException.hpp"
+#include "com/sun/star/registry/MergeConflictException.hpp"
+#include "com/sun/star/registry/RegistryKeyType.hpp"
+#include "com/sun/star/registry/RegistryValueType.hpp"
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/registry/XSimpleRegistry.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/DeploymentException.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XFlushable.hpp"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/implbase3.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "configurationregistry.hxx"
+
+namespace com { namespace sun { namespace star { namespace util {
+ class XFlushListener;
+} } } }
+
+namespace configmgr { namespace configuration_registry {
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Service:
+ public cppu::WeakImplHelper3<
+ css::lang::XServiceInfo, css::registry::XSimpleRegistry,
+ css::util::XFlushable >,
+ private boost::noncopyable
+{
+public:
+ Service(css::uno::Reference< css::uno::XComponentContext > const & context);
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return configuration_registry::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return configuration_registry::getSupportedServiceNames(); }
+
+ virtual rtl::OUString SAL_CALL getURL() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL open(
+ rtl::OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isValid() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL close()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL destroy()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL
+ getRootKey()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isReadOnly() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL mergeKey(rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::MergeConflictException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL flush() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException);
+
+ void checkValid();
+
+ void checkValid_RuntimeException();
+
+ void doClose();
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > provider_;
+ osl::Mutex mutex_;
+ css::uno::Reference< css::uno::XInterface > access_;
+ rtl::OUString url_;
+ bool readOnly_;
+
+ friend class RegistryKey;
+};
+
+class RegistryKey:
+ public cppu::WeakImplHelper1< css::registry::XRegistryKey >,
+ private boost::noncopyable
+{
+public:
+ RegistryKey(Service & service, css::uno::Any const & value):
+ service_(service), value_(value) {}
+
+private:
+ virtual ~RegistryKey() {}
+
+ virtual rtl::OUString SAL_CALL getKeyName()
+ throw (css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isReadOnly()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isValid() throw (css::uno::RuntimeException);
+
+ virtual css::registry::RegistryKeyType SAL_CALL getKeyType(
+ rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::registry::RegistryValueType SAL_CALL getValueType()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getLongValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLongValue(sal_Int32)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL getLongListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLongListValue(
+ css::uno::Sequence< sal_Int32 > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getAsciiValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setAsciiValue(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAsciiListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setAsciiListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getStringValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setStringValue(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getStringListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setStringListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBinaryValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setBinaryValue(css::uno::Sequence< sal_Int8 > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL openKey(
+ rtl::OUString const & aKeyName)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL
+ createKey(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL closeKey()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL deleteKey(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual
+ css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+ SAL_CALL openKeys()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getKeyNames()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL createLink(
+ rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL deleteLink(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getLinkTarget(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getResolvedName(
+ rtl::OUString const & aKeyName)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ Service & service_;
+ css::uno::Any value_;
+};
+
+Service::Service(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ OSL_ASSERT(context.is());
+ try {
+ provider_ = css::uno::Reference< css::lang::XMultiServiceFactory >(
+ (css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider")),
+ context)),
+ css::uno::UNO_QUERY_THROW);
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ } catch (css::uno::Exception & e) {
+ throw css::uno::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "component context fails to supply service"
+ " com.sun.star.configuration.DefaultProvider of type"
+ " com.sun.star.lang.XMultiServiceFactory: ")) +
+ e.Message),
+ context);
+ }
+}
+
+rtl::OUString Service::getURL() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ checkValid_RuntimeException();
+ return url_;
+}
+
+void Service::open(rtl::OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ //TODO: bCreate
+ osl::MutexGuard g(mutex_);
+ if (access_.is()) {
+ doClose();
+ }
+ css::uno::Sequence< css::uno::Any > args(1);
+ args[0] <<= css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(rURL));
+ try {
+ access_ = provider_->createInstanceWithArguments(
+ (bReadOnly
+ ? rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess"))
+ : rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess"))),
+ args);
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ } catch (css::uno::Exception & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: open"
+ " failed: ")) +
+ e.Message),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ url_ = rURL;
+ readOnly_ = bReadOnly;
+}
+
+sal_Bool Service::isValid() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ return access_.is();
+}
+
+void Service::close()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(mutex_);
+ checkValid();
+ doClose();
+}
+
+void Service::destroy()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::registry::XRegistryKey > Service::getRootKey()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(mutex_);
+ checkValid();
+ return new RegistryKey(*this, css::uno::makeAny(access_));
+}
+
+sal_Bool Service::isReadOnly() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ checkValid_RuntimeException();
+ return readOnly_;
+}
+
+void Service::mergeKey(rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::MergeConflictException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::flush() throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::checkValid() {
+ if (!access_.is()) {
+ throw css::registry::InvalidRegistryException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " valid")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+void Service::checkValid_RuntimeException() {
+ if (!access_.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " valid")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+void Service::doClose() {
+ access_.clear();
+}
+
+rtl::OUString RegistryKey::getKeyName() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ css::uno::Reference< css::container::XNamed > named;
+ if (value_ >>= named) {
+ return named->getName();
+ }
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool RegistryKey::isReadOnly()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return service_.readOnly_; //TODO: read-only sub-nodes in update access?
+}
+
+sal_Bool RegistryKey::isValid() throw (css::uno::RuntimeException) {
+ return service_.isValid();
+}
+
+css::registry::RegistryKeyType RegistryKey::getKeyType(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ return css::registry::RegistryKeyType_KEY;
+}
+
+css::registry::RegistryValueType RegistryKey::getValueType()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Type t(value_.getValueType());
+ switch (t.getTypeClass()) {
+ case css::uno::TypeClass_LONG:
+ return css::registry::RegistryValueType_LONG;
+ case css::uno::TypeClass_STRING:
+ return css::registry::RegistryValueType_STRING;
+ case css::uno::TypeClass_SEQUENCE:
+ if (t == cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get()) {
+ return css::registry::RegistryValueType_BINARY;
+ } else if (t == cppu::UnoType< css::uno::Sequence< sal_Int32 > >::get())
+ {
+ return css::registry::RegistryValueType_LONGLIST;
+ } else if (t ==
+ cppu::UnoType< css::uno::Sequence< rtl::OUString > >::get())
+ {
+ return css::registry::RegistryValueType_STRINGLIST;
+ }
+ // fall through
+ default:
+ return css::registry::RegistryValueType_NOT_DEFINED;
+ }
+}
+
+sal_Int32 RegistryKey::getLongValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ sal_Int32 v = 0;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setLongValue(sal_Int32)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< sal_Int32 > RegistryKey::getLongListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< sal_Int32 > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setLongListValue(css::uno::Sequence< sal_Int32 > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::OUString RegistryKey::getAsciiValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ rtl::OUString v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setAsciiValue(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getAsciiListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< rtl::OUString > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setAsciiListValue(css::uno::Sequence< rtl::OUString > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::OUString RegistryKey::getStringValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ rtl::OUString v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setStringValue(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getStringListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< rtl::OUString > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setStringListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< sal_Int8 > RegistryKey::getBinaryValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< sal_Int8 > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setBinaryValue(css::uno::Sequence< sal_Int8 > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::registry::XRegistryKey > RegistryKey::openKey(
+ rtl::OUString const & aKeyName)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ css::uno::Reference< css::container::XHierarchicalNameAccess > access;
+ if (value_ >>= access) {
+ try {
+ return new RegistryKey(
+ service_, access->getByHierarchicalName(aKeyName));
+ } catch (css::container::NoSuchElementException &) {}
+ }
+ return css::uno::Reference< css::registry::XRegistryKey >();
+}
+
+css::uno::Reference< css::registry::XRegistryKey > RegistryKey::createKey(
+ rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::closeKey()
+ throw (
+ css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+}
+
+void RegistryKey::deleteKey(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+RegistryKey::openKeys()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getKeyNames()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool RegistryKey::createLink(rtl::OUString const &, rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return false;
+}
+
+void RegistryKey::deleteLink(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+}
+
+rtl::OUString RegistryKey::getLinkTarget(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return rtl::OUString();
+}
+
+rtl::OUString RegistryKey::getResolvedName(rtl::OUString const & aKeyName)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return aKeyName;
+}
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry must be"
+ " instantiated without arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return static_cast< cppu::OWeakObject * >(new Service(Context));
+}
+
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.ConfigurationRegistry"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory > createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/configurationregistry.hxx b/configmgr/source/configurationregistry.hxx
new file mode 100644
index 000000000000..6cba122188b1
--- /dev/null
+++ b/configmgr/source/configurationregistry.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XSingleComponentFactory;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace configuration_registry {
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
new file mode 100644
index 000000000000..5540a40fd5f4
--- /dev/null
+++ b/configmgr/source/data.cxx
@@ -0,0 +1,318 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "setnode.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool decode(
+ rtl::OUString const & encoded, sal_Int32 begin, sal_Int32 end,
+ rtl::OUString * decoded)
+{
+ OSL_ASSERT(
+ begin >= 0 && begin <= end && end <= encoded.getLength() &&
+ decoded != 0);
+ rtl::OUStringBuffer buf;
+ while (begin != end) {
+ sal_Unicode c = encoded[begin++];
+ if (c == '&') {
+ if (encoded.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("amp;"), begin))
+ {
+ buf.append(sal_Unicode('&'));
+ begin += RTL_CONSTASCII_LENGTH("amp;");
+ } else if (encoded.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("quot;"), begin))
+ {
+ buf.append(sal_Unicode('"'));
+ begin += RTL_CONSTASCII_LENGTH("quot;");
+ } else if (encoded.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("apos;"), begin))
+ {
+ buf.append(sal_Unicode('\''));
+ begin += RTL_CONSTASCII_LENGTH("apos;");
+ } else {
+ return false;
+ }
+ OSL_ASSERT(begin <= end);
+ } else {
+ buf.append(c);
+ }
+ }
+ *decoded = buf.makeStringAndClear();
+ return true;
+}
+
+}
+
+rtl::OUString Data::createSegment(
+ rtl::OUString const & templateName, rtl::OUString const & name)
+{
+ if (templateName.getLength() == 0) {
+ return name;
+ }
+ rtl::OUStringBuffer buf(templateName);
+ //TODO: verify template name contains no bad chars?
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("['"));
+ for (sal_Int32 i = 0; i < name.getLength(); ++i) {
+ sal_Unicode c = name[i];
+ switch (c) {
+ case '&':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ break;
+ case '"':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&quot;"));
+ break;
+ case '\'':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&apos;"));
+ break;
+ default:
+ buf.append(c);
+ break;
+ }
+ }
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("']"));
+ return buf.makeStringAndClear();
+}
+
+sal_Int32 Data::parseSegment(
+ rtl::OUString const & path, sal_Int32 index, rtl::OUString * name,
+ bool * setElement, rtl::OUString * templateName)
+{
+ OSL_ASSERT(
+ index >= 0 && index <= path.getLength() && name != 0 &&
+ setElement != 0);
+ sal_Int32 i = index;
+ while (i < path.getLength() && path[i] != '/' && path[i] != '[') {
+ ++i;
+ }
+ if (i == path.getLength() || path[i] == '/') {
+ *name = path.copy(index, i - index);
+ *setElement = false;
+ return i;
+ }
+ if (templateName != 0) {
+ if (i - index == 1 && path[index] == '*') {
+ *templateName = rtl::OUString();
+ } else {
+ *templateName = path.copy(index, i - index);
+ }
+ }
+ if (++i == path.getLength()) {
+ return -1;
+ }
+ sal_Unicode del = path[i++];
+ if (del != '\'' && del != '"') {
+ return -1;
+ }
+ sal_Int32 j = path.indexOf(del, i);
+ if (j == -1 || j + 1 == path.getLength() || path[j + 1] != ']' ||
+ !decode(path, i, j, name))
+ {
+ return -1;
+ }
+ *setElement = true;
+ return j + 2;
+}
+
+rtl::OUString Data::fullTemplateName(
+ rtl::OUString const & component, rtl::OUString const & name)
+{
+ if (component.indexOf(':') != -1 || name.indexOf(':') != -1) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad component/name pair containing colon ")) +
+ component + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ name),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUStringBuffer buf(component);
+ buf.append(sal_Unicode(':'));
+ buf.append(name);
+ return buf.makeStringAndClear();
+}
+
+bool Data::equalTemplateNames(
+ rtl::OUString const & shortName, rtl::OUString const & longName)
+{
+ if (shortName.indexOf(':') == -1) {
+ sal_Int32 i = longName.indexOf(':') + 1;
+ OSL_ASSERT(i > 0);
+ return
+ rtl_ustr_compare_WithLength(
+ shortName.getStr(), shortName.getLength(),
+ longName.getStr() + i, longName.getLength() - i) ==
+ 0;
+ } else {
+ return shortName == longName;
+ }
+}
+
+rtl::Reference< Node > Data::findNode(
+ int layer, NodeMap const & map, rtl::OUString const & name)
+{
+ NodeMap::const_iterator i(map.find(name));
+ return i == map.end() || i->second->getLayer() > layer
+ ? rtl::Reference< Node >() : i->second;
+}
+
+rtl::Reference< Node > Data::resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path, int * finalizedLayer)
+ const
+{
+ if (pathRepresentation.getLength() == 0 || pathRepresentation[0] != '/') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString seg;
+ bool setElement;
+ sal_Int32 n = parseSegment(pathRepresentation, 1, &seg, &setElement, 0);
+ if (n == -1 || setElement)
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ NodeMap::const_iterator i(components.find(seg));
+ if (path != 0) {
+ path->clear();
+ }
+ rtl::Reference< Node > parent;
+ int finalized = NO_LAYER;
+ for (rtl::Reference< Node > p(i == components.end() ? 0 : i->second);;) {
+ if (!p.is()) {
+ return p;
+ }
+ if (path != 0) {
+ path->push_back(seg);
+ }
+ finalized = std::min(finalized, p->getFinalized());
+ if (n != pathRepresentation.getLength() &&
+ pathRepresentation[n++] != '/')
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ // for backwards compatibility, ignore a final slash
+ if (n == pathRepresentation.getLength()) {
+ if (finalizedLayer != 0) {
+ *finalizedLayer = finalized;
+ }
+ return p;
+ }
+ parent = p;
+ rtl::OUString templateName;
+ n = parseSegment(
+ pathRepresentation, n, &seg, &setElement, &templateName);
+ if (n == -1) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ // For backwards compatibility, allow set members to be accessed with
+ // simple path segments, like group members:
+ p = p->getMember(seg);
+ if (setElement) {
+ switch (parent->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (templateName.getLength() != 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_SET:
+ if (templateName.getLength() != 0 &&
+ !dynamic_cast< SetNode * >(parent.get())->isValidTemplate(
+ templateName))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (templateName.getLength() != 0 && p != 0) {
+ OSL_ASSERT(p->getTemplateName().getLength() != 0);
+ if (!equalTemplateNames(templateName, p->getTemplateName())) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ }
+}
+
+rtl::Reference< Node > Data::getTemplate(
+ int layer, rtl::OUString const & fullName) const
+{
+ return findNode(layer, templates, fullName);
+}
+
+}
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
new file mode 100644
index 000000000000..495ca1233878
--- /dev/null
+++ b/configmgr/source/data.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
+
+#include "sal/config.h"
+
+#include <climits>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "modifications.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Node;
+
+struct Data: private boost::noncopyable {
+ enum { NO_LAYER = INT_MAX };
+
+ NodeMap templates;
+
+ NodeMap components;
+
+ Modifications modifications;
+
+ static rtl::OUString createSegment(
+ rtl::OUString const & templateName, rtl::OUString const & name);
+
+ static sal_Int32 parseSegment(
+ rtl::OUString const & path, sal_Int32 index, rtl::OUString * name,
+ bool * setElement, rtl::OUString * templateName);
+
+ static rtl::OUString fullTemplateName(
+ rtl::OUString const & component, rtl::OUString const & name);
+
+ //TODO: better rules under which circumstances a short template name matches
+ static bool equalTemplateNames(
+ rtl::OUString const & shortName, rtl::OUString const & longName);
+
+ static rtl::Reference< Node > findNode(
+ int layer, NodeMap const & map, rtl::OUString const & name);
+
+ rtl::Reference< Node > resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const;
+
+ rtl::Reference< Node > getTemplate(
+ int layer, rtl::OUString const & fullName) const;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/data/anydata.cxx b/configmgr/source/data/anydata.cxx
deleted file mode 100644
index 6d768147b7bc..000000000000
--- a/configmgr/source/data/anydata.cxx
+++ /dev/null
@@ -1,468 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "anydata.hxx"
-#include "sequence.hxx"
-#include "flags.hxx"
-#include "typeconverter.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
- namespace Type = data::Type;
- namespace uno = ::com::sun::star::uno;
-//-----------------------------------------------------------------------------
-
-sal_uInt8 getTypeCode(uno::Type const & _aType)
-{
- switch (_aType.getTypeClass())
- {
- case uno::TypeClass_ANY:
- case uno::TypeClass_VOID:
- return Type::value_any;
-
- case uno::TypeClass_STRING:
- return Type::value_string;
-
- case uno::TypeClass_BOOLEAN:
- return Type::value_boolean;
-
- case uno::TypeClass_SHORT:
- return Type::value_short;
-
- case uno::TypeClass_LONG:
- return Type::value_int;
-
- case uno::TypeClass_HYPER:
- return Type::value_long;
-
- case uno::TypeClass_FLOAT:
- case uno::TypeClass_DOUBLE:
- return Type::value_double;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Type aElementType = getSequenceElementType(_aType);
-
- if (aElementType.getTypeClass() == uno::TypeClass_BYTE)
- return Type::value_binary;
-
- OSL_ASSERT(aElementType != _aType); // would cause infinite recursion
- sal_uInt8 aElementTC = getTypeCode(aElementType);
-
- OSL_ASSERT(Type::value_invalid & Type::flag_sequence); // ensure check works for invalid types
-
- if (aElementTC & Type::flag_sequence) // no sequence of sequence
- return Type::value_invalid;
-
- return sal_uInt8( aElementTC | Type::flag_sequence );
- }
- default:
- return Type::value_invalid;
- }
-}
-//-----------------------------------------------------------------------------
-
-static uno::Type getUnoSimpleType( sal_uInt8 _aSimpleType)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- return ::getCppuType(static_cast<rtl::OUString const *>(0));
-
- case Type::value_boolean:
- return ::getBooleanCppuType();
-
- case Type::value_short:
- return ::getCppuType(static_cast<sal_Int16 const *>(0));
-
- case Type::value_int:
- return ::getCppuType(static_cast<sal_Int32 const *>(0));
-
- case Type::value_long:
- return ::getCppuType(static_cast<sal_Int64 const *>(0));
-
- case Type::value_double:
- return ::getCppuType(static_cast<double const *>(0));
-
- case Type::value_binary:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int8> const *>(0));
-
- case Type::value_any:
- //return ::getVoidCppuType();
- return ::getCppuType(static_cast<uno::Any const *>(0));
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return ::getVoidCppuType();
- }
-}
-//-----------------------------------------------------------------------------
-
-static uno::Type getUnoSequenceType( sal_uInt8 _aSimpleType)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- return ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const *>(0));
-
- case Type::value_boolean:
- return ::getCppuType(static_cast<uno::Sequence<sal_Bool> const *>(0));
-
- case Type::value_short:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int16> const *>(0));
-
- case Type::value_int:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int32> const *>(0));
-
- case Type::value_long:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int64> const *>(0));
-
- case Type::value_double:
- return ::getCppuType(static_cast<uno::Sequence<double> const *>(0));
-
- case Type::value_binary:
- return ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const *>(0));
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return ::getVoidCppuType();
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Type getUnoType( sal_uInt8 _aType)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- return getUnoSequenceType( sal_uInt8(_aType & Type::mask_basetype));
-
- else
- return getUnoSimpleType(_aType);
-}
-//-----------------------------------------------------------------------------
-
-static
-AnyData allocSimpleData(sal_uInt8 _aSimpleType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- AnyData aResult;
- aResult.data = 0;
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- rtl::OUString sValue;
- OSL_VERIFY(_aAny >>= sValue );
- aResult.stringValue = acquireString(sValue);
- }
- break;
-
- case Type::value_boolean:
- OSL_VERIFY(_aAny >>= aResult.boolValue );
- break;
-
- case Type::value_short:
- OSL_VERIFY(_aAny >>= aResult.shortValue);
- break;
-
- case Type::value_int:
- OSL_VERIFY(_aAny >>= aResult.intValue);
- break;
-
- case Type::value_long:
- {
- sal_Int64 nValue = 0;
- OSL_VERIFY(_aAny >>= nValue);
-
- aResult.longValue = new sal_Int64( nValue );
- }
- break;
-
- case Type::value_double:
- {
- double dValue = 0;
- OSL_VERIFY(_aAny >>= dValue);
-
- aResult.doubleValue = new double( dValue );
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence<sal_Int8> aValue;
- OSL_VERIFY(_aAny >>= aValue);
- aResult.binaryValue = allocBinary(aValue);
- }
- break;
-
- case Type::value_any:
- OSL_ENSURE( false, "Trying to allocate void value" );
- break;
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-template <class E>
-inline
-sal_Sequence const * extractSequenceData(uno::Sequence< E > & _rSeq, uno::Any const & _aAny)
-{
- if (_aAny >>= _rSeq)
- {
- return _rSeq.get();
- }
-
- else
- {
- OSL_ENSURE(false, "Could not extract sequence from Any");
- return NULL;
- }
-}
-//-----------------------------------------------------------------------------
-
-static
-AnyData allocSequenceData(sal_uInt8 _aSimpleType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- sal_uInt8 * aSequence = 0;
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- uno::Sequence<rtl::OUString> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_boolean:
- {
- uno::Sequence<sal_Bool> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_short:
- {
- uno::Sequence<sal_Int16> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_int:
- {
- uno::Sequence<sal_Int32> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_long:
- {
- uno::Sequence<sal_Int64> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_double:
- {
- uno::Sequence<double> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence<uno::Sequence<sal_Int8> > aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- AnyData aResult;
- aResult.sequenceValue = aSequence;
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-AnyData allocData(sal_uInt8 _aType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
- OSL_ENSURE( _aType == getTypeCode(_aAny.getValueType()), "Type code does not match value" );
-
- if (_aType & Type::flag_sequence)
- return allocSequenceData(sal_uInt8( _aType & Type::mask_basetype),_aAny);
- else
- return allocSimpleData(_aType,_aAny);
-}
-//-----------------------------------------------------------------------------
-
-static
-void freeSimpleData(sal_uInt8 _aSimpleType, AnyData const & _aData)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- rtl_uString_release(_aData.stringValue);
- break;
-
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- // nothing to do
- break;
-
- // free memory for oversized values
- case Type::value_long:
- delete _aData.longValue;
- break;
-
- case Type::value_double:
- delete _aData.doubleValue;
- break;
-
- case Type::value_binary:
- freeBinary(_aData.binaryValue);
- break;
-
- case Type::value_any:
- // nothing to do for void value
- break;
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-}
-//-----------------------------------------------------------------------------
-
-void freeData(sal_uInt8 _aType, AnyData _aData)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- freeSequence(sal_uInt8(_aType & Type::mask_basetype),_aData.sequenceValue);
-
- else
- freeSimpleData(_aType,_aData);
-}
-//-----------------------------------------------------------------------------
-
-static
-uno::Any readSimpleData(sal_uInt8 _aSimpleType, AnyData const & _aData)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- rtl::OUString sValue = rtl::OUString(_aData.stringValue);
- return uno::makeAny(sValue);
- }
-
- case Type::value_boolean:
- return uno::makeAny( _aData.boolValue );
-
- case Type::value_short:
- return uno::makeAny( _aData.shortValue );
-
- case Type::value_int:
- return uno::makeAny( _aData.intValue );
-
- case Type::value_long:
- return uno::makeAny( *_aData.longValue );
-
- case Type::value_double:
- return uno::makeAny( *_aData.doubleValue );
-
- case Type::value_binary:
- {
- uno::Sequence<sal_Int8> aValue = readBinary( _aData.binaryValue );
- return uno::makeAny( aValue );
- }
-
- case Type::value_any: // void value
- return uno::Any();
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return uno::Any();
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Any readData(sal_uInt8 _aType, AnyData _aData)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- return readAnySequence(sal_uInt8(_aType & Type::mask_basetype),_aData.sequenceValue);
-
- else
- return readSimpleData(_aType,_aData);
-}
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/data/makefile.mk b/configmgr/source/data/makefile.mk
deleted file mode 100644
index fd6dc059b5fa..000000000000
--- a/configmgr/source/data/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=data
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/anydata.obj \
- $(SLO)$/sequence.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/data/sequence.cxx b/configmgr/source/data/sequence.cxx
deleted file mode 100644
index 6674a760c86e..000000000000
--- a/configmgr/source/data/sequence.cxx
+++ /dev/null
@@ -1,490 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "datalock.hxx"
-#include "sequence.hxx"
-#include "flags.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-#ifndef INCLUDED_STRING_H
-#include <string.h>
-#define INCLUDED_STRING_H
-#endif
-
-#include "utility.hxx"
-
-#ifndef SIMPLE_REFERENCE_FAST
-# include <stdio.h>
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
- namespace Type = data::Type;
- namespace uno = ::com::sun::star::uno;
-//-----------------------------------------------------------------------------
-static
-sal_uInt32 implGetElementSize(sal_uInt8 _aElementType)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- switch (_aElementType)
- {
-
- case Type::value_boolean: return sizeof(sal_Bool);
-
- case Type::value_short: return sizeof(sal_Int16);
-
- case Type::value_int: return sizeof(sal_Int32);
-
- case Type::value_long: return sizeof(sal_Int64);
-
- case Type::value_double: return sizeof(double);
-
- case Type::value_string: return sizeof(rtl_uString *);
-
- case Type::value_binary: return sizeof(sal_uInt8 *);
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return 0;
- }
-}
-
-//-----------------------------------------------------------------------------
-static inline
-sal_uInt32 implGetHeaderSize(sal_uInt32 _nElemSize)
-{
- // pad header to elem size, if larger (for safe alignment)
- OSL_ASSERT(_nElemSize > sizeof(sal_Int32) || sizeof(sal_Int32) % _nElemSize== 0);
- return _nElemSize > sizeof(sal_Int32) ? _nElemSize : sizeof(sal_Int32);
-}
-
-//-----------------------------------------------------------------------------
-static
-inline
-sal_Int32& implGetSize(sal_uInt8 * _aSeq)
-{
- return * (sal_Int32 *) _aSeq;
-}
-
-//-----------------------------------------------------------------------------
-static
-sal_uInt8 * implSeqAlloc(sal_Int32 _nElements, sal_uInt32 _nElemSize)
-{
- sal_uInt32 nTotalSize = implGetHeaderSize(_nElemSize) + _nElements * _nElemSize;
-
- sal_uInt8 * aResult = (sal_uInt8 *) (new sal_uInt8[nTotalSize]);
-
- implGetSize(aResult) = _nElements;
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-
-static
-void allocSeqData(sal_uInt8 *_pDestAddr,
- sal_uInt8 _aElementType,
- sal_Int32 _nElements, sal_uInt32 _nElementSize,
- void const * _pSourceData)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- OSL_ASSERT(_nElementSize == implGetElementSize(_aElementType));
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- ::memcpy(_pDestAddr,_pSourceData,_nElements * _nElementSize);
- break;
-
- case Type::value_string:
- {
- OSL_ASSERT(_nElementSize == sizeof(rtl_uString *));
-
- rtl::OUString const * pSource = static_cast<rtl::OUString const *>(_pSourceData);
-
- while (--_nElements >= 0)
- {
- rtl_uString * aElement = acquireString(*pSource);
-
- rtl_uString * * pDest = reinterpret_cast<rtl_uString **>(_pDestAddr);
- *pDest = aElement;
-
- ++pSource;
- _pDestAddr += sizeof *pDest;
- }
- }
- break;
-
- case Type::value_binary:
- {
- OSL_ASSERT(_nElementSize == sizeof(sal_uInt8 *));
-
- uno::Sequence< sal_Int8 > const * pSource = static_cast<uno::Sequence< sal_Int8 > const *>(_pSourceData);
-
- while (--_nElements >= 0)
- {
- sal_uInt8 * aElement = allocBinary(*pSource);
-
- sal_uInt8 * * pDest = (sal_uInt8 * *) _pDestAddr;
- *pDest = aElement;
-
- ++pSource;
- _pDestAddr += sizeof *pDest;
- }
- }
- break;
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- break;
- }
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt8 * allocSequence(sal_uInt8 _aElementType, ::sal_Sequence const * _pSeqData)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_pSeqData, "ERROR: Trying to allocate from a NULL sequence");
- if (_pSeqData == NULL) return 0;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 const nElementSize = implGetElementSize(_aElementType);
- sal_Int32 const nElements = _pSeqData->nElements;
-
- sal_uInt8 * aResult = implSeqAlloc(nElements,nElementSize);
-
- if (aResult)
- allocSeqData( aResult + implGetHeaderSize(nElementSize),
- _aElementType, nElements, nElementSize,
- _pSeqData->elements);
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt8 * allocBinary(uno::Sequence<sal_Int8> const & _aBinaryValue)
-{
- sal_uInt32 const nElementSize = 1;
- sal_Int32 const nLength = _aBinaryValue.getLength();
-
- sal_uInt8 * aResult = implSeqAlloc(nLength,nElementSize);
-
- if (aResult)
- {
- sal_uInt8 *pElementBaseAddr = aResult + implGetHeaderSize(nElementSize);
- ::memcpy(pElementBaseAddr, _aBinaryValue.getConstArray(), nLength);
- }
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-static
-void freeSeqData(sal_uInt8 *_pDataAddr,
- sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
-
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- // nothing to do
- break;
-
- case Type::value_string:
- {
- rtl_uString * * pElements = reinterpret_cast<rtl_uString **>( _pDataAddr );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- rtl_uString_release(pElements[i]);
- }
- }
- break;
-
- case Type::value_binary:
- {
- sal_uInt8 * * pElements = reinterpret_cast<sal_uInt8 **>( _pDataAddr );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- freeBinary(pElements[i]);
- }
- }
- break;
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- break;
- }
-}
-
-//-----------------------------------------------------------------------------
-void freeSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_aSeq, "ERROR: Trying to free a NULL sequence");
- if (_aSeq == 0) return;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 nHeaderSize = implGetHeaderSize( implGetElementSize( _aElementType ) );
-
- freeSeqData(_aSeq + nHeaderSize, _aElementType, implGetSize(_aSeq));
-
- delete[] (sal_uInt8 *)_aSeq;
-}
-
-//-----------------------------------------------------------------------------
-void freeBinary(sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aSeq, "ERROR: Trying to free a NULL sequence");
- if (_aSeq == 0) return;
-
- delete[] (sal_uInt8 *)_aSeq;
-}
-
-//-----------------------------------------------------------------------------
-
-static inline
-sal_Sequence * implCreateSequence(void const * _pElements, sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- uno::Type aUnoType = getUnoType( sal_uInt8( _aElementType | Type::flag_sequence ));
-
- sal_Sequence * pResult = NULL;
- ::uno_type_sequence_construct( &pResult, aUnoType.getTypeLibType(),
- const_cast< void * >( _pElements ),
- _nElements, NULL );
-
- OSL_ASSERT(pResult->nRefCount == 1);
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-static
-sal_Sequence * readSeqData(sal_uInt8 *_pDataAddr, sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
-
- void const * pElementData = (void const *)_pDataAddr;
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- return implCreateSequence(pElementData,_aElementType,_nElements);
-
- case Type::value_string:
- {
- uno::Sequence<rtl::OUString> aResult(_nElements);
- rtl::OUString * pResult = aResult.getArray();
-
- rtl_uString * const * pElements = static_cast<rtl_uString * const *>( pElementData );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- pResult[i] = rtl::OUString(pElements[i]);
- }
-
- sal_Sequence * pRet = aResult.get();
- ++pRet->nRefCount;
- return pRet;
- }
-
- case Type::value_binary:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > aResult(_nElements);
- uno::Sequence< sal_Int8 > * pResult = aResult.getArray();
-
- sal_uInt8 * const * pElements = static_cast<sal_uInt8 * const *>( pElementData );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- pResult[i] = readBinary(pElements[i]);
- }
-
- sal_Sequence * pRet = aResult.get();
- ++pRet->nRefCount;
- return pRet;
- }
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- return NULL;
- }
-}
-
-//-----------------------------------------------------------------------------
-
-::sal_Sequence * readSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_aSeq, "ERROR: Trying to read from a NULL sequence");
- if (_aSeq == 0) return NULL;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 nHeaderSize = implGetHeaderSize( implGetElementSize( _aElementType ) );
-
- return readSeqData(_aSeq + nHeaderSize, _aElementType, implGetSize(_aSeq));
-}
-
-//-----------------------------------------------------------------------------
-uno::Any readAnySequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- sal_Sequence * pRawSequence = readSequence(_aElementType, _aSeq);
-
- uno::Any aResult;
-
- if (pRawSequence != NULL)
- switch (_aElementType & Type::mask_basetype)
- {
- case Type::value_string:
- {
- uno::Sequence< rtl::OUString > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_boolean:
- {
- uno::Sequence< sal_Bool > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_short:
- {
- uno::Sequence< sal_Int16 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_int:
- {
- uno::Sequence< sal_Int32 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_long:
- {
- uno::Sequence< sal_Int64 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_double:
- {
- uno::Sequence< double > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_any: // from value_invalid ??
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- OSL_ASSERT(!aResult.hasValue() || aResult.getValueType() == getUnoType(sal_uInt8(_aElementType | Type::flag_sequence)));
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-uno::Sequence<sal_Int8> readBinary(sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aSeq, "ERROR: Trying to read from a NULL sequence");
- if (_aSeq == 0) return uno::Sequence<sal_Int8>();
-
- return uno::Sequence< sal_Int8 >((const sal_Int8 *)(_aSeq + implGetHeaderSize(1)),
- implGetSize(_aSeq));
-}
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace
-
-// Remaining 'global' mutex bits - should move to api2 ...
-namespace configmgr
-{
- osl::Mutex UnoApiLock::aCoreLock;
- volatile oslInterlockedCount UnoApiLock::nHeld = 0;
-
- UnoApiLockReleaser::UnoApiLockReleaser()
- {
- mnCount = UnoApiLock::nHeld;
- for (oslInterlockedCount i = 0; i < mnCount; i++)
- UnoApiLock::release();
- }
-
- UnoApiLockReleaser::~UnoApiLockReleaser()
- {
- for (oslInterlockedCount i = 0; i < mnCount; i++)
- UnoApiLock::acquire();
- }
-} // namespace configmgr
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx
new file mode 100644
index 000000000000..d069663290e8
--- /dev/null
+++ b/configmgr/source/defaultprovider.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/weak.hxx"
+#include "sal/types.h"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "configurationprovider.hxx"
+#include "lock.hxx"
+
+namespace configmgr { namespace default_provider {
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider must be"
+ " instantiated without arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ osl::MutexGuard guard(lock);
+ static css::uno::Reference< css::uno::XInterface > singleton(
+ configuration_provider::createDefault(Context));
+ return singleton;
+}
+
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.DefaultProvider"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx
new file mode 100644
index 000000000000..7b267a80b42e
--- /dev/null
+++ b/configmgr/source/defaultprovider.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_DEFAULTPROVIDER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_DEFAULTPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XSingleComponentFactory;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace default_provider {
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx
new file mode 100644
index 000000000000..60d825451d69
--- /dev/null
+++ b/configmgr/source/groupnode.cxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+GroupNode::GroupNode(
+ int layer, bool extensible, rtl::OUString const & templateName):
+ Node(layer), extensible_(extensible), templateName_(templateName),
+ mandatory_(Data::NO_LAYER)
+{}
+
+rtl::Reference< Node > GroupNode::clone() const {
+ return new GroupNode(*this);
+}
+
+NodeMap & GroupNode::getMembers() {
+ return members_;
+}
+
+rtl::OUString GroupNode::getTemplateName() const {
+ return templateName_;
+}
+
+void GroupNode::setMandatory(int layer) {
+ mandatory_ = layer;
+}
+
+int GroupNode::getMandatory() const {
+ return mandatory_;
+}
+
+bool GroupNode::isExtensible() const {
+ return extensible_;
+}
+
+GroupNode::GroupNode(GroupNode const & other):
+ Node(other), extensible_(other.extensible_),
+ templateName_(other.templateName_), mandatory_(other.mandatory_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+GroupNode::~GroupNode() {}
+
+Node::Kind GroupNode::kind() const {
+ return KIND_GROUP;
+}
+
+void GroupNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx
new file mode 100644
index 000000000000..be4907b86ce3
--- /dev/null
+++ b/configmgr/source/groupnode.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_GROUPNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_GROUPNODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class GroupNode: public Node {
+public:
+ GroupNode(int layer, bool extensible, rtl::OUString const & templateName);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ bool isExtensible() const;
+
+private:
+ GroupNode(GroupNode const & other);
+
+ virtual ~GroupNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ bool extensible_;
+ NodeMap members_;
+ rtl::OUString templateName_;
+ // non-empty iff this node is a template, free node, or set member
+ int mandatory_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/inc/anydata.hxx b/configmgr/source/inc/anydata.hxx
deleted file mode 100644
index 8a50630f4542..000000000000
--- a/configmgr/source/inc/anydata.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_ANYDATA_HXX
-#define INCLUDED_SHARABLE_ANYDATA_HXX
-
-#include "rtl/ustring.h"
-#include "sal/types.h"
-
-//-----------------------------------------------------------------------------
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
- class Type;
-} } } }
-//-----------------------------------------------------------------------------
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
- namespace sharable
- {
- //-----------------------------------------------------------------------------
-
- union AnyData
- {
- sal_Bool boolValue;
- sal_Int16 shortValue;
- sal_Int32 intValue;
- sal_Int64 *longValue;
- double *doubleValue;
- sal_uInt8 * binaryValue; // points to counted sal_(u)Int8 []
- rtl_uString * stringValue; // points to counted sal_Unicode []
- sal_uInt8 * sequenceValue; // points to counted AnyData [] (or SomeType [] ?)
- void *data; // used to initialize to 0
- };
-
- //-----------------------------------------------------------------------------
-
- sal_uInt8 getTypeCode(::com::sun::star::uno::Type const & _aType);
- ::com::sun::star::uno::Type getUnoType( sal_uInt8 _aType);
-
- AnyData allocData(sal_uInt8 _aType, ::com::sun::star::uno::Any const & _aAny);
- void freeData(sal_uInt8 _aType, AnyData _aData);
- ::com::sun::star::uno::Any readData(sal_uInt8 _aType, AnyData _aData);
-
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // INCLUDED_SHARABLE_ANYDATA_HXX
-
diff --git a/configmgr/source/inc/anynoderef.hxx b/configmgr/source/inc/anynoderef.hxx
deleted file mode 100644
index 6b786f664fbc..000000000000
--- a/configmgr/source/inc/anynoderef.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGANYNODE_HXX_
-#define CONFIGMGR_CONFIGANYNODE_HXX_
-
-#include "noderef.hxx"
-
-namespace configmgr
-{
- namespace configapi { class Factory; }
- namespace node { struct Attributes; }
-
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class AnyNodeRef;
- class NodeID;
- class Tree;
- //-------------------------------------------------------------------------
-
- /// represents any node in some tree
- class AnyNodeRef
- {
- public:
- /// constructs an empty (invalid) node
- AnyNodeRef();
-
- AnyNodeRef(unsigned int nParentPos, unsigned int m_nDepth);
- AnyNodeRef(rtl::OUString const& aName, unsigned int nParentPos);
-
- /// converts an inner node
- explicit AnyNodeRef(NodeRef const& aInnerNode);
- /// converts a value node
- explicit AnyNodeRef(ValueRef const& aValueNode);
-
- /// copy a node (with reference semantics)
- AnyNodeRef(AnyNodeRef const& rOther);
- /// copy a node (with reference semantics)
- AnyNodeRef& operator=(AnyNodeRef const& rOther);
-
- void swap(AnyNodeRef& rOther);
-
- ~AnyNodeRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- /// checks if this a node (rather than a value only)
- bool isNode() const;
-
- /// converts this, if it is a value
- ValueRef toValue() const;
-
- /// converts this, if it is a inner node
- NodeRef toNode() const;
-
-#if OSL_DEBUG_LEVEL > 0
- bool checkValidState() const;
-#endif
-
- rtl::OUString m_sNodeName;
- unsigned int m_nUsedPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- inline
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, AnyNodeRef const& aNode, rtl::OUString const& aName)
- { return aNode.isNode() && hasChildOrElement(aTree,aNode.toNode(),aName); }
-
- /** tries to find the immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
- <p> On return <var>aNode</var> is modified to refer to the node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
-
- @return The requested child node, if it exists
- (then <var>aTree</var> refers to the tree containing the desired node),
- */
- AnyNodeRef getChildOrElement(rtl::Reference< Tree > & aTree, NodeRef const& aParentNode, rtl::OUString const& aName);
-
- /** tries to find the descendant of <var>aNode</var> specified by <var>aPath</var> within <var>aTree</var>
- <p> This function follows the given path stepwise, until a requested node is missing in the tree.</p>
- <p> On return <var>aNode</var> is modified to refer to the last inner node found
- and <var>aTree</var> will be unchanged (except for deprecated usage).
- <p/>
- <p> Also, <var>aPath</var> is modified to contain the unresolved part of the original path.
- </p>
-
- @return the requested node, if the path could be resolved completely
- (so <var>aNode</var> refers to the desired node or its parent,
- and <var>aPath</var> is empty)<BR/>
- an invalid node otherwise
- */
- AnyNodeRef getLocalDescendant(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& aPath);
-
- /** tries to find the descendant of <var>aNode</var> (which is in <var>aTree</var>) specified by <var>aPath</var>
- <p> This function follows the given path stepwise, until a requested node is missing in the tree.</p>
- <p> On return <var>aNode</var> is modified to refer to the last inner node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
- <p> Also, <var>aPath</var> is modified to contain the unresolved part of the original path.
- </p>
-
- @return the requested node, if the path could be resolved completely
- (so <var>aNode</var> and <var>aTree</var> refer to the desired node or its parent,
- and <var>aPath</var> is empty)<BR/>
- an invalid node otherwise
- */
- AnyNodeRef getDeepDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& aPath);
-
- //-------------------------------------------------------------------------
- inline bool AnyNodeRef::isValid() const
- {
- OSL_ASSERT( m_nUsedPos == 0 || checkValidState() );
- return m_nUsedPos != 0;
- }
-
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGANYNODE_HXX_
diff --git a/configmgr/source/inc/anypair.hxx b/configmgr/source/inc/anypair.hxx
deleted file mode 100644
index 0ce5c9628179..000000000000
--- a/configmgr/source/inc/anypair.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef CFGMGR_ANYPAIR_HXX
-#define CFGMGR_ANYPAIR_HXX
-
-#include <uno/any2.h>
-#include <com/sun/star/uno/Any.h>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-namespace configmgr
-{
- namespace css = com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-
- //==========================================================================
- //= flags for handling the state of an Anypair
- //==========================================================================
- enum {
- cfgmgr_SELECT_FIRST = 0x01,
- cfgmgr_SELECT_SECOND = 0x02,
- cfgmgr_SELECT_BOTH = cfgmgr_SELECT_FIRST | cfgmgr_SELECT_SECOND
- };
-
- //==========================================================================
- //= data structure for descriptive data for an AnyPair
- //==========================================================================
- struct cfgmgr_AnyPair_Desc
- {
- typelib_TypeDescriptionReference * pType;
- sal_uInt8 nState;
- };
-
- inline bool cfgmgr_AnyPair_isNull(cfgmgr_AnyPair_Desc const* _pDesc, sal_uInt8 nSelect)
- { return (_pDesc->nState & nSelect) == 0; }
-
- inline bool cfgmgr_AnyPair_isEmpty(cfgmgr_AnyPair_Desc const* _pDesc)
- { return (typelib_TypeClass_VOID == _pDesc->pType->eTypeClass); }
-
- //==========================================================================
- //= cfgmgr_AnyPair Basic (POD) data structure for a nullable pair of Anys
- //==========================================================================
-
- struct cfgmgr_AnyPair
- {
- cfgmgr_AnyPair_Desc desc;
- const void * first;
- const void * second;
- };
-
-// -----------------------------------------------------------------------------
- //==========================================================================
- //= AnyPair
- //==========================================================================
- // this AnyPair holds 2 nullable Any's which have to have the same type.
-
- class AnyPair
- {
- cfgmgr_AnyPair m_aAnyPair;
-
- public:
- enum SelectMember
- {
- SELECT_FIRST = cfgmgr_SELECT_FIRST,
- SELECT_SECOND = cfgmgr_SELECT_SECOND,
- SELECT_BOTH = cfgmgr_SELECT_BOTH
- };
- public:
- explicit AnyPair(uno::Type const& _aType); // one Type, any's are null
- explicit AnyPair(uno::Any const& _aAny, SelectMember _select); // one selected any
-
- explicit AnyPair(uno::Any const& _aAny, uno::Any const& _aAny2) SAL_THROW((lang::IllegalArgumentException));
-
- // copy
- AnyPair(AnyPair const& _aAny);
- AnyPair& operator=(AnyPair const& _aAny);
-
- // d-tor
- ~AnyPair();
-
- // elementwise setters
- sal_Bool setFirst(uno::Any const& _aAny);
- sal_Bool setSecond(uno::Any const& _aAny);
-
- // clear data (but not type)
- void clear(SelectMember _select = SELECT_BOTH);
-
-
- // checking state and availablity of values
- bool isEmpty() const { return cfgmgr_AnyPair_isEmpty(&m_aAnyPair.desc); }
-
- bool isNull () const { return ! hasValue(); }
-
- bool hasValue(SelectMember _select = SELECT_BOTH) const
- {
- return !cfgmgr_AnyPair_isNull(&m_aAnyPair.desc, (sal_uInt8)_select);
- }
- bool hasFirst() const
- {
- return hasValue(SELECT_FIRST);
- }
- bool hasSecond() const
- {
- return hasValue(SELECT_SECOND);
- }
-
- // elementwise getters
- uno::Type getValueType() const;
- uno::Any getFirst() const;
- uno::Any getSecond() const;
- uno::Any getValue(SelectMember _select) const;
-
- };
-
-
-
-
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/apitypes.hxx b/configmgr/source/inc/apitypes.hxx
deleted file mode 100644
index 5e6bec5a4f56..000000000000
--- a/configmgr/source/inc/apitypes.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_APITYPES_HXX_
-#define CONFIGMGR_API_APITYPES_HXX_
-
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-namespace configmgr
-{
- namespace configapi
- {
- namespace uno = ::com::sun::star::uno;
-
- inline
- uno::Type getAnyType( )
- {
- return ::getCppuType( static_cast< uno::Any const * >(0) );
- }
-
- inline
- uno::Type getUnoInterfaceType( )
- {
- return ::getCppuType( static_cast< uno::Reference< uno::XInterface > const * >(0) );
- }
-
- template <typename Interface>
- inline
- uno::Type getReferenceType( Interface const* )
- {
- return ::getCppuType( static_cast< uno::Reference<Interface> const * >(0) );
- }
-
- template <typename Type>
- inline
- uno::Type getSequenceType( Type const* )
- {
- return ::getCppuType( static_cast< uno::Sequence<Type> const * >(0) );
- }
-
- template <typename T>
- inline
- uno::Sequence<T> makeSequence(::std::vector<T> const& aVector)
- {
- if (aVector.empty())
- return uno::Sequence<T>();
- return uno::Sequence<T>(&aVector[0],aVector.size());
- }
- }
-
-}
-
-#endif // CONFIGMGR_API_APITYPES_HXX_
-
-
diff --git a/configmgr/source/inc/attributes.hxx b/configmgr/source/inc/attributes.hxx
deleted file mode 100644
index a7718157da7f..000000000000
--- a/configmgr/source/inc/attributes.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
-#define CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
-namespace configmgr
-{
- namespace node
- {
- enum State
- {
- isDefault, isToDefault = isDefault,
- isMerged, isModification = isMerged,
- isReplaced, isReplacement = isReplaced,
- isAdded, isAddition = isAdded
- };
- enum Access
- {
- accessNull = 0,
- accessWritable = 0,
- accessFinal = 1,
- accessReadonly = 2,
- accessReadonlyAndFinal = 3
- };
- inline Access makeAccess(bool readonly, bool final)
- { return Access( (readonly ? accessReadonly : accessNull) | (final ? accessFinal : accessNull) ); }
- inline bool isAccessReadonly(Access access)
- { return (access & accessReadonly) != 0; }
- inline bool isAccessFinal(Access access)
- { return (access & accessFinal) != 0; }
-
- inline bool existsInDefault(State eState) { return eState <= isReplaced;}
- inline bool isReplacedForUser(State eState) { return eState >= isReplaced;}
-
- /// holds attributes a node in the schema
- struct Attributes
- {
- Attributes()
- : state_(node::isMerged)
- , bReadonly(false)
- , bFinalized(false)
- , bNullable(true)
- , bLocalized(false)
- , bMandatory(false)
- , bRemovable(false)
- {}
-
- State state() const { return State(0x03 & state_); }
- void setState(State _state) { this->state_ = _state; }
-
- bool isWritable() const { return!bReadonly; }
- bool isReadonly() const { return bReadonly; }
- bool isFinalized() const { return bFinalized; }
-
- void markReadonly() { bReadonly = true; }
-
- Access getAccess() const
- { return makeAccess(bReadonly,bFinalized); }
-
- void setAccess(bool _bReadonly, bool _bFinalized)
- { bReadonly = _bReadonly; bFinalized = _bFinalized; }
-
- void setAccess(Access _aAccessLevel)
- { setAccess( isAccessReadonly(_aAccessLevel), isAccessFinal(_aAccessLevel) ); }
-
- bool isNullable() const { return bNullable; }
- void setNullable (bool _bNullable) {bNullable = _bNullable; }
-
- bool isLocalized() const { return bLocalized; }
- void setLocalized (bool _bLocalized) {bLocalized = _bLocalized; }
-
- bool isMandatory() const { return bMandatory; }
- bool isRemovable() const { return bRemovable; }
-
- void markMandatory() { bMandatory = true; }
- void markRemovable() { bRemovable = true; }
-
- void setRemovability(bool _bRemovable, bool _bMandatory)
- { bRemovable = _bRemovable; bMandatory = _bMandatory; }
-
- bool isDefault() const { return this->state() == node::isDefault;}
- bool existsInDefault() const { return node::existsInDefault(this->state());}
- bool isReplacedForUser() const { return node::isReplacedForUser(this->state());}
-
- void markAsDefault(bool _bDefault = true)
- {
- if (_bDefault)
- this->state_ = node::isDefault;
- else if (this->isDefault())
- this->state_ = node::isMerged;
- }
-
- private:
- State state_ : 2; // merged/replaced/default state
-
- bool bReadonly : 1; // write-protected, if true
- bool bFinalized : 1; // can not be overridden - write protected when merged upwards
-
- bool bNullable : 1; // values only: can be NULL
- bool bLocalized : 1; // values only: value may depend on locale
-
- bool bMandatory : 1; // cannot be removed/replaced in subsequent layers
- bool bRemovable : 1; // can be removed
- };
-
- }
-}
-
-#endif
diff --git a/configmgr/source/inc/autoobject.hxx b/configmgr/source/inc/autoobject.hxx
deleted file mode 100644
index f5ec5137a82f..000000000000
--- a/configmgr/source/inc/autoobject.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_AUTOOBJECT_HXX
-#define CONFIGMGR_AUTOOBJECT_HXX
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- template < class Object >
- class AutoObject: private boost::noncopyable
- {
- public:
- AutoObject() : m_pObject(NULL) {}
- AutoObject(Object * _obj) : m_pObject(_obj) {}
- ~AutoObject() { delete m_pObject; }
-
- bool is() const;
- Object * get() const;
- Object * getOrCreate();
- private:
- Object * internalCreate();
- private:
- Object * m_pObject;
- };
-//-----------------------------------------------------------------------------
-
- template < class Object >
- inline
- Object * AutoObject<Object>::get() const
- {
- return m_pObject;
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- inline
- bool AutoObject<Object>::is() const
- {
- return get() != NULL;
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- Object * AutoObject<Object>::getOrCreate()
- {
- Object * p = get();
- return p ? p : internalCreate();
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- Object * AutoObject<Object>::internalCreate()
- {
- if (m_pObject == NULL)
- m_pObject = new Object();
- return m_pObject;
-
- }
-//-----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/autoreferencemap.hxx b/configmgr/source/inc/autoreferencemap.hxx
deleted file mode 100644
index 135531680540..000000000000
--- a/configmgr/source/inc/autoreferencemap.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_AUTOREFERENCEMAP_HXX
-#define CONFIGMGR_AUTOREFERENCEMAP_HXX
-
-#include <rtl/ref.hxx>
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare = std::less<Key> >
- class AutoReferenceMap
- {
- public:
- typedef std::map<Key,rtl::Reference<Object>,KeyCompare> Map;
- public:
- AutoReferenceMap() {}
- ~AutoReferenceMap() {}
-
- Map copy() const
- {
- return m_aMap;
- }
- void swap(Map & _rOtherData)
- {
- m_aMap.swap( _rOtherData );
- }
- void swap(AutoReferenceMap & _rOther)
- {
- this->swap( _rOther.m_aMap );
- }
-
-
- bool has(Key const & _aKey) const;
- rtl::Reference<Object> get(Key const & _aKey) const;
-
- rtl::Reference<Object> insert(Key const & _aKey, rtl::Reference<Object> const & _anEntry);
- rtl::Reference<Object> remove(Key const & _aKey);
-
- private:
- rtl::Reference<Object> internalGet(Key const & _aKey) const
- {
- typename Map::const_iterator it = m_aMap.find(_aKey);
-
- return it != m_aMap.end() ? it->second : rtl::Reference<Object>();
- }
-
- rtl::Reference<Object> internalAdd(Key const & _aKey, rtl::Reference<Object> const & _aNewRef)
- {
- return m_aMap[_aKey] = _aNewRef;
- }
-
- void internalDrop(Key const & _aKey)
- {
- m_aMap.erase(_aKey);
- }
- private:
- Map m_aMap;
- };
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- bool AutoReferenceMap<Key,Object,KeyCompare>::has(Key const & _aKey) const
- {
- return internalGet(_aKey).is();
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::get(Key const & _aKey) const
- {
- return internalGet(_aKey);
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::insert(Key const & _aKey, rtl::Reference<Object> const & _anEntry)
- {
- rtl::Reference<Object> aRef = internalAdd(_aKey,_anEntry);
- return aRef;
-
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::remove(Key const & _aKey)
- {
- rtl::Reference<Object> aRef = internalGet(_aKey);
- internalDrop(_aKey);
- return aRef;
- }
-//-----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/backendfactory.hxx b/configmgr/source/inc/backendfactory.hxx
deleted file mode 100644
index ebda5680adb5..000000000000
--- a/configmgr/source/inc/backendfactory.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKENDFACTORY_HXX_
-#define CONFIGMGR_BACKENDFACTORY_HXX_
-
-#include <rtl/ref.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace backend
- {
-//-----------------------------------------------------------------------------
-
- struct IMergedDataProvider;
-//-----------------------------------------------------------------------------
- class BackendFactory
- {
- public:
- rtl::Reference<IMergedDataProvider> createBackend();
-
- com::sun::star::uno::Reference< com::sun::star::configuration::backend::XBackend > getUnoBackend();
-
- static BackendFactory instance(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx);
-
- private:
- explicit
- BackendFactory(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx)
- : m_xCtx(_xCtx)
- {}
-
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xCtx;
- };
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif
-
diff --git a/configmgr/source/inc/bootstrap.hxx b/configmgr/source/inc/bootstrap.hxx
deleted file mode 100644
index dbe877aec6c1..000000000000
--- a/configmgr/source/inc/bootstrap.hxx
+++ /dev/null
@@ -1,240 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BOOTSTRAP_HXX_
-#define CONFIGMGR_BOOTSTRAP_HXX_
-
-#include "bootstrapcontext.hxx"
-
-// ---------------------------------------------------------------------------------------
-#define BOOTSTRAP_ITEM_INIFILE "CFG_INIFILE"
-// ---------------------------------------------------------------------------------------
-// standard settings
-#define SETTING_UNOSERVICE "BackendService"
-#define SETTING_UNOWRAPPER "BackendWrapper"
-#define SETTING_OFFLINE "Offline"
-#define SETTING_LOCALE_NEW "Locale"
-#define SETTING_ASYNC_NEW "EnableAsync"
-#define SETTING_INIFILE "Inifile"
-
-// Prefixes
-#define CONTEXT_MODULE_PREFIX_ "/modules/com.sun.star.configuration/"
-#define CONTEXT_SECTION_BOOTSTRAP_ "bootstrap/"
-#define CONTEXT_ITEM_PREFIX_ CONTEXT_MODULE_PREFIX_ CONTEXT_SECTION_BOOTSTRAP_
-#define BOOTSTRAP_ITEM_PREFIX_ "CFG_"
-
-// special internal context values
-#define CONTEXT_SECTION_INTERNAL_ "factory/"
-#define CONTEXT_INTERNAL_PREFIX_ CONTEXT_MODULE_PREFIX_ CONTEXT_SECTION_INTERNAL_
-#define CONTEXT_ITEM_ADMINFLAG CONTEXT_INTERNAL_PREFIX_"isAdminConfiguration"
-#define CONTEXT_ITEM_BOOTSTRAP_ERROR CONTEXT_INTERNAL_PREFIX_"theBootstrapError"
-
-#define CONTEXT_ITEM_IS_WRAPPER_CONTEXT CONTEXT_INTERNAL_PREFIX_"isWrapperContext"
-#define CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT CONTEXT_INTERNAL_PREFIX_"isBootstrapContext"
-
-// ---------------------------------------------------------------------------------------
-#define A_DefaultProviderSingletonName "com.sun.star.configuration.theDefaultProvider"
-#define K_DefaultBackendSingletonName "com.sun.star.configuration.backend.theDefaultBackend"
-#define A_BootstrapContextSingletonName "com.sun.star.configuration.bootstrap.theBootstrapContext"
-// -------------------------------------------------------------------------
-#define A_DefaultProviderServiceAndImplName "com.sun.star.configuration.DefaultProvider"
-#define K_DefaultBackendServiceAndImplName "com.sun.star.configuration.backend.DefaultBackend"
-// ---------------------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------------
-
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- // -----------------------------------------------------------------------------------
-
- /** Customized ComponentContext for configuration bootstrap data and runtime arguments
- */
- class BootstrapContext : public ComponentContext
- {
- // creation and destruction
- private:
- friend uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xContext );
-
- // constructor
- BootstrapContext(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // two-phase construct
- void initialize();
-
- protected:
- using ComponentContext::initialize;
-
- public:
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
-
- /** Constructs a Context based on the given arguments and context.
- @param _xContext
- The base context of this component context.
-
- @param _aArguments
- The arguments used to create this component context.
- */
- static uno::Reference< uno::XComponentContext > createWrapper(uno::Reference< uno::XComponentContext > const & _xContext, uno::Sequence < beans::NamedValue > const & _aOverrides);
-
- /** Checks, if the given context is a wrapper.
- @param _xContext
- The context that is checked.
- */
- static sal_Bool isWrapper(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /** Retrieves the BootstrapContext for the given non-bootstrap context.
- @param _xContext
- The context from which the bootstrap context should be retrieved.
-
- */
- static uno::Reference< uno::XComponentContext > get(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /// Destroys this BootstrapContext
- ~BootstrapContext();
-
- // gets the INI that should be used for bootstrap data by default
- static rtl::OUString getDefaultConfigurationBootstrapURL();
-
- // interface implementations
- public:
- // XComponentContext
- /** Retrieves a value from this context.
-
- @param name
- The name of the value to retrieve.
- A prefix of "com.sun.star.configuration.bootstrap." is stripped/ignored
-
- @returns
- The requested value, or <VOID/> if the value is not found.
- */
- virtual uno::Any SAL_CALL
- getValueByName( const rtl::OUString& name )
- throw (uno::RuntimeException);
-
- public: // used by ArgumentHelper
- static rtl::OUString makeContextName (rtl::OUString const & _aShortName);
-
- private:
- static rtl::OUString makeBootstrapName(rtl::OUString const & _aLongName);
- uno::Any makeBootstrapException();
- };
-// -----------------------------------------------------------------------------
- class ContextReader
- {
- public:
- explicit
- ContextReader(uno::Reference< uno::XComponentContext > const & context);
-
- // the underlying contexts
- sal_Bool hasBootstrapContext() const { return m_fullcontext.is(); }
- uno::Reference< uno::XComponentContext > const & getBootstrapContext() const { return m_fullcontext; }
- uno::Reference< uno::XComponentContext > const & getBaseContext() const { return m_basecontext; }
- uno::Reference< uno::XComponentContext > const & getBestContext() const { return m_fullcontext.is() ? m_fullcontext : m_basecontext; }
-
- uno::Reference< lang::XMultiComponentFactory > getServiceManager() const;
-
- /** Checks, if the given context has the given 'admin' flag setting..
- @param _xContext
- The context that is checked.
- */
- static bool testAdminService(uno::Reference< uno::XComponentContext > const & context, bool bAdmin);
-
- // general settings
- sal_Bool isUnoBackend() const;
-
- sal_Bool hasUnoBackendService() const;
- sal_Bool hasUnoBackendWrapper() const;
-
- sal_Bool hasLocale() const;
- sal_Bool hasAsyncSetting() const;
- sal_Bool hasOfflineSetting() const;
-
- rtl::OUString getUnoBackendService() const;
- rtl::OUString getUnoBackendWrapper() const;
-
- rtl::OUString getLocale() const;
- sal_Bool getAsyncSetting() const;
- sal_Bool getOfflineSetting() const;
-
- // internal settings - should only ever be in configmgr::BootstrapContext instances
- // get a special setting
- sal_Bool isAdminService() const;
-
- // access to error diagnostics
- sal_Bool isBootstrapValid() const;
- uno::Any getBootstrapError() const;
- private:
- sal_Bool hasSetting(rtl::OUString const & _aSetting) const;
- sal_Bool getBoolSetting(rtl::OUString const & _aSetting, sal_Bool bValue) const;
- rtl::OUString getStringSetting(rtl::OUString const & _aSetting, rtl::OUString aValue) const;
- uno::Any getSetting(rtl::OUString const & _aSetting) const;
- private:
- uno::Reference< uno::XComponentContext > m_basecontext;
- uno::Reference< uno::XComponentContext > m_fullcontext;
- };
- //------------------------------------------------------------------------
-
- class ArgumentHelper
- {
- public:
- explicit
- ArgumentHelper(uno::Reference< uno::XComponentContext > const & context)
- : m_context(context)
- , m_bHasBackendArguments(false)
- {}
-
- bool hasBackendArguments() const { return m_bHasBackendArguments; }
- bool checkBackendArgument(beans::NamedValue const & aAdjustedValue);
-
- bool filterAndAdjustArgument(beans::NamedValue & rValue);
-
- static
- bool extractArgument(beans::NamedValue & rValue, uno::Any const & aArgument);
-
- static beans::NamedValue makeAdminServiceOverride(sal_Bool bAdmin);
- private:
- uno::Reference< uno::XComponentContext > m_context; // context used to strip identical arguments
- bool m_bHasBackendArguments;
- };
-// -----------------------------------------------------------------------------------
-
-}
-
-#endif // CONFIGMGR_BOOTSTRAP_HXX_
-
-
diff --git a/configmgr/source/inc/bootstrapcontext.hxx b/configmgr/source/inc/bootstrapcontext.hxx
deleted file mode 100644
index 628a5309e3d5..000000000000
--- a/configmgr/source/inc/bootstrapcontext.hxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
-#define CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
-
-#include <cppuhelper/compbase3.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <rtl/bootstrap.h>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XCurrentContext.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
-} } } }
-
-// -----------------------------------------------------------------------------
-#define SINGLETON_ "/singletons/"
-#define SINGLETON( NAME ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SINGLETON_ NAME ) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
- /** Base class for customized ComponentContext using bootstrap data and overrides
- */
- class ComponentContext : public cppu::WeakComponentImplHelper3 < uno::XComponentContext, uno::XCurrentContext, lang::XServiceInfo >
- {
- // creation and destruction
- public:
- /** Constructs a ComponentContext based on the given overrides and context.
- Initially no bootstrap data will be used.
-
- @param _xContext
- The base context of this component context.
- Values from here take precedence over values from bootstrap data.
-
- @param _aOverrides
- The overrides used to create this component context.
- These values take precedence over values from the base context or bootstrap data.
- */
- explicit
- ComponentContext(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /// Destroys this BootstrapContext
- ~ComponentContext();
-
- // gets the INI in use for getting bootstrap data
- rtl::OUString getBootstrapURL() const;
-
- static sal_Bool isPassthrough(uno::Reference< uno::XComponentContext > const & _xContext);
-
- static beans::NamedValue makePassthroughMarker(sal_Bool bPassthrough = true);
- // interface implementations
- public:
-
- // XComponentContext only
- virtual uno::Reference< lang::XMultiComponentFactory > SAL_CALL
- getServiceManager( )
- throw (uno::RuntimeException);
-
- protected:
- // ComponentHelper
- virtual void SAL_CALL disposing();
-
- protected:
- // two phase construct - also initialized the bootstrap data
- void initialize(const rtl::OUString& _aBootstrapURL);
-
- bool lookupInContext ( uno::Any & _rValue, const rtl::OUString& _aName ) const;
- bool lookupInBootstrap( uno::Any & _rValue, const rtl::OUString& _aName ) const;
-
- uno::Reference< uno::XComponentContext > const & basecontext() const { return m_xContext; }
-
- private:
- /// The context that most requests are delegated to
- uno::Reference< uno::XComponentContext > m_xContext;
- /// The bootstrap data consulted as fallback
- rtlBootstrapHandle m_hBootstrapData;
- /// The service manager associated with this context
- uno::Reference< lang::XMultiComponentFactory > m_xServiceManager;
- };
-// -----------------------------------------------------------------------------
-
- class UnoContextTunnel
- {
- public:
- UnoContextTunnel();
- ~UnoContextTunnel();
- void tunnel(uno::Reference< uno::XComponentContext > const & xContext);
- void passthru(uno::Reference< uno::XComponentContext > const & xContext);
- uno::Any recoverFailure(bool bRaise); // true, if there is a failure
-
- static uno::Reference< uno::XComponentContext > recoverContext(uno::Reference< uno::XComponentContext > const & xFallback = uno::Reference< uno::XComponentContext >());
- static bool tunnelFailure(uno::Any const & aException, bool bRaise = false);
- private:
- uno::Reference< uno::XCurrentContext > m_xOldContext;
- uno::Reference< lang::XUnoTunnel > m_xActiveTunnel;
- class Tunnel;
- };
-// -----------------------------------------------------------------------------
-
- class DisposingForwarder : public cppu::WeakImplHelper1< lang::XEventListener >
- {
- uno::Reference< lang::XComponent > m_xTarget;
-
- DisposingForwarder( uno::Reference< lang::XComponent > const & xTarget ) SAL_THROW( () )
- : m_xTarget( xTarget )
- { OSL_ASSERT( m_xTarget.is() ); }
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- public:
- // listens at source for disposing, then disposes target
- static inline void forward(
- uno::Reference< lang::XComponent > const & xSource,
- uno::Reference< lang::XComponent > const & xTarget )
- SAL_THROW( (uno::RuntimeException) );
- };
-//__________________________________________________________________________________________________
- inline void DisposingForwarder::forward(
- uno::Reference< lang::XComponent > const & xSource,
- uno::Reference< lang::XComponent > const & xTarget )
- SAL_THROW( (uno::RuntimeException) )
- {
- if (xSource.is())
- {
- xSource->addEventListener( new DisposingForwarder( xTarget ) );
- }
- }
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
-
diff --git a/configmgr/source/inc/bufferedfile.hxx b/configmgr/source/inc/bufferedfile.hxx
deleted file mode 100644
index c9bde6e7f713..000000000000
--- a/configmgr/source/inc/bufferedfile.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BUFFEREDFILE_HXX
-#define CONFIGMGR_BUFFEREDFILE_HXX
-
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <osl/file.hxx>
-#include <com/sun/star/io/IOException.hpp>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-
- namespace io = com::sun::star::io;
-
- class BufferedOutputFile: private boost::noncopyable, public osl::FileBase
- {
- osl::File * m_pFile;
- std::vector<sal_uInt8> m_buffer;
- public:
- BufferedOutputFile( rtl::OUString const& aFileURL, sal_uInt32 nBufferSizeHint = 0 );
- ~BufferedOutputFile ();
-
- RC open( sal_uInt32 uFlags );
- RC close();
-
- //RC getPos( sal_uInt64& uPos )
- RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten);
-
- // as opposed to osl::File, this method is not const here
- RC sync();
- };
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/builddata.hxx b/configmgr/source/inc/builddata.hxx
deleted file mode 100644
index f2f3c840e0c8..000000000000
--- a/configmgr/source/inc/builddata.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BUILDDATA_HXX
-#define CONFIGMGR_BUILDDATA_HXX
-
-#include "treefragment.hxx"
-#ifndef INCLUDED_MEMORY
-#define INCLUDED_MEMORY
-#include <memory>
-#endif
-//-----------------------------------------------------------------------------
-namespace rtl { class OUString; }
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class INode;
- class ISubtree;
- class ValueNode;
-//-----------------------------------------------------------------------------
- namespace sharable { struct TreeFragment; }
- namespace data
- {
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildTree(sharable::TreeFragment * tree);
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults);
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildElementTree(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults);
-//-----------------------------------------------------------------------------
- void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode);
-//-----------------------------------------------------------------------------
- void destroyTree(sharable::TreeFragment * _aBaseAddress);
-//-----------------------------------------------------------------------------
- std::auto_ptr<INode> convertTree(sharable::TreeFragment * tree, bool _bUseTreeName);
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_BUILDDATA_HXX
-
-
diff --git a/configmgr/source/inc/change.hxx b/configmgr/source/inc/change.hxx
deleted file mode 100644
index 67200d13776e..000000000000
--- a/configmgr/source/inc/change.hxx
+++ /dev/null
@@ -1,504 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CHANGE_HXX
-#define CONFIGMGR_CHANGE_HXX
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning(disable : 4350) // behavior change: 'member1' called instead of 'member2'
-#endif
-
-#include "valuenode.hxx"
-#include "treesegment.hxx"
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-
- namespace uno = com::sun::star::uno;
-
- class Change;
- class SubtreeChange;
- class ValueChange;
- class AddNode;
- class RemoveNode;
-
-
- //==========================================================================
- //= ChangeTreeAction
- //==========================================================================
- struct ChangeTreeAction
- {
- virtual void handle(ValueChange const& aValueNode) = 0;
- virtual void handle(AddNode const& aAddNode) = 0;
- virtual void handle(RemoveNode const& aRemoveNode) = 0;
- virtual void handle(SubtreeChange const& aSubtree) = 0;
-
- void applyToChange(Change const& aChange);
- void applyToChildren(SubtreeChange const& aSubtree);
- protected:
- virtual ~ChangeTreeAction() {}
- };
-
- struct ChangeTreeModification
- {
- virtual void handle(ValueChange& aValueNode) = 0;
- virtual void handle(AddNode& aAddNode) = 0;
- virtual void handle(RemoveNode& aRemoveNode) = 0;
- virtual void handle(SubtreeChange& aSubtree) = 0;
-
- void applyToChange(Change& aChange);
- void applyToChildren(SubtreeChange& aSubtree);
- protected:
- virtual ~ChangeTreeModification() {}
- };
-
- //==========================================================================
- //= Change
- //==========================================================================
- class Change
- {
- protected:
- rtl::OUString m_aName;
- bool m_bIsToDefault;
-
- void swap(Change& aOther);
-
- public:
- explicit
- Change(rtl::OUString const& _rName, bool _bToDefault)
- : m_aName(_rName)
- , m_bIsToDefault(_bToDefault)
- {}
-
- virtual ~Change() {}
-
- rtl::OUString getNodeName() const { return m_aName; }
- void setNodeName(const rtl::OUString &aName) {m_aName = aName;}
-
- bool isToDefault() const { return m_bIsToDefault; }
-
- Change* getSubChange(rtl::OUString const& _rName) { return doGetChild(_rName); }
- Change const* getSubChange(rtl::OUString const& _rName) const { return doGetChild(_rName); }
-
- virtual void dispatch(ChangeTreeAction& anAction) const = 0;
- virtual void dispatch(ChangeTreeModification& anAction) = 0;
-
- virtual std::auto_ptr<Change> clone() const = 0;
-
- private:
- virtual Change* doGetChild(rtl::OUString const& ) const { return 0; }
- };
-
- //==========================================================================
- //= ValueChange
- //==========================================================================
- class ValueChange : public Change
- {
- public:
- struct SetToDefault {};
- enum Mode { wasDefault, changeValue, setToDefault, changeDefault };
-
- private:
- uno::Type m_aValueType;
- uno::Any m_aValue;
- uno::Any m_aOldValue;
- node::Attributes m_aAttributes;
- Mode m_eMode;
- public:
- ValueChange(
- rtl::OUString const& _rName,
- const node::Attributes& _rAttributes,
- Mode aMode,
- uno::Any const & aNewValue,
- uno::Any const & aOldValue = uno::Any());
-
- virtual std::auto_ptr<Change> clone() const;
-
- bool isChange() const;
-
- uno::Type getValueType() const { return m_aValueType; }
-
- uno::Any getNewValue() const { return m_aValue; }
- uno::Any getOldValue() const { return m_aOldValue; }
-
- void setNewValue(const uno::Any& _rNewVal);
- void setNewValue(const uno::Any& _rNewVal, Mode aMode)
- { setNewValue(_rNewVal); m_eMode = aMode;}
-
- bool isReplacedValue() const {return m_aAttributes.isReplacedForUser();}
- bool isLocalizedValue() const {return m_aAttributes.isLocalized();}
-
- Mode getMode() const { return m_eMode; }
-
- const node::Attributes& getAttributes() const {return m_aAttributes;}
-
- void applyChangeNoRecover(ValueNode& aNode) const;
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
-
- friend class ApplyValueChange;
- };
-
- //==========================================================================
- //= AddNode
- //==========================================================================
- class AddNode : public Change
- {
- rtl::Reference< data::TreeSegment > m_aOwnNewNode;
- rtl::Reference< data::TreeSegment > m_aOwnOldNode;
- sharable::TreeFragment * m_aInsertedTree;
- bool m_bReplacing;
-
- private:
- void operator=(AddNode const&); // not implemented
-
- // needed for clone()
- AddNode(AddNode const&);
- public:
- AddNode(rtl::Reference< data::TreeSegment > const & _aAddedTree, rtl::OUString const& _rName, bool _bToDefault);
- ~AddNode();
-
- virtual std::auto_ptr<Change> clone() const;
-
- /// marks this as not merely adding a node but replacing another
- void setReplacing() { m_bReplacing = true; }
- /// is this not merely adding a node but replacing another ?
- bool isReplacing() const { return m_bReplacing; }
-
- /// has this been applied and inserted
- bool wasInserted() const { return m_aInsertedTree != NULL; }
-
- /** returns the node this change represents, even if this node does not own the new Node object any more.
- This is somewhat dangerous if the node referenced by this object dies before the object itself does.<BR>
- In this case all calls to this method will return nonsense. This case can be detected by testing
- whether <method>getAddedNode</method> returns NULL.
- */
- sharable::TreeFragment * getInsertedTree() const { return m_aInsertedTree; }
-
- /** returns the node this change represents; The Node object is owned by this change until
- <method>releaseAddedNode</method> is called.<BR>
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getNewTreeData() const { return m_aOwnNewNode.is() ? m_aOwnNewNode->fragment : 0; }
-
- /** returns the node the change represents. .
- */
- rtl::Reference< data::TreeSegment > getNewTree() const { return m_aOwnNewNode; }
-
- /** returns the node the change represents, and releases ownership of it. This means that
- afterwards <method>getAddedNode</method> will return NULL. This change object keeps a reference
- to the node though which can be retrieved using <method>getAddedNode_unsafe</method>.
- */
- void clearNewTree() { m_aOwnNewNode.clear(); }
-
- /** .
- */
- void setInsertedAddress(sharable::TreeFragment * const & _aInsertedAddress);
-
-
- /** returns the node this change replaces, ihe Node object is owned by this change.
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getReplacedTreeData() const { return m_aOwnOldNode.is() ? m_aOwnOldNode->fragment : 0; }
-
- /** returns the node the change replaces.
- */
- rtl::Reference< data::TreeSegment > getReplacedTree() const { return m_aOwnOldNode; }
-
- /** forgets about the node the change replaces
- */
- void clearReplacedTree() { m_aOwnOldNode.clear(); }
-
- void takeReplacedTree(rtl::Reference< data::TreeSegment > const& _aTree);
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
- };
-
- //==========================================================================
- //= RemoveNode
- //==========================================================================
- class RemoveNode : public Change
- {
- protected:
- rtl::Reference< data::TreeSegment > m_aOwnOldNode;
- bool m_bIsToDefault;
-
- private:
- RemoveNode& operator=(const RemoveNode&); // not implemented
- // needed for clone()
- RemoveNode(const RemoveNode&);
- public:
- explicit
- RemoveNode(rtl::OUString const& _rName, bool _bToDefault);
- ~RemoveNode();
-
- virtual std::auto_ptr<Change> clone() const;
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
-
- /** returns the node this change removes, ihe Node object is owned by this change.
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getRemovedTreeData() const { return m_aOwnOldNode.is() ? m_aOwnOldNode->fragment : 0; }
- /** returns the node the change removes.
- */
- rtl::Reference< data::TreeSegment > getRemovedTree() const { return m_aOwnOldNode; }
-
- /** forgets about the node the change removes, returning the previous setting with ownership
- */
- void clearRemovedTree() { m_aOwnOldNode.clear(); }
-
- void takeRemovedTree(rtl::Reference< data::TreeSegment > const & _aTree);
- };
-
- //==========================================================================
- //= SubtreeChange
- //==========================================================================
- class SubtreeChange : public Change
- {
- protected:
- typedef ::std::map< ::rtl::OUString,Change* > Children;
- Children m_aChanges;
- ::rtl::OUString m_sTemplateName; /// path of the template for child instantiation
- ::rtl::OUString m_sTemplateModule; /// module of the template for child instantiation
- node::Attributes m_aAttributes;
-
- // don't create copy ops automatically
- SubtreeChange(const SubtreeChange&);
- void operator=(SubtreeChange&);
-
- using Change::swap;
-
- public:
- class ChildIterator;
- ChildIterator begin() const throw();
- ChildIterator end() const throw();
-
- class MutatingChildIterator;
- MutatingChildIterator begin_changes() throw();
- MutatingChildIterator end_changes() throw();
-
- friend class MutatingChildIterator;
- public:
- SubtreeChange(const rtl::OUString& _rName,
- const node::Attributes& _rAttr,
- bool _bToDefault = false)
- : Change(_rName,_bToDefault)
- , m_aAttributes(_rAttr)
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const rtl::OUString& _rName,
- const rtl::OUString& _rTemplateName,
- const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttr,
- bool _bToDefault = false)
- : Change(_rName,_bToDefault)
- , m_sTemplateName(_rTemplateName)
- , m_sTemplateModule(_rTemplateModule)
- , m_aAttributes(_rAttr)
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const ISubtree& _rTree, bool _bToDefault = false)
- : Change(_rTree.getName(),_bToDefault)
- , m_sTemplateName(_rTree.getElementTemplateName())
- , m_sTemplateModule(_rTree.getElementTemplateModule())
- , m_aAttributes(_rTree.getAttributes())
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const SubtreeChange& _rChange, treeop::NoChildCopy)
- : Change(_rChange)
- , m_sTemplateName(_rChange.getElementTemplateName())
- , m_sTemplateModule(_rChange.getElementTemplateModule())
- , m_aAttributes(_rChange.getAttributes())
- {}
-
- ~SubtreeChange();
-
- SubtreeChange(const SubtreeChange&, treeop::DeepChildCopy);
-
- virtual std::auto_ptr<Change> clone() const;
-
- void swap(SubtreeChange& aOther);
-
- bool isReplacedNode() const { return m_aAttributes.isReplacedForUser(); }
- bool isLocalizedContainer() const { return m_aAttributes.isLocalized(); }
-
- const node::Attributes& getAttributes() const {return m_aAttributes;}
-
- bool isSetNodeChange() const { return m_sTemplateName.getLength() != 0; }
-
- rtl::OUString getElementTemplateName() const { return m_sTemplateName; }
- rtl::OUString getElementTemplateModule() const { return m_sTemplateModule; }
-
- void setElementTemplate(const rtl::OUString& _rName, const rtl::OUString& _rModule)
- { m_sTemplateName = _rName; m_sTemplateModule = _rModule; }
-
- sal_Int32 size() const { return m_aChanges.size(); }
- uno::Sequence< rtl::OUString > elementNames() const;
-
- void addChange(std::auto_ptr<Change> aChange);
- ::std::auto_ptr<Change> removeChange(rtl::OUString const& _rName);
-
- Change* getChange(rtl::OUString const& _rName);
- Change const* getChange(rtl::OUString const& _rName) const;
-
- virtual void dispatch(ChangeTreeAction& _anAction) const;
- virtual void dispatch(ChangeTreeModification& _anAction);
-
- void forEachChange(ChangeTreeAction& _anAction) const;
- void forEachChange(ChangeTreeModification& _anAction);
-
- private:
- virtual Change* doGetChild(rtl::OUString const& _rName) const;
- };
-
- /** iterates through all children of a <type>SubtreeChange</type>. Every non-const action on the object
- which is beeing iterated invalidates the iterator.
- <BR>
- beware of the lifetime of the tree change object : it has to live as long as the iterator does (at least) !!
- */
- class SubtreeChange::ChildIterator
- {
- protected:
- uno::Sequence< rtl::OUString > m_aNames;
- const SubtreeChange* m_pTree;
- sal_Int32 m_nPos;
-
- friend class SubtreeChange;
- struct EndPos { };
- ChildIterator(const SubtreeChange* _pTree, struct EndPos);
-
- inline sal_Bool isValid() const { return m_nPos >= 0 && m_nPos < m_aNames.getLength(); }
-
- public:
- ChildIterator(const SubtreeChange* _pTree);
-
- const Change& operator*() const;
- const Change* operator->() const;
-
- ChildIterator& operator++();
- ChildIterator operator++(int) { ChildIterator ret(*this); ++*this; return ret; }
-
- ChildIterator& operator--();
- ChildIterator operator--(int) { ChildIterator ret(*this); --*this; return ret; }
-
- friend bool operator==(ChildIterator const& lhs, ChildIterator const& rhs);
- friend bool operator!=(ChildIterator const& lhs, ChildIterator const& rhs) { return !(lhs == rhs); }
- };
-
- /** iterates through all children of a <type>SubtreeChange</type>. Every non-const action on the object
- which is beeing iterated invalidates the iterator.
- <BR>
- beware of the lifetime of the tree change object : it has to live as long as the iterator does (at least) !!
- */
- class SubtreeChange::MutatingChildIterator
- {
- protected:
- SubtreeChange::Children::iterator m_aBaseIter;
-
- friend class SubtreeChange;
- MutatingChildIterator(SubtreeChange::Children::iterator aBase) : m_aBaseIter(aBase) {};
-
- public:
- Change& current() const { return *m_aBaseIter->second; }
-
- Change& operator*() const { return current(); }
- Change* operator->() const { return &current(); }
-
- MutatingChildIterator& operator++() { ++m_aBaseIter; return *this; }
- MutatingChildIterator operator++(int) { return MutatingChildIterator(m_aBaseIter++); }
-
- MutatingChildIterator& operator--() { ++m_aBaseIter; return *this; }
- MutatingChildIterator operator--(int) { return MutatingChildIterator(m_aBaseIter++); }
-
- friend bool operator==(MutatingChildIterator const& lhs, MutatingChildIterator const& rhs)
- { return lhs.m_aBaseIter == rhs.m_aBaseIter; }
- friend bool operator!=(MutatingChildIterator const& lhs, MutatingChildIterator const& rhs) { return !(lhs == rhs); }
- };
- //==========================================================================
- //= SubtreeChangeReferrer
- //==========================================================================
- /** a specialized SubtreeChange, which, upon desctruction, does not delete the changes
- it holds
-
- <BR>
- This implies that when using this class, you have to beware of the lifetime of the involved objects
- */
- class SubtreeChangeReferrer : public SubtreeChange
- {
- // no explicit construction
- SubtreeChangeReferrer() : SubtreeChange(::rtl::OUString(), node::Attributes()) { }
-
- public:
- SubtreeChangeReferrer(const SubtreeChange& _rSource);
- ~SubtreeChangeReferrer();
- };
-
-////////////////////////////////////////////////////////////////////////////////
- //==========================================================================
- extern bool isLocalizedValueSet(SubtreeChange const& _aSubtree);
- extern bool isValueSet(SubtreeChange const& _aSubtree);
-
- //==========================================================================
- //= inlines
- //==========================================================================
- inline void ChangeTreeAction::applyToChange(Change const& aChange)
- { aChange.dispatch(*this); }
- inline void ChangeTreeAction::applyToChildren(SubtreeChange const& aSubtree)
- { aSubtree.forEachChange(*this); }
-
- inline void ChangeTreeModification::applyToChange(Change& aChange)
- { aChange.dispatch(*this); }
- inline void ChangeTreeModification::applyToChildren(SubtreeChange& aSubtree)
- { aSubtree.forEachChange(*this); }
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/confapifactory.hxx b/configmgr/source/inc/confapifactory.hxx
deleted file mode 100644
index 8ff282b52463..000000000000
--- a/configmgr/source/inc/confapifactory.hxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#define CONFIGMGR_API_FACTORY_HXX_
-
-#include <sal/types.h>
-
-namespace com { namespace sun { namespace star {
- namespace uno
- {
- class XInterface;
- template <class> class Reference;
- class XComponentContext;
- }
- namespace lang
- {
- class XSingleComponentFactory;
- }
-} } }
-namespace rtl { class OUString; }
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- extern
- uno::Reference< lang::XSingleComponentFactory > SAL_CALL
- createProviderFactory(
- ::rtl::OUString const & aImplementationName,
- bool bAdmin
- )
- SAL_THROW( () );
-
- struct ServiceRegistrationInfo;
- struct SingletonRegistrationInfo;
-
-// provider instantiation
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultConfigProviderSingleton( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateDefaultProvider( uno::Reference< uno::XComponentContext > const& xContext );
-
-// provider service info
- const SingletonRegistrationInfo * getDefaultProviderSingletonInfo();
- const ServiceRegistrationInfo * getConfigurationProviderServiceInfo();
- const ServiceRegistrationInfo * getDefaultProviderServiceInfo();
- const ServiceRegistrationInfo * getAdminProviderServiceInfo();
-
-// other services - instantiation and info
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateConfigRegistry( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo* getConfigurationRegistryServiceInfo();
-
-// bootstrap context support
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xContext );
-
- const SingletonRegistrationInfo * getBootstrapContextSingletonInfo();
- const ServiceRegistrationInfo * getBootstrapContextServiceInfo();
-
- namespace xml
- {
- uno::Reference< uno::XInterface > SAL_CALL instantiateSchemaParser
- ( uno::Reference< uno::XComponentContext > const& xContext );
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerParser
- ( uno::Reference< uno::XComponentContext > const& xContext );
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerWriter
- ( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo* getSchemaParserServiceInfo();
- const ServiceRegistrationInfo* getLayerParserServiceInfo();
- const ServiceRegistrationInfo* getLayerWriterServiceInfo();
- }
- namespace backend
- {
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultBackendSingleton( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateDefaultBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateUpdateMerger( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateSingleBackendAdapter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateMergeImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateCopyImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateMultiStratumBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- const SingletonRegistrationInfo * getDefaultBackendSingletonInfo();
- const ServiceRegistrationInfo * getDefaultBackendServiceInfo();
-
- const ServiceRegistrationInfo * getUpdateMergerServiceInfo();
- const ServiceRegistrationInfo * getSingleBackendAdapterServiceInfo();
- const ServiceRegistrationInfo * getMergeImportServiceInfo();
- const ServiceRegistrationInfo * getCopyImportServiceInfo();
- const ServiceRegistrationInfo * getMultiStratumBackendServiceInfo();
- }
- namespace localbe
- {
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalDataImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalHierarchyBrowser( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalSchemaSupplier( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalLegacyStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalDataStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalReadonlyStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalResourceStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalMultiStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo * getLocalBackendServiceInfo();
- const ServiceRegistrationInfo * getLocalDataImportServiceInfo();
- const ServiceRegistrationInfo * getLocalHierarchyBrowserServiceInfo();
- const ServiceRegistrationInfo * getLocalSchemaSupplierServiceInfo();
- const ServiceRegistrationInfo * getLocalLegacyStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalDataStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalReadonlyStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalResourceStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalMultiStratumServiceInfo();
- } // localbe
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
-
-
diff --git a/configmgr/source/inc/confevents.hxx b/configmgr/source/inc/confevents.hxx
deleted file mode 100644
index f9c126f345a7..000000000000
--- a/configmgr/source/inc/confevents.hxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_EVENTS_HXX_
-#define CONFIGMGR_API_EVENTS_HXX_
-
-#include <hash_set>
-#include <map>
-#include <set>
-
-#include "osl/mutex.hxx"
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "configpath.hxx"
-#include "utility.hxx"
-
-namespace rtl { class OUString; }
-
-namespace configmgr
-{
- class Change;
- struct TreeChangeList;
- class TreeManager;
-
- namespace configuration { class AbsolutePath; }
-
- struct IConfigListener : public salhelper::SimpleReferenceObject
- {
- virtual void disposing(TreeManager * pSource) = 0;
- };
- struct INodeListener : IConfigListener
- {
- virtual void nodeChanged(Change const& aChange, configuration::AbsolutePath const& aPath, TreeManager * pSource) = 0;
- virtual void nodeDeleted(configuration::AbsolutePath const& aPath, TreeManager * pSource) = 0;
- };
-
- namespace internal
- {
-
- ////////////////////////////////////////////////////////////////////////
- template <class ListenerRef>
- class BroadcastImplHelper
- {
- public:
- osl::Mutex mutex;
-
- public:
- BroadcastImplHelper()
- {}
-
- ~BroadcastImplHelper()
- {
- OSL_ENSURE(m_aInterfaces.empty(), "Configuration Broadcaster was not disposed properly");
- }
-
- public:
- typedef std::set<ListenerRef> Interfaces;
-
- public:
- typename Interfaces::iterator addListener(ListenerRef aListener)
- {
- return m_aInterfaces.insert(aListener).first;
- }
- void removeListener(ListenerRef aListener)
- {
- m_aInterfaces.erase(aListener);
- }
-
- void disposing(TreeManager * pSource);
-
- public:
- typename Interfaces::const_iterator begin() const { return m_aInterfaces.begin(); }
- typename Interfaces::const_iterator end() const { return m_aInterfaces.end(); }
-
- typename Interfaces::const_iterator find(ListenerRef aListener) const { return m_aInterfaces.find(aListener); }
- typename Interfaces::iterator findFull(ListenerRef aListener) { return m_aInterfaces.find(aListener); }
- private:
- Interfaces m_aInterfaces;
-
- // no implementation - not copyable
- BroadcastImplHelper(BroadcastImplHelper&);
- void operator=(BroadcastImplHelper&);
- };
-
- ////////////////////////////////////////////////////////////////////////
- template <class Listener>
- void BroadcastImplHelper<Listener>::disposing(TreeManager * pSource)
- {
- osl::ClearableMutexGuard aGuard(this->mutex); // ensure that no notifications are running
-
- Interfaces aTargets;
- aTargets.swap(m_aInterfaces);
-
- aGuard.clear();
- for(typename Interfaces::iterator it = aTargets.begin(); it != aTargets.end(); )
- {
- typename Interfaces::iterator cur = it++;
- if (*cur)
- (*cur)->disposing(pSource);
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////
-
- class NodeListenerInfo
- {
- public:
- typedef std::hash_set<configuration::AbsolutePath, configuration::Path::Hash, configuration::Path::Equiv> Pathes;
-
- public:
- NodeListenerInfo(rtl::Reference<INodeListener> const& pListener)
- : m_pListener(pListener)
- {
- }
-
- // path handling
- Pathes const& pathList() const { return m_aPathes; }
-
- void addPath(configuration::AbsolutePath const& sPath) const { m_aPathes.insert(sPath); }
- void removePath(configuration::AbsolutePath const& sPath) const { m_aPathes.erase(sPath); }
- //void removeChildPathes(OUString const& sPath);
-
- // behave as pointer for use as a 'reference' class
- rtl::Reference<INodeListener> get() const { return m_pListener; }
- rtl::Reference<INodeListener> operator->() const { return get(); }
- INodeListener& operator*() const { return *m_pListener; }
- // needed to allow if (info) ...
- struct HasListener;
- operator HasListener const*() const { return reinterpret_cast<HasListener*>(m_pListener.get()); }
-
- bool operator < (NodeListenerInfo const& aInfo) const
- { return std::less<INodeListener*>()(m_pListener.get(), aInfo.m_pListener.get()); }
-
- bool operator == (NodeListenerInfo const& aInfo) const
- { return !!( m_pListener == aInfo.m_pListener); }
-
- bool operator > (NodeListenerInfo const& aInfo) const
- { return aInfo.operator < (*this); }
- bool operator >= (NodeListenerInfo const& aInfo) const
- { return !operator<(aInfo); }
- bool operator <= (NodeListenerInfo const& aInfo) const
- { return !operator>(aInfo); }
-
- bool operator != (NodeListenerInfo const& aInfo) const
- { return !operator==(aInfo); }
-
- private:
- rtl::Reference<INodeListener> m_pListener;
- mutable Pathes m_aPathes; // hack to be mutable even as set element
- };
- } // namespace
-
- /////////////////////////////////////////////////////////////////////////
- class ConfigChangeBroadcastHelper // broadcasts changes for a given set of options
- {
- public:
- ConfigChangeBroadcastHelper();
- ~ConfigChangeBroadcastHelper();
-
- void broadcast(TreeChangeList const& anUpdate, sal_Bool bError, TreeManager * pSource);
-
- void addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& );
- void removeListener(rtl::Reference<INodeListener> const&);
-
- void dispose(TreeManager * pSource);
-
- private:
- void add(configuration::AbsolutePath const& aPath, rtl::Reference<INodeListener> const& pListener);
- void remove(rtl::Reference<INodeListener> const& pListener);
-
- void dispatch(Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
- void dispatch(TreeChangeList const& rList_, sal_Bool _bError, TreeManager * pSource);
- void disposing(TreeManager * pSource);
-
- void dispatchInner(rtl::Reference<INodeListener> const& pTarget, configuration::AbsolutePath const& sTargetPath, Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
- void dispatchOuter(rtl::Reference<INodeListener> const& pTarget, configuration::AbsolutePath const& sTargetPath, Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
-
- typedef std::multimap<configuration::AbsolutePath, internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::iterator, configuration::Path::Before> PathMap;
- internal::BroadcastImplHelper<internal::NodeListenerInfo> m_aListeners;
- PathMap m_aPathMap;
- };
-} // namespace
-
-#endif // CONFIGMGR_API_EVENTS_HXX_
-
-
-
diff --git a/configmgr/source/inc/configdefaultprovider.hxx b/configmgr/source/inc/configdefaultprovider.hxx
deleted file mode 100644
index ce589aa78dc5..000000000000
--- a/configmgr/source/inc/configdefaultprovider.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
-#define CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
-
-#include "utility.hxx"
-#include <com/sun/star/uno/Exception.hpp>
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class ISubtree;
- class IDefaultableTreeManager;
- class RequestOptions;
- class TreeManager;
-
- namespace uno = com::sun::star::uno;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class Tree;
- class NodeRef;
-//-----------------------------------------------------------------------------
-
- /// provides access to the default for a given request
- class DefaultProviderProxy;
-
- class DefaultProvider
- {
- rtl::Reference< DefaultProviderProxy > m_aProxy;
- public:
- // factory methods
- static DefaultProvider createEmpty();
- static DefaultProvider create(rtl::Reference< Tree > const& _aRootTree,
- RequestOptions const& _xOptions,
- rtl::Reference< TreeManager > const & _xDefaultProvider,
- IDefaultableTreeManager* _pDefaultableTree);
-
- // actual c'tor
- explicit
- DefaultProvider(rtl::Reference< DefaultProviderProxy > const& _xProviderProxy);
-
- // standard c/d-tors to make compiler barrier
- DefaultProvider(DefaultProvider const& _aOther);
- DefaultProvider& operator=(DefaultProvider const& _aOther);
- ~DefaultProvider();
-
- bool isValid() const { return !! m_aProxy.is(); }
-
- /// tries to load a default instance of the specified node
- std::auto_ptr<ISubtree> getDefaultTree(rtl::Reference< Tree > const& _aTree, NodeRef const& _aNode) const SAL_THROW((com::sun::star::uno::Exception));
-
- /// tries to load default data into the specified tree
- bool fetchDefaultData(rtl::Reference< Tree > const& _aTreeRef) const SAL_THROW((com::sun::star::uno::Exception));
- };
-
-//-----------------------------------------------------------------------------
-
- }
-}
-
-#endif // CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
diff --git a/configmgr/source/inc/configexcept.hxx b/configmgr/source/inc/configexcept.hxx
deleted file mode 100644
index 9cc24a843c9a..000000000000
--- a/configmgr/source/inc/configexcept.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGEXCEPT_HXX_
-#define CONFIGMGR_CONFIGEXCEPT_HXX_
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-namespace configmgr
-{
-//-------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- //-------------------------------------------------------------------------
-
- class Exception
- {
- rtl::OString m_sAsciiMessage;
- public:
- Exception(char const* sAsciiMessage);
- Exception(rtl::OString const& sAsciiMessage);
- virtual ~Exception() {}
-
- virtual rtl::OUString message() const;
- virtual char const* what() const;
- };
- //-------------------------------------------------------------------------
-
- class InvalidName : public Exception
- {
- rtl::OUString m_sName;
- public:
- InvalidName(rtl::OUString const& sName, char const* sAsciiDescription);
-
- virtual rtl::OUString message() const;
- };
- //-------------------------------------------------------------------------
-
- class ConstraintViolation
- : public Exception
- {
- public:
- ConstraintViolation(char const* sConstraint);
- };
- //-------------------------------------------------------------------------
-
- class TypeMismatch : public Exception
- {
- rtl::OUString m_sTypes;
- static rtl::OUString describe(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType);
- public:
- TypeMismatch(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType);
- TypeMismatch(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType, char const* sAsciiDescription);
-
- virtual rtl::OUString message() const;
- };
- //-------------------------------------------------------------------------
- }
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
- namespace configapi
- {
- //-------------------------------------------------------------------------
- class ExceptionMapper
- {
- configuration::Exception& m_eOriginal;
- uno::Reference<uno::XInterface> m_xContext;
- rtl::OUString m_sMessage;
- public:
- ExceptionMapper(configuration::Exception& e);
- ~ExceptionMapper();
-
- void setContext(uno::XInterface* pContext);
-
- rtl::OUString message() const;
- uno::Reference<uno::XInterface> context() const;
-
- void illegalArgument(sal_Int16 nArgument = -1) throw(lang::IllegalArgumentException);
- void unhandled() throw(uno::RuntimeException);
- };
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGEXCEPT_HXX_
diff --git a/configmgr/source/inc/configgroup.hxx b/configmgr/source/inc/configgroup.hxx
deleted file mode 100644
index a9cb1dd5bb36..000000000000
--- a/configmgr/source/inc/configgroup.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGGROUP_HXX_
-#define CONFIGMGR_CONFIGGROUP_HXX_
-
-#include "configexcept.hxx"
-#include "noderef.hxx"
-#include "configdefaultprovider.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class NodeChange;
- class RelativePath;
-//-----------------------------------------------------------------------------
-
- /// helper for updating a <type>NodeRef</type> that refers to a Group
- class GroupUpdateHelper
- {
- rtl::Reference< Tree > m_aTree;
- NodeRef m_aNode;
- public:
- GroupUpdateHelper(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode);
- ~GroupUpdateHelper() {}
-
- void validateNode(ValueRef const& aNode) const;
- void validateNode(NodeRef const& aNode) const;
-
- rtl::Reference< Tree > const& tree() const { return m_aTree; }
- NodeRef const& node() const { return m_aNode; }
- private:
- void implValidateTree(rtl::Reference< Tree > const& aTree) const;
- void implValidateNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) const;
- void implValidateNode(rtl::Reference< Tree > const& aTree, ValueRef const& aNode) const;
- };
-//-----------------------------------------------------------------------------
- /// allows to update values of a simple type within a <type>NodeRef</type> that refers to a Group
- class GroupUpdater
- {
- GroupUpdateHelper m_aHelper;
- com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> m_xTypeConverter;
- public:
- GroupUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter);
-
- NodeChange validateSetValue(ValueRef const& aValueNode, com::sun::star::uno::Any const& newValue );
-
- private:
- com::sun::star::uno::Any implValidateValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode, com::sun::star::uno::Any const& aValue) const;
- };
-//-----------------------------------------------------------------------------
-
- /// allows to reset to default value or state members of a <type>NodeRef</type> that refers to a Group
- class GroupDefaulter
- {
- GroupUpdateHelper m_aHelper;
- DefaultProvider m_aDefaultProvider;
- bool m_bHasDoneSet;
- public:
- GroupDefaulter(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aProvider);
-
- bool hasDoneSet() const { return m_bHasDoneSet; }
-
- NodeChange validateSetToDefaultValue(ValueRef const& aValueNode);
-
- NodeChange validateSetToDefaultState(NodeRef const& aNode);
-
- NodeChanges validateSetAllToDefault();
-
- static bool isDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode);
- static bool ensureDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aSource);
- };
-//-----------------------------------------------------------------------------
- bool isPossibleValueType(com::sun::star::uno::Type const& aValueType);
-//-----------------------------------------------------------------------------
- bool convertCompatibleValue(com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter, uno::Any& rConverted,
- com::sun::star::uno::Any const& rNewValue, com::sun::star::uno::Type const& rTargetType);
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGGROUP_HXX_
diff --git a/configmgr/source/inc/configinteractionhandler.hxx b/configmgr/source/inc/configinteractionhandler.hxx
deleted file mode 100644
index 5fb881f4dd1e..000000000000
--- a/configmgr/source/inc/configinteractionhandler.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGINTERACTIONHANDLER_HXX
-#define CONFIGMGR_CONFIGINTERACTIONHANDLER_HXX
-
-#include "sal/config.h"
-#include "com/sun/star/uno/Reference.hxx"
-#include "rtl/ref.hxx"
-#include "uno/current_context.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace task { class XInteractionHandler; }
- namespace uno { class Any; }
-} } }
-namespace rtl { class OUString; }
-
-namespace configmgr { namespace apihelper {
-
-/**
- represents the InteractionHandler for configuration errors from the current
- context.
-
- <p>Should only be kept in scope while the error is being handled.</p>
-*/
-class ConfigurationInteractionHandler {
-public:
- ConfigurationInteractionHandler();
-
- ~ConfigurationInteractionHandler();
-
- com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
- get() const; // throw (com::sun::star::uno::RuntimeException)
-
- void setRecursive(
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionHandler > const & handler);
-
-private:
- ConfigurationInteractionHandler(ConfigurationInteractionHandler &);
- // not defined
- void operator =(ConfigurationInteractionHandler &); // not defined
-
- com::sun::star::uno::Any getPreviousContextValue(
- rtl::OUString const & name) const;
- // throw (com::sun::star::uno::RuntimeException)
-
- class Context;
- friend class Context;
-
- rtl::Reference< Context > m_context;
- com::sun::star::uno::ContextLayer m_layer;
-};
-
-} }
-
-#endif
diff --git a/configmgr/source/inc/configpath.hxx b/configmgr/source/inc/configpath.hxx
deleted file mode 100644
index 4664ec032559..000000000000
--- a/configmgr/source/inc/configpath.hxx
+++ /dev/null
@@ -1,446 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGPATH_HXX_
-#define CONFIGMGR_CONFIGPATH_HXX_
-
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-namespace configmgr
-{
- namespace configuration
- {
- //--------------------------------------------------------------------
-
- /** check if this is a well-formed name for a
- config Node (excluding set elements)
- */
- bool isSimpleName(rtl::OUString const& sName) SAL_THROW(());
-
- /** make a name out of <var>sName</var>,
- validating that it can be used for a config Node (excluding set elements)
- or template name.
- @throws InvalidName
- if the name is not valid for that purpose
- */
- rtl::OUString validateNodeName(rtl::OUString const& sName);
-
- /** make a name out of <var>sName</var>
- validating that it can be used for a config set element
- @throws InvalidName
- if the name is not valid for that purpose
- */
- rtl::OUString validateElementName(rtl::OUString const& sName);
- //------------------------------------------------------------------------
-
- //------------------------------------------------------------------------
- namespace Path
- {
- //------------------------------------------------------------------------
-
- class Component
- {
- /// holds the contents of this path component
- rtl::OUString m_aName;
- public:
- /// construct a path component from a string, without any validation
- Component(rtl::OUString const& _sName) SAL_THROW(());
-
- /// is this component an empty name ?
- bool isEmpty() const SAL_THROW(()) { return m_aName.getLength() == 0; }
- /// is this component a simple name ?
- bool isSimpleName() const SAL_THROW(());
- /// get the inner name for this component
- rtl::OUString getName() const SAL_THROW(());
- /// get the embedded type name for this component (if any)
- rtl::OUString getTypeName() const SAL_THROW(());
-
- /// get the contents of this as string (unparsed).
- rtl::OUString toPathString() const SAL_THROW(()) { return m_aName; }
-
- // hashing - for hash maps. compatible to equiv or matches
- size_t hashCode() const SAL_THROW(())
- { return this->getName().hashCode(); }
-
- /// get the contents of this as a name (unparsed). Use with care !
- rtl::OUString const& getInternalName() const SAL_THROW(()) { return m_aName; }
-
- };
-
- //-------------------------------------------------------------------------
-
- /// compare taking type wildcards into account
- bool matches(Component const& lhs,Component const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool before(Component const& lhs,Component const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool equiv(Component const& lhs,Component const& rhs) SAL_THROW(());
- //-------------------------------------------------------------------------
-
- /// construct a empty path component
- Component makeEmptyComponent() SAL_THROW(());
-
- //-------------------------------------------------------------------------
- /// construct a path component from a name, validating it as simple name
- Component wrapSimpleName(rtl::OUString const& _aName);
-
- /// construct a path component from a type and element name, using a wildcard if no type is available
- Component makeCompositeName(rtl::OUString const& _aElementName, rtl::OUString const& _aTypeName);
-
- //-----------------------------------------------------------------------------
- /// construct a composite path component from a element name or string, using a wildcard type
- template <class NameRep>
- Component wrapElementName(NameRep const& _aElementName) SAL_THROW(())
- {
- return makeCompositeName(_aElementName, NameRep());
- }
-
- //-------------------------------------------------------------------------
- /// construct a path component from an arbitrary na,e or string
- template <class NameRep>
- Component wrapSafeName(NameRep const& _aName) SAL_THROW(())
- {
- return isSimpleName(_aName) ? wrapSimpleName(_aName) : wrapElementName(_aName);
- }
-
- //-----------------------------------------------------------------------------
- /** lower-level representation of a path within the configuration
- <p>Keeps the data in a vector of names in reverse order! </P>
- */
- class Rep
- {
- public:
- /// construct an empty path
- Rep() SAL_THROW(()) : m_aComponents() {}
-
- /// construct a path consisting of a single component <var>_aName</var>
- explicit Rep(Component const& _aName) SAL_THROW(()) : m_aComponents(1,_aName) {}
-
- /// construct a path consisting of a path subrange
- explicit Rep(std::vector<Component>::const_reverse_iterator const& _first, std::vector<Component>::const_reverse_iterator const& _last)
- : m_aComponents(_last.base(), _first.base()) {}
-
- /// swap contents with another instance
- void swap(Rep& _aOther) SAL_THROW(()) { m_aComponents.swap(_aOther.m_aComponents); }
-
- /// modify a path by prepending <var>aName</var>
- void prepend(Component const& _aName) SAL_THROW(()) { m_aComponents.push_back(_aName); }
-
- /// modify a path by prepending <var>aName</var>
- void prepend(Rep const& _aOther) SAL_THROW(());
-
- /// get the local name (the last component of this path)
- Component const& getLocalName() const { check_not_empty(); return m_aComponents.front(); }
-
- /// get the next name (the first component of this path)
- Component const& getFirstName() const { check_not_empty(); return m_aComponents.back(); }
-
- /// set this to the remainder after the first name (drop the first component of this path)
- void dropFirstName() { check_not_empty(); m_aComponents.pop_back(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString(bool _bAbsolute) const SAL_THROW(());
-
- public:
- /// check if this is an empty path
- bool isEmpty() const SAL_THROW(()) { return m_aComponents.empty(); }
-
- /// Count the components of this
- std::vector<Component>::size_type countComponents() const SAL_THROW(()) { return m_aComponents.size(); }
-
- /// Insert a component into this path
- void insertComponent(std::vector<Component>::reverse_iterator _it, Component _aName)
- { m_aComponents.insert(_it.base(),_aName); }
-
- /// Remove a component from this path
- void removeComponent(std::vector<Component>::reverse_iterator _it) { m_aComponents.erase(_it.base()); }
-
- /// Remove all components from this path
- void clearComponents() SAL_THROW(()) { m_aComponents.clear(); }
-
- /// get a STL style iterator to the first component
- std::vector<Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aComponents.rbegin(); }
- /// get a STL style iterator to after the last component
- std::vector<Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aComponents.rend(); }
-
- /// get a STL style iterator to the first component
- std::vector<Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aComponents.rbegin(); }
- /// get a STL style iterator to after the last component
- std::vector<Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aComponents.rend(); }
-
- // hashing - for hash maps
- size_t hashCode() const SAL_THROW(());
-
- /// preflight check for operations that require a non-empty path
- void check_not_empty() const;
-
- private:
- std::vector<Component> m_aComponents;
- };
- //------------------------------------------------------------------------
-
- /// compare taking type wildcards into account
- bool matches(Rep const& lhs,Rep const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool before(Rep const& lhs,Rep const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool equiv(Rep const& lhs,Rep const& rhs) SAL_THROW(());
- //------------------------------------------------------------------------
-
- /// check a path for a prefix
- bool hasMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix) SAL_THROW(());
-
- /// remove a prefix from a path. Throws InvalidName if it isn't a prefix
- Rep stripMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix);
- //------------------------------------------------------------------------
-
- /// distinguishes which kind of path is present in a string
- bool isAbsolutePath(rtl::OUString const& _sPath);
- //------------------------------------------------------------------------
- }
- //------------------------------------------------------------------------
-
- class RelativePath
- {
- Path::Rep m_aRep;
- public:
- // Construction
- /// construct a relative path from <var>aString</var> throwing InvalidName for parse errors
- static RelativePath parse(rtl::OUString const& _aString);
-
- /// construct an empty relative path
- RelativePath() SAL_THROW(()) : m_aRep() { init(); }
-
- /// construct a relative path having <var>aRep</var> as representation
- explicit RelativePath(Path::Rep const& _aRep)
- : m_aRep(_aRep) { init(); }
-
- /// CONVERSION: construct a relative path having <var>aName</var> as single component
- RelativePath(Path::Component const& _aName) SAL_THROW(());
-
- /// build the Path that results from appending <var>aPath</var> to this
- RelativePath compose(RelativePath const& _aPath) const SAL_THROW(());
-
- /// check if this is an empty path
- bool isEmpty() const SAL_THROW(()) { return m_aRep.isEmpty(); }
-
- /// Count the components of this
- std::vector<Path::Component>::size_type getDepth() const SAL_THROW(()) { return m_aRep.countComponents(); }
-
- /// get the local name (the last component of this path)
- Path::Component const& getLocalName() const { return m_aRep.getLocalName(); }
-
- /// get the local name (the first component of this path)
- Path::Component const& getFirstName() const { return m_aRep.getFirstName(); }
-
- /// set this to the remainder of this path after the first name (drop the first component of this path)
- void dropFirstName() { m_aRep.dropFirstName(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString() const SAL_THROW(());
- public:
- // Iteration support
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aRep.begin(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aRep.end(); }
-
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aRep.begin_mutate(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aRep.end_mutate(); }
-
- // Direct access - 'package' visible
- /// Get a reference to (or copy of) the internal PathRep of this
- Path::Rep const& rep() const SAL_THROW(()) { return m_aRep; }
-
- private:
- void init();
- };
-
- /// compare taking type wildcards into account
- inline bool matches(RelativePath const& lhs,RelativePath const& rhs) SAL_THROW(())
- { return Path::matches(lhs.rep(),rhs.rep()); }
-
- //------------------------------------------------------------------------
-
- class AbsolutePath
- {
- Path::Rep m_aRep;
- public:
- // Construction
- /// construct a absolute path from <var>aString</var> throwing InvalidName for parse errors
- static AbsolutePath parse(rtl::OUString const& _aString);
-
- /// construct a absolute path to a whole module (toplevel) without error checking
- static AbsolutePath makeModulePath(rtl::OUString const& _aString) SAL_THROW(());
-
- /// construct an absolute path to the (virtual) hierarchy root
- static AbsolutePath root() SAL_THROW(());
-
- /// construct an (otherwise invalid) substitute path for the root of a free-floating node
- static AbsolutePath detachedRoot() SAL_THROW(());
-
- /// construct a absolute path having <var>aRep</var> as representation
- explicit AbsolutePath(Path::Rep const& _aRep) SAL_THROW(())
- : m_aRep(_aRep) { init(); }
-
- /// build the absolute path that results from appending <var>aPath</var> to this
- AbsolutePath compose(RelativePath const& _aPath) const SAL_THROW(());
-
- /// build the absolute path that results from removing the last component of this
- AbsolutePath getParentPath() const;
-
- /// check if this is the path to the (imaginary) root node
- bool isRoot() const SAL_THROW(()) { return m_aRep.isEmpty(); }
-#if OSL_DEBUG_LEVEL > 0
- /// check if this is a path to a detached node
- bool isDetached() const SAL_THROW(());
-#endif
- /// get the local name (the last component of this path)
- Path::Component const& getLocalName() const { return m_aRep.getLocalName(); }
-
- rtl::OUString const & getModuleName() const { return m_aRep.getFirstName().getInternalName(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString() const SAL_THROW(());
-
- /// Count the components of this
- std::vector<Path::Component>::size_type getDepth() const SAL_THROW(()) { return m_aRep.countComponents(); }
- public:
- // Iteration support
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aRep.begin(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aRep.end(); }
-
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aRep.begin_mutate(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aRep.end_mutate(); }
-
- // Direct access - 'package' visible
- /// Get a reference to (or copy of) the internal PathRep of this
- Path::Rep const& rep() const SAL_THROW(()) { return m_aRep; }
- private:
- void init() SAL_THROW(());
- };
-
- /// compare taking type wildcards into account
- inline bool matches(AbsolutePath const& lhs,AbsolutePath const& rhs) SAL_THROW(())
- { return Path::matches(lhs.rep(),rhs.rep()); }
-
- namespace Path
- {
- //------------------------------------------------------------------------
- template <class PathClass>
- bool hasPrefix(PathClass const& _aPath, PathClass const& _aPrefix) SAL_THROW(())
- {
- return hasMatchingPrefix(_aPath.rep(),_aPrefix.rep() );
- }
- //------------------------------------------------------------------------
-
- template <class PathClass>
- RelativePath stripPrefix(PathClass const& _aPath, PathClass const& _aPrefix)
- {
- return RelativePath( stripMatchingPrefix(_aPath.rep(),_aPrefix.rep()) );
- }
- //------------------------------------------------------------------------
-
- // STL Helpers
- //------------------------------------------------------------------------
-
- /// a weak strict ordering considering only the name part
- struct Before
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return before(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return before(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return before(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return before(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
-
- /// an equality relation considering only the name part (compatible to Before)
- struct Equiv
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return equiv(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return equiv(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return equiv(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return equiv(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
-
- /// a hash generator (compatible to Equiv and Before)
- struct Hash
- {
- size_t operator()(Component const& _aObject) const SAL_THROW(())
- { return _aObject.hashCode(); }
- size_t operator()(Rep const& _aObject) const SAL_THROW(())
- { return _aObject.hashCode(); }
- size_t operator()(AbsolutePath const& _aObject) const SAL_THROW(())
- { return _aObject.rep().hashCode(); }
- size_t operator()(RelativePath const& _aObject) const SAL_THROW(())
- { return _aObject.rep().hashCode(); }
- };
- //------------------------------------------------------------------------
- /// a binary predicate that is not (!) an equivalence relation
-
- struct Matches
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return matches(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return matches(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return matches(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return matches(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
- }
- //------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNAME_HXX_
diff --git a/configmgr/source/inc/configset.hxx b/configmgr/source/inc/configset.hxx
deleted file mode 100644
index b09446313fdf..000000000000
--- a/configmgr/source/inc/configset.hxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGSET_HXX_
-#define CONFIGMGR_CONFIGSET_HXX_
-
-#include "configexcept.hxx"
-#include "configdefaultprovider.hxx"
-#include "template.hxx"
-#include "noderef.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
- namespace data { class TreeSegment; }
-
- namespace configuration
- {
- namespace Path { class Component; }
- //---------------------------------------------------------------------
-
- class ElementTree;
-
- class NodeChange;
- class Template;
-
- class SetElementFactory
- {
- TemplateProvider m_aProvider;
- public:
- SetElementFactory(TemplateProvider const& aProvider);
- SetElementFactory(SetElementFactory const& aOther);
- SetElementFactory& operator=(SetElementFactory const& aOther);
- ~SetElementFactory();
-
- rtl::Reference< ElementTree > instantiateTemplate(rtl::Reference<Template> const& aTemplate);
- rtl::Reference< ElementTree > instantiateOnDefault(rtl::Reference< data::TreeSegment > const& _aTree, rtl::Reference<Template> const& aDummyTemplate);
-
- static TemplateProvider findTemplateProvider(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
- };
-
-//-----------------------------------------------------------------------------
-
- /// allows to insert,remove and replace an element of a <type>Node</type> that is a Container ("set") of full-fledged trees.
- class TreeSetUpdater
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- rtl::Reference<Template> m_aTemplate;
- public:
- TreeSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, rtl::Reference< Template > const& aTemplate);
-
- NodeChange validateInsertElement (rtl::OUString const& aName, rtl::Reference< ElementTree > const& aNewElement);
-
- NodeChange validateReplaceElement(rtl::Reference< ElementTree > const& aElement, rtl::Reference< ElementTree > const& aNewElement);
-
- NodeChange validateRemoveElement (rtl::Reference< ElementTree > const& aElement);
- private:
- void implValidateSet();
- Path::Component implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable);
- void implValidateTree(rtl::Reference< ElementTree > const& aElementTree);
- };
-//-----------------------------------------------------------------------------
- /// allows to insert,remove and replace an element of a <type>Node</type> that is a Container ("set") of simple values.
- class ValueSetUpdater
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- rtl::Reference<Template> m_aTemplate;
- com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> m_xTypeConverter;
- public:
- ValueSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- rtl::Reference< Template > const& aTemplate, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter);
-
- NodeChange validateInsertElement (rtl::OUString const& aName, com::sun::star::uno::Any const& aNewValue);
-
- NodeChange validateReplaceElement(rtl::Reference< ElementTree > const& aElement, com::sun::star::uno::Any const& aNewValue);
-
- NodeChange validateRemoveElement (rtl::Reference< ElementTree > const& aElement);
- private:
- void implValidateSet();
- Path::Component implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable);
- com::sun::star::uno::Any implValidateValue(rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue);
- com::sun::star::uno::Any implValidateValue(com::sun::star::uno::Any const& aValue);
-
- rtl::Reference<ElementTree> makeValueElement(rtl::OUString const& aName, rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue, bool bInserting);
- rtl::Reference<ElementTree> makeValueElement(rtl::OUString const& aName, com::sun::star::uno::Any const& aValue, bool bInserting);
- rtl::Reference< Tree > extractElementNode(rtl::Reference< ElementTree > const& aElement);
- };
-//-----------------------------------------------------------------------------
-
- /// allows to restore to its default state a <type>Node</type> that is a Container ("set") of full-fledged trees.
- class SetDefaulter
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- DefaultProvider m_aDefaultProvider;
- public:
- SetDefaulter(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, DefaultProvider const& aDefaultProvider);
-
- NodeChange validateSetToDefaultState();
-
- private:
- void implValidateSet();
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGSET_HXX_
diff --git a/configmgr/source/inc/confsvccomponent.hxx b/configmgr/source/inc/confsvccomponent.hxx
deleted file mode 100644
index 38d6b8eb79df..000000000000
--- a/configmgr/source/inc/confsvccomponent.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SVCCOMPONENT_HXX_
-#define CONFIGMGR_API_SVCCOMPONENT_HXX_
-
-#include "serviceinfohelper.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase1.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-#ifndef _OSL_MUTEX_HXX_
-#include <osl/Mutex.hxx>
-#endif
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-
-//----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-
-//----------------------------------------------------------------------------
- class ServiceComponentImpl
- : public ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >
- {
- protected:
- ServiceImplementationInfo const*const m_info;
- public:
- ServiceComponentImpl(ServiceImplementationInfo const* aInfo);
-
- // XTypeProvider
- virtual uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(uno::RuntimeException);
- //virtual uno::Sequence<uno::Type> SAL_CALL getTypes( ) throw(uno::RuntimeException) = 0;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( ) throw(uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException);
- virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(uno::RuntimeException);
-
- // Component Helper - force override
- virtual void SAL_CALL disposing() = 0;
- // Component Helper - check object state
- virtual void checkAlive() throw (uno::RuntimeException);
- void checkAlive(char const* message) throw (uno::RuntimeException)
- { checkAlive( rtl::OUString::createFromAscii(message) ); }
- void checkAlive(rtl::OUString const& message) throw (uno::RuntimeException);
-
- // Extra helpers
- static uno::Sequence<sal_Int8> getStaticImplementationId(ServiceImplementationInfo const* pServiceInfo) throw(uno::RuntimeException);
-
- private: // no implementation
- ServiceComponentImpl(ServiceComponentImpl&);
- void operator=(ServiceComponentImpl&);
- };
-//----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_SVCCOMPONENT_HXX_
-
-
diff --git a/configmgr/source/inc/datalock.hxx b/configmgr/source/inc/datalock.hxx
deleted file mode 100644
index a2a739974efd..000000000000
--- a/configmgr/source/inc/datalock.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DATALOCK_HXX_
-#define CONFIGMGR_DATALOCK_HXX_
-
-#include "sal/config.h"
-
-#include "osl/interlck.h"
-#include "osl/mutex.hxx"
-
-namespace configmgr {
-
- class UnoApiLock
- {
- static osl::Mutex aCoreLock;
- public:
- static volatile oslInterlockedCount nHeld;
- UnoApiLock() { acquire(); }
- ~UnoApiLock() { release(); }
-
- static osl::Mutex &getLock() { return aCoreLock; }
- static void acquire() { aCoreLock.acquire(); nHeld++; }
- static void release() { nHeld--; aCoreLock.release(); }
- static bool isHeld() { return nHeld != 0; }
- };
- class UnoApiLockReleaser
- {
- oslInterlockedCount mnCount;
- public:
- UnoApiLockReleaser();
- ~UnoApiLockReleaser();
- };
- class UnoApiLockClearable : public UnoApiLock
- {
- bool mbSet;
- public:
- UnoApiLockClearable() : mbSet(true) { acquire(); }
- ~UnoApiLockClearable() { clear(); }
- void clear() { if (mbSet) { mbSet = false; release(); } }
- };
-}
-
-#endif // CONFIGMGR_DATALOCK_HXX_
diff --git a/configmgr/source/inc/defaultprovider.hxx b/configmgr/source/inc/defaultprovider.hxx
deleted file mode 100644
index 0f673b7f380c..000000000000
--- a/configmgr/source/inc/defaultprovider.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFAULTPROVIDER_HXX
-#define CONFIGMGR_DEFAULTPROVIDER_HXX
-
-#include "sal/config.h"
-
-#include "com/sun/star/uno/Exception.hpp"
-#include "sal/types.h"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
- class AbsolutePath;
- }
- //-------------------------
- class RequestOptions;
- //==========================================================================
- //= IDefaultableTreeManager
- //==========================================================================
- /* is a supplementary interface for an <type>OProviderImpl</type>.
- <p>Supports functionality to load default data into the managed tree</p>
- */
- class SAL_NO_VTABLE IDefaultableTreeManager
- {
- public:
- /** attempt to load default data into the tree named by a path using certain options
- and requiring a specific loading depth.
-
- @returns
- <TRUE/>, if some default data is available within the tree
- <FALSE/>, if no default data is available for the tree
- */
- virtual sal_Bool fetchDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _xOptions
- ) SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- };
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/emptylayer.hxx b/configmgr/source/inc/emptylayer.hxx
deleted file mode 100644
index d61b38d0ee25..000000000000
--- a/configmgr/source/inc/emptylayer.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_EMPTYLAYER_HXX
-#define CONFIGMGR_BACKEND_EMPTYLAYER_HXX
-
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
- // -----------------------------------------------------------------------------
- uno::Reference< backenduno::XLayer > createEmptyLayer();
-
- bool checkEmptyLayer(uno::Reference< backenduno::XLayer > const & xLayer );
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/inc/filehelper.hxx b/configmgr/source/inc/filehelper.hxx
deleted file mode 100644
index e1dd4a03a412..000000000000
--- a/configmgr/source/inc/filehelper.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_FILEHELPER_HXX_
-#define _CONFIGMGR_FILEHELPER_HXX_
-
-#include "utility.hxx"
-#include <osl/file.hxx>
-#include <com/sun/star/io/IOException.hpp>
-
-namespace io = com::sun::star::io;
-
-namespace configmgr
-{
- //==========================================================================
- //= FileHelper
- //==========================================================================
- /** Within the FileHelper namespace there is a list of methods declared, which ease
- specific file operations.
- */
- namespace FileHelper
- {
- /// delimiter used in URLs and ConfPath
- static const ::sal_Unicode delimiter = sal_Unicode('/');
-
- /// Tests if the file exists.
- bool fileExists(rtl::OUString const& _sFileURL);
-
- /// Tests if the directory exists.
- bool dirExists(rtl::OUString const& _sDirURL);
-
- /** Returns the parent part of the pathname of this File URL,
- or an empty string if the name has no parent part.
- The parent part is generally everything leading up to the last occurrence
- of the separator character.
- */
- rtl::OUString getParentDir(rtl::OUString const& _aFileURL);
-
- /**
- Returns the file name part of a file URL.
-
- @param aFileUrl file URL
- @return everything in the URL from the last delimiter on
- */
- rtl::OUString getFileName(const rtl::OUString& aFileUrl) ;
-
- /**
- Splits a file URL between its parent directory/file name
- parts.
-
- @param aFileUrl file URL
- @param aParentDirectory parent directory filled on return
- @param aFileName file name filled on return
- */
- void splitFileUrl(const rtl::OUString& aFileUrl,
- rtl::OUString& aParentDirectory,
- rtl::OUString& aFileName) ;
-
- /** creates a directory whose pathname is specified by a FileURL.
- @return true if directory could be created or does exist, otherwise false.
- */
- osl::FileBase::RC mkdir(rtl::OUString const& _sDirURL);
-
- /** creates a directory whose pathname is specified by a FileURL,
- including any necessary parent directories.
- @return true if directory (or directories) could be created or do(es) exist, otherwise false.
- */
- osl::FileBase::RC mkdirs(rtl::OUString const& _aDirectory);
-
- /** replaces a file specified by _aToURL with a file specified by _aFromURL.
- */
- void replaceFile(const rtl::OUString& _aToURL, const rtl::OUString &_aFromURL) SAL_THROW((io::IOException));
-
- /** removes a file specified by _aURL. Ignores the case of a non-existing file.
- */
- bool tryToRemoveFile(const rtl::OUString& _aURL, bool tryBackupFirst);
-
- /** creates an error msg string for a given file error return code.
- */
- rtl::OUString createOSLErrorString(osl::FileBase::RC eError);
-
- /** determines the status of a directory entry specified by a URL.
- @return the Size of the file in bytes and the TimeValue of the last modification, if the file exists,
- otherwise 0 and a TimeValue(0,0).
- */
- sal_uInt64 getModifyStatus(rtl::OUString const& _aNormalizedFilename, TimeValue & rModifyTime);
- }
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/flags.hxx b/configmgr/source/inc/flags.hxx
deleted file mode 100644
index 100723f2f3fd..000000000000
--- a/configmgr/source/inc/flags.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DATA_FLAGS_HXX
-#define INCLUDED_DATA_FLAGS_HXX
-
-#include <sal/types.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data
- {
- //-----------------------------------------------------------------------------
- // node type + value type selector - fits into a byte (bit 5 currently unassigned)
- namespace Type
- {
- enum Type
- {
- // Primitive Data Type is stored in bits 0-4 (bit 3 currently unused)
- // base data types
- value_any, // = 0
- value_string, // = 1
- value_boolean, // = 2
- value_short, // = 3
- value_int, // = 4
- value_long, // = 5
- value_double, // = 6
- value_binary, // = 7
-
- mask_basetype = 0x0F,
-
- // sequence data types
- flag_sequence = 0x10,
-
- value_invalid = value_any | flag_sequence,
-
- value_string_list = value_string | flag_sequence,
- value_boolean_list = value_boolean | flag_sequence,
- value_short_list = value_short | flag_sequence,
- value_int_list = value_int | flag_sequence,
- value_long_list = value_long | flag_sequence,
- value_double_list = value_double | flag_sequence,
- value_binary_list = value_binary | flag_sequence,
-
- mask_valuetype = mask_basetype | flag_sequence, // 0x1F
-
- // Node Type is stored in bits 6+7
- nodetype_shift_ = 6,
- mask_nodetype = 0x03 << nodetype_shift_, // 0xC0
-
- // maybe we should use 0 for node type 'value'
- // to make the complete type be the valuetype ?
- nodetype_invalid= 0x00,
-
- nodetype_value = 0x01 << nodetype_shift_, // 0x40
- nodetype_group = 0x02 << nodetype_shift_, // 0x80
- nodetype_set = 0x03 << nodetype_shift_, // 0xC0
-
- flag_innernode = 0x02 << nodetype_shift_, // 0x80
- flag_setnode = 0x01 << nodetype_shift_ // 0x40
- };
- }
-
- //-----------------------------------------------------------------------------
- // node attributes
- namespace Flags
- {
- enum Type
- {
- readonly = 0x01,
- finalized = 0x02,
-
- nullable = 0x04,
- localized = 0x08,
-
- valueAvailable = 0x10, // only used for value nodes
- defaultAvailable = 0x20, // only used for value nodes
-
- defaulted = 0x40, // somewhat redundant with State
- defaultable = 0x80 // redundant with State (merged || defaulted)
- };
- }
- //-----------------------------------------------------------------------------
- // set element or tree state
- namespace State
- {
- enum Type
- {
- merged, // = 0, - result of merging defaults + changes
- defaulted, // = 1, - result of copying defaults unchanged
- replaced, // = 2, - result of copying new layer unchanged
- added, // = 3, - same as 'replaced', but it is known,
- // that there is no corresponding default
-
- mask_state = 0x0F, // leaves bits 3+4 reserved for states
-
- flag_mandatory = 0x10, // marks this element as non-removable/replacable
- flag_readonly = 0x20, // marks this element as read-only
- flag_default_avail = 0x40, // marks this element as containing default values
- flag_removable = 0x80 // marks this element as removable
- };
- }
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_DATA_FLAGS_HXX
diff --git a/configmgr/source/inc/interactionrequest.hxx b/configmgr/source/inc/interactionrequest.hxx
deleted file mode 100644
index 5d9573ed655f..000000000000
--- a/configmgr/source/inc/interactionrequest.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_INTERACTIONREQUEST_HXX
-#define CONFIGMGR_INTERACTIONREQUEST_HXX
-
-#include <com/sun/star/task/XInteractionRequest.hpp>
-#include <com/sun/star/task/XInteractionAbort.hpp>
-#include <com/sun/star/task/XInteractionRetry.hpp>
-#include <com/sun/star/task/XInteractionApprove.hpp>
-#include <com/sun/star/task/XInteractionDisapprove.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr {
-namespace apihelper {
- namespace uno = com::sun::star::uno;
- namespace task = com::sun::star::task;
-//============================================================================
-
-/**
- * This class implements the interface XInteractionRequest. Instances can
- * be passed directly to XInteractionHandler::handle(...). Each interaction
- * request contains an exception describing the error and a number of
- * interaction continuations describing the possible "answers" for the request.
- * After the request was passed to XInteractionHandler::handle(...) the method
- * getSelection() returns the continuation choosen by the interaction handler.
- *
- * The typical usage of this class would be:
- *
- * 1) Create exception object that shall be handled by the interaction handler.
- * 2) Create InteractionRequest, supply exception as ctor parameter
- * 3) Create continuations needed and add them to a sequence
- * 4) Supply the continuations to the InteractionRequest by calling
- * setContinuations(...)
- *
- * This class can also be used as base class for more specialized requests,
- * like authentication requests.
- */
-class InteractionRequest : public cppu::WeakImplHelper1<com::sun::star::task::XInteractionRequest>
-{
- struct Impl;
- Impl * m_pImpl;
-
-protected:
- virtual ~InteractionRequest();
-public:
- /**
- * Constructor.
- *
- * @param rRequest is the exception describing the error.
- */
- InteractionRequest( const com::sun::star::uno::Any & rRequest );
-
- /**
- * This method sets the continuations for the request.
- *
- * @param rContinuations contains the possible continuations.
- */
- void setContinuations(
- const uno::Sequence< uno::Reference< task::XInteractionContinuation > > &
- rContinuations );
-
- // XInteractionRequest
- virtual uno::Any SAL_CALL
- getRequest()
- throw( uno::RuntimeException );
-
- virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
- getContinuations()
- throw( com::sun::star::uno::RuntimeException );
-
- // Non-interface methods.
-
- /**
- * After passing this request to XInteractionHandler::handle, this method
- * returns the continuation that was choosen by the interaction handler.
- *
- * @return the continuation choosen by an interaction handler or an empty
- * reference, if the request was not (yet) handled.
- */
- uno::Reference< task::XInteractionContinuation > getSelection() const;
-
- /**
- * This method sets a continuation for the request. It also can be used
- * to reset the continuation set by a previous XInteractionHandler::handle
- * call in order to use this request object more then once.
- *
- * @param rxSelection is the interaction continuation to activate for
- * the request or an empty reference in order to reset the
- * current selection.
- */
- void setSelection(
- const uno::Reference< task::XInteractionContinuation > & rxSelection );
-};
-
-//============================================================================
-
-/**
- * This template class implements a simple standard interaction continuation
- * interface provided as template parameter. Classes instantiated from this
- * template work together with class InteractionRequest.
- * Instances of such a class can be passed along with an interaction request
- * to indicate the possiblity to continue the operation that caused the request
- * as indicated by the interface.
- */
-template <class XThisContinuation >
-class InteractionContinuation : public cppu::WeakImplHelper1< XThisContinuation >
-{
- InteractionRequest * m_pRequest;
-public:
- InteractionContinuation( InteractionRequest * pRequest )
- : m_pRequest( pRequest ) {}
-
- // XInteractionContinuation
- /**
- * This method marks this continuation as "selected" at the request it
- * belongs to.
- *
- * Derived classes must implement their XInteractionContinuation::select()
- * method the way that they call this method.
- */
- virtual void SAL_CALL select()
- throw( com::sun::star::uno::RuntimeException );
-};
-//============================================================================
-
-template <class XThisContinuation >
-void SAL_CALL InteractionContinuation< XThisContinuation >::select()
- throw( com::sun::star::uno::RuntimeException )
-{
- m_pRequest->setSelection(this);
-}
-//============================================================================
-
-
-} // namespace apihelper
-} // namespace configmgr
-
-#endif /* !CONFIGMGR_INTERACTIONREQUEST_HXX */
diff --git a/configmgr/source/inc/logger.hxx b/configmgr/source/inc/logger.hxx
deleted file mode 100644
index 57787c336647..000000000000
--- a/configmgr/source/inc/logger.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOGGER_HXX
-#define CONFIGMGR_LOGGER_HXX
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/util/logging/XLogger.hpp>
-#include <com/sun/star/util/logging/LogLevel.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = com::sun::star::uno;
- namespace logging = com::sun::star::util::logging;
- namespace LogLevel = logging::LogLevel;
-
- /// class providing access to a log output sink in the context
- class Logger
- {
- uno::Reference< logging::XLogger > m_xLogger;
- public:
- Logger() : m_xLogger() {}
-
- Logger(uno::Reference< logging::XLogger > const & xLogger)
- : m_xLogger(xLogger)
- {}
-
- explicit
- Logger(uno::Reference< uno::XComponentContext > const & xContext)
- : m_xLogger( getUnoLoggerFromContext(xContext) )
- {}
-
- sal_Int32 level() const
- { return m_xLogger.is() ? m_xLogger->getLevel() : LogLevel::OFF; }
-
- bool isLogging(sal_Int32 nLogLevel) const
- { return m_xLogger.is() && m_xLogger->isLoggable(nLogLevel); }
-
- /// log output to the logger
- void log(sal_Int32 nLevel, const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const;
- void log(sal_Int32 nLevel, const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const;
-
- void error(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::SEVERE, msg, sourceMethod, sourceClass); }
- void error(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::SEVERE, msg, sourceMethod, sourceClass); }
-
- void warning(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::WARNING, msg, sourceMethod, sourceClass); }
- void warning(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::WARNING, msg, sourceMethod, sourceClass); }
-
- void info(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::INFO, msg, sourceMethod, sourceClass); }
- void info(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::INFO, msg, sourceMethod, sourceClass); }
-
- void config(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::CONFIG, msg, sourceMethod, sourceClass); }
- void config(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::CONFIG, msg, sourceMethod, sourceClass); }
-
- void fine(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINE, msg, sourceMethod, sourceClass); }
- void fine(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINE, msg, sourceMethod, sourceClass); }
-
- void finer(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINER, msg, sourceMethod, sourceClass); }
- void finer(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINER, msg, sourceMethod, sourceClass); }
-
- void finest(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINEST, msg, sourceMethod, sourceClass); }
- void finest(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINEST, msg, sourceMethod, sourceClass); }
-
- uno::Reference< logging::XLogger > getUnoLogger() const { return m_xLogger; }
-
- static
- uno::Reference< logging::XLogger >
- getUnoLoggerFromContext(uno::Reference< uno::XComponentContext > const & xContext);
- };
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif // CONFIGMGR_LOGGER_HXX
-
diff --git a/configmgr/source/inc/matchlocale.hxx b/configmgr/source/inc/matchlocale.hxx
deleted file mode 100644
index fe32f375dbf5..000000000000
--- a/configmgr/source/inc/matchlocale.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_MATCHLOCALE_HXX
-#define CONFIGMGR_MATCHLOCALE_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/Locale.hpp>
-
-#include <rtl/ustring.hxx>
-#include <vector>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-
- namespace localehelper
- {
- // -------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- // -------------------------------------------------------------------------
- extern char const * const c_sAnyLanguage;
- extern char const * const c_sDefLanguage;
-
- extern bool isAnyLanguage(rtl::OUString const & _sLanguage);
- extern bool isDefaultLanguage(rtl::OUString const & _sLanguage);
-
- extern rtl::OUString getAnyLanguage();
- extern rtl::OUString getDefaultLanguage();
-
- extern com::sun::star::lang::Locale getAnyLocale();
- extern com::sun::star::lang::Locale getDefaultLocale();
-
- // -------------------------------------------------------------------------
- // the max value of std::vector< com::sun::star::lang::Locale >::size_type - marks out-of-range (Value == -1 == ~0)
- std::vector< com::sun::star::lang::Locale >::size_type const c_noPosition = std::vector< com::sun::star::lang::Locale >::size_type(0)-std::vector< com::sun::star::lang::Locale >::size_type(1);
-
- // conversion helpers
- com::sun::star::lang::Locale makeLocale(rtl::OUString const& sLocaleName_);
- rtl::OUString makeIsoLocale(com::sun::star::lang::Locale const& aUnoLocale_);
-
- std::vector< com::sun::star::lang::Locale > makeLocaleSequence(uno::Sequence<rtl::OUString> const& sLocaleNames_);
- uno::Sequence<rtl::OUString> makeIsoSequence(std::vector< com::sun::star::lang::Locale > const& aLocales_);
-
- inline
- bool equalLocale(com::sun::star::lang::Locale const & lhs, com::sun::star::lang::Locale const & rhs)
- { return lhs.Language == rhs.Language && lhs.Country == rhs.Country; }
-
- inline
- bool equalLanguage(com::sun::star::lang::Locale const & lhs, com::sun::star::lang::Locale const & rhs)
- { return lhs.Language == rhs.Language; }
- // -------------------------------------------------------------------------
- bool designatesAllLocales(com::sun::star::lang::Locale const& aLocale_);
- bool designatesAllLocales(std::vector< com::sun::star::lang::Locale > const& aLocales_);
- // -------------------------------------------------------------------------
-
- /// result of matching a locale against a target locale
- enum MatchQuality
- {
- MISMATCH = 0, /// match: locales do not match (must be zero!)
- MATCH_LANGUAGE, /// match: languages match - country mismatch
- MATCH_LANGUAGE_PLAIN, /// match: languages match - no country to match
- MATCH_LOCALE, /// match: full match
- BEST_MATCH = MATCH_LOCALE
- };
-
- /// compare two locales for 'nearness'
- MatchQuality match(com::sun::star::lang::Locale const& aLocale_, com::sun::star::lang::Locale const& aTarget_);
-
-
- // -------------------------------------------------------------------------
- /// result of matching a Locale against a target sequence of locales
- class MatchResult
- {
- std::vector< com::sun::star::lang::Locale >::size_type m_nPos;
- MatchQuality m_eQuality;
-
- public:
- /// construct a default (no match) result
- MatchResult()
- { reset(); }
-
- /// construct a result from given parameters - use with care
- MatchResult(std::vector< com::sun::star::lang::Locale >::size_type nPos_, MatchQuality eQuality_)
- : m_nPos( nPos_ )
- , m_eQuality(eQuality_)
- {}
-
- /// construct an optimum result
- static MatchResult best() { return MatchResult(0,MATCH_LOCALE); }
-
- /// has there been a match
- bool isMatch() const { return m_eQuality != MISMATCH; }
- /// is this the best match possible ?
- bool isBest() const { return m_nPos == 0 && m_eQuality == MATCH_LOCALE; }
-
- /// retrieve the position that was matched
- std::vector< com::sun::star::lang::Locale >::size_type position() const { return m_nPos; }
- /// retrieve the quality of match
- MatchQuality quality() const { return m_eQuality; }
-
- /// assign the given position and quality, if they are an improvement
- bool improve(std::vector< com::sun::star::lang::Locale >::size_type nPos, MatchQuality eQuality_);
-
- /// reset to no match or best match state
- void reset()
- {
- m_nPos = c_noPosition;
- m_eQuality = MISMATCH;
- }
-
- // ---------------------------------------------------------------------
- // comparing MatchResults
- friend bool operator ==(MatchResult const& lhs, MatchResult const& rhs)
- {
- return lhs.m_nPos == rhs.m_nPos &&
- lhs.m_eQuality == rhs.m_eQuality;
- }
-
- // ordering of MatchResults - greater is better
- friend bool operator < (MatchResult const& lhs, MatchResult const& rhs)
- {
- if (lhs.m_nPos > rhs.m_nPos) return true; // greater position is worse
- if (lhs.m_nPos < rhs.m_nPos) return false;
-
- return (lhs.m_eQuality < rhs.m_eQuality); // least Quality is worse
- }
-
- };
-
- // ---------------------------------------------------------------------
- // derived relational operators
- inline bool operator !=(MatchResult const& lhs, MatchResult const& rhs)
- { return !(lhs == rhs); }
- inline bool operator > (MatchResult const& lhs, MatchResult const& rhs)
- { return rhs < lhs; }
- inline bool operator <= (MatchResult const& lhs, MatchResult const& rhs)
- { return !(rhs < lhs); }
- inline bool operator >=(MatchResult const& lhs, MatchResult const& rhs)
- { return !(lhs < rhs); }
-
- /// improve an existing match of a locale against a sequence of locales
- bool improveMatch(MatchResult& rMatch_, com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_);
-
- /// match a locale against a sequence of locales for a given quality level
- bool isMatch(com::sun::star::lang::Locale const& aLocales, std::vector< com::sun::star::lang::Locale > const& aTarget_, MatchQuality eRequiredQuality_);
-
- // -------------------------------------------------------------------------
- /// add defaults to a sequence of locales
- void addFallbackLocales(std::vector< com::sun::star::lang::Locale >& aTargetList_);
-
- // -------------------------------------------------------------------------
- class FindBestLocale
- {
- public:
- /// construct a MatchLocale with a single target locale
- FindBestLocale(com::sun::star::lang::Locale const& aTarget_);
-
- /// is there any match ?
- bool isMatch() const { return m_aResult.isMatch(); }
-
- /// is there an optimum match (so we are done) ?
- bool isBestMatch() const { return m_aResult.isBest(); }
-
- /// get the quality of the best match found
- MatchQuality getMatchQuality() const { return m_aResult.quality(); }
-
- /// check, if the given locale improves the quality. if it does, accept it
- bool accept(com::sun::star::lang::Locale const& aLocale_);
-
- /// reset the match result, indicating whether a match is needed at all
- void reset(bool bNeedLocale_ = true);
-
- private:
- void implSetTarget(std::vector< com::sun::star::lang::Locale > const& aTarget_);
-
- std::vector< com::sun::star::lang::Locale > m_aTarget;
- MatchResult m_aResult;
- };
-
- } // namespace
-// -----------------------------------------------------------------------------
-
-} // namespace
-
-#endif
-
diff --git a/configmgr/source/inc/mergechange.hxx b/configmgr/source/inc/mergechange.hxx
deleted file mode 100644
index 7bc24333a705..000000000000
--- a/configmgr/source/inc/mergechange.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_MERGECHANGE_HXX
-#define INCLUDED_CONFIGMGR_MERGECHANGE_HXX
-
-#include "namecreator.hxx"
-#include "change.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
- // method that applies changes on a existing subtree
- void combineUpdates (SubtreeChange const& _anUpdate, SubtreeChange& _aCombinedUpdate);
-
- // -----------------------------------------------------------------------------
- class OStripDefaults : private ChangeTreeModification
- {
- SubtreeChange& m_rParent;
- public:
- OStripDefaults(SubtreeChange& _rSubtree) : m_rParent(_rSubtree) {}
-
- bool isEmpty() const { return m_rParent.size() == 0; }
-
- OStripDefaults& strip();
-
- static bool strip(SubtreeChange& _rSubtree)
- {
- return OStripDefaults(_rSubtree).strip().isEmpty();
- }
- private:
- void stripOne(Change& _rChange);
-
- virtual void handle(ValueChange& _rValueNode);
- virtual void handle(AddNode& _rAddNode);
- virtual void handle(RemoveNode& _rRemoveNode);
- virtual void handle(SubtreeChange& _rSubtree);
- };
-
- // -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/mergeddataprovider.hxx b/configmgr/source/inc/mergeddataprovider.hxx
deleted file mode 100644
index f4b42b3f0680..000000000000
--- a/configmgr/source/inc/mergeddataprovider.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
-#define CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "request.hxx"
-#include "requesttypes.hxx"
-#include "utility.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
- /** Listener interface for receiving notifications
- about changes to previously requested data
- */
- struct SAL_NO_VTABLE INodeDataListener
- {
- /** is called to indicate changes within the data being observed.
-
- @param _aOriginalRequest
- identifies the data that changed
- */
- virtual void dataChanged(ComponentRequest const & _aOriginalRequest) SAL_THROW(()) = 0;
- };
-// ---------------------------------------------------------------------------
-
- /// Interface providing access to template (schema) data
- struct SAL_NO_VTABLE ITemplateDataProvider
- {
- /** loads a given template and returns it as return value
-
- @param _aRequest
- identifies the template to be loaded
-
- @returns
- A valid instance of the given template.
-
- <p> Currently a request with empty template name
- will retrieve a group node holding all templates
- of a component.
- </p>
-
- @throws com::sun::star::uno::Exception
- if the template cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< TemplateInstance > getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
- };
-// ---------------------------------------------------------------------------
-
- /** Composite interface providing full access to merged configuration data
- from some data store.
-
- <p> Loading and updating of data is supported.
- Support for notification depends on the backend.
- </p>
- */
- struct IMergedDataProvider
- : salhelper::SimpleReferenceObject
- , ITemplateDataProvider
- {
- /** loads merged data for a (partial) tree and returns it as return value.
-
- @param _aRequest
- identifies the component to be loaded
-
- @param _pListener
- a listener to observe subsequent changes to the data requested
-
- <p> If NULL, no notifications will be sent. </p>
-
- <p> Otherwise the listener will be notified of changes.
- The listener must subsequently be removed by calling
- <member>removeRequestListener</member>.
- The listener must live at least until it is removed.
- </p>
-
- @returns
- A valid component instance for the given request.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< ComponentInstance > getNodeData(ComponentRequest const & _aRequest,
- ITemplateDataProvider* _aTemplateProvider,
- INodeDataListener * _pListener = NULL)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- /** remove a listener registered for a previous request.
- <p>This may also release some open resources for the request.</p>
-
- @param _pListener
- a listener that was passed to a previous succes
-
- @param _aRequest
- identifies the component associated with the listener
- */
- virtual void removeRequestListener(INodeDataListener * _pListener,
- const ComponentRequest& aRequest) SAL_THROW(()) = 0;
-
- /** applies an update to the stored data.
-
- @param _anUpdate
- identifies the node to be updated and
- describes the changes to be applied.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be updated.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual void updateNodeData(UpdateRequest const & _anUpdate)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- /** loads default data for a (partial) tree and returns it as return value
-
- @param _aRequest
- identifies the node to be loaded
-
- @returns
- A valid node instance for the default state of the given node.
-
- <p>May be NULL, if the node exists but has no default equivalent.</p>
-
- @throws com::sun::star::uno::Exception
- if the default cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< NodeInstance > getDefaultData(NodeRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
- };
-
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/namecreator.hxx b/configmgr/source/inc/namecreator.hxx
deleted file mode 100644
index 25a1da53c09e..000000000000
--- a/configmgr/source/inc/namecreator.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_NAMECREATOR_HXX
-#define INCLUDED_CONFIGMGR_NAMECREATOR_HXX
-
-#include "configpath.hxx"
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- class Change;
- class SubtreeChange;
- // -----------------------------------------------------------------------------
-
- class ONameCreator
- {
- public:
- ONameCreator() {}
-
- void pushName(const configuration::Path::Component &_aName) { m_aNameList.push_back(_aName); }
- void popName() { m_aNameList.pop_back(); }
-
- void clear() { m_aNameList.clear(); }
-
- static configuration::Path::Component createName(Change const& _rChange, SubtreeChange const* _pParent);
- private:
- std::vector< configuration::Path::Component > m_aNameList;
- };
-
- template <class PathClass>
- class OPathCreator : public ONameCreator
- {
- public:
- OPathCreator() : m_aBasePath( configuration::Path::Rep() ) {}
- OPathCreator(PathClass const & _aBasePath) : m_aBasePath(_aBasePath) {}
-
- void init(PathClass const & _aBasePath)
- { clear(); m_aBasePath = _aBasePath; }
-
- private:
- PathClass m_aBasePath;
- };
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/node.hxx b/configmgr/source/inc/node.hxx
deleted file mode 100644
index 0e102921872d..000000000000
--- a/configmgr/source/inc/node.hxx
+++ /dev/null
@@ -1,229 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_NODE_HXX
-#define INCLUDED_SHARABLE_NODE_HXX
-
-#include "rtl/ustring.hxx"
-
-#include "flags.hxx"
-#include "anydata.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace node { struct Attributes; }
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- struct TreeFragment;
- union Node;
- //-----------------------------------------------------------------------------
- struct NodeInfo
- {
- rtl_uString * name;
- sal_uInt16 parent; // always counts backwards
- sal_uInt8 flags;
- sal_uInt8 type; // contains discriminator for union
-
- rtl::OUString getName() const;
- node::Attributes getNodeInfoAttributes() const;
- bool isDefault() const;
- bool isLocalized() const;
-
- void markAsDefault(bool bDefault = true);
- };
- //-----------------------------------------------------------------------------
- struct GroupNode
- {
- NodeInfo info;
- sal_uInt16 numDescendants; // = number of descendants
-
- bool hasDefaultsAvailable() const;
-
- Node * getFirstChild() const;
- Node * getNextChild(Node * child) const;
- Node * getChild(rtl::OUString const & name) const;
-
- static inline GroupNode * from(Node * node);
- };
- //-----------------------------------------------------------------------------
- struct SetNode
- {
-
- NodeInfo info;
- sal_uInt8 * elementType; // points to template [MM:SetNode *?]
- TreeFragment * elements; // points to first element (TreeFragmentHeader)
-
- rtl::OUString getElementTemplateName() const;
- rtl::OUString getElementTemplateModule() const;
-
- TreeFragment * getFirstElement() const;
- TreeFragment * getNextElement(TreeFragment * _pElement) const;
- TreeFragment * getElement(rtl::OUString const & name) const;
-
- void addElement(TreeFragment * newElement);
- TreeFragment * removeElement(rtl::OUString const & name);
-
- static inline SetNode * from(Node * node);
-
- // low-level helper for template data abstraction
- static
- sal_uInt8 * allocTemplateData(const rtl::OUString &rName,
- const rtl::OUString &rModule);
- static
- sal_uInt8 * copyTemplateData(sal_uInt8 * _aTemplateData);
- static
- void releaseTemplateData(sal_uInt8 * _aTemplateData);
- };
- //-----------------------------------------------------------------------------
- struct ValueNode
- {
- NodeInfo info;
- AnyData value;
- AnyData defaultValue;
-
- bool isNull() const;
- bool hasUsableDefault() const;
-
- com::sun::star::uno::Any getValue() const;
- com::sun::star::uno::Type getValueType() const;
- com::sun::star::uno::Any getUserValue() const;
- com::sun::star::uno::Any getDefaultValue() const;
-
- void setValue(com::sun::star::uno::Any const & newValue);
- void setToDefault();
- void changeDefault(com::sun::star::uno::Any const & newDefault);
-
- static inline ValueNode * from(Node * node);
-
- private:
- void releaseValue();
- sal_uInt8 adaptType(com::sun::star::uno::Any const & newValue);
- };
- //-----------------------------------------------------------------------------
- // TODO: optimized representation of localized values (now as set; mapping locale->element-name)
- // TODO (?): better representation of sets of values
- //-----------------------------------------------------------------------------
- union Node
- {
- NodeInfo info;
- GroupNode group;
- SetNode set;
- ValueNode value;
-
- // info access
- bool isNamed(rtl::OUString const & _aName) const;
- rtl::OUString getName() const;
- node::Attributes getAttributes() const;
- bool isDefault() const;
-
- // type checks
- bool isGroup() const { return typeIs (data::Type::nodetype_group); }
- bool isSet() const { return typeIs (data::Type::nodetype_set); }
- bool isValue() const { return typeIs (data::Type::nodetype_value); }
-
- // checked access
- inline GroupNode * groupData();
- inline GroupNode const * groupData() const;
- inline SetNode * setData();
- inline SetNode const * setData() const;
- inline ValueNode * valueData();
- inline ValueNode const * valueData() const;
-
- // navigation
- bool isFragmentRoot() const;
-#if OSL_DEBUG_LEVEL > 0
- Node * getParentNode();
- Node const * getParentNode() const;
-#endif
- TreeFragment * getTreeFragment();
- TreeFragment const * getTreeFragment() const;
-
- Node * getSubnode(rtl::OUString const & name);
-
- private:
- bool typeIs(data::Type::Type eType) const
- { return (info.type & data::Type::mask_nodetype) == eType; }
- };
-
- //-----------------------------------------------------------------------------
- inline GroupNode * GroupNode::from(Node * node)
- { return node == 0 ? 0 : node->groupData(); }
-
- inline SetNode * SetNode::from(Node * node)
- { return node == 0 ? 0 : node->setData(); }
-
- inline ValueNode * ValueNode::from(Node * node)
- { return node == 0 ? 0 : node->valueData(); }
-
- inline GroupNode * Node::groupData()
- { return isGroup() ? &this->group : NULL; }
- inline GroupNode const * Node::groupData() const
- { return isGroup() ? &this->group : NULL; }
- inline SetNode * Node::setData()
- { return isSet() ? &this->set : NULL; }
- inline SetNode const * Node::setData() const
- { return isSet() ? &this->set : NULL; }
- inline ValueNode * Node::valueData()
- { return isValue() ? &this->value : NULL; }
- inline ValueNode const * Node::valueData() const
- { return isValue() ? &this->value : NULL; }
-
- inline Node * node(ValueNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
- inline Node * node(GroupNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
- inline Node * node(SetNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
-
- inline Node const * node(ValueNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- inline Node const * node(GroupNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- inline Node const * node(SetNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- //-----------------------------------------------------------------------------
- inline Node & node(ValueNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
- inline Node & node(GroupNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
- inline Node & node(SetNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
-
- inline Node const & node(ValueNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- inline Node const & node(GroupNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- inline Node const & node(SetNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_SHARABLE_NODE_HXX
diff --git a/configmgr/source/inc/nodechange.hxx b/configmgr/source/inc/nodechange.hxx
deleted file mode 100644
index db9856917b69..000000000000
--- a/configmgr/source/inc/nodechange.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGE_HXX_
-#define CONFIGMGR_CONFIGCHANGE_HXX_
-
-#include "rtl/ref.hxx"
-
-#include "configexcept.hxx"
-
-#include <vector>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class AbsolutePath;
- class RelativePath;
- class NodeRef;
- class NodeID;
- class SubNodeID;
- class Tree;
-//-----------------------------------------------------------------------------
-
- class NodeChange;
- class NodeChangeImpl;
- class NodeChangeLocation;
- class NodeChangeInformation;
- class NodeChangesInformation;
-//-----------------------------------------------------------------------------
-
- /// represents a node position in some tree
- class NodeChange
- {
- public:
- /// constructs an empty (unchanging) node change
- NodeChange();
- /// constructs a node change with a given implementation
- NodeChange(NodeChangeImpl* pImpl);
- /// copies a node change with reference semantics
- NodeChange(NodeChange const& rOther);
- /// copies a node change with reference semantics
- NodeChange& operator=(NodeChange const& rOther);
- /// swaps the contents of this with another NodeChange
- void swap(NodeChange& rOther);
- /// destroys a node change
- ~NodeChange();
-
- /// checks, if this may represent an actual change (might not be tested)
- bool maybeChange() const;
- /// checks, if this represents an actual change (PRE: must be tested)
- bool isChange() const;
- /// retrieve information about the changed data, appending to a sequence, returning the count
- sal_uInt32 getChangeInfos(NodeChangesInformation& rInfo) const;
- /// retrieve information about what node is changed
- bool getChangeLocation(NodeChangeLocation& rLoc) const;
-
- /// test whether this would really be a change (as close as possible)
- NodeChange& test();
- NodeChange const& test() const;
-
- /// apply this change and check whether the target node changed
- NodeChange& apply();
- NodeChange const& apply() const;
-
- // retrieve the tree where the change is actually taking place
- rtl::Reference< Tree > getAffectedTree() const;
- // retrieve the node where the change is actually taking place
- NodeRef getAffectedNode() const;
-
- // Comparison
- friend bool operator==(NodeChange const& lhs, NodeChange const& rhs)
- {
- return lhs.m_pImpl == rhs.m_pImpl;
- }
- friend bool operator!=(NodeChange const& lhs, NodeChange const& rhs)
- {
- return lhs.m_pImpl != rhs.m_pImpl;
- }
-
- /// provides access to the internal Implementation for related classes
- NodeChangeImpl* impl() const { return m_pImpl; }
- private:
- NodeChangeImpl* m_pImpl;
- void init(), deinit();
- };
-
- /** represents a collection of updates to nodes (identified by <type>NodeChange</type>s) within a hierarchy of config entries
- */
- class NodeChanges
- {
- public:
- /// Constructs an empty collection of changes
- NodeChanges();
-
- /// checks whether there are any (non-empty) changes in this
- bool isEmpty() const;
-
- /// retrieves the total count of changes in this collection
- std::vector<NodeChange>::size_type getCount() const { return m_aChanges.size(); }
-
- /// retrieve information about the changed data, appending to a sequence, returning the count
- sal_uInt32 getChangesInfos(NodeChangesInformation& rInfos) const;
-
- /// test all changes
- NodeChanges& test() { implTest(); return *this; }
- NodeChanges const& test() const { implTest(); return *this; }
-
- /// remove all changes known to be doing nothing from this collection.
- NodeChanges& compact();
-
- /** insert a change into this collection
- */
- void add(NodeChange const& aChange);
-
- /// returns an STL-style iterator to the first element of the collection
- std::vector<NodeChange>::const_iterator begin() const { return m_aChanges.begin(); }
- std::vector<NodeChange>::iterator begin() { return m_aChanges.begin(); }
-
- /// returns an STL-style iterator to past the last element of the collection
- std::vector<NodeChange>::const_iterator end() const { return m_aChanges.end(); }
- std::vector<NodeChange>::iterator end() { return m_aChanges.end(); }
-
- private:
- void implTest() const;
- std::vector<NodeChange> m_aChanges;
- };
-
- }
-}
-
-#endif // CONFIGMGR_CONFIGCHANGE_HXX_
diff --git a/configmgr/source/inc/nodechangeinfo.hxx b/configmgr/source/inc/nodechangeinfo.hxx
deleted file mode 100644
index 2abc5dccece9..000000000000
--- a/configmgr/source/inc/nodechangeinfo.hxx
+++ /dev/null
@@ -1,246 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGEINFO_HXX_
-#define CONFIGMGR_CONFIGCHANGEINFO_HXX_
-
-#include "configpath.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class NodeID;
- class SubNodeID;
-
- class ElementTree;
-
-//-----------------------------------------------------------------------------
- /// captures the values of something changing
- template <class DataT>
- struct DataChange
- {
- DataT newValue;
- DataT oldValue;
-
- DataChange()
- : newValue(), oldValue()
- {}
-
- DataChange(DataT const& newValue_, DataT const& oldValue_)
- : newValue(newValue_), oldValue(oldValue_)
- {}
-
- // note: maybe we should support a comparison object
- bool isDataChange() const
- { return !(oldValue == newValue); } // not using != to avoid conversion warning
- };
-
-//-----------------------------------------------------------------------------
- /// information about what changed (but close to no context)
- class NodeChangeData
- {
- public:
- //-------------------------------------------------
- enum Type
- {
- eNoChange,
-
- // Changes to value nodes
- eSetValue,
- eSetDefault,
-
- // Changes to set nodes
- eInsertElement,
- eReplaceElement,
- eRemoveElement,
-
- eRenameElementTree, // not fully supported yet
-
- eResetSetDefault
- };
- //-------------------------------------------------
-
- bool isEmptyChange() const { return eNoChange == type; }
- bool isValueChange() const { return eSetValue <= type && type <= eSetDefault; }
- bool isSetChange() const { return eInsertElement <= type && type <= eRemoveElement; }
- bool isRemoveSetChange() const { return eRemoveElement == type;}
- bool isReplaceSetChange() const { return eReplaceElement == type;}
- //-------------------------------------------------
- bool isDataChange() const;
-
- //-------------------------------------------------
- // wrapper object creation
- rtl::Reference< Tree > getNewElementTree() const;
- rtl::Reference< Tree > getOldElementTree() const;
-
- NodeID getNewElementNodeID() const;
- NodeID getOldElementNodeID() const;
- //-------------------------------------------------
-
- //-- Compiler barrier for element tree ------------
- NodeChangeData();
- NodeChangeData(NodeChangeData const& aOther);
- NodeChangeData& operator=(NodeChangeData const& aOther);
- ~NodeChangeData();
- //-------------------------------------------------
- Type type;
-
- // Value change: old/new value; Set change: new/old api element (if known); Rename: old/new name
- DataChange< com::sun::star::uno::Any > unoData;
- // Value change: NULL,NULL; Set change: new/old tree element; Rename: the affected element-tree (twice)
- DataChange< rtl::Reference<ElementTree> > element;
- //-------------------------------------------------
- };
-
- //-------------------------------------------------
- // Identify the location of a change. Interpretation of members may depend upon
- class NodeChangeLocation
- {
- public:
- //-------------------------------------------------
- // checks whether the base has been properly set up.
- // Does not check for existence of the affected node
-#if OSL_DEBUG_LEVEL > 0
- /// check whether the location has been initialized properly
- bool isValidData() const;
-#endif
- /// check whether the location is for a valid object
- bool isValidLocation() const;
-
- //-------------------------------------------------
- /// retrieve the path from the base node to the changed node (which might be a child of the affected node)
- RelativePath getAccessor() const { return m_path; }
-
- /// retrieve the tree where the change is actually initiated/reported
- rtl::Reference< Tree > getBaseTree() const;
- /// retrieve the node where the change is actually initiated/reported
- NodeRef getBaseNode() const;
-
- /// retrieve the tree where the change is actually taking place (may be Empty, if the tree has never been accessed)
- rtl::Reference< Tree > getAffectedTreeRef() const;
- /// identify the node where the change is actually taking place
- NodeID getAffectedNodeID() const;
-
- /// identify the node (within the affected tree), that actually is changed (this one may be a value node)
- SubNodeID getChangingValueID() const;
-
- //-------------------------------------------------
- void setAccessor( RelativePath const& aAccessor );
-
- void setBase( NodeID const& aBaseID );
- void setBase( rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode )
- { setBase( NodeID(aBaseTree,aBaseNode) ); }
-
- void setAffected( NodeID const& aTargetID );
- void setAffected( rtl::Reference< Tree > const& aTargetTree, NodeRef const& aTargetNode )
- { setAffected( NodeID(aTargetTree,aTargetNode) ); }
-
- void setChangingSubnode( bool bSubnode = true );
- //-------------------------------------------------
- NodeChangeLocation();
- // NodeChangeLocation(NodeChangeLocation const& aOther);
- // NodeChangeLocation& operator=(NodeChangeLocation const& aOther);
- // ~NodeChangeLocation();
- //-------------------------------------------------
- private:
- RelativePath m_path; // path from baseNode to changing node
- NodeID m_base; // a (non-empty) node
- NodeID m_affected; // identifies the affected node (if available)
- bool m_bSubNodeChanging; // do we change a value ?
- //-------------------------------------------------
- };
-//-----------------------------------------------------------------------------
- class NodeChangeInformation
- {
- public:
- //-------------------------------------------------
- explicit
- NodeChangeInformation()
- : change()
- , location()
- {
- }
- //-------------------------------------------------
- NodeChangeData change;
- NodeChangeLocation location;
-
- //-------------------------------------------------
- bool hasValidLocation() const { return location.isValidLocation(); }
- bool isDataChange() const { return change.isDataChange(); }
-
- bool isEmptyChange() const { return change.isEmptyChange(); }
- bool isValueChange() const { return change.isValueChange(); }
- bool isSetChange() const { return change.isSetChange(); }
- //-------------------------------------------------
- };
-//-----------------------------------------------------------------------------
-
- class NodeChangesInformation
- {
- public:
- std::vector< NodeChangeInformation >::size_type size() const { return m_data.size(); }
- bool empty() const { return m_data.empty(); }
-
- void reserve(std::vector< NodeChangeInformation >::size_type sz_) { m_data.reserve(sz_); }
- void clear() { m_data.clear(); }
- void swap(NodeChangesInformation& aOther) throw() { m_data.swap(aOther.m_data); }
-
- void push_back(NodeChangeInformation const& aChange_)
- { m_data.push_back(aChange_); }
-
- std::vector< NodeChangeInformation >::const_iterator begin() const { return m_data.begin(); }
- std::vector< NodeChangeInformation >::const_iterator end() const { return m_data.end(); }
- private:
- std::vector< NodeChangeInformation > m_data;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#if !defined(WNT) || (defined(WNT) && _MSC_VER < 1400)
-namespace std
-{
- template <>
- inline
- void swap(configmgr::configuration::NodeChangesInformation& lhs, configmgr::configuration::NodeChangesInformation& rhs)
- { lhs.swap(rhs); }
-}
-#endif
-
-#endif // CONFIGMGR_CONFIGCHANGEINFO_HXX_
diff --git a/configmgr/source/inc/noderef.hxx b/configmgr/source/inc/noderef.hxx
deleted file mode 100644
index 430b4af0cd9f..000000000000
--- a/configmgr/source/inc/noderef.hxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODE_HXX_
-#define CONFIGMGR_CONFIGNODE_HXX_
-
-#include "rtl/ref.hxx"
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "tree.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- class INode;
-
- namespace view { class ViewTreeAccess; }
- namespace configapi { class Factory; }
- namespace node { struct Attributes; }
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class AbsolutePath;
- class RelativePath;
- namespace Path { class Component; }
-
- class NodeChange;
- class NodeChanges;
- class NodeRef;
- class ValueRef;
- class AnyNodeRef;
-
- class NodeID;
-
- const unsigned int C_TreeDepthAll = ~0u;
- //-------------------------------------------------------------------------
-
- /// represents a inner node position in some tree
- class NodeRef
- {
- public:
- /// constructs an empty (invalid) node
- NodeRef();
-
- NodeRef(unsigned int nPos, unsigned int nDepth);
-
- /// copy a node (with reference semantics)
- NodeRef(NodeRef const& rOther);
- /// copy a node (with reference semantics)
- NodeRef& operator=(NodeRef const& rOther);
-
- void swap(NodeRef& rOther);
-
- ~NodeRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- /// returns the offset of this Node
- inline unsigned int getOffset() const;
-
- /// returns the offset of this Node
- inline unsigned int getDepth() const;
-
- private:
- friend class AnyNodeRef;
- private:
- unsigned int m_nPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- class NodeID
- {
- public:
- NodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rNode);
- NodeID(Tree* pImpl, unsigned int nNode);
-
- // comparison
- // equality
- friend bool operator==(NodeID const& lhs, NodeID const& rhs)
- { return lhs.m_pTree == rhs.m_pTree && lhs.m_nNode == rhs.m_nNode; }
- // ordering
- friend bool operator < (NodeID const& lhs, NodeID const& rhs);
- // checking
- bool isEmpty() const;
- // checking
- bool isValidNode() const;
- // hashing
- size_t hashCode() const;
- // use as index - returns a value in the range 0..rTree.getContainedNodes() for the tree used to construct this
- unsigned int toIndex() const;
-
- Tree * getTree() const { return m_pTree; }
-
- unsigned int getOffset() const { return m_nNode; }
-
- NodeRef getNode() const;
-
- private:
- Tree* m_pTree;
- unsigned int m_nNode;
- };
- //-------------------------------------------------------------------------
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for a member of group <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateChildName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for an element of set <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for a child of <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateChildOrElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make one path component out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for an element of set <var>aNode</var> within <var>aTree</var>
-
- */
- Path::Component validateElementPathComponent(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** parse <var>aPath</var> into a relative path,
- valid in the context of node <var>aNode<var/> in <var>aTree<var/>.
-
- @returns
- <var>aPath<var/> parsed as a relative path
- @throws InvalidName
- if <var>aPath<var/> is not a relative path or not valid in the context of <var>aNode<var/>
- */
- RelativePath validateRelativePath(rtl::OUString const& aPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /** parse <var>aPath</var> as a configuration path
- and reduce it to be relative to node <var>aNode<var/> in <var>aTree<var/>.
-
- @returns
- the result of parsing <var>aPath<var/>, if that results in a relative path, or
- the part of it relative to <var>aNode<var/>,
- if it is an absolute path to a descendant of <var>aNode<var/>
- @throws InvalidName
- if <var>aPath<var/> is not awell-formed path or
- if it is an absolute path that is not to a descendant of <var>aNode<var/>
- */
- RelativePath validateAndReducePath(rtl::OUString const& aPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, rtl::OUString const& aName);
-
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, Path::Component const& aName);
-
- /** tries to find the immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
- <p> On return <var>aNode</var> is modified to refer to the node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
- <p>Caution: May miss an existing child unless the child has been accessed before.</p>
-
- @return
- <TRUE/> if the child node exists and is available
- (so <var>aNode</var> and <var>aTree</var> refer to the desired node),
- <FALSE/> otherwise
-
- @see NodeRef::getAvailableChild
- */
- bool findInnerChildOrAvailableElement(rtl::Reference< Tree >& aTree, NodeRef& aNode, rtl::OUString const& aName);
-
- /// test whether the given node is a structural (inner) node
- bool isStructuralNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// test whether the given inner node is a group node
- bool isGroupNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// get the value for a node that is a simple value (as tree element)
- com::sun::star::uno::Any getSimpleElementValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// test whether the given inner node is a set node
- bool isSetNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- void getAllContainedNodes(rtl::Reference< Tree > const& aTree, std::vector<NodeID>& aList);
- NodeID findNodeFromIndex(rtl::Reference< Tree > const& aTreeRef, unsigned int nIndex);
-
- //-------------------------------------------------------------------------
- inline bool NodeRef::isValid() const
- {
- return m_nPos != 0;
- }
-
- //-------------------------------------------------------------------------
- inline unsigned int NodeRef::getOffset() const
- {
- return m_nPos;
- }
-
- //-------------------------------------------------------------------------
- inline unsigned int NodeRef::getDepth() const
- {
- return m_nDepth;
- }
-
- //-------------------------------------------------------------------------
- inline bool operator!=(NodeID const& lhs, NodeID const& rhs)
- { return !(lhs == rhs); }
- //---------------------------------------------------------------------
-
- inline bool operator>=(NodeID const& lhs, NodeID const& rhs)
- { return !(lhs < rhs); }
- //---------------------------------------------------------------------
- inline bool operator > (NodeID const& lhs, NodeID const& rhs)
- { return (rhs < lhs); }
- inline bool operator<=(NodeID const& lhs, NodeID const& rhs)
- { return !(rhs < lhs); }
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNODE_HXX_
diff --git a/configmgr/source/inc/options.hxx b/configmgr/source/inc/options.hxx
deleted file mode 100644
index 5d851ae7b951..000000000000
--- a/configmgr/source/inc/options.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
-#define CONFIGMGR_MISC_OPTIONS_HXX_
-
-#include "requestoptions.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include "utility.hxx"
-#include <salhelper/simplereferenceobject.hxx>
-#include <vos/ref.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
-
- /**
- class OOptions is created one time per Configuration[update]Access
- all important options should stored in this class.
- The object will be forwarded to all other objects so we only
- need to extend this classobject and all other class can work with
- the new options or important options etc.
- */
-
- class OOptions : public salhelper::SimpleReferenceObject
- {
- RequestOptions m_aRequestOptions; // current options to use
-
- public:
- OOptions()
- : m_aRequestOptions()
- {}
-
- explicit
- OOptions(const RequestOptions& _aDefaultOptions)
- : m_aRequestOptions(_aDefaultOptions)
- {
- }
-
- OOptions(const OOptions& _aOtherOptions)
- : SimpleReferenceObject()
- , m_aRequestOptions(_aOtherOptions.m_aRequestOptions)
- {
- }
-
- bool isForSessionUser() const { return ! m_aRequestOptions.hasEntity(); }
-
- rtl::OUString getLocale() const { return m_aRequestOptions.getLocale(); }
- rtl::OUString getUser() const { return m_aRequestOptions.getEntity(); }
-
- RequestOptions const & getRequestOptions() const
- { return m_aRequestOptions; }
-
- void setUser(const rtl::OUString & _rUser)
- { m_aRequestOptions.setEntity(_rUser); }
-
- void setLocale(const com::sun::star::lang::Locale & _rLocale)
- { m_aRequestOptions.setLocale(_rLocale); }
-
- void setMultiLocaleMode()
- { m_aRequestOptions.setAllLocales(); }
-
- void enableAsync(bool _bEnable)
- { m_aRequestOptions.enableAsync(_bEnable); }
- };
-
- struct ltOptions
- {
- lessRequestOptions ltData;
- bool operator()(vos::ORef<OOptions> const &o1, vos::ORef<OOptions> const &o2) const
- {
- return ltData(o1->getRequestOptions(),o2->getRequestOptions());
- }
- };
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/oslstream.hxx b/configmgr/source/inc/oslstream.hxx
deleted file mode 100644
index 0a07044ad955..000000000000
--- a/configmgr/source/inc/oslstream.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_OSLSTREAM_HXX_
-#define _CONFIGMGR_OSLSTREAM_HXX_
-
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-#include "bufferedfile.hxx"
-
-namespace osl
-{
- class File;
-}
-
-namespace configmgr
-{
- namespace stario = ::com::sun::star::io;
- namespace staruno = ::com::sun::star::uno;
-
-// -----------------------------------------------------------------------------
- /// OSLInputStreamWrapper - implementation of XInputStream on an (unbuffered) osl::File
- class OSLInputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XInputStream>
- {
- ::osl::Mutex m_aMutex;
- ::osl::File* m_pFile;
- sal_Bool m_bFileOwner : 1;
-
- public:
- /// c'tor. _rStream must live at least until closeInput() is called on this stream
- OSLInputStreamWrapper(::osl::File& _rStream);
- /// c'tor. if bOwner is <FALSE/> *pStream must live at least until closeInput() is called on this stream
- OSLInputStreamWrapper(::osl::File* pStream, sal_Bool bOwner=sal_False);
- virtual ~OSLInputStreamWrapper();
-
- // stario::XInputStream
- virtual sal_Int32 SAL_CALL
- readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL
- readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL
- skipBytes(sal_Int32 nBytesToSkip)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL available() throw(stario::NotConnectedException, staruno::RuntimeException);
- virtual void SAL_CALL closeInput() throw(stario::NotConnectedException, staruno::RuntimeException);
- };
-
-// -----------------------------------------------------------------------------
- /// OSLOutputStreamWrapper - implementation of XOutputStream on an (unbuffered) osl::File
- class OSLOutputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XOutputStream>
- {
- ::osl::Mutex m_aMutex;
- ::osl::File& rFile;
-
- public:
- /// c'tor. _rStream must live at least until closeOutput() is called on this stream
- OSLOutputStreamWrapper(::osl::File& _rFile) :rFile(_rFile) { }
-
- // stario::XOutputStream
- virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL flush()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL closeOutput()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
- /// BufferedFileOutputStream - buffered implementation of XOutputStream on an osl::File
- class BufferedFileOutputStream: public ::cppu::WeakImplHelper1<stario::XOutputStream>
- {
- BufferedOutputFile m_aFile;
-
- public:
- BufferedFileOutputStream(rtl::OUString const & aFileURL, bool bCreate=true, sal_uInt32 nBufferSizeHint=0);
- virtual ~BufferedFileOutputStream();
-
- // stario::XOutputStream
- virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
-
- virtual void SAL_CALL flush()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
-
- virtual void SAL_CALL closeOutput()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif // _CONFIGMGR_OSLSTREAM_HXX_
-
-
-
diff --git a/configmgr/source/inc/propertysethelper.hxx b/configmgr/source/inc/propertysethelper.hxx
deleted file mode 100644
index 16289691be14..000000000000
--- a/configmgr/source/inc/propertysethelper.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_PROPERTYSETHELPER_HXX
-#define CONFIGMGR_MISC_PROPERTYSETHELPER_HXX
-
-#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/weak.hxx>
-
-//..........................................................................
-namespace configmgr {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-class BroadcasterBase
-{
- osl::Mutex m_aMutex;
- cppu::OBroadcastHelper m_aBroadcastHelper;
-
-protected:
- BroadcasterBase() : m_aMutex(), m_aBroadcastHelper(m_aMutex) {}
- ~BroadcasterBase() {}
-
- osl::Mutex & getBroadcastMutex() { return m_aMutex; }
- cppu::OBroadcastHelper & getBroadcastHelper() { return m_aBroadcastHelper; }
-};
-
-//..........................................................................
-
-class PropertySetHelper : protected BroadcasterBase // must be first
- , public cppu::OWeakObject
- , public cppu::OPropertySetHelper // not copyable
-{
-public:
- PropertySetHelper();
- ~PropertySetHelper();
-
- // XInterface
- virtual uno::Any SAL_CALL queryInterface( uno::Type const & rType ) throw (uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
- // XTypeProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes() throw (uno::RuntimeException);
-
- // to be provided by derived classes
- // virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (uno::RuntimeException) = 0;
-
- // XPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
- getPropertySetInfo( ) throw (uno::RuntimeException);
-
-
-protected:
-// new methods still to be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
-// cppu::OPropertySetHelper interface
-#if 0 // these methods still must be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception) = 0;
-
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const = 0;
-#endif
- virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // default implementation: does not do any conversion
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue,
- sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException);
-private:
- cppu::IPropertyArrayHelper * m_pHelper;
-};
-//..........................................................................
- } // namespace apihelper
-} // namespace configmgr
-//..........................................................................
-
-#endif
-
-
diff --git a/configmgr/source/inc/request.hxx b/configmgr/source/inc/request.hxx
deleted file mode 100644
index 242230970da9..000000000000
--- a/configmgr/source/inc/request.hxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_REQUEST_HXX_
-#define CONFIGMGR_BACKEND_REQUEST_HXX_
-
-#include "requestoptions.hxx"
-#include "requesttypes.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-
- class NodeRequest
- {
- configuration::AbsolutePath m_aNodePath;
- RequestOptions m_aOptions;
- public:
- NodeRequest(configuration::AbsolutePath const& _aNodePath, RequestOptions const & _aOptions)
- : m_aNodePath(_aNodePath)
- , m_aOptions(_aOptions)
- {
- }
-
- configuration::AbsolutePath const & getPath() const { return m_aNodePath; }
- RequestOptions const & getOptions() const { return m_aOptions; }
- };
-// ---------------------------------------------------------------------------
-
- class ComponentRequest
- {
- rtl::OUString m_aComponentName;
- RequestOptions m_aOptions;
- bool m_bForcedReload;
- public:
- ComponentRequest(rtl::OUString const& _aComponentName, RequestOptions const & _aOptions)
- : m_aComponentName(_aComponentName)
- , m_aOptions(_aOptions)
- , m_bForcedReload(false)
- {
- }
-
- rtl::OUString const & getComponentName() const { return m_aComponentName; }
- RequestOptions const & getOptions() const { return m_aOptions; }
-
- bool isForcingReload() const { return m_bForcedReload; }
- void forceReload(bool _bForce = true) { m_bForcedReload = _bForce; }
- };
-// ---------------------------------------------------------------------------
-
- class TemplateRequest
- {
- rtl::OUString m_aComponentName;
- rtl::OUString m_aTemplateName;
-
- public:
- static
- TemplateRequest forComponent(rtl::OUString const & _aComponentName)
- {
- return TemplateRequest( rtl::OUString(), _aComponentName);
- }
-
- explicit
- TemplateRequest(rtl::OUString const & _aTemplateName, rtl::OUString const & _aComponentName)
- : m_aComponentName(_aComponentName)
- , m_aTemplateName(_aTemplateName)
- {}
-
- bool isComponentRequest() const { return m_aTemplateName.getLength() == 0; }
- rtl::OUString getTemplateName() const { return m_aTemplateName; }
- rtl::OUString getComponentName() const { return m_aComponentName; }
-
- };
-
-// ---------------------------------------------------------------------------
-
- class UpdateRequest
- {
- ConstUpdateInstance m_aUpdate;
- RequestOptions m_aOptions;
- rtl::OUString m_aRQID;
- public:
- explicit
- UpdateRequest( UpdateInstance const & _aUpdate,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdate)
- , m_aOptions(_aOptions)
- {}
-
- explicit
- UpdateRequest( ConstUpdateInstance const & _aUpdate,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdate)
- , m_aOptions(_aOptions)
- {}
-
- explicit
- UpdateRequest( ConstUpdateInstance::Data _aUpdateData,
- configuration::AbsolutePath const & _aRootpath,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdateData, _aRootpath)
- , m_aOptions(_aOptions)
- {}
-
- bool isSyncRequired() const { return !m_aOptions.isAsyncEnabled(); }
-
- RequestOptions const & getOptions() const { return m_aOptions; }
- configuration::AbsolutePath const & getUpdateRoot() const { return m_aUpdate.root(); }
-
- ConstUpdateInstance const & getUpdate() const { return m_aUpdate; }
- ConstUpdateInstance::Data getUpdateData() const { return m_aUpdate.data(); }
-
- void setRequestId(rtl::OUString const & _aRQID) { m_aRQID = _aRQID; }
- rtl::OUString getRequestId() const { return m_aRQID; }
- };
-
- inline ComponentRequest getComponentRequest(UpdateRequest const & _aUR)
- { return ComponentRequest(_aUR.getUpdateRoot().getModuleName(), _aUR.getOptions()); }
-// ---------------------------------------------------------------------------
- } // namespace
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/requestoptions.hxx b/configmgr/source/inc/requestoptions.hxx
deleted file mode 100644
index 5613be1450a7..000000000000
--- a/configmgr/source/inc/requestoptions.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_REQUESTOPTIONS_HXX_
-#define CONFIGMGR_MISC_REQUESTOPTIONS_HXX_
-
-#include <com/sun/star/lang/Locale.hpp>
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- /**
- Options which can be used to modify a request for data
- */
- class RequestOptions
- {
- public:
- /// Default constructor. Sets options to use defaults.
- RequestOptions()
- : m_sLocale()
- , m_sEntity()
- , m_bEnableAsync(true)
- , m_bReload(false)
- {}
-
- /// @returns <TRUE/>, if data can be written asynchronously
- bool isAsyncEnabled() const { return m_bEnableAsync; }
- /// @returns <TRUE/>, if data is reloaded into cache
- bool isRefreshEnabled() const { return m_bReload; }
- /** @returns
- <TRUE/>, if a locale is specified, <BR/>
- <FALSE/>, if the default locale should be used
- */
- bool hasLocale() const { return m_sLocale.Language.getLength() != 0; }
- /// @returns the locale to get data for
- bool isForAllLocales() const;
- /// @returns the locale to get data for - compatibilty version
- rtl::OUString getLocale() const { return getIsoLocale(); }
- /// @returns the locale to get data for
- rtl::OUString getIsoLocale() const;
- /// @returns the locale to get data for
- com::sun::star::lang::Locale const & getUnoLocale() const { return m_sLocale; }
-
- /** @returns
- <TRUE/>, if an entity is specified, <BR/>
- <FALSE/>, if data of the session user is requested
- */
- bool hasEntity() const { return m_sEntity.getLength() != 0; }
- /// @returns the entity to get data for
- rtl::OUString getEntity() const { return m_sEntity; }
-
- /// sets the entity to get data for to the given entity
- void setEntity(rtl::OUString const & _sEntity) { m_sEntity = _sEntity; }
- /// resets the entity to get data for to be the session user
- void clearEntity() { m_sEntity = rtl::OUString(); }
-
- /// sets the locale so data is gotten for all locales
- void setAllLocales();
- /// sets the locale to get data for to the given locale
- void setLocale(com::sun::star::lang::Locale const & _aLocale) { m_sLocale = _aLocale; }
- /// sets the locale to get data for to the given locale
- void setIsoLocale(rtl::OUString const & _sLocale);
- /// sets a fallback locale, if no locale is set yet
- void ensureLocaleSet();
-
- /// marks asyncronous access a enabled or disabled
- void enableAsync(bool _bEnable = true) { m_bEnableAsync = _bEnable; }
- /// enforce a refresh to cache
- void forceRefresh(bool _bEnable = true) { m_bReload = _bEnable; }
- // comparison/container helpers
- /// function that defines a weak strict ordering on RequestOptions
- friend sal_Int32 compareRequestOptions(RequestOptions const& lhs, RequestOptions const& rhs);
- private:
- com::sun::star::lang::Locale m_sLocale; /// locale to fetch data for
- rtl::OUString m_sEntity; /// user/group/role to fetch data for
- bool m_bEnableAsync; /// true, if data may be
- bool m_bReload; /// reload into cache from backend
- };
-
-// ---------------------------------------------------------------------------
- struct lessRequestOptions
- {
- bool operator()(RequestOptions const & lhs, RequestOptions const & rhs) const
- { return compareRequestOptions(lhs,rhs) < 0; }
- };
-// ---------------------------------------------------------------------------
- struct equalRequestOptions
- {
- bool operator()(RequestOptions const & lhs, RequestOptions const & rhs) const
- { return compareRequestOptions(lhs,rhs) == 0; }
- };
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/requesttypes.hxx b/configmgr/source/inc/requesttypes.hxx
deleted file mode 100644
index bc2389cc4840..000000000000
--- a/configmgr/source/inc/requesttypes.hxx
+++ /dev/null
@@ -1,234 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_REQUESTTYPES_HXX_
-#define CONFIGMGR_BACKEND_REQUESTTYPES_HXX_
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "valuenode.hxx"
-#include "treechangelist.hxx"
-#include "configpath.hxx"
-
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
- struct ComponentDataStruct
- {
- const std::auto_ptr<ISubtree>& data;
- rtl::OUString name;
- ComponentDataStruct (const std::auto_ptr<ISubtree>& _data, rtl::OUString _name)
- : data(_data), name(_name) {}
- };
-// ---------------------------------------------------------------------------
- struct NodeInstance
- {
- typedef std::auto_ptr<ISubtree> Data;
-
- explicit
- NodeInstance(Data _node, configuration::AbsolutePath const & _rootpath)
- : m_node(_node)
- , m_root(_rootpath)
- {
- }
-
- Data const & data() const { return m_node; }
- configuration::AbsolutePath const & root() const { return m_root; }
-
- Data & mutableData() { return m_node; }
- Data extractData() { return m_node; }
- private:
- Data m_node;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
- struct TemplateInstance
- {
- typedef std::auto_ptr<INode> Data;
-
- explicit
- TemplateInstance(Data _node, rtl::OUString const & _name, rtl::OUString const & _component)
- : m_node(_node)
- , m_name(_name)
- , m_component(_component)
- {
- }
-
- Data const & data() const { return m_node; }
- rtl::OUString const & name() const { return m_name; }
- rtl::OUString const & component() const { return m_component; }
-
- Data extractData() { return m_node; }
- private:
- Data m_node;
- rtl::OUString m_name; // if empty, this is a complete set of component templates
- rtl::OUString m_component;
- };
-// ---------------------------------------------------------------------------
- struct ComponentInstance
- {
- typedef std::auto_ptr<ISubtree> Data;
-
- explicit
- ComponentInstance(Data _node, Data _template, rtl::OUString const & _component)
- : m_node(_node)
- , m_template(_template)
- , m_component(_component)
- {
- }
-
- Data const & data() const { return m_node; }
- Data const & templateData() const { return m_template; }
- rtl::OUString const & component() const { return m_component; }
-
- ComponentDataStruct componentTemplateData () const { return ComponentDataStruct(m_template,m_component);}
- ComponentDataStruct componentNodeData () const { return ComponentDataStruct(m_node,m_component);}
- Data & mutableData() { return m_node; }
- Data extractData() { return m_node; }
- Data extractTemplateData() { return m_template; }
- private:
- Data m_node;
- Data m_template;
- rtl::OUString m_component;
- };
-// ---------------------------------------------------------------------------
- struct UpdateInstance
- {
- typedef SubtreeChange * Data;
-
- explicit
- UpdateInstance(Data _update, configuration::AbsolutePath const & _rootpath)
- : m_update(_update)
- , m_root(_rootpath)
- {
- }
-
- UpdateInstance(UpdateInstance & _aModifiableOther)
- : m_update(_aModifiableOther.m_update)
- , m_root(_aModifiableOther.m_root)
- {
- }
-
- Data data() { return m_update; }
- SubtreeChange const * data() const { return m_update; }
- configuration::AbsolutePath const & root() const { return m_root; }
- private:
- Data m_update;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
- struct ConstUpdateInstance
- {
- typedef SubtreeChange const * Data;
-
- explicit
- ConstUpdateInstance(Data _update, configuration::AbsolutePath const & _rootpath)
- : m_update(_update)
- , m_root(_rootpath)
- {
- }
-
- // conversion
- ConstUpdateInstance(UpdateInstance const & _aModifiable)
- : m_update(_aModifiable.data())
- , m_root(_aModifiable.root())
- {
- }
-
- Data data() const { return m_update; }
- configuration::AbsolutePath const & root() const { return m_root; }
- private:
- Data m_update;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-// Due to the use of auto_ptr, the XxxInstance classes cannot easily be used as return values
-// To return them, they should be wrapped into a ResultHolder
-
- template <class Instance_>
- class ResultHolder
- {
- struct RCInstance : public salhelper::SimpleReferenceObject
- {
- RCInstance(Instance_ & _instance)
- : instance(_instance) {}
- Instance_ instance;
- };
-
- rtl::Reference< RCInstance > m_xInstance;
- public:
- explicit
- ResultHolder(Instance_ & _rInstance)
- : m_xInstance( new RCInstance(_rInstance) )
- {}
-
- bool isEmpty() const { return !m_xInstance.is(); }
-
- bool is() const { return m_xInstance.is() && m_xInstance->instance.data().get(); }
-
- Instance_ const & instance() const { return m_xInstance->instance; }
-
- Instance_ const & operator *() const { return instance(); }
- Instance_ const * operator->() const { return &instance(); }
- Instance_ & mutableInstance() { return m_xInstance->instance; }
-
- typename Instance_::Data extractDataAndClear()
- {
- typename Instance_::Data aData = m_xInstance->instance.extractData();
- this->clear();
- return aData;
- }
-
- void releaseAndClear()
- {
- typename Instance_::Data aData = this->extractDataAndClear();
- aData.release();
- }
-
- void clear() { m_xInstance.clear(); }
- };
-// ---------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/roottree.hxx b/configmgr/source/inc/roottree.hxx
deleted file mode 100644
index 493a3bfc6f3d..000000000000
--- a/configmgr/source/inc/roottree.hxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_ROOTTREE_HXX_
-#define CONFIGMGR_ROOTTREE_HXX_
-
-#include "sal/config.h"
-
-#include <memory>
-
-#include "boost/utility.hpp"
-#include "rtl/ref.hxx"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable { union Node; }
- class SubtreeChange;
- struct TreeChangeList;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class Tree;
- class NodeRef;
- class NodeChangesInformation;
- class AbsolutePath;
- class TemplateProvider;
-
-//-----------------------------------------------------------------------------
-
- rtl::Reference< Tree > createReadOnlyTree( AbsolutePath const& aRootPath,
- sharable::Node * _aCacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
- rtl::Reference< Tree > createUpdatableTree( AbsolutePath const& aRootPath,
- sharable::Node * _aCacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
-//-----------------------------------------------------------------------------
- class CommitHelper: private boost::noncopyable
- {
- struct Data;
-
- std::auto_ptr<Data> m_pData;
- Tree* m_pTree;
- public:
- CommitHelper(rtl::Reference< Tree > const& aTree);
- ~CommitHelper();
-
- // collect all changes into rChangeList
- bool prepareCommit(TreeChangeList& rChangeList);
-
- // finish and clean up the changes in rChangeList after they are integrated
- void finishCommit(TreeChangeList& rChangeList);
- // throw away and clean up the changes in rChangeList after a commit failed
- void failedCommit(TreeChangeList& rChangeList);
- };
-
-//-----------------------------------------------------------------------------
- /** adjusts <var>aTree</var> tree to the (externally produced) changes under <var>aExternalChanges</var>
- and collects the changes this induces locally.
- @param rLocalChanges
- a collection that will hold the changes induced by <var>aExternalChanges</var>.
- @param aExternalChanges
- a structured change that has already been applied to the master tree.
- @param aBaseTree
- the tree that contains (directly) the affected node of <var>aExternalChanges</var>.
- @param aBaseNode
- a NodeRef referring to the (directly) affected node of <var>aExternalChanges</var>.
- @return
- <TRUE/> if any changes occur in this tree (so rLocalChanges is not empty), <FALSE/> otherwise.
-
- */
- bool adjustToChanges( NodeChangesInformation& rLocalChanges,
- rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode,
- SubtreeChange const& aExternalChange) ;
-
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_ROOTTREE_HXX_
diff --git a/configmgr/source/inc/sequence.hxx b/configmgr/source/inc/sequence.hxx
deleted file mode 100644
index 51017e3c2dda..000000000000
--- a/configmgr/source/inc/sequence.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_SEQUENCE_HXX
-#define INCLUDED_SHARABLE_SEQUENCE_HXX
-
-#include "anydata.hxx"
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- //-----------------------------------------------------------------------------
-
- sal_uInt8 * allocSequence(sal_uInt8 _aElementType, ::sal_Sequence const * _pSeqData);
- void freeSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
-
- ::sal_Sequence * readSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
- ::com::sun::star::uno::Any readAnySequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
- //-----------------------------------------------------------------------------
-
- sal_uInt8 * allocBinary(::com::sun::star::uno::Sequence<sal_Int8> const & _aBinaryValue);
- void freeBinary(sal_uInt8 * _aSeq);
-
- ::com::sun::star::uno::Sequence<sal_Int8> readBinary(sal_uInt8 * _aSeq);
- //-----------------------------------------------------------------------------
-
- template <class ET>
- inline
- sal_uInt8 getElementTypeCode(::com::sun::star::uno::Sequence<ET> const & )
- {
- ::com::sun::star::uno::Type aElementType = ::getCppuType( static_cast<ET const *>(NULL) );
- return getTypeCode(aElementType);
- }
-
- template <class ET>
- sal_uInt8 * allocSequence(::com::sun::star::uno::Sequence<ET> const & _aSeq)
- {
- sal_uInt8 aTC = getElementTypeCode(_aSeq);
- ::sal_Sequence const * pSeqData = _aSeq.get();
- return allocSequence(aTC, pSeqData);
- }
-
- template <class ET>
- void readSequence(::com::sun::star::uno::Sequence<ET> & _rSeq, sal_uInt8 * _aSeq)
- {
- sal_uInt8 aElementType = getElementTypeCode(_rSeq);
-
- ::sal_Sequence * pNewSequence = readSequence(aElementType, _aSeq);
-
- if (!pNewSequence) return;
-
- ::com::sun::star::uno::Sequence<ET> aNewSequence(pNewSequence, SAL_NO_ACQUIRE);
-
- _rSeq = aNewSequence;
- }
-
- template <class ET>
- bool readSequence(::com::sun::star::uno::Sequence<ET> & _rSeq, sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
- {
- if (getElementTypeCode(_rSeq) != _aElementType) return false;
-
- ::sal_Sequence * pNewSequence = readSequence(_aElementType, _aSeq);
-
- if (!pNewSequence) return false;
-
- ::com::sun::star::uno::Sequence<ET> aNewSequence(pNewSequence, SAL_NO_ACQUIRE);
-
- _rSeq = aNewSequence;
-
- return true;
- }
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // INCLUDED_SHARABLE_SEQUENCE_HXX
diff --git a/configmgr/source/inc/serviceinfohelper.hxx b/configmgr/source/inc/serviceinfohelper.hxx
deleted file mode 100644
index 7af0202f1bf7..000000000000
--- a/configmgr/source/inc/serviceinfohelper.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SERVICEINFOHELPER_HXX_
-#define CONFIGMGR_SERVICEINFOHELPER_HXX_
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the registration information of a service implementation
- struct ServiceRegistrationInfo
- {
- /// The implementation name of this service implementation
- sal_Char const * implementationName;
- /// The services for which this service implementation is registered
- sal_Char const * const * registeredServiceNames;
- };
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the implementation information of a service implementation
- struct ServiceImplementationInfo
- {
- /// The implementation name of this service implementation
- sal_Char const * implementationName;
- /// The services for which this service implementation is registered
- sal_Char const * const * registeredServiceNames;
- /// Additional services implemented by this service implementation, for which it is not registered
- sal_Char const * const * additionalServiceNames;
- };
-// -----------------------------------------------------------------------------
-
- // ServiceImplementationInfo has a compatible initial sequence with struct ServiceRegistrationInfo
-
- inline
- ServiceRegistrationInfo const *
- getRegistrationInfo(ServiceImplementationInfo const * _info)
- {
- return reinterpret_cast<ServiceRegistrationInfo const *>(_info);
- }
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the registration information of a singleton
- struct SingletonRegistrationInfo
- {
- /// The name of this singleton
- sal_Char const * singletonName;
- /// The implementation, which owns this singleton
- sal_Char const * implementationName;
- /// The service, which should be instatiated for this singleton
- sal_Char const * instantiatedServiceName;
- /// A name for a pseudo-implementation, which is mapped to this singleton
- ServiceRegistrationInfo const * mappedImplementation;
- };
-// -----------------------------------------------------------------------------
-
- class ServiceRegistrationHelper
- {
- ServiceRegistrationInfo const*const m_info;
-
- public:
- ServiceRegistrationHelper(ServiceRegistrationInfo const* _info)
- : m_info(_info)
- {}
-
- ServiceRegistrationHelper(ServiceImplementationInfo const* _info)
- : m_info(getRegistrationInfo(_info))
- {}
-
- sal_Int32 countServices() const;
-
- rtl::OUString getImplementationName( ) const
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > getRegisteredServiceNames( ) const
- throw(uno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
- class ServiceInfoHelper
- {
- ServiceImplementationInfo const*const m_info;
-
- public:
- ServiceInfoHelper(ServiceImplementationInfo const* _info)
- : m_info(_info)
- {}
-
- sal_Int32 countServices() const;
-
- rtl::OUString getImplementationName( ) const
- throw(uno::RuntimeException);
-
- sal_Bool supportsService( rtl::OUString const & ServiceName ) const
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > getSupportedServiceNames( ) const
- throw(uno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
-
diff --git a/configmgr/source/inc/simpleinteractionrequest.hxx b/configmgr/source/inc/simpleinteractionrequest.hxx
deleted file mode 100644
index 8e8b4d6f1c35..000000000000
--- a/configmgr/source/inc/simpleinteractionrequest.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX
-#define CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX
-
-#include "interactionrequest.hxx"
-
-// this file was copied and adapted from the corresponding file in module ucbhelper
-
-namespace configmgr {
-namespace apihelper {
-
- namespace uno = com::sun::star::uno;
-/**
- This class implements a simple interaction request. The user must not deal
- with XInteractionContinuations directly, but can use constants that are
- mapped internally to the according objects. This class encapsulates the
- standard Interaction Continuations "Abort", "Retry", "Approve" and
- "Disaprrove". Instances can be passed directly to
- XInteractionHandler::handle(...).
-
- @see InteractionRequest
- @see InteractionAbort
- @see InteractionRetry
- @see InteractionApprove
- @see InteractionDisapprove
- */
- class SimpleInteractionRequest : public InteractionRequest
- {
- public:
- /**
- * Constructor.
- *
- * @param rRequest is the exception describing the error.
- * @param nContinuations contains the possible "answers" for the request.
- * This can be any of the CONTINUATION_* constants combinations
- * listed above.
- */
- SimpleInteractionRequest( const uno::Any & rRequest,
- const sal_uInt32 nContinuations );
-
- /**
- * After passing this request to XInteractionHandler::handle, this method
- * returns the continuation that was choosen by the interaction handler.
- *
- * @return the continuation choosen by an interaction handler or
- * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
- */
- sal_uInt32 getResponse() const;
- };
-
-/** These are the constants that can be passed to the constructor of class
- * SimpleInteractionRequest and that are returned by method
- * SimpleInteractionRequest::getResponse().
- */
-
- /** The request was not (yet) handled by the interaction handler. */
- const sal_uInt32 CONTINUATION_UNKNOWN = 0;
-
- /** The interaction handler selected XInteractionAbort. */
- const sal_uInt32 CONTINUATION_ABORT = 1;
-
- /** The interaction handler selected XInteractionRetry. */
- const sal_uInt32 CONTINUATION_RETRY = 2;
-
- /** The interaction handler selected XInteractionApprove. */
- const sal_uInt32 CONTINUATION_APPROVE = 4;
-
- /** The interaction handler selected XInteractionDisapprove. */
- const sal_uInt32 CONTINUATION_DISAPPROVE = 8;
-
-
-} // namespace apihelper
-} // namespace configmgr
-
-#endif /* !CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX */
diff --git a/configmgr/source/inc/stack.hxx b/configmgr/source/inc/stack.hxx
deleted file mode 100644
index 164abb8818e2..000000000000
--- a/configmgr/source/inc/stack.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_STACK_HXX_
-#define CONFIGMGR_STACK_HXX_
-
-#ifndef INCLUDED_STACK
-#include <stack>
-#define INCLUDED_STACK
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-
- // simple wrapper for a vector-based stack
- template <typename T_>
- struct Stack : public std::stack< T_, std::vector<T_> >
- {
- typedef typename std::vector<T_>::const_iterator bottomup_iterator;
- typedef typename std::vector<T_>::const_reverse_iterator topdown_iterator;
- bottomup_iterator begin_up() const { return this->c.begin(); }
- bottomup_iterator end_up() const { return this->c.end(); }
- topdown_iterator begin_down() const { return this->c.rbegin(); }
- topdown_iterator end_down() const { return this->c.rend(); }
- };
-}
-
-#endif // CONFIGMGR_STACK_HXX_
-
-
diff --git a/configmgr/source/inc/strdecl.hxx b/configmgr/source/inc/strdecl.hxx
deleted file mode 100644
index 6fb2212e6529..000000000000
--- a/configmgr/source/inc/strdecl.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONFIGMGR_STRDECL_HXX_
-#define _CONFIGMGR_STRDECL_HXX_
-
-#include "strings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
-// extern declaration for predefined strings
-
- // simple types names
- DECLARE_CONSTASCII_USTRING(TYPE_BOOLEAN);
- DECLARE_CONSTASCII_USTRING(TYPE_SHORT);
- DECLARE_CONSTASCII_USTRING(TYPE_INT);
- DECLARE_CONSTASCII_USTRING(TYPE_LONG);
- DECLARE_CONSTASCII_USTRING(TYPE_DOUBLE);
- DECLARE_CONSTASCII_USTRING(TYPE_STRING);
- // Type: Sequence<bytes>
- DECLARE_CONSTASCII_USTRING(TYPE_BINARY);
- // Universal type: Any
- DECLARE_CONSTASCII_USTRING(TYPE_ANY);
-
- // special template names for native/localized value types
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_PREFIX);
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_VALUE);
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_LOCALIZED_VALUE);
-
- DECLARE_CONSTASCII_USTRING(TEMPLATE_LIST_SUFFIX);
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/inc/strings.hxx b/configmgr/source/inc/strings.hxx
deleted file mode 100644
index 7afff58c10f0..000000000000
--- a/configmgr/source/inc/strings.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_STRINGS_HXX_
-#define _CONFIGMGR_STRINGS_HXX_
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
-struct UStringDescription
-{
- const sal_Char* m_pZeroTerminatedName;
- sal_Int32 m_nLen;
- rtl_TextEncoding m_encoding;
-
- UStringDescription(const sal_Char* _pName, sal_Int32 _nLen, rtl_TextEncoding _encoding)
- : m_pZeroTerminatedName( _pName )
- , m_nLen( _nLen )
- , m_encoding(_encoding )
- , m_aString (_pName, _nLen, _encoding)
- {
- }
-
- sal_Int32 getLength() const { return m_nLen; }
- operator ::rtl::OUString const&() const { return m_aString; }
- operator const sal_Char*() const { return m_pZeroTerminatedName; }
-
-private:
- rtl::OUString m_aString;
- UStringDescription();
-};
-
-#define DECLARE_CONSTASCII_USTRING(name) \
- extern ::configmgr::UStringDescription name
-
-#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \
- ::configmgr::UStringDescription name(RTL_CONSTASCII_USTRINGPARAM(asciivalue))
-
-//.........................................................................
-} // namespace frm
-//.........................................................................
-
-#endif // _CONFIGMGR_STRINGS_HXX_
-
diff --git a/configmgr/source/inc/template.hxx b/configmgr/source/inc/template.hxx
deleted file mode 100644
index b75a0f0dcc09..000000000000
--- a/configmgr/source/inc/template.hxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGTEMPLATE_HXX_
-#define CONFIGMGR_CONFIGTEMPLATE_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class RequestOptions;
- class TreeManager;
- namespace sharable { struct SetNode; }
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class AbsolutePath;
-//-----------------------------------------------------------------------------
-
- struct TemplateProvider_Impl;
- class TemplateProvider
- {
- friend class SetElementFactory;
- friend class TemplateImplHelper;
-
- rtl::Reference<TemplateProvider_Impl> m_aImpl;
- public:
- TemplateProvider(); // creates an empty (invalid) template instance provider
- TemplateProvider(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& xOptions);
- TemplateProvider(TemplateProvider const& aOther);
- TemplateProvider& operator=(TemplateProvider const& aOther);
- ~TemplateProvider();
-
- bool isValid() const { return !!m_aImpl.is(); }
- };
-//-----------------------------------------------------------------------------
-
- /// provides information about the elements of a <type>Node</type> that is a Container ("set").
- class Template : public salhelper::SimpleReferenceObject
- {
- rtl::OUString m_aName;
- rtl::OUString m_aModule;
- com::sun::star::uno::Type m_aInstanceType;
- private:
- explicit Template(rtl::OUString const& aName, rtl::OUString const& aModule,com::sun::star::uno::Type const& aType);
-
- public:
- /// checks if the type of an instance of this is known
- bool isInstanceTypeKnown() const;
-
- /// checks if this is a 'value' template <p> PRE: the instance type is known </p>
- bool isInstanceValue() const;
-
- /// get the UNO type for instances (primarily (only ?) for 'value' templates) <p> PRE: the instance type is known </p>
- com::sun::star::uno::Type getInstanceType() const;
-
- /// get the path where the template is located
- rtl::OUString getPathString() const;
-
- /// get the local name of the template
- rtl::OUString getName() const { return m_aName; }
-
- /// get the package name of the template
- rtl::OUString getModule() const { return m_aModule; }
-
- friend class TemplateImplHelper;
- };
-
- /// make a template instance that matches the elements of the given set. Ensures that the element type is known
- rtl::Reference<Template> makeSetElementTemplate(sharable::SetNode * set, TemplateProvider const& _aProvider);
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGTEMPLATE_HXX_
diff --git a/configmgr/source/inc/tracer.hxx b/configmgr/source/inc/tracer.hxx
deleted file mode 100644
index 722f5a9d8f0f..000000000000
--- a/configmgr/source/inc/tracer.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TRACER_HXX_
-#define _CONFIGMGR_TRACER_HXX_
-
-#if OSL_DEBUG_LEVEL > 0
-#define CFG_ENABLE_TRACING
-#endif
-
-#ifdef CFG_ENABLE_TRACING
-
-#include <sal/types.h>
-#include <rtl/string.hxx>
-#include <osl/mutex.hxx>
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#ifdef WNT
-#include <sys/timeb.h>
-#else
-#include <sys/time.h>
-#endif
-
-#define OUSTRING2ASCII(rtlOUString) ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr()
-
-#define CFG_TRACE_INFO OTraceIndent aIndent; OConfigTracer::traceInfo
-// FIXME: do something more intelligent here
-// the CFG_TRACE_INFO2 macro exists only to have a unique name of aIndent2
-// so it does not hide aIndent in an outer scope (which would produce a
-// a shadowing warning
-#define CFG_TRACE_INFO2 OTraceIndent aIndent2; OConfigTracer::traceInfo
-#define CFG_TRACE_WARNING OTraceIndent aIndent; OConfigTracer::traceWarning
-#define CFG_TRACE_ERROR OTraceIndent aIndent; OConfigTracer::traceError
-#define CFG_TRACE_INFO_NI OConfigTracer::traceInfo
-#define CFG_TRACE_WARNING_NI OConfigTracer::traceWarning
-#define CFG_TRACE_ERROR_NI OConfigTracer::traceError
-
-namespace configmgr
-{
-
-struct OTracerSetup;
-class OConfigTracer
-{
- friend class OTraceIndent;
-
-protected:
- static ::osl::Mutex & getMutex();
- static OTracerSetup* s_pImpl;
-#ifdef WNT
- static timeb s_aStartTime;
-#else
- static timeval s_aStartTime;
-#endif
-
-private:
- OConfigTracer(); // never implemented, no instantiation of this class allowed, only static members
-
-public:
- static void traceInfo(const sal_Char* _pFormat, ...);
-#if OSL_DEBUG_LEVEL > 0
- static void traceWarning(const sal_Char* _pFormat, ...);
- static void traceError(const sal_Char* _pFormat, ...);
-#endif
-protected:
- static void implTrace(const sal_Char* _pType, const sal_Char* _pFormat, va_list args);
- static void startGlobalTimer();
- static sal_uInt32 getGlobalTimer();
-
- static void inc();
- static void dec();
-
- static void indent();
-
- static void ensureData();
- static void ensureInitalized();
-};
-
-class OTraceIndent
-{
-public:
- OTraceIndent() { OConfigTracer::inc(); }
- ~OTraceIndent() { OConfigTracer::dec(); }
-};
-
-} // namespace configmgr
-
-#else // !CFG_ENABLE_TRACING
-
-#include <stdio.h>
-
-#define OUSTRING2ASCII(rtlOUString) "nothing"
-
-namespace configmgr {
-inline static void dont_trace(const char*,...) {}
-}
-
-#define CFG_TRACE_INFO dont_trace
-#define CFG_TRACE_INFO2 dont_trace
-#define CFG_TRACE_WARNING dont_trace
-#define CFG_TRACE_ERROR dont_trace
-#define CFG_TRACE_INFO_NI dont_trace
-#define CFG_TRACE_WARNING_NI dont_trace
-#define CFG_TRACE_ERROR_NI dont_trace
-#define CFG_TRACE_TO_DEVICE dont_trace
-
-#endif // CFG_ENABLE_TRACING
-
-#endif // _CONFIGMGR_TRACER_HXX_
-
diff --git a/configmgr/source/inc/tree.hxx b/configmgr/source/inc/tree.hxx
deleted file mode 100644
index a8661173c068..000000000000
--- a/configmgr/source/inc/tree.hxx
+++ /dev/null
@@ -1,665 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEIMPL_HXX_
-#define CONFIGMGR_CONFIGNODEIMPL_HXX_
-
-#include "change.hxx"
-#include "configpath.hxx"
-#include "template.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- namespace node { struct Attributes; }
- namespace sharable { union Node; }
- namespace view { class ViewStrategy; }
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class AnyNodeRef;
- class ElementTree;
- class GroupNodeImpl;
- class NodeChange;
- class NodeChanges;
- class NodeImpl;
- class NodeRef;
- class SetNodeImpl;
- class TemplateProvider;
- class Tree;
- class ValueElementNodeImpl;
- class ValueMemberNode;
- class ValueRef;
-//-----------------------------------------------------------------------------
- // WARNING: a similar item is in noderef.hxx
- const unsigned int c_TreeDepthAll = ~0u;
-
-//-----------------------------------------------------------------------------
- inline
- unsigned int& incDepth(unsigned int& rDepth)
- {
- if (rDepth != c_TreeDepthAll) ++rDepth;
- return rDepth;
- }
-
- inline
- unsigned int& decDepth(unsigned int& rDepth)
- {
- OSL_ENSURE(rDepth != 0,"Cannot decrement zero depth");
- if (rDepth != c_TreeDepthAll && rDepth != 0) --rDepth;
- return rDepth;
- }
-
- inline
- unsigned int childDepth(unsigned int nDepth)
- { return decDepth(nDepth); }
-
- inline
- unsigned int parentDepth(unsigned int nDepth)
- { return incDepth(nDepth); }
-
- inline
- unsigned int remainingDepth(unsigned int nOuterDepth, unsigned int nRelativeDepth)
- {
- OSL_ENSURE(nRelativeDepth != c_TreeDepthAll,"RelativeDepth can't be infinite");
- OSL_ENSURE(nRelativeDepth <= nOuterDepth,"ERROR: RelativeDepth is larger than enclosing depth");
-
- unsigned int nInnerDepth = (nOuterDepth == c_TreeDepthAll) ? nOuterDepth :
- (nRelativeDepth < nOuterDepth) ? nOuterDepth-nRelativeDepth :
- 0;
- return nInnerDepth;
- }
- //-------------------------------------------------------------------------
-
- /// interface for a class that can be used to do some operation on a set of <type>NodeRef</type>s and <type>ValueRef</type>s.
- struct NodeVisitor
- {
- /// returned from <method>handle</method> to indicate whether the operation is complete or should continue
- enum Result { DONE, CONTINUE };
- /// do the operation on <var>aNode</var>. needs to be implemented by concrete visitor classes
- virtual Result handle(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) = 0;
- /// do the operation on <var>aValue</var>. needs to be implemented by concrete visitor classes
- virtual Result handle(rtl::Reference< Tree > const& aTree, ValueRef const& aValue) = 0;
- protected:
- virtual ~NodeVisitor() {}
- };
-//-----------------------------------------------------------------------------
-
-// class Node Impl
-//-----------------------------------------------------------------------------
-
- /** is the Implementation class for class <type>Node</type>, held inside a <type>Tree</type>.
- <p> Implements some functionality common to all node types.
- </p>
- <p> Otherwise it provides (not really typesafe) access to a
- <type scope='configmgr::configuration::NodeType>NodeImpl</type> which implements
- functionality for a node of a given type
- (as given by a <type scope='configmgr::configuration::NodeType>Enum</type> value).
- </p>
- */
- class NodeData
- {
- rtl::Reference<NodeImpl> m_pSpecificNode;
- rtl::OUString m_aName_; // cached for better performance
- unsigned int m_nParent;
- public:
- NodeData(rtl::Reference<NodeImpl> const& aSpecificNodeImpl, rtl::OUString const& aName, unsigned int nParent);
-
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::Node * _aNewData);
- // COMMON: information
- rtl::OUString getName() const { return m_aName_; }
- unsigned int getParent() const { return m_nParent; }
-
- // change management
- public:
- // BASIC NODE: access to common attributes
- NodeImpl & nodeImpl() { return implGetNodeImpl(); }
- NodeImpl const & nodeImpl() const { return implGetNodeImpl(); }
-
- // SET: access to child elements
- bool isSetNode() const;
- SetNodeImpl& setImpl() { return implGetSetImpl(); }
- SetNodeImpl const& setImpl() const { return implGetSetImpl(); }
-
- // VALUES: access to data
- bool isValueElementNode() const;
- ValueElementNodeImpl& valueElementImpl() { return implGetValueImpl(); }
- ValueElementNodeImpl const& valueElementImpl() const { return implGetValueImpl(); }
-
- // GROUP: access to children
- bool isGroupNode() const;
- GroupNodeImpl& groupImpl() { return implGetGroupImpl(); }
- GroupNodeImpl const&groupImpl() const { return implGetGroupImpl(); }
-
- // access helper
- public:
- sharable::Node * getOriginalNodeAccess() const;
-
- private:
- NodeImpl& implGetNodeImpl() const;
- SetNodeImpl& implGetSetImpl() const;
- GroupNodeImpl& implGetGroupImpl() const ;
- ValueElementNodeImpl& implGetValueImpl() const ;
- };
-//-----------------------------------------------------------------------------
- /** represents a hierarchy of config entries (identified by <type>NodeRef</type>s and <type>ValueRef</type>s)
-
- <p>Examples for trees include</p>
- <ulist>
- <li>A module tree (for a specific set of parameters).</li>
- <li>An updating tree (for a part of the whole).</li>
- <li>A set element (updating or not), which could be detached.</li>
- <ulist>
- <p> Holds a list of <type>Node</type> which it allows to access by
- <type>unsigned int</type> (which is basically a one-based index).
- </p>
- <p> Also provides for navigation to the context this tree is located in
- </p>
- */
- class Tree : public salhelper::SimpleReferenceObject
- {
- friend class view::ViewStrategy;
- protected:
- // Construction
- /// creates a Tree for a detached, virgin tree
- Tree( );
-
- /// creates a Tree with a parent tree
- Tree(Tree& rParentTree, unsigned int nParentNode);
-
- virtual ~Tree() = 0;
-
- /// fills this Tree starting from _aRootNode, using the given factory and the tree's template provider
- void build(rtl::Reference<view::ViewStrategy> const& _xStrategy, sharable::Node * _aRootNode, unsigned int nDepth, TemplateProvider const& aTemplateProvider);
-
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::Node * _aNewData);
-
- public:
- // realeses the data this refers to
- virtual void disposeData();
-
- // Context Access
- /// gets the path to the root node of this tree
- AbsolutePath getRootPath() const;
- /// gets the tree of parent node of this tree
- Tree* getContextTree() { return m_pParentTree; }
- /// gets the tree of parent node of this tree
- Tree const *getContextTree() const { return m_pParentTree; }
- /// gets the offset of parent node of this tree within its tree
- unsigned int getContextNode() const { return m_nParentNode; }
-
- // Node Collection information
- /// checks whether <var>nNode</var> is a valid node offset in this tree
- bool isValidNode(unsigned int nNode) const;
-
- bool isRootNode(NodeRef const & node) const;
-
- NodeRef getRootNode() const;
-
- NodeRef getContextNodeRef() const;
-
- bool isValidValueNode(ValueRef const & value);
-
-#if OSL_DEBUG_LEVEL > 0
- bool isValidAnyNode(AnyNodeRef const & node);
-#endif
-
- /// checks whether the node has any element nodes (of its own)
- bool hasElements(NodeRef const & node);
-
- bool hasElement(NodeRef const & node, rtl::OUString const & name);
-
- bool hasElement(NodeRef const & node, Path::Component const & name);
-
- /** gets the element with the given name of the given node
- <p>PRE: <code>hasElement(node, name)</code></p>
- <p>If there is no such element, may return an empty node or
- raise an exception (?)</p>
-
- @throws InvalidName
- if name is not a valid child name for this node
- */
- rtl::Reference< ElementTree > getElement(
- NodeRef const & node, rtl::OUString const & name);
-
- /** gets the element with the given name of the given node, if it is
- available
- <p>PRE: <code>hasElement(node, name)</code></p>
- <p>If there is no such element, may return an empty node or
- raise an exception (?)</p>
- <p>Caution: May miss existing children unless hasChild/getChild
- has been called before.</p>
-
- @throws InvalidName
- if name is not a valid child name for this node
- */
- rtl::Reference< ElementTree > getAvailableElement(
- NodeRef const & node, rtl::OUString const & name);
-
- /// checks whether the node has any child nodes (in this tree)
- bool hasChildren(NodeRef const & node);
-
- bool hasChildValue(
- NodeRef const & node, rtl::OUString const & name);
-
- bool hasChildNode(NodeRef const & node, rtl::OUString const & name);
-
- bool hasChild(NodeRef const & node, rtl::OUString const & name);
-
- /** gets the child value (in this tree) with the given name of the
- given node
- <p>PRE: <code>hasChildValue(node, name)</code></p>
- <P>If there is no such node, may return an empty node or raise
- an exception (?)</p>
-
- @throws InvalidName
- if <var>aName</var> is not a valid child name for this node
- */
- ValueRef getChildValue(
- NodeRef const & node, rtl::OUString const & name);
-
- NodeRef getChildNode(
- NodeRef const & node, rtl::OUString const & name);
-
- AnyNodeRef getAnyChild(
- NodeRef const& node, rtl::OUString const & name);
-
- node::Attributes getAttributes(NodeRef const & node);
-
- node::Attributes getAttributes(AnyNodeRef const & node);
-
- node::Attributes getAttributes(ValueRef const & value);
-
- com::sun::star::uno::Type getUnoType(ValueRef const & value);
-
- /// return the parent of the given node (or an empty node, if it is
- /// the tree root)
- NodeRef getParent(NodeRef const & node);
-
- /// return the parent of the given value (or an empty node, if it is
- /// the tree root)
- NodeRef getParent(ValueRef const & value);
-
- AbsolutePath getAbsolutePath(NodeRef const & node);
-
- /// retrieves the current value for the given node, provided there
- /// is one and it is available (only works for value nodes)
- com::sun::star::uno::Any getNodeValue(ValueRef const & value);
-
- /// checks whether the given node has a default value (only works
- /// for value nodes)
- bool hasNodeDefault(ValueRef const & value);
-
- /// checks whether the given node assumes its default value (only
- /// works for value nodes)
- bool isNodeDefault(ValueRef const & value);
-
- /// checks whether the given node has a default state
- bool hasNodeDefault(NodeRef const & node);
-
- /// checks whether the given node assumes its default state
- bool isNodeDefault(NodeRef const & node);
-
- /// checks whether the given node has a default state
- bool hasNodeDefault(AnyNodeRef const & node);
-
- /// checks whether the given node assumes its default state
- bool isNodeDefault(AnyNodeRef const & node);
-
- /// checks whether the default values are available for the children
- /// of the given node (if applicable)
- bool areValueDefaultsAvailable(NodeRef const & node);
-
- /// retrieves the default value for the given node, provided there
- /// is one and it is available (only works for value nodes)
- com::sun::star::uno::Any getNodeDefaultValue(
- ValueRef const & value);
-
- bool hasChanges();
-
- /// lists any pending changes on this tree
- bool collectChanges(NodeChanges & changes);
-
- void integrate(
- NodeChange & change, NodeRef const & node, bool local);
-
- void integrate(
- NodeChanges & changes, NodeRef const & node, bool local);
-
- NodeVisitor::Result visit(
- NodeRef const & node, NodeVisitor & visitor)
- { return visitor.handle(this, node); }
-
- NodeVisitor::Result visit(
- ValueRef const & value, NodeVisitor & visitor)
- { return visitor.handle(this, value); }
-
- /** lets the given visitor visit the child nodes of the given node
-
- The order in which nodes are visited is repeatable (but
- currently unspecified). Visits nodes until NodeVisitor::DONE is
- returned, then returns NodeVisitor::DONE. If all visits return
- NodeVisitor::CONTINUE, returns NodeVisitor::CONTINUE. If no
- children are present, returns NodeVisitor::CONTINUE.
- */
- NodeVisitor::Result dispatchToChildren(
- NodeRef const & node, NodeVisitor & visitor);
-
- NodeRef getNode(unsigned int offset) const;
-
- rtl::Reference< Template > extractElementInfo(NodeRef const & node);
-
- /// gets the depth that is available in this tree (due to the original request)
- unsigned int getAvailableDepth() const { return m_nDepth; }
-
- /// gets the depth that is available in this tree within the given node
- unsigned int getRemainingDepth(unsigned int nNode) const
- { return remainingDepth(getAvailableDepth(),depthTo(nNode)); }
-
- // Node Collection navigation
- /** gets the simple name of the node <var>nNode</var>
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- rtl::OUString getSimpleNodeName(unsigned int nNode) const;
-
- /** gets the simple name of the root node (i.e. of the tree as a whole)
- */
- virtual rtl::OUString getSimpleRootName() const;
-
- /** gets the full name of the root node
- */
- Path::Component getExtendedRootName() const;
-
- /** gets the number of hierarchy levels from the root node to node <var>nNode</var>
- in this tree
- <p>In particular <code>depthTo(N) == 0</code> if <code>N == root()</code>
- </p>
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- unsigned int depthTo(unsigned int nNode) const;
-
- /// append the local path (relative to root) to a node to a collection of names
- void prependLocalPathTo(unsigned int nNode, Path::Rep& rNames);
-
- // check whether defaults are available
- bool hasDefaults(unsigned int _nNode) const;
- public:
- enum { ROOT = 1 }; /// base of <type>unsigned int</type>s used in this class
-
- /** gets the <type>unsigned int</type> of the parent node <var>nNode</var> in this tree
- or 0 (zero) if it is the root node
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- unsigned int parent_(unsigned int nNode) const;
-
- // Node iteration and access
- /** gets the <type>unsigned int</type> of the first child node
- of node <var>nParent</var> in this tree (in list order)
- or 0 (zero) if it has no children in this tree
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- */
- unsigned int firstChild_ (unsigned int nParent) const;
-
- /** gets the <type>unsigned int</type> of the first child node
- of node <var>nParent</var> that is after
- node <var>nNode</var> in this tree (in list order)
- or 0 (zero) if there is no such node
- <p>if <code>nStartAfter == 0</code> searching starts at the beginning
- </p>
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- <p>PRE: <code>isValidNode(nStartAfter) || nStartAfter == 0</code>
- </p>
- */
- unsigned int findNextChild_(unsigned int nParent, unsigned int nStartAfter) const;
-
- /** gets the <type>unsigned int</type> of the first (and only) child node
- of node <var>nParent</var> in this tree (in list order)
- where the name of the node is <var>aName</var>,
- or 0 (zero) if there is no such node
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- */
- unsigned int findChild_(unsigned int nParent, rtl::OUString const& aName) const;
-
- // Node Collection access
- /// get the number of nodes in this tree
- unsigned int nodeCount() const;
-
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeData* nodeData(unsigned int nNode);
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeData const* nodeData(unsigned int nNode) const;
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeImpl& nodeImpl(unsigned int nNode) { return nodeData(nNode)->nodeImpl(); }
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeImpl const& nodeImpl(unsigned int nNode) const { return nodeData(nNode)->nodeImpl(); }
-
- unsigned int nodeOffset(NodeData const & rNodeData) const;
-
- // Behavior
- rtl::Reference< view::ViewStrategy > getViewBehavior() const;
- protected:
- // immediate commit
-/* // implementation of commit protocol
- void commitDirect();
-
- void implCommitDirectFrom(unsigned int nNode);
-*/
- void implRebuild(unsigned int nNode, sharable::Node * _aNewData);
-
- protected:
- /// set a new parent context for this tree
- void setContext(Tree* pParentTree, unsigned int nParentNode);
- /// set no-parent context for this tree
- void clearContext();
-
- inline // is protected and should be used only in the implementation
- rtl::OUString implGetOriginalName(unsigned int nNode) const;
-
- private:
- /// get the full name of the root of this tree
- virtual Path::Component doGetRootName() const = 0;
-
- /// prepend the absolute path to the root of this tree (no context use)
- virtual void doFinishRootPath(Path::Rep& rPath) const = 0;
-
- ValueMemberNode getMemberNode(ValueRef const & value);
-
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- std::vector<NodeData> m_aNodes;
- Tree* m_pParentTree;
- unsigned int m_nParentNode;
- unsigned int m_nDepth;
-
- /// prepend the absolute path to the root of this tree (using context if present)
- void implPrependRootPath(Path::Rep& rPath) const;
-
- friend class TreeImplBuilder;
- };
-
- /// checks, if tree represents a real tree
- bool isEmpty(Tree * tree);
-//-----------------------------------------------------------------------------
-
- class ElementTree : public Tree
- {
- public:
-
- /// creates a Tree for a detached, virgin instance of <var>aTemplate</var> (always will be direct)
- ElementTree(rtl::Reference< data::TreeSegment > const& _aElementData, rtl::Reference<Template> aTemplate, TemplateProvider const& aTemplateProvider );
-
- /** creates a Tree with a parent tree, that (supposedly)
- is an instance of <var>aTemplateInfo</var>
- */
- ElementTree(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rParentTree, unsigned int nParentNode,
- sharable::TreeFragment * dataTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider );
-
- /** creates a Tree with no parent node, that (supposedly)
- is an instance of <var>aTemplateInfo</var>
- */
- ElementTree(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- sharable::TreeFragment * dataTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider );
-
- ~ElementTree();
-
- // realeses the data this refers to
- virtual void disposeData();
-
- // rebuilding
- using Tree::rebuild;
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::TreeFragment * newData);
-
- // data access
- sharable::TreeFragment * getOriginalTreeAccess() const { return m_aDataAddress; }
-
- // Tree information
- virtual rtl::OUString getSimpleRootName() const;
- /// checks whether this is an instance of a known template
- bool isTemplateInstance() const { return !!m_aInstanceInfo.is(); }
- /// checks whether this is an instance of the given template
- bool isInstanceOf(rtl::Reference<Template> const& aTemplateInfo) const
- { return m_aInstanceInfo == aTemplateInfo && aTemplateInfo.is(); }
- /// retrieves the template that this is an instance of
- rtl::Reference<Template> getTemplate() const { return m_aInstanceInfo; }
- /// makes a complete name from a simple name and template information
- Path::Component makeExtendedName(rtl::OUString const& aSimpleName) const;
-
- // node control operation
- /// check if this is a free-floating tree
- bool isFree() const { return m_aOwnData.is(); }
- /// transfer ownership to the given set
- void attachTo(sharable::SetNode * updatableSetNode, rtl::OUString const& aElementName);
- /// tranfer ownership from the given set
- void detachFrom(sharable::SetNode * updatableSetNode, rtl::OUString const& aElementName);
-
- /// take ownership of the given tree (which must not already be the one in use)
- void takeTreeAndRebuild(rtl::Reference< data::TreeSegment > const& _aElementData);
- /// take ownership of the given tree (which must already be the one in use)
- void takeTreeBack(rtl::Reference< data::TreeSegment > const& _aElementData);
-
- /// release ownership
- rtl::Reference< data::TreeSegment > releaseOwnedTree();
-
- // context operation
- /// set a new root name
- void renameTree(rtl::OUString const& aNewName);
- /// set a new parent context for this tree
- void moveTree(Tree* pParentTree, unsigned int nParentNode);
- /// set no-parent context for this tree
- void detachTree();
-
- private:
- static bool isUpdatableSegment(Tree& _rTree);
-
- virtual Path::Component doGetRootName() const;
-
- virtual void doFinishRootPath(Path::Rep& rPath) const;
- private:
- rtl::Reference<Template> const m_aInstanceInfo;
- rtl::OUString m_aElementName;
- sharable::TreeFragment * m_aDataAddress;
- rtl::Reference< data::TreeSegment > m_aOwnData;
- };
-//-----------------------------------------------------------------------------
- inline
- bool Tree::isValidNode(unsigned int nNode) const
- {
- return ROOT <= nNode && nNode < nodeCount() + ROOT;
- }
- //---------------------------------------------------------------------
- inline
- unsigned int Tree::nodeCount() const
- {
- return m_aNodes.size();
- }
- //---------------------------------------------------------------------
- inline
- NodeData* Tree::nodeData(unsigned int nNode)
- {
- if (nNode == 0) return NULL;
- OSL_ASSERT(isValidNode(nNode));
- return &m_aNodes[nNode - ROOT];
- }
- //---------------------------------------------------------------------
- inline
- NodeData const* Tree::nodeData(unsigned int nNode) const
- {
- if (nNode == 0) return NULL;
- OSL_ASSERT(isValidNode(nNode));
- return &m_aNodes[nNode - ROOT];
- }
- //---------------------------------------------------------------------
- inline
- unsigned int Tree::nodeOffset(NodeData const & rNode) const
- {
- unsigned int nOffset = ROOT + (&rNode - &m_aNodes[0]);
- OSL_ASSERT(isValidNode(nOffset));
- return nOffset;
- }
-
-//-----------------------------------------------------------------------------
-// helper for other impl classes
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
- struct ElementHelper
- {
- static
- com::sun::star::uno::Type getUnoType(rtl::Reference< ElementTree > const& aElement);
- };
-#endif
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGNODEIMPL_HXX_
diff --git a/configmgr/source/inc/treeactions.hxx b/configmgr/source/inc/treeactions.hxx
deleted file mode 100644
index 0ebe5827f1bd..000000000000
--- a/configmgr/source/inc/treeactions.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TREEACTIONS_HXX_
-#define _CONFIGMGR_TREEACTIONS_HXX_
-
-#include "change.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-//..........................................................................
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
-//==========================================================================
-//= OChangeActionCounter
-//==========================================================================
-/** collects meta data about a changes tree
-*/
-struct OChangeActionCounter : public ChangeTreeAction
-{
- sal_Int32 nValues, nAdds, nRemoves;
-
- OChangeActionCounter() :nValues(0), nAdds(0), nRemoves(0) {}
-
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree);
-
- sal_Bool hasChanges() const {return nValues || nAdds || nRemoves;}
-};
-
-// ===================================================================
-// = CollectNames
-// ===================================================================
-class CollectNames : public NodeAction
-{
-public:
- std::vector<rtl::OUString> const& list() const { return aList; }
-
- CollectNames() : aList() {}
-
- void handle(ValueNode const& aValue) { add(aValue); }
- void handle(ISubtree const& m_aSubtree) { add(m_aSubtree); }
-
- void add(INode const& aNode)
- {
- aList.push_back(aNode.getName());
- }
-private:
- std::vector<rtl::OUString> aList;
-};
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_TREEACTIONS_HXX_
-
-
diff --git a/configmgr/source/inc/treechangefactory.hxx b/configmgr/source/inc/treechangefactory.hxx
deleted file mode 100644
index 43627135f833..000000000000
--- a/configmgr/source/inc/treechangefactory.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREE_CHANGEFACTORY_HXX
-#define CONFIGMGR_TREE_CHANGEFACTORY_HXX
-
-#include "change.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
-
- //==========================================================================
-
- class OTreeChangeFactory
- {
- public:
- //-----------------------------------------------
- std::auto_ptr<SubtreeChange> createSetNodeChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes _aAttrs,
- bool _bToDefault = false);
- //-----------------------------------------------
-
- //= Set Changes ============================================================
- std::auto_ptr<AddNode> createAddNodeChange(
- rtl::Reference< data::TreeSegment > const & _aNewTree,
- rtl::OUString const& _aName,
- bool _bToDefault = false);
-
- //-----------------------------------------------
- std::auto_ptr<RemoveNode> createRemoveNodeChange(
- rtl::OUString const& _aName,
- bool _bToDefault = false);
-
- //= special case: Dummy ISubtree ============================================================
- static std::auto_ptr<SubtreeChange> createDummyChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aElementTypeName);
-
- //-----------------------------------------------
- };
-
- OTreeChangeFactory& getDefaultTreeChangeFactory();
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<SubtreeChange> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<ValueChange> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<AddNode> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<RemoveNode> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
-
- bool isGenericSetElementType(rtl::OUString const& _aElementType);
- bool isDummySetElementModule(rtl::OUString const& _aElementModule);
- rtl::OUString getGenericSetElementType();
- rtl::OUString getDummySetElementModule();
- //==========================================================================
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/treechangelist.hxx b/configmgr/source/inc/treechangelist.hxx
deleted file mode 100644
index a2a9c6161073..000000000000
--- a/configmgr/source/inc/treechangelist.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-
-#ifndef CONFIGMGR_TREECHANGELIST_HXX
-#define CONFIGMGR_TREECHANGELIST_HXX
-
-#include "change.hxx"
-#include "attributes.hxx"
-#include "configpath.hxx"
-#include "requestoptions.hxx"
-
-namespace configmgr
-{
-
-////////////////////////////////////////////////////////////////////////////////
-
- //==========================================================================
- //= TreeChangeList
- //==========================================================================
- struct TreeChangeList
- {
- TreeChangeList(const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- const SubtreeChange& _aSubtree,
- treeop::DeepChildCopy _doDeepCopy)
- : root(_aSubtree,_doDeepCopy)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rRootPath path to the root of the whole to-be-updated subtree
- */
- TreeChangeList( const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- const node::Attributes& _rAttr = node::Attributes())
- : root(_rRootPath.getLocalName().getName(), _rAttr)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rLocalName relative path within the to-be-updated subtree
- */
- TreeChangeList( const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- rtl::OUString const & _rChildTemplateName,
- rtl::OUString const & _rChildTemplateModule,
- const node::Attributes& _rAttr = node::Attributes())
- : root(_rRootPath.getLocalName().getName(), _rChildTemplateName, _rChildTemplateModule, _rAttr)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rTreeList list to initialize the path, no childs are copied
- */
- TreeChangeList( const TreeChangeList& _rTree, treeop::NoChildCopy _rNoCopy)
- : root(_rTree.root, _rNoCopy)
- , m_aLocation(_rTree.m_aLocation)
- , m_aOptions(_rTree.m_aOptions)
- {}
-
- /// is root a change for the module root
- bool isModuleRootChange() const { return m_aLocation.getDepth() <= 1; }
-
- /// get the module these changes belong to
- rtl::OUString getModuleName() const { return m_aLocation.getModuleName(); }
-
- /// get the full path to the root (location + root-name)
- void setRootPath(const configuration::AbsolutePath& _rRootPath)
- { m_aLocation = _rRootPath; }
-
- /// get the full path to the root (location + root-name)
- configuration::AbsolutePath const& getRootNodePath() const { return m_aLocation; }
-
- /// get the full path to the root (location)
- configuration::AbsolutePath getRootContextPath() const { return m_aLocation.getParentPath(); }
-
- RequestOptions const & getOptions() const { return m_aOptions; }
-
- public:
- SubtreeChange root; // the root of the whole tree of updates
- private:
- configuration::AbsolutePath m_aLocation; // absolute path to the parent of the node corresponding to this->root
- RequestOptions m_aOptions; // options for the tree that is concerned by these changes
- };
-//----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/treefragment.hxx b/configmgr/source/inc/treefragment.hxx
deleted file mode 100644
index 109fed509113..000000000000
--- a/configmgr/source/inc/treefragment.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_TREEFRAGMENT_HXX
-#define INCLUDED_SHARABLE_TREEFRAGMENT_HXX
-
-#include "flags.hxx"
-#include "node.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- //-----------------------------------------------------------------------------
- /* a TreeFragment header is interpreted differently, depending on the kind of TreeFragment
-
- - for a set element
- name points to the element name (the name in the root node is the template name)
- parent points to the SetNode that is the parent. The containing treefragment can
- be recovered from this with some care
- next points to the next element of the same set. It is null for the last element.
- state is fully used here
-
- - for a template tree
- name points to the template name (same as the name in the root node)
- component points to the home component name of the template
- (often the same as 'component' in the component tree)
- next points to another template TreeFragment. It is null for the last template.
- state must be 'replaced' here (rarely it might be marked as mandatory)
-
- - for a component tree
- name points to the component name (same as the name in the root node)
- component is equal to name (or NULL ?)
- next points to another template TreeFragment. It is null if there is no template.
- state must be either 'defaulted' or 'merged'
- (it should be marked as mandatory although that is not used yet)
- */
- struct TreeFragmentHeader
- {
- struct TreeFragment *next; // next sibling set element or template
- rtl_uString * name; // element-name/template name
- union // context
- {
- union Node *parent; // parent node
- rtl_uString * component; // component name
- };
- sal_uInt16 count; // number of contained nodes
- sal_uInt8 state;
- sal_uInt8 reserved;
- };
- //-----------------------------------------------------------------------------
- /* a tree fragment is stored as a variable-sized struct
- containing a header and a fixed sequence of nodes
-
- R - - A - - A1
- | |
- | - A2
- |
- - B
- |
- - C - - C1 - - C11
- | | |
- | | - C12
- | |
- | - C2 - - C21
- |
- - D
-
- is stored as
-
- H(count = 12) : [R;A;A1;A2;B;C;C1;C11;C12;C2;C21;D]
- */
- //-----------------------------------------------------------------------------
- /* tree fragments are used for: Component trees, Template trees, Set elements
-
- They are only fragments, as for a TreeFragment a Set is considered a leaf node.
- Set elements are maintained as a singly linked list that is accessible from the set node
-
- A cache component has the Root (component tree) TreeFragment at a well-known location.
- The 'next' element of the component tree points to the list of template TreeFragments
- used in the component.
- */
- struct TreeFragment
- {
- TreeFragmentHeader header; // really variable-sized:
- Node nodes[1]; // nodes[header.count]
-
- // header info access
- bool hasDefaultsAvailable() const;
-
- bool isDefault() const;
- bool isNew() const;
-
- bool isNamed(rtl::OUString const & _aName) const;
-
- rtl::OUString getName() const;
-
- void setName(rtl::OUString const & name);
-
- configmgr::node::Attributes getAttributes()const;
-
- Node * getRootNode() { return nodes; }
-
- static TreeFragment *allocate(sal_uInt32 nFragments);
- static void free_shallow( TreeFragment *pFragment );
- };
- //-----------------------------------------------------------------------------
-
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_SHARABLE_TREEFRAGMENT_HXX
diff --git a/configmgr/source/inc/treemanager.hxx b/configmgr/source/inc/treemanager.hxx
deleted file mode 100644
index f62955022849..000000000000
--- a/configmgr/source/inc/treemanager.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREEMANAGER_HXX_
-#define CONFIGMGR_TREEMANAGER_HXX_
-
-#include <memory>
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "defaultprovider.hxx"
-#include "confevents.hxx"
-#include "options.hxx"
-#include "autoreferencemap.hxx"
-#include "autoobject.hxx"
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
-
- namespace backend {
- class CacheController;
- class ComponentRequest;
- class UpdateRequest;
- }
- namespace sharable {
- struct TreeFragment;
- union Node;
- }
-
- //==========================================================================
- //= TreeManager
- //==========================================================================
- class CacheClientAccess;
- class CacheData;
- class ConfigChangeBroadcastHelper;
- class ISubtree;
- //==========================================================================
- class TreeManager: public salhelper::SimpleReferenceObject {
- typedef AutoReferenceMap< RequestOptions, CacheClientAccess, lessRequestOptions> CacheList;
-
- osl::Mutex m_aCacheControllerMutex;
- rtl::Reference< backend::CacheController > m_xCacheController;
-
- rtl::Reference< backend::CacheController > maybeGetBackendCache() SAL_THROW(());
- rtl::Reference< backend::CacheController > getCacheLoader() SAL_THROW((com::sun::star::uno::RuntimeException));
- void disposeBackendCache() SAL_THROW(());
-
- CacheList m_aCacheList; // Map
- AutoObject< CacheData > m_aTemplates;
- sal_Bool m_bEnableAsync;
-
- virtual ~TreeManager();
-
- public:
- /** ctor
- */
- explicit
- TreeManager(rtl::Reference< backend::CacheController > const & _xBackend);
-
- // disposing the cache before destroying
- void dispose();
-
- /** requests a node given by it's path. Basicly, this means
- that the node is fetch from the cache when it contains it else it ask the server
- system into it's cache.
- @param _rSubtreePath the path to the node in URI notation.
- @param _nMinLevels indicates how many tree levels under the node determined by <arg>_rSubtreePath</arg>
- should be loaded
- */
- sharable::Node * requestSubtree(configuration::AbsolutePath const& _rSubtreePath,
- RequestOptions const& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- void updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- void saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- void releaseSubtree(configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _aOptions ) SAL_THROW(());
-
- void fetchSubtree( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _xOptions
- ) SAL_THROW(());
-
- void refreshAll() SAL_THROW((com::sun::star::uno::Exception));
- void flushAll() SAL_THROW(());
- void enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(()) ;
-
- sal_Bool fetchDefaultData( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- std::auto_ptr<ISubtree> requestDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- sharable::TreeFragment * requestTemplate( rtl::OUString const& aName, rtl::OUString const& aModule
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- // implementation interfaces
- void refreshSubtree(const configuration::AbsolutePath &_aAbsoluteSubtreePath,
- const RequestOptions& _aOptions) SAL_THROW((com::sun::star::uno::Exception));
-
- void addListener(configuration::AbsolutePath const& aName, const RequestOptions& _aOptions, rtl::Reference<INodeListener> const& pListener);
- void removeListener(const RequestOptions& _aOptions, rtl::Reference<INodeListener> const& pListener);
-
- void componentCreated(backend::ComponentRequest const & _aComponent) SAL_THROW(());
- void componentChanged(backend::UpdateRequest const & _anUpdate) SAL_THROW(());
-
- private:
- CacheData & getTemplates() { return * m_aTemplates.get(); }
-
- configuration::AbsolutePath encodeTemplateLocation(rtl::OUString const & _rLogicalTemplateName, rtl::OUString const &_rModule);
-
- private:
- rtl::Reference<CacheClientAccess> getCacheAlways(RequestOptions const & _aOptions);
-
- // disposing
- void disposeAll();
-
- void fireChanges(TreeChangeList const& _aChanges, sal_Bool _bError);
- ConfigChangeBroadcastHelper* getBroadcastHelper(RequestOptions const& _aOptions, bool bCreate);
- void disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper);
-
- void nodeUpdated(TreeChangeList& _rChanges);
- };
-
-}
-
-
-#endif
-
diff --git a/configmgr/source/inc/treenodefactory.hxx b/configmgr/source/inc/treenodefactory.hxx
deleted file mode 100644
index 0a016cbb536b..000000000000
--- a/configmgr/source/inc/treenodefactory.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREE_NODEFACTORY_HXX
-#define CONFIGMGR_TREE_NODEFACTORY_HXX
-
-#include "valuenode.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning(disable : 4350)
-#endif
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
-
- //==========================================================================
-
- class OTreeNodeFactory
- {
- public:
- //= ValueNodes ============================================================
- std::auto_ptr<ValueNode> createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ValueNode> createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- uno::Any const& aDefault,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ValueNode> createNullValueNode(
- rtl::OUString const& aName,
- uno::Type const& aType,
- node::Attributes _aAttrs);
-
- //= ISubtree ============================================================
- std::auto_ptr<ISubtree> createGroupNode(
- rtl::OUString const& aName,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ISubtree> createSetNode(
- rtl::OUString const& aName,
- rtl::OUString const& _rTemplateName,
- rtl::OUString const& _rTemplateModule,
- node::Attributes _aAttrs);
- };
-
- OTreeNodeFactory& getDefaultTreeNodeFactory();
- //==========================================================================
- inline
- std::auto_ptr<INode> base_ptr(std::auto_ptr<ISubtree> pNode)
- { return std::auto_ptr<INode>(pNode.release()); }
- //==========================================================================
- inline
- std::auto_ptr<INode> base_ptr(std::auto_ptr<ValueNode> pNode)
- { return std::auto_ptr<INode>(pNode.release()); }
- //==========================================================================
-
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/treesegment.hxx b/configmgr/source/inc/treesegment.hxx
deleted file mode 100644
index badea86541a2..000000000000
--- a/configmgr/source/inc/treesegment.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_TREESEGMENT_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_TREESEGMENT_HXX
-
-#include "sal/config.h"
-
-#include <memory>
-
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-namespace rtl { class OUString; }
-
-namespace configmgr {
- class INode;
- namespace sharable { struct TreeFragment; }
-
- namespace data {
- // rtl::Reference< TreeSegment > is a reference counted
- // sharable::TreeFragment *. A null reference is always modeled as an
- // empty rtl::Reference< TreeSegment >, never as a null fragment.
- class TreeSegment: public salhelper::SimpleReferenceObject {
- public:
- static rtl::Reference< TreeSegment > create(
- std::auto_ptr< INode > tree, rtl::OUString const & type);
-
- static rtl::Reference< TreeSegment > create(
- rtl::OUString const & name, std::auto_ptr< INode > tree);
-
- static rtl::Reference< TreeSegment > create(
- sharable::TreeFragment * tree);
-
- static rtl::Reference< TreeSegment > create(
- rtl::Reference< TreeSegment > const & tree)
- { return create(tree.is() ? tree->fragment : 0); }
-
- sharable::TreeFragment * const fragment; // non-null
-
- private:
- TreeSegment(sharable::TreeFragment * tree);
-
- virtual ~TreeSegment();
- };
- }
-}
-
-#endif
diff --git a/configmgr/source/inc/typeconverter.hxx b/configmgr/source/inc/typeconverter.hxx
deleted file mode 100644
index ab2c5be2509c..000000000000
--- a/configmgr/source/inc/typeconverter.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_TYPECONVERTER_HXX
-#define CONFIGMGR_TYPECONVERTER_HXX
-
-#include "utility.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace script = ::com::sun::star::script;
-
- // UNO Type handling
- uno::Type getSequenceElementType(uno::Type const& rSequenceType);
-
- uno::Type getBasicType(uno::Type const& rType, bool& bSequence);
- inline
- uno::Type getBasicType(uno::Type const& rType)
- { bool dummy; return getBasicType(rType,dummy); }
-
- // Any Conversion - uses TypeConverter
- uno::Any toAny( const uno::Reference< script::XTypeConverter >& xTypeConverter,
- const ::rtl::OUString& _rValue,
- const uno::TypeClass& _rTypeClass)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- rtl::OUString toString(const uno::Reference< script::XTypeConverter >& xTypeConverter, const uno::Any& rValue)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- // Type conversion
- ::rtl::OUString toTypeName(const uno::TypeClass& _rTypeClass);
-
- uno::Type toType(const ::rtl::OUString& _rsType);
- uno::Type toListType(const ::rtl::OUString& _rsElementType);
- ::rtl::OUString toTypeName(const uno::Type& _rType);
-
- inline
- uno::Type toType(const ::rtl::OUString& _rsSimpleType, bool isList)
- {
- return isList ? toListType(_rsSimpleType) : toType(_rsSimpleType);
- }
-
- // template names
- ::rtl::OUString toTemplateName(const uno::Type& _rType);
- ::rtl::OUString toTemplateName(const uno::TypeClass& _rBasicType, bool bList = false);
- ::rtl::OUString toTemplateName(const ::rtl::OUString& _rBasicTypeName, bool bList = false);
-
- uno::Type parseTemplateName(::rtl::OUString const& sTypeName);
- bool parseTemplateName(::rtl::OUString const& sTypeName, ::rtl::OUString& _rBasicName, bool& bList);
-
-} // namespace configmgr
-
-#endif /* CONFIGMGR_TYPECONVERTER_HXX */
diff --git a/configmgr/source/inc/updatehelper.hxx b/configmgr/source/inc/updatehelper.hxx
deleted file mode 100644
index 0d53078d4fca..000000000000
--- a/configmgr/source/inc/updatehelper.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_UPDATEHELPER_HXX
-#define CONFIGMGR_UPDATEHELPER_HXX
-
-#include "change.hxx"
-
-namespace configmgr {
- namespace sharable { union Node; }
-
-// apply a already matching set of changes to the target tree
- void applyUpdateToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode);
-
-// apply a set of changes to the target tree
- void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode);
-
-// apply a set of changes to the target tree, return true, if there are changes found
- bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, sharable::Node * existingData, ISubtree const & _aNewData);
-}
-
-#endif
diff --git a/configmgr/source/inc/utility.hxx b/configmgr/source/inc/utility.hxx
deleted file mode 100644
index 664015459ee8..000000000000
--- a/configmgr/source/inc/utility.hxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_UTILITY_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_UTILITY_HXX
-
-#include "sal/config.h"
-
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-
-#if defined _MSC_VER && _MSC_VER >= 1400
-#pragma warning(disable: 4350)
- // behavior change: 'member1' called instead of 'member2'
-#endif
-
-namespace configmgr {
-
- inline rtl_uString * acquireString(rtl::OUString const & string) {
- rtl_uString_acquire(string.pData);
- return string.pData;
- }
-
-}
-
-#endif
diff --git a/configmgr/source/inc/valuenode.hxx b/configmgr/source/inc/valuenode.hxx
deleted file mode 100644
index a9cbc7970710..000000000000
--- a/configmgr/source/inc/valuenode.hxx
+++ /dev/null
@@ -1,293 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TREE_VALUENODE_HXX
-#define _CONFIGMGR_TREE_VALUENODE_HXX
-
-#include "attributes.hxx"
-#include "anypair.hxx"
-#include <com/sun/star/uno/Any.h>
-#include <rtl/ustring.hxx>
-
-#include <string.h>
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-
- namespace css = com::sun::star;
- namespace uno = css::uno;
-
- class INode;
- class ISubtree;
- class ValueNode;
-
- // helper (tag) class
- namespace treeop { struct NoChildCopy {}; struct DeepChildCopy {}; enum { ALL_LEVELS = -1 }; }
- //==========================================================================
- //= Visitors
- //==========================================================================
- struct NodeAction
- {
- virtual void handle(ValueNode const&) = 0;
- virtual void handle(ISubtree const&) = 0;
-
- void applyToNode(INode const&);
- void applyToChildren(ISubtree const&);
- protected:
- virtual ~NodeAction() {}
- };
-
- struct NodeModification
- {
- virtual void handle(ValueNode&) = 0;
- virtual void handle(ISubtree&) = 0;
-
- void applyToNode(INode&);
- void applyToChildren(ISubtree&);
- protected:
- virtual ~NodeModification() {}
- };
-
- class INode
- {
- rtl::OUString m_aName;
- node::Attributes m_aAttributes;
-
- protected:
- INode(){}
-
- void markAsDefault(bool _bDefault = true)
- {
- m_aAttributes.markAsDefault(_bDefault);
- }
- public:
- explicit
- INode(rtl::OUString const& aName, node::Attributes);
-
- virtual ~INode();
-
- virtual std::auto_ptr<INode> clone() const = 0;
- public:
-
- const rtl::OUString& getName() const { return m_aName; }
- node::Attributes getAttributes() const { return m_aAttributes; }
-
- bool isDefault() const { return m_aAttributes.isDefault(); }
- bool isLocalized() const { return m_aAttributes.isLocalized(); }
-
- void modifyState(node::State _eNewState);
- void modifyAccess(node::Access _aAccessLevel);
- void markMandatory();
- void markRemovable();
- void promoteAccessToDefault();
-
- // to be used with caution. If the node is referenced from somewhere else under it's old name,
- // you may have problems with this inconsistence
- void setName(const rtl::OUString& _rNewName) { m_aName = _rNewName; }
-
- virtual ValueNode* asValueNode();
- virtual ValueNode const* asValueNode() const;
- virtual ISubtree* asISubtree();
- virtual ISubtree const* asISubtree() const;
-
- // double dispatch support
- virtual void dispatch(NodeAction&) const = 0;
- virtual void dispatch(NodeModification&) = 0;
- };
-
-// -----------------------------------------------------------------------------
-
- //==========================================================================
- //= ISubtree
- //==========================================================================
- class ISubtree : public INode
- {
- sal_Int16 m_nLevel; /// determines if everything is read
- sal_Int16 m_nDefaultLevels; /// determines if defaults are read
- rtl::OUString m_sId;
- rtl::OUString m_sTemplateName; /// path of the template for child instantiation
- rtl::OUString m_sTemplateModule; /// module of the template for child instantiation
-
- virtual INode* doGetChild(rtl::OUString const& name) const = 0;
-
- protected:
- ISubtree():m_nLevel(0){}
-
- ISubtree(ISubtree const& other)
- :INode(other)
- ,m_nLevel(other.m_nLevel)
- ,m_nDefaultLevels(other.m_nDefaultLevels)
- ,m_sId() // do not copy ID while cloning !
- ,m_sTemplateName(other.m_sTemplateName)
- ,m_sTemplateModule(other.m_sTemplateModule)
- {}
-
- public:
- // Ctor for group trees
- ISubtree(const rtl::OUString& aName, const node::Attributes& _rAttrs)
- :INode(aName, _rAttrs)
- ,m_nLevel(0)
- ,m_nDefaultLevels(0)
- {}
-
- // Ctor for set trees
- ISubtree(const rtl::OUString& aName,
- const rtl::OUString& _rTemplateName,
- const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttrs)
- :INode(aName, _rAttrs)
- ,m_nLevel(0)
- ,m_nDefaultLevels(0)
- ,m_sTemplateName(_rTemplateName)
- ,m_sTemplateModule(_rTemplateModule){}
-
- INode* getChild(rtl::OUString const& name) { return doGetChild(name); }
- INode const* getChild(rtl::OUString const& name) const { return doGetChild(name); }
-
- ISubtree* asISubtree();
- ISubtree const* asISubtree() const;
-
- using INode::markAsDefault;
-
- sal_Int16 getLevel() const { return m_nLevel; }
-
- void setLevels(sal_Int16 _nLevel,sal_Int16 _nDefaultsLevel);
-
- bool isSetNode() const { return m_sTemplateName.getLength() != 0; }
-
- void makeSetNode(rtl::OUString const& _sTemplateName, rtl::OUString const& _sTemplateModule)
- { m_sTemplateName = _sTemplateName; m_sTemplateModule = _sTemplateModule; }
-
- rtl::OUString const& getElementTemplateName() const { return m_sTemplateName; }
- rtl::OUString const& getElementTemplateModule() const { return m_sTemplateModule; }
-
- virtual INode* addChild(std::auto_ptr<INode> node) =0; // takes ownership
- virtual ::std::auto_ptr<INode> removeChild(rtl::OUString const& name) =0; // releases ownership
-
- // Iteration support, stop if (action returns true)
- virtual void forEachChild(NodeAction& anAction) const = 0;
- virtual void forEachChild(NodeModification& anAction) = 0;
-
- // double dispatch support
- virtual void dispatch(NodeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(NodeModification& anAction) { anAction.handle(*this); }
- };
-
- //==========================================================================
- //= ValueNode
- //==========================================================================
- class ValueNode : public INode
- {
- AnyPair m_aValuePair;
- // uno::Type m_aType;
- // uno::Any m_aValue;
- // uno::Any m_aDefaultValue;
-
- public:
- //ValueNode(){}
-
- //explicit ValueNode(node::Attributes _aAttrs):INode(_aAttrs){}
-
- /*
- ValueNode(rtl::OUString const& aName, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair()
- {}
- */
- ValueNode(rtl::OUString const& aName,uno::Type const& aType, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(aType)
- {
- }
- ValueNode(rtl::OUString const& aName,uno::Any const& anAny, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(anAny, selectMember(_aAttrs.isDefault()))
- {
- }
- ValueNode(rtl::OUString const& aName,uno::Any const& anAny,uno::Any const& aDefault, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(anAny, aDefault)
- {
- }
-
- bool isEmpty() const {return m_aValuePair.isEmpty();}
- bool isValid() const {return !m_aValuePair.isEmpty();}
-
- bool isNull() const {return m_aValuePair.isNull();}
- bool hasUsableDefault() const {return getAttributes().isNullable() || m_aValuePair.hasSecond();}
-
- uno::Type getValueType() const {return m_aValuePair.getValueType();}
- uno::Any getValue() const {return m_aValuePair.getValue( selectMember(this->isDefault()) );}
- uno::Any getUserValue() const {return m_aValuePair.getFirst();}
- uno::Any getDefault() const {return m_aValuePair.getSecond();}
-
- bool setValueType(uno::Type const& _aType);
- bool setValue(uno::Any const& _aValue);
- void setDefault();
-
- bool changeDefault(uno::Any const& _aValue);
- void promoteToDefault();
-
- virtual std::auto_ptr<INode> clone() const;
-
- ValueNode* asValueNode();
- ValueNode const* asValueNode() const;
- // double dispatch support
- virtual void dispatch(NodeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(NodeModification& anAction) { anAction.handle(*this); }
-
- private:
- static AnyPair::SelectMember selectValue() { return AnyPair::SELECT_FIRST; }
- static AnyPair::SelectMember selectDeflt() { return AnyPair::SELECT_SECOND; }
- static AnyPair::SelectMember selectMember(bool bDeflt)
- { return bDeflt ? AnyPair::SELECT_SECOND : AnyPair::SELECT_FIRST; }
- };
- //==========================================================================
-
- extern bool isLocalizedValueSet(ISubtree const& _aSubtree);
-
- //==========================================================================
- //= inlines
- //==========================================================================
- inline void NodeAction::applyToNode(INode const& aNode)
- { aNode.dispatch(*this); }
- inline void NodeAction::applyToChildren(ISubtree const& aSubtree)
- { aSubtree.forEachChild(*this); }
-
- inline void NodeModification::applyToNode(INode& aNode)
- { aNode.dispatch(*this); }
- inline void NodeModification::applyToChildren(ISubtree& aSubtree)
- { aSubtree.forEachChild(*this); }
-
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/valueref.hxx b/configmgr/source/inc/valueref.hxx
deleted file mode 100644
index 5e24da39d8b8..000000000000
--- a/configmgr/source/inc/valueref.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGVALUEREF_HXX_
-#define CONFIGMGR_CONFIGVALUEREF_HXX_
-
-#include "noderef.hxx"
-
-namespace configmgr
-{
- namespace node { struct Attributes; }
-
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class Tree;
- //-------------------------------------------------------------------------
-
- /// represents a value node in some tree
- class ValueRef
- {
- public:
- /// constructs an empty (invalid) node
- ValueRef();
-
- ValueRef(rtl::OUString const& aName, unsigned int nParentPos);
-
- /// copy a node (with reference semantics)
- ValueRef(ValueRef const& rOther);
- /// copy a node (with reference semantics)
- ValueRef& operator=(ValueRef const& rOther);
-
- void swap(ValueRef& rOther);
-
- ~ValueRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- bool checkValidState() const;
-
- rtl::OUString m_sNodeName;
- unsigned int m_nParentPos;
- };
- //-------------------------------------------------------------------------
-
- /** extract the value from a plain value
- */
- inline
- com::sun::star::uno::Any getSimpleValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode)
- { return aTree->getNodeValue( aNode ); }
-
- //-------------------------------------------------------------------------
- inline bool ValueRef::isValid() const
- {
- OSL_ASSERT( m_nParentPos == 0 || checkValidState() );
- return m_nParentPos != 0;
- }
-
- //-------------------------------------------------------------------------
-
- class SubNodeID
- {
- public:
- static SubNodeID createEmpty() { return SubNodeID(); }
- SubNodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rParentNode, rtl::OUString const& aName);
- SubNodeID(NodeID const& rParentNodeID, rtl::OUString const& aName);
-
- // comparison
- // equality
- friend bool operator==(SubNodeID const& lhs, SubNodeID const& rhs)
- { return lhs.m_aParentID == rhs.m_aParentID && lhs.m_sNodeName == rhs.m_sNodeName; }
- // ordering
- friend bool operator < (SubNodeID const& lhs, SubNodeID const& rhs);
- // checking
- bool isValidNode() const;
- // hashing
- size_t hashCode() const { return m_aParentID.hashCode() + 5*m_sNodeName.hashCode(); }
- // containing node this
- NodeID getParentID() const { return m_aParentID; }
- // containing node this
- rtl::OUString getNodeName() const { return m_sNodeName; }
- private:
- SubNodeID(); // create an empty one
- rtl::OUString m_sNodeName;
- NodeID m_aParentID;
- };
- //-------------------------------------------------------------------------
-
- void getAllChildrenHelper(NodeID const& aNode, std::vector<SubNodeID>& aList);
-
- //-------------------------------------------------------------------------
- inline bool operator!=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(lhs == rhs); }
- //---------------------------------------------------------------------
-
- inline bool operator>=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(lhs < rhs); }
- //---------------------------------------------------------------------
- inline bool operator > (SubNodeID const& lhs, SubNodeID const& rhs)
- { return (rhs < lhs); }
- inline bool operator<=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(rhs < lhs); }
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGVALUENODE_HXX_
diff --git a/configmgr/source/inc/valuetypeconverter.hxx b/configmgr/source/inc/valuetypeconverter.hxx
deleted file mode 100644
index fd6fc7afe764..000000000000
--- a/configmgr/source/inc/valuetypeconverter.hxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUECONVERTER_HXX
-#define CONFIGMGR_VALUECONVERTER_HXX
-
-#include "utility.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace script = ::com::sun::star::script;
-
-// -----------------------------------------------------------------------------
- class ValueConverter
- {
- /// TypeConverter is used for converting type from string values
- uno::Reference< script::XTypeConverter > m_xTypeConverter;
- /// Value info
- uno::Type m_aType;
- rtl::OUString m_sSeparator;
- bool m_bNull;
- public:
- /// construct a value converter with no initial type info
- ValueConverter(const uno::Reference< script::XTypeConverter > & _xTC)
- : m_xTypeConverter(_xTC)
- , m_aType()
- {
- implReset();
- }
-
- /// construct a value converter with a type
- ValueConverter(uno::Type const& _aType, const uno::Reference< script::XTypeConverter > & _xTC)
- : m_xTypeConverter(_xTC)
- , m_aType(_aType)
- {
- implReset();
- }
-
- /// provide access to the TypeConverter that is used for converting string format
- uno::Reference< script::XTypeConverter > const& getTypeConverter() const SAL_THROW(())
- {
- return m_xTypeConverter;
- }
-
- /// (re)start the converter with the current type
- void restart()
- {
- implReset();
- }
-
- /// (re)start the converter with a new type info (or none)
- void reset(uno::Type const & _aType = uno::Type())
- {
- m_aType = _aType;
- implReset();
- }
-
- /// set the NULL state of this converter
- void setIsNull(bool bNull = true)
- {
- m_bNull = bNull;
- }
-
- /// set the separator of this converter
- void setSeparator(rtl::OUString const & _aSeparator)
- {
- m_sSeparator = _aSeparator;
- }
-
- /// get the (UNO) type
- bool isTypeSet() const { return m_aType.getTypeClass() != uno::TypeClass_VOID; }
-
- /// get the (UNO) type
- uno::Type getType() const { return m_aType; }
-
- /// is this marked null
- bool isNull() const { return m_bNull; }
-
- /// does this have a list type
- bool isList() const;
-
- /// does this have a separator set
- bool hasSeparator() const { return m_sSeparator.getLength() != 0; }
-
- /// converting a value
- uno::Any convertToAny(rtl::OUString const& aContent) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a list
- uno::Any convertListToAny(uno::Sequence< rtl::OUString > const& aContentList) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a binary value
- uno::Sequence<sal_Int8> parseBinary(rtl::OUString const& aBinaryString) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// splits a string list
- uno::Sequence< rtl::OUString > splitStringList(rtl::OUString const& aContent) const;
- private:
- /// converting a list
- bool convertListToAny(std::vector< rtl::OUString > const& aContentList, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a scalar value
- bool convertScalarToAny(rtl::OUString const& aContent, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// splitting a string list
- void splitListData(rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList) const
- SAL_THROW(());
- private:
- void implReset() SAL_THROW(())
- {
- m_sSeparator = rtl::OUString();
- m_bNull = false;
- }
- };
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/wrapexception.hxx b/configmgr/source/inc/wrapexception.hxx
deleted file mode 100644
index c942a2190286..000000000000
--- a/configmgr/source/inc/wrapexception.hxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_WRAPEXCEPTION_HXX
-#define CONFIGMGR_WRAPEXCEPTION_HXX
-
-#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InstallationIncompleteException.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/AuthenticationFailedException.hpp>
-#include <com/sun/star/configuration/backend/InvalidAuthenticationMechanismException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-
-#define WRAP_EXCEPTION( ETyp, Raise ) \
- catch (ETyp & _e_) { Raise( uno::makeAny(_e_) ); }
-
-#define WRAP_EXCEPTION1( ETyp, Raise, Arg ) \
- catch (ETyp & _e_) { Raise( uno::makeAny(_e_), (Arg) ); }
-
-#define PASS_EXCEPTION( ETyp ) \
- catch (ETyp & ) { throw; }
-
-#define WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::AuthenticationFailedException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InvalidAuthenticationMechanismException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::CannotConnectException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendSetupException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendAccessException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::MissingBootstrapFileException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::InvalidBootstrapFileException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::InstallationIncompleteException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::CannotLoadConfigurationException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetRuntimeException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::DisposedException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::uno::RuntimeException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::uno::Exception, Raise)
-
-#define WRAP_CONFIGBACKEND_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::ConnectionLostException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendAccessException, Raise) \
-
-#define WRAP_CONFIGDATA_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::MalformedDataException, Raise) \
- WRAP_CONFIGBACKEND_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetException, Raise) \
-
-#define WRAP_SAX_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::xml::sax::SAXParseException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::xml::sax::SAXException, Raise) \
-
-#define WRAP_OTHER_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::uno::Exception, Raise)
-
-#define WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::AuthenticationFailedException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InvalidAuthenticationMechanismException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::CannotConnectException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendSetupException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendAccessException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::MissingBootstrapFileException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::InvalidBootstrapFileException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::InstallationIncompleteException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::CannotLoadConfigurationException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetRuntimeException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::DisposedException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::uno::RuntimeException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::uno::Exception, Raise, Arg)
-
-#define WRAP_CONFIGBACKEND_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::ConnectionLostException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendAccessException, Raise, Arg) \
-
-#define WRAP_CONFIGDATA_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::MalformedDataException, Raise, Arg) \
- WRAP_CONFIGBACKEND_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetException, Raise, Arg) \
-
-#define WRAP_SAX_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::xml::sax::SAXParseException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::xml::sax::SAXException, Raise, Arg) \
-
-#define WRAP_OTHER_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::uno::Exception, Raise, Arg)
-
-#endif // CONFIGMGR_WRAPEXCEPTION_HXX
diff --git a/configmgr/source/localbe/localdataimportsvc.cxx b/configmgr/source/localbe/localdataimportsvc.cxx
deleted file mode 100644
index 9a79c3edc82c..000000000000
--- a/configmgr/source/localbe/localdataimportsvc.cxx
+++ /dev/null
@@ -1,357 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localdataimportsvc.hxx"
-#include "localsinglebackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/configuration/backend/XLayerImporter.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTRING( constascii ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(constascii))
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace backend = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aLocalDataImportServices[] =
-{
- "com.sun.star.configuration.backend.LocalDataImporter",
- 0,
- "com.sun.star.configuration.backend.DataImporter",
- 0
-};
-const ServiceImplementationInfo aLocalDataImportSI =
-{
- "com.sun.star.comp.configuration.backend.LocalDataImporter",
- aLocalDataImportServices,
- aLocalDataImportServices + 3
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLocalDataImportServiceInfo()
-{ return getRegistrationInfo(& aLocalDataImportSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper LocalDataImportService::getServiceInfo()
-{
- return & aLocalDataImportSI;
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateLocalDataImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LocalDataImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-LocalDataImportService::LocalDataImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage = OUSTRING("Configuration Importer: Context has no service manager (or interface is missing)");
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LocalDataImportService::~LocalDataImportService()
-{}
-// -----------------------------------------------------------------------------
-
-namespace
-{
-// -----------------------------------------------------------------------------
- struct JobDesc
- {
- explicit JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments);
-
- rtl::OUString aLayerDataUrl;
- rtl::OUString aImporterService;
-
- rtl::OUString aComponent;
- rtl::OUString aEntity;
-
- uno::Reference< backend::XLayer > xLayerFilter;
-
- sal_Bool overwrite;
- sal_Bool truncate;
-
- sal_Bool use_component;
- sal_Bool use_entity;
- sal_Bool use_overwrite;
- sal_Bool use_truncate;
- };
- // -----------------------------------------------------------------------------
-
- JobDesc::JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments)
- : aLayerDataUrl()
- , aImporterService()
- , aComponent()
- , aEntity()
- , xLayerFilter()
- , overwrite(true)
- , truncate(false)
- , use_component(false)
- , use_entity(false)
- , use_overwrite(false)
- , use_truncate(false)
- {
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage = OUSTRING("Too many arguments for LocalDataImporter Job");
- throw lang::IllegalArgumentException(sMessage,pJob,0);
- }
-
- for (sal_Int16 i=0; i < nCount; ++i)
- {
- sal_Bool bKnown = false;
- sal_Bool bGood = false;
-
- if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerDataUrl")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aLayerDataUrl);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ImporterService")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aImporterService);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Component")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aComponent);
- use_component = bGood && (aComponent.getLength() != 0);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Entity")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aEntity);
- use_entity = bGood && (aEntity.getLength() != 0);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerFilter")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= xLayerFilter);
- if (xLayerFilter.is() && !uno::Reference<lang::XInitialization>::query(xLayerFilter).is())
- bGood = false;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OverwriteExisting")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= overwrite);
- use_overwrite = bGood;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TruncateExisting")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= truncate);
- use_truncate = bGood;
- }
-
- if (!bGood)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalDataImportService - Illegal argument: ");
- if (bKnown)
- sMsg.appendAscii("Wrong value type for argument '");
- else
- sMsg.appendAscii("Unknown argument '");
-
- sMsg.append(aArguments[i].Name).appendAscii("'.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,i+1);
- }
- }
- if (aLayerDataUrl.getLength() == 0)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalDataImportService - Missing argument: ");
- sMsg.appendAscii("No data URL available");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,0);
- }
- if (aImporterService.getLength() == 0)
- {
- if ( (use_truncate && truncate) || (use_overwrite && !overwrite) )
- aImporterService = OUSTRING("com.sun.star.configuration.backend.CopyImporter");
- else
- aImporterService = OUSTRING("com.sun.star.configuration.backend.MergeImporter");
- }
- }
- // -----------------------------------------------------------------------------
-
- static
- inline
- uno::Type getOverwriteFailedExceptionType()
- {
- lang::IllegalAccessException const * const selected = 0;
- return ::getCppuType(selected);
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-// XJob
-
-uno::Any SAL_CALL
- LocalDataImportService::execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
-{
- JobDesc const aJob(this,Arguments);
-
- uno::Reference< lang::XMultiServiceFactory > aFactory = this->getServiceFactory();
-
- uno::Reference< backend::XLayer > xLayer = aJob.use_component ?
- LocalSingleBackend::createSimpleLayer(aFactory,aJob.aLayerDataUrl, aJob.aComponent ):
- LocalSingleBackend::createSimpleLayer(aFactory,aJob.aLayerDataUrl) ;
-
- if (!xLayer.is())
- {
- rtl::OUString sMessage = OUSTRING("LocalDataImportService - Cannot create layer to import from");
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< lang::XInitialization > xFilterInit(aJob.xLayerFilter,uno::UNO_QUERY);
- if (xFilterInit.is())
- {
- beans::NamedValue argvalue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Source") ),
- uno::makeAny( xLayer) );
-
- uno::Sequence< uno::Any > args(1);
- args[0] <<= argvalue;
-
- xFilterInit->initialize(args);
-
- xLayer = aJob.xLayerFilter;
- }
-
- uno::Reference< backend::XLayerImporter > xImporter;
-
- int nArgCount = 0;
- if (aJob.use_overwrite) ++nArgCount;
- if (aJob.use_truncate) ++nArgCount;
-
- if (nArgCount)
- {
- uno::Sequence< uno::Any > aArgs(nArgCount);
-
- int n = 0;
- if (aJob.use_overwrite)
- aArgs[n++] <<= beans::NamedValue(OUSTRING("Overwrite"), uno::makeAny(aJob.overwrite));
-
- if (aJob.use_truncate)
- aArgs[n++] <<= beans::NamedValue(OUSTRING("Truncate"), uno::makeAny(aJob.truncate));
-
- OSL_ASSERT(n == nArgCount);
-
- xImporter.set( aFactory->createInstanceWithArguments(aJob.aImporterService,aArgs), uno::UNO_QUERY);
- }
- else
- xImporter.set( aFactory->createInstance(aJob.aImporterService), uno::UNO_QUERY);
-
- if (!xImporter.is())
- {
- rtl::OUString sMessage = OUSTRING("LocalDataImportService - Cannot create importer service: ") + aJob.aImporterService;
- throw lang::NullPointerException(sMessage,*this);
- }
-
- try
- {
- if (aJob.use_entity)
- xImporter->importLayerForEntity(xLayer,aJob.aEntity);
-
- else
- xImporter->importLayer(xLayer);
- }
- catch (lang::WrappedTargetException & e)
- {
- if (aJob.overwrite || !e.TargetException.isExtractableTo(getOverwriteFailedExceptionType())) throw;
- return e.TargetException;
- }
- catch (lang::WrappedTargetRuntimeException & e)
- {
- if (aJob.overwrite || !e.TargetException.isExtractableTo(getOverwriteFailedExceptionType())) throw;
- return e.TargetException;
- }
-
- return uno::Any();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- LocalDataImportService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- LocalDataImportService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- LocalDataImportService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/localbe/localdataimportsvc.hxx b/configmgr/source/localbe/localdataimportsvc.hxx
deleted file mode 100644
index 3980d287173e..000000000000
--- a/configmgr/source/localbe/localdataimportsvc.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_IMPORTSVC_HXX
-#define CONFIGMGR_LOCALBE_IMPORTSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase2.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/task/XJob.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace task = ::com::sun::star::task;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
-
- class LocalDataImportService : public ::cppu::WeakImplHelper2<
- task::XJob,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- LocalDataImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- ~LocalDataImportService();
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XJob
- virtual uno::Any SAL_CALL
- execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/localbe/localfilehelper.cxx b/configmgr/source/localbe/localfilehelper.cxx
deleted file mode 100644
index 453df7c5ce2c..000000000000
--- a/configmgr/source/localbe/localfilehelper.cxx
+++ /dev/null
@@ -1,242 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localfilehelper.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <vector>
-
-namespace configmgr
-{
- namespace localbe
- {
- //------------------------------------------------------------------------------
- bool isValidFileURL (rtl::OUString const& _sFileURL)
- {
- rtl::OUString sSystemPath;
- return _sFileURL.getLength() && (osl::File::E_None == osl::File::getSystemPathFromFileURL(_sFileURL, sSystemPath));
- }
- //------------------------------------------------------------------------------
- void validateFileURL(const rtl::OUString& _sFileURL, const uno::Reference<uno::XInterface>& pContext)
- throw(css::configuration::InvalidBootstrapFileException)
- {
- if (!isValidFileURL( _sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" Not a Valid File URL: \"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\"");
- throw com::sun::star::configuration::InvalidBootstrapFileException(
- sMsg.makeStringAndClear(),pContext, rtl::OUString() ) ;
- }
- }
- //------------------------------------------------------------------------------
- void checkFileExists(const rtl::OUString& _sFileURL,const uno::Reference<uno::XInterface>& pContext)
- throw (backend::CannotConnectException)
- {
- if (!FileHelper::fileExists(_sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" No Such File or Directory: \"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\"");
-
- throw backend::CannotConnectException(sMsg.makeStringAndClear(), pContext, uno::Any()) ;
- }
- }
- //------------------------------------------------------------------------------
- void checkIfDirectory(const rtl::OUString& _sFileURL, const uno::Reference<uno::XInterface>& pContext)
- throw (backend::BackendSetupException)
- {
- if (!FileHelper::dirExists(_sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" File:\"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\" Must be a Directory\"");
-
- throw backend::BackendSetupException(sMsg.makeStringAndClear(),pContext, uno::Any()) ;
- }
- }
-
- // ---------------------------------------------------------------------------------------
- bool implEnsureAbsoluteURL(rtl::OUString & _rsURL) // also strips embedded dots etc.
- {
- rtl::OUString sBasePath;
- OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
-
- rtl::OUString sAbsolute;
- if ( osl::File::E_None == osl::File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
- {
- _rsURL = sAbsolute;
- return true;
- }
- else
- {
- OSL_ENSURE(false, "Could not get absolute file URL for valid URL");
- return false;
- }
- }
- // ---------------------------------------------------------------------------------------
- osl::DirectoryItem::RC implNormalizeURL(rtl::OUString & _sURL, osl::DirectoryItem& aDirItem)
- {
- OSL_PRECOND(aDirItem.is(), "Opened DirItem required");
-
- static const sal_uInt32 cFileStatusMask = FileStatusMask_FileURL;
-
- osl::FileStatus aFileStatus(cFileStatusMask);
-
- osl::DirectoryItem::RC rc = aDirItem.getFileStatus(aFileStatus);
-
- if (rc == osl::DirectoryItem::E_None)
- {
- rtl::OUString aNormalizedURL = aFileStatus.getFileURL();
-
- if (aNormalizedURL.getLength() != 0)
- _sURL = aNormalizedURL;
- else
- rc = osl::DirectoryItem::E_INVAL;
- }
- return rc;
- }
-
- // ---------------------------------------------------------------------------------------
-
- bool normalizeURL(rtl::OUString & _sURL, const uno::Reference<uno::XInterface>& pContext, bool bNothrow )
- throw (backend::InsufficientAccessRightsException, backend::BackendAccessException)
- {
- if (_sURL.getLength() == 0)
- return false;
-
- osl::DirectoryItem aDirItem;
-
- osl::DirectoryItem::RC rc = osl::DirectoryItem::get(_sURL, aDirItem);
-
- if (rc == osl::DirectoryItem::E_None)
- rc = implNormalizeURL(_sURL,aDirItem);
-
- switch (rc)
- {
- case osl::DirectoryItem::E_None: return true;
-
- case osl::DirectoryItem::E_NOENT: return true;
-
- case osl::DirectoryItem::E_ACCES:
- if (!bNothrow)
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("LocalBackend: Cannot normalize URL \"" );
- msg.append(_sURL);
- msg.appendAscii("\" - InsufficientAccess");
- throw backend::InsufficientAccessRightsException(msg.makeStringAndClear(),pContext,uno::Any());
- }
- return false;
-
- default:
- if (!bNothrow)
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("LocalBackend: Cannot normalize URL \"" );
- msg.append(_sURL);
- msg.appendAscii("\" - ").append(FileHelper::createOSLErrorString(rc));
- throw backend::BackendAccessException(msg.makeStringAndClear(),pContext,uno::Any());
- }
- return false;
-
- }
- }
-
- // ---------------------------------------------------------------------------------------
- static const sal_Unicode kComponentSeparator = '.' ;
- static const sal_Unicode kPathSeparator = '/' ;
-
- rtl::OUString componentToPath(const rtl::OUString& aComponent)
- {
- rtl::OUStringBuffer retCode ;
-
- retCode.append(kPathSeparator) ;
- retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- return retCode.makeStringAndClear() ;
- }
- //------------------------------------------------------------------------------
- rtl::OUString layeridToPath(const rtl::OUString& aLayerId)
- {
- sal_Int32 const nSplit = aLayerId.indexOf(k_cLayerIdSeparator);
- if (nSplit < 0)
- return componentToPath(aLayerId);
-
- rtl::OUString const aComponent= aLayerId.copy(0,nSplit);
- rtl::OUString const aSubid = aLayerId.copy(nSplit+1);
-
- rtl::OUStringBuffer retCode ;
-
- retCode.append(kPathSeparator) ;
- retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- retCode.append(kPathSeparator) ;
- retCode.append(aSubid) ;
- return retCode.makeStringAndClear() ;
- }
- //------------------------------------------------------------------------------
- bool checkOptionalArg(rtl::OUString& aArg)
- {
- if (aArg.getLength() && aArg[0] == sal_Unicode('?'))
- {
- aArg = aArg.copy(1);
- return true;
- }
- else
- {
- return false;
- }
- }
- //------------------------------------------------------------------------------
- void fillFromBlankSeparated(const rtl::OUString& aList,
- uno::Sequence<rtl::OUString>& aTarget)
- {
- std::vector<rtl::OUString> tokens ;
- sal_Int32 nextToken = 0 ;
-
- do {
- tokens.push_back(aList.getToken(0, ' ', nextToken)) ;
- } while (nextToken >= 0) ;
- if (tokens.size() > 0) {
- aTarget.realloc(tokens.size()) ;
- std::vector<rtl::OUString>::const_iterator token ;
- sal_Int32 i = 0 ;
-
- for (token = tokens.begin() ; token != tokens.end() ; ++ token) {
- aTarget [i ++] = *token ;
- }
- }
- }
- //------------------------------------------------------------------------------
- }
-} // namespace configmgr
diff --git a/configmgr/source/localbe/localfilehelper.hxx b/configmgr/source/localbe/localfilehelper.hxx
deleted file mode 100644
index 56610a9e73e6..000000000000
--- a/configmgr/source/localbe/localfilehelper.hxx
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
-
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <osl/file.hxx>
-
-
-namespace configmgr
-{
-
- namespace localbe
- {
- namespace css = com::sun::star ;
- namespace uno = css::uno ;
- namespace backend = css::configuration::backend ;
-
- /**
- Validates a file URL
-
- @param _sFileURL URL of the file to validate
- @return bool true if URL valid, false if URL invalid
- */
-
- bool isValidFileURL (rtl::OUString const& _sFileURL);
- /**
- Ensures Absolute URL
- @param _sFileURL URL of the file to validate
- @return bool true if URL is absolute URL,
- false if URL is not absolute URL
- */
-
- bool implEnsureAbsoluteURL(rtl::OUString & _sFileURL);
- /**
- Normalize URL
- @param _sFileURL URL of the file to validate
- @param aDirItem Directory Item
- @return RC error code
- */
-
- osl::DirectoryItem::RC implNormalizeURL(rtl::OUString & _sFileURL, osl::DirectoryItem& aDirItem);
- /**
- Normalize URL
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @param bNothrow param indicating that exception should not be thrown
- @return bool true if URL is normalized URL
- false if URL is not normalized URL
- */
-
-
- bool normalizeURL(rtl::OUString & _sFileURL,
- const uno::Reference<uno::XInterface>& pContext,
- bool bNothrow = false )
- throw (backend::InsufficientAccessRightsException,
- backend::BackendAccessException);
-
- /**
- Validates a file URL
-
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @throws css::configuration::InvalidBootstrapFileException
- */
- void validateFileURL(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext)
- throw(css::configuration::InvalidBootstrapFileException);
- /**
- Checks if a Directory exist for a given file URL
-
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @throws backend::BackendSetupException
- */
- void checkIfDirectory(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext )
- throw (backend::BackendSetupException);
- /**
- Checks if a File exist for a given file URL
- @param pContext pointer to context class
- @param _sFileURL URL of the file to validate
- @throws backend::CannotConnectException
- */
- void checkFileExists(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext)
- throw (backend::CannotConnectException);
-
- /**
- Convert Component name to Path name
- @param aComponent Component name
- */
- rtl::OUString componentToPath(const rtl::OUString& aComponent);
-
- /// character that can be used to delimit a sub-id within a layerid
- const sal_Unicode k_cLayerIdSeparator = ':';
- /**
- Convert layer id to Path name
- Format of layer id is <component> [:<sub-id>]
- @param aLayerId layer id
- */
- rtl::OUString layeridToPath(const rtl::OUString& aLayerId);
-
-
- /**
- Checks if Arguement is Optional
- @param aArg Argument
- @return bool returns true is Argument is Optional, false otherwise
- */
- bool checkOptionalArg(rtl::OUString& aArg);
-
- /*
- parses sequence of strings from blank separated list
- @param aList blank separated list
- @param aTarget sequence of parsed strings
- */
- void fillFromBlankSeparated(const rtl::OUString& aList,
- uno::Sequence<rtl::OUString>& aTarget);
-
- }
-}
-#endif
diff --git a/configmgr/source/localbe/localfilelayer.cxx b/configmgr/source/localbe/localfilelayer.cxx
deleted file mode 100644
index 68e570760a24..000000000000
--- a/configmgr/source/localbe/localfilelayer.cxx
+++ /dev/null
@@ -1,608 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localfilelayer.hxx"
-#include "localoutputstream.hxx"
-#include "oslstream.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-BasicLocalFileLayer::BasicLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: mFactory(xFactory)
-, mFileUrl(aComponentFile)
-{
- static const rtl::OUString kXMLLayerParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.LayerParser")) ;
-
- mLayerReader = uno::Reference<backend::XLayer>::query(
- mFactory->createInstance(kXMLLayerParser)) ;
-
-}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: BasicLocalFileLayer(xFactory,aComponentFile)
-{
-}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent)
-: BasicLocalFileLayer(xFactory,aBaseDir + aComponent)
-{
-}
-//------------------------------------------------------------------------------
-
-FlatLocalFileLayer::FlatLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent)
-: BasicLocalFileLayer(xFactory,aBaseDir + aComponent)
-, mLayerWriter( createLayerWriter() )
-{
-}
-//------------------------------------------------------------------------------
-
-BasicCompositeLocalFileLayer::BasicCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: BasicLocalFileLayer(xFactory,aComponentFile)
-{
-}
-//------------------------------------------------------------------------------
-
-CompositeLocalFileLayer::CompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories)
-: BasicCompositeLocalFileLayer(xFactory,rtl::OUString())
-{
- fillSubLayerLists(aSublayerDirectories, aComponent) ;
-}
-//------------------------------------------------------------------------------
-
-FullCompositeLocalFileLayer::FullCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories)
-: BasicCompositeLocalFileLayer(xFactory,aBaseDir + aComponent)
-, mLayerWriter( createLayerWriter() )
-{
- fillSubLayerLists(aSublayerDirectories, aComponent) ;
-}
-//------------------------------------------------------------------------------
-
-BasicLocalFileLayer::~BasicLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::~SimpleLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-FlatLocalFileLayer::~FlatLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-CompositeLocalFileLayer::~CompositeLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-FullCompositeLocalFileLayer::~FullCompositeLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayerHandler> BasicLocalFileLayer::createLayerWriter()
-{
- static const rtl::OUString kXMLLayerWriter(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.LayerWriter")) ;
-
- uno::Reference< uno::XInterface > xWriter = mFactory->createInstance(kXMLLayerWriter);
-
- return uno::Reference<backend::XLayerHandler>(xWriter,uno::UNO_REF_QUERY_THROW) ;
-}
-//------------------------------------------------------------------------------
-
-static inline void readEmptyLayer(const uno::Reference<backend::XLayerHandler>& xHandler)
-{
- OSL_ASSERT(xHandler.is());
- xHandler->startLayer();
- xHandler->endLayer();
-}
-//------------------------------------------------------------------------------
-
-void BasicLocalFileLayer::readData(
- backend::XLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aFileUrl)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot readData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,pContext);
- }
-
- osl::File blobFile(aFileUrl) ;
- osl::File::RC errorCode = blobFile.open(OpenFlag_Read) ;
-
- switch (errorCode)
- {
- case osl::File::E_None: // got it
- {
- uno::Reference<io::XActiveDataSink> xAS(mLayerReader, uno::UNO_QUERY_THROW);
-
- uno::Reference<io::XInputStream> xStream( new OSLInputStreamWrapper(blobFile) );
-
- xAS->setInputStream(xStream);
-
- mLayerReader->readData(xHandler) ;
- }
- break;
-
- case osl::File::E_NOENT: // no layer => empty layer
- readEmptyLayer(xHandler);
- break;
-
- default:
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFile Layer: Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(errorCode));
-
- io::IOException ioe(sMsg.makeStringAndClear(),pContext);
-
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(ioe.Message);
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),pContext,uno::makeAny(ioe));
- }
- }
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SimpleLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(this,xHandler, getFileUrl()) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FlatLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(this,xHandler, getFileUrl() ) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL CompositeLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot readData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
-
- readEmptyLayer(xHandler) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(static_cast<backend::XCompositeLayer*>(this),xHandler, getFileUrl() ) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL BasicCompositeLocalFileLayer::readSubLayerData(
- backend::XCompositeLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "CompositeLocalFileLayer - Cannot readSubLayerData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,pContext);
- }
-
- sal_Int32 i ;
-
- for (i = 0 ; i < mSubLayers.getLength() ; ++ i) {
- if (mSubLayers [i].equals(aSubLayerId)) { break ; }
- }
- if (i == mSubLayers.getLength())
- {
- rtl::OUStringBuffer message ;
-
- message.appendAscii("Sublayer Id '").append(aSubLayerId) ;
- message.appendAscii("' is unknown") ;
- throw lang::IllegalArgumentException(message.makeStringAndClear(),
- pContext, 2) ;
- }
- if (mSubLayerFiles[i].getLength() != 0)
- BasicLocalFileLayer::readData(pContext,xHandler, mSubLayerFiles [i]) ;
- else
- readEmptyLayer(xHandler);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL CompositeLocalFileLayer::readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- return BasicCompositeLocalFileLayer::readSubLayerData(this,xHandler,aSubLayerId);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- return BasicCompositeLocalFileLayer::readSubLayerData(this,xHandler,aSubLayerId);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FlatLocalFileLayer::replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!aNewLayer.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot replaceWith: Replacement layer is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
- OSL_ENSURE( !uno::Reference<backend::XCompositeLayer>::query(aNewLayer).is(),
- "Warning: correct updates with composite layers are not implemented");
-
- uno::Reference<io::XActiveDataSource> xAS(mLayerWriter, uno::UNO_QUERY_THROW);
-
- LocalOutputStream * pStream = new LocalOutputStream(getFileUrl());
- uno::Reference<io::XOutputStream> xStream( pStream );
-
- xAS->setOutputStream(xStream);
-
- aNewLayer->readData(mLayerWriter) ;
-
- pStream->finishOutput();
-
- // clear the output stream
- xStream.clear();
- xAS->setOutputStream(xStream);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!aNewLayer.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot replaceWith: Replacement layer is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
- OSL_ENSURE( !uno::Reference<backend::XCompositeLayer>::query(aNewLayer).is(),
- "Warning: correct updates with composite layers are not implemented");
-
- uno::Reference<io::XActiveDataSource> xAS(mLayerWriter, uno::UNO_QUERY_THROW);
-
- LocalOutputStream * pStream = new LocalOutputStream(getFileUrl());
- uno::Reference<io::XOutputStream> xStream( pStream );
-
- xAS->setOutputStream(xStream);
-
- aNewLayer->readData(mLayerWriter) ;
-
- pStream->finishOutput();
-
- // clear the output stream
- xStream.clear();
- xAS->setOutputStream(xStream);
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString BasicLocalFileLayer::getTimestamp(const rtl::OUString& aFileUrl)
-{
- TimeValue timevalue = {0,0};
- sal_uInt64 aSize = FileHelper::getModifyStatus(aFileUrl,timevalue) ;
- oslDateTime fileStamp ;
- rtl::OUString retCode ;
-
- if (osl_getDateTimeFromTimeValue(&timevalue, &fileStamp))
- {
- // truncate to 32 bits
- unsigned long aLongSize = static_cast<sal_Int32>(aSize);
-
- sal_Char asciiStamp [50] ;
-
- sprintf(asciiStamp, "%04u%02u%02u%02u%02u%02uZ%010lu",
- unsigned(fileStamp.Year), unsigned(fileStamp.Month), unsigned(fileStamp.Day),
- unsigned(fileStamp.Hours), unsigned(fileStamp.Minutes), unsigned(fileStamp.Seconds),
- aLongSize) ;
- retCode = rtl::OUString::createFromAscii(asciiStamp) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SimpleLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString FlatLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString FullCompositeLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-#if 0 // thus far composite layers are only manipulated via the main layer
- for (std::vector<rtl::OUString>::const_iterator it = mSubLayerFiles.begin();
- it != mSubLayerFiles.end();
- ++it)
- {
- rtl::OUString sSublayerTime = BasicLocalFileLayer::getTimestamp(*it);
- if (sStamp < sSublayerTime)
- sStamp = sSublayerTime;
- }
-#endif
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-void BasicCompositeLocalFileLayer::fillSubLayerLists( const std::vector<rtl::OUString>& aSublayerDirectories,
- const rtl::OUString& aComponent)
-{
- std::vector<rtl::OUString>::size_type const nSublayerCount = aSublayerDirectories.size();
- mSubLayers.realloc(nSublayerCount);
- mSubLayerFiles.resize(nSublayerCount);
-
- for (std::vector<rtl::OUString>::size_type i = 0; i < nSublayerCount; ++i)
- {
- mSubLayers[i] = FileHelper::getFileName(aSublayerDirectories[i]);
-
- // Let's check whether the sublayer exists for the
- // particular component.
- rtl::OUString subLayerFile(aSublayerDirectories[i] + aComponent) ;
- if (FileHelper::fileExists(subLayerFile))
- {
- mSubLayerFiles[i] = subLayerFile;
- }
- else
- OSL_ASSERT(mSubLayerFiles[i].getLength() == 0);
- }
-}
-//------------------------------------------------------------------------------
-
-static bool findSubLayers(const rtl::OUString& aResDir,
- std::vector<rtl::OUString>& aSublayerDirectories)
-{
- if (aResDir.getLength() == 0) return false;
-
- // Extract the directory where the file is located
- osl::Directory directory(aResDir) ;
- if (directory.open() != osl::Directory::E_None) return false;
-
- osl::DirectoryItem item ;
- osl::FileStatus status(osl_FileStatus_Mask_Type |
- osl_FileStatus_Mask_FileURL) ;
-
- while (directory.getNextItem(item) == osl::Directory::E_None)
- {
- if (item.getFileStatus(status) == osl::Directory::E_None)
- {
- if (status.getFileType() == osl::FileStatus::Directory)
- {
- aSublayerDirectories.push_back(status.getFileURL()) ;
- }
- }
- }
- return !aSublayerDirectories.empty();
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> createReadonlyLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir)
-{
- uno::Reference<backend::XLayer> xResult;
-
- std::vector<rtl::OUString> aSublayers;
- if (aBaseDir.getLength() == 0)
- {
- findSubLayers(aResDir,aSublayers);
- xResult.set( new CompositeLocalFileLayer(xFactory,aComponent,aSublayers) );
- }
- else if (findSubLayers(aResDir,aSublayers))
- {
- // there is no readonly full composite layer - take the updatable one
- backend::XCompositeLayer * pNewLayer =
- new FullCompositeLocalFileLayer(xFactory,aBaseDir,aComponent,aSublayers);
- xResult.set( pNewLayer );
- }
- else
- {
- xResult.set( new SimpleLocalFileLayer(xFactory,aBaseDir,aComponent) );
- }
- return xResult;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> createUpdatableLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir)
-{
- uno::Reference<backend::XUpdatableLayer> xResult;
-
- std::vector<rtl::OUString> aSublayers;
- if (findSubLayers(aResDir,aSublayers))
- {
- xResult.set( new FullCompositeLocalFileLayer(xFactory,aBaseDir,aComponent,aSublayers) );
- }
- else if (aBaseDir.getLength() != 0)
- {
- xResult.set( new FlatLocalFileLayer(xFactory,aBaseDir,aComponent) );
- }
- else
- OSL_ENSURE(false,"WARNING: Trying to create an updatable ressource-only layer");
-
- return xResult;
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-enum
-{
- LAYER_PROPERTY_URL = 1
-};
-
-#define PROPNAME( name ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( name ) )
-#define PROPTYPE( type ) getCppuType( static_cast< type const *>( 0 ) )
-
-// cppu::OPropertySetHelper
-cppu::IPropertyArrayHelper * SAL_CALL LayerPropertyHelper::newInfoHelper()
-{
- com::sun::star::beans::Property properties[] =
- {
- com::sun::star::beans::Property(PROPNAME("URL"), LAYER_PROPERTY_URL, PROPTYPE(rtl::OUString), com::sun::star::beans::PropertyAttribute::READONLY)
- };
-
- return new cppu::OPropertyArrayHelper(properties, sizeof(properties)/sizeof(properties[0]));
-}
-
-#define MESSAGE( text ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Layer Properties: " text ) )
-
-void SAL_CALL LayerPropertyHelper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& /*rValue*/ )
- throw (uno::Exception)
-{
- namespace beans = com::sun::star::beans;
-
- switch (nHandle)
- {
- case LAYER_PROPERTY_URL:
- OSL_ENSURE(false, "Error: trying to set a READONLY property");
- throw beans::PropertyVetoException(MESSAGE("Property 'URL' is read-only"),*this);
-
- default:
- OSL_ENSURE(false, "Error: trying to set an UNKNOWN property");
- throw beans::UnknownPropertyException(MESSAGE("Trying to set an unknown property"),*this);
- }
-}
-
-void SAL_CALL LayerPropertyHelper::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const
-{
- switch (nHandle)
- {
- case LAYER_PROPERTY_URL:
- rValue = uno::makeAny( this->getLayerUrl() );
- break;
-
- default:
- OSL_ENSURE(false, "Error: trying to get an UNKNOWN property");
- break;
- }
-}
-
-//------------------------------------------------------------------------------
-} } // configmgr.localbe
-
diff --git a/configmgr/source/localbe/localfilelayer.hxx b/configmgr/source/localbe/localfilelayer.hxx
deleted file mode 100644
index d370e1b212b0..000000000000
--- a/configmgr/source/localbe/localfilelayer.hxx
+++ /dev/null
@@ -1,492 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XCompositeLayer.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef VECTOR_INCLUDED_
-#define VECTOR_INCLUDED_
-#include <vector>
-#endif // VECTOR_INCLUDED_
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace util = css::util ;
-namespace backend = css::configuration::backend ;
-
-/**
- Basic Implementation of the readonly XLayer interfaces for a local file access.
- The read data is accessible through a canned implementation of an XML parser.
- The layer is defined by the URL of the file containing its contents.
- */
-class BasicLocalFileLayer
-{
-protected :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponentFile path describing the component file
- */
- BasicLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile) ;
- /** Destructor */
- ~BasicLocalFileLayer() ;
-
-protected :
- /**
- Describes the contents of a particular file to a handler.
-
- @param xHandler handler to describe the data to
- @param aFileUrl URL of the file
- @throws com::sun::star::configuration::backend::MalformedDataException
- if the file contains invalid data.
- @throws com::sun::star::lang::NullPointerException
- if pContext is NULL.
- @throws com::sun::star::lang::WrappedTargetException
- if an error occurs while accessing the data.
- */
- void readData(backend::XLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aFileUrl)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- /**
- Returns an object that can be used to write a layer.
- */
- uno::Reference<backend::XLayerHandler> createLayerWriter();
-
-public:
- /**
- Returns a timestamp associated to a file defined by its URL.
-
- @param aFileUrl URL of the file
- @return timestamp
- */
- static rtl::OUString getTimestamp(const rtl::OUString& aFileUrl) ;
-
- rtl::OUString const & getFileUrl() const { return mFileUrl; };
-
-private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> const mFactory ;
- /** URL of the file being accessed */
- rtl::OUString const mFileUrl ;
- /** XLayer implementation used for readData */
- uno::Reference<backend::XLayer> mLayerReader ;
-
-} ;
-
-// provides properties for file layers
-class LayerPropertyHelper : public apihelper::PropertySetHelper
-{
-protected:
- LayerPropertyHelper(){};
- virtual ~LayerPropertyHelper(){};
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const = 0;
-
-protected:
- // cppu::OPropertySetHelper
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper();
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception);
-
- using PropertySetHelper::getFastPropertyValue;
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const;
-
-};
-
-/**
- Implementation of the readonly XLayer interfaces for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents.
- */
-class SimpleLocalFileLayer : public BasicLocalFileLayer
- , public cppu::ImplInheritanceHelper2< LayerPropertyHelper,
- backend::XLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponentFile URL describing the component file
- */
- SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile) ;
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- */
- SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent) ;
-
- /** Destructor */
- ~SimpleLocalFileLayer() ;
-
- // XLayer
- using BasicLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-} ;
-
-/**
- Implementation of the XUpdatableLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser, and the write data is defined through a canned
- implementation of an XML writer.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class FlatLocalFileLayer : public BasicLocalFileLayer
- , public cppu::ImplInheritanceHelper2< LayerPropertyHelper,
- backend::XUpdatableLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- */
- FlatLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent) ;
- /** Destructor */
- ~FlatLocalFileLayer(void) ;
-
- // XLayer
- using BasicLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XUpdatableLayer
- virtual void SAL_CALL replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-
-private :
- /** XLayerHandler implementation for getWriteHandler */
- uno::Reference<backend::XLayerHandler> mLayerWriter ;
-
-} ;
-
-/**
- Implementation of the XCompositeLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class BasicCompositeLocalFileLayer : public BasicLocalFileLayer
-{
-protected:
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponent path describing the component file
- */
- BasicCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent) ;
-
- // XCompositeLayer helpers
- uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return mSubLayers ; }
-
- void SAL_CALL readSubLayerData(
- backend::XCompositeLayer * context,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
- /**
- Fills the list of available sublayers.
-
- @param aResDir resource directory containing potential sublayers
- @param aComponent component subpath
- */
- void fillSubLayerLists(const std::vector<rtl::OUString>& aSublayerDirectories,
- const rtl::OUString& aComponent) ;
-private :
- /** List of available sublayers... */
- uno::Sequence<rtl::OUString> mSubLayers ;
- /** .. and the corresponding file URLs. */
- std::vector<rtl::OUString> mSubLayerFiles ;
-
-};
-
-/**
- Implementation of the XCompositeLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class CompositeLocalFileLayer : public BasicCompositeLocalFileLayer
- , public cppu::WeakImplHelper1< backend::XCompositeLayer>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
- CompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories) ;
- /** Destructor */
- ~CompositeLocalFileLayer(void) ;
- // XLayer
- using BasicCompositeLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XCompositeLayer
- virtual uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return BasicCompositeLocalFileLayer::listSubLayerIds() ; }
-
- using BasicCompositeLocalFileLayer::readSubLayerData;
- virtual void SAL_CALL readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
-private :
- // not implemented: warn of attempts to use this here
- void getFileUrl() const;
-} ;
-/**
- Implementation of the XUpdatableLayer and XCompositeLayer
- interfaces for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser, and the write data is defined through a canned
- implementation of an XML writer.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class FullCompositeLocalFileLayer : public BasicCompositeLocalFileLayer
- , public cppu::ImplInheritanceHelper3<
- LayerPropertyHelper,
- backend::XUpdatableLayer,
- backend::XCompositeLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
- FullCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories) ;
- /** Destructor */
- ~FullCompositeLocalFileLayer(void) ;
- // XLayer
- using BasicCompositeLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XUpdatableLayer
- virtual void SAL_CALL replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XCompositeLayer
- virtual uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return BasicCompositeLocalFileLayer::listSubLayerIds() ; }
-
- using BasicCompositeLocalFileLayer::readSubLayerData;
- virtual void SAL_CALL readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-
-private :
- /** XLayerHandler implementation for getWriteHandler */
- uno::Reference<backend::XLayerHandler> mLayerWriter ;
-} ;
-/**
- Factory function to create the appropriate Flat- or Composite-
- LocalFileLayer for a set of parameters.
-
- Arguments provide the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
-uno::Reference<backend::XLayer> createReadonlyLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir) ;
-
-/**
- Factory function to create the appropriate Flat- or Composite-
- LocalFileLayer for a set of parameters.
-
- Arguments provide the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
-uno::Reference<backend::XUpdatableLayer> createUpdatableLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir) ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.cxx b/configmgr/source/localbe/localhierarchybrowsersvc.cxx
deleted file mode 100644
index 4480e6a66d71..000000000000
--- a/configmgr/source/localbe/localhierarchybrowsersvc.cxx
+++ /dev/null
@@ -1,533 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localhierarchybrowsersvc.hxx"
-#include "localsinglebackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include <algorithm>
-// -----------------------------------------------------------------------------
-
-#define OUSTRING( constascii ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(constascii))
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aLocalHierarchyBrowserServices[] =
-{
- "com.sun.star.configuration.backend.LocalHierarchyBrowser",
- 0,
- "com.sun.star.configuration.backend.HierarchyBrowser",
- 0
-};
-const ServiceImplementationInfo aLocalHierarchyBrowserSI =
-{
- "com.sun.star.comp.configuration.backend.LocalHierarchyBrowser",
- aLocalHierarchyBrowserServices,
- aLocalHierarchyBrowserServices + 3
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLocalHierarchyBrowserServiceInfo()
-{ return getRegistrationInfo(& aLocalHierarchyBrowserSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper LocalHierarchyBrowserService::getServiceInfo()
-{
- return & aLocalHierarchyBrowserSI;
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateLocalHierarchyBrowser
-( uno::Reference< uno::XComponentContext > const& rServiceManager )
-{
- return * new LocalHierarchyBrowserService( rServiceManager );
-}
-// -----------------------------------------------------------------------------
-
-LocalHierarchyBrowserService::LocalHierarchyBrowserService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context"));
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LocalHierarchyBrowserService::~LocalHierarchyBrowserService()
-{}
-// -----------------------------------------------------------------------------
-
-namespace
-{
- struct JobDesc
- {
- explicit JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments);
-
- enum Mode { findNone, findSchemas, findLayers };
- enum Result { getDefault,getUrls, getNames };
-
- rtl::OUString aBaseDataUrl;
- uno::Sequence< rtl::OUString > aExcludeList;
- Mode mode;
- Result result_type;
- };
-
- JobDesc::JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments)
- : aBaseDataUrl()
- , aExcludeList()
- , mode(findNone)
- , result_type(getDefault)
- {
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage = OUSTRING("Too many arguments for LocalHierarchyBrowser Job");
- throw lang::IllegalArgumentException(sMessage,pJob,0);
- }
-
- for (sal_Int16 i=0; i < nCount; ++i)
- {
- sal_Bool bKnown = false;
- sal_Bool bGood = false;
-
- if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SchemaDataUrl")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aBaseDataUrl);
- mode = (bGood && aBaseDataUrl.getLength()) ? findSchemas : findNone;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerDataUrl")))
- {
- bKnown = true;
-
- rtl::OUString aLayerBaseUrl;
- bGood = (aArguments[i].Value >>= aLayerBaseUrl);
-
- if (aLayerBaseUrl.getLength())
- {
- rtl::OUString aLocalizedSubDir;
- LocalSingleBackend::getLayerSubDirectories(aLayerBaseUrl,this->aBaseDataUrl,aLocalizedSubDir);
-
- mode = findLayers;
- }
- else
- {
- mode = findNone;
- }
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExcludeComponents")))
- {
- bKnown = true;
-
- sal_Int32 const nNextIndex = aExcludeList.getLength();
-
- switch (aArguments[i].Value.getValueTypeClass())
- {
- case uno::TypeClass_STRING:
- {
- rtl::OUString aComponent;
- bGood = (aArguments[i].Value >>= aComponent);
-
- OSL_ASSERT(bGood);
-
- aExcludeList.realloc(nNextIndex + 1);
- aExcludeList[nNextIndex] = aComponent;
- }
- break;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Sequence<rtl::OUString> aComponentList;
- bGood = (aArguments[i].Value >>= aComponentList);
-
- if (bGood)
- {
- sal_Int32 const nCompListCount = aComponentList.getLength();
- aExcludeList.realloc(nNextIndex + nCompListCount);
-
- rtl::OUString const * pSrc = aComponentList.getConstArray();
- std::copy(pSrc,pSrc+nCompListCount,aExcludeList.getArray());
- }
- }
- break;
-
- default:
- OSL_ASSERT(!bGood);
- break;
- }
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FetchComponentNames")))
- {
- sal_Bool bComponents = sal_False;
-
- bKnown = true;
- if (aArguments[i].Value.hasValue())
- {
- bGood = (aArguments[i].Value >>= bComponents);
- if (bGood) result_type = bComponents ? getNames : getUrls;
- }
- else
- {
- bGood = true;
- result_type = getDefault;
- }
- }
-
- if (!bGood)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalHierarchyBrowser - Illegal argument: ");
- if (bKnown)
- sMsg.appendAscii("Wrong value type for argument '");
- else
- sMsg.appendAscii("Unknown argument '");
-
- sMsg.append(aArguments[i].Name).appendAscii("'.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,i+1);
- }
- }
- if (findNone == mode)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalHierarchyBrowser - Missing argument: ");
- sMsg.appendAscii("No data URL available");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,0);
- }
- if (getDefault == result_type)
- result_type = (mode == findSchemas) ? getNames : getUrls;
-
- }
-
- static
- inline
- rtl::OUString getDataFileExtension(JobDesc::Mode mode)
- {
- switch (mode)
- {
- case JobDesc::findSchemas: return OUSTRING(".xcs");
- case JobDesc::findLayers: return OUSTRING(".xcu");
- default: OSL_ASSERT(false); return rtl::OUString();
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-// XJob
-
-uno::Any SAL_CALL
- LocalHierarchyBrowserService::execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
-{
- JobDesc const aJob(this,Arguments);
-
- OSL_ASSERT(JobDesc::getUrls == aJob.result_type || JobDesc::getNames == aJob.result_type);
-
- uno::Sequence< rtl::OUString > (LocalHierarchyBrowserService::* const find)( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList) = (JobDesc::getUrls == aJob.result_type) ?
- &LocalHierarchyBrowserService::findLocalComponentUrls :
- &LocalHierarchyBrowserService::findLocalComponentNames;
-
- uno::Sequence< rtl::OUString > aComponents = (this->*find)(aJob.aBaseDataUrl,getDataFileExtension(aJob.mode), aJob.aExcludeList);
-
- return uno::makeAny(aComponents);
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- LocalHierarchyBrowserService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- LocalHierarchyBrowserService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- LocalHierarchyBrowserService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-#include "filehelper.hxx"
-#include <osl/file.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <vector>
-// -----------------------------------------------------------------------------
-
- namespace uno = com::sun::star::uno;
- // -----------------------------------------------------------------------------
-
- #define OSL_VERIFY_RC( expr ) OSL_VERIFY( (expr) == osl::FileBase::E_None )
- //------------------------------------------------------------------------------
- static
- inline
- bool matchesExtension( rtl::OUString const & aFileName, rtl::OUString const & aExt )
- {
- sal_Int32 const nExtStart = aFileName.getLength() - aExt.getLength();
- return nExtStart > 0 && !!aFileName.copy(nExtStart).equalsIgnoreAsciiCase(aExt);
- }
- //------------------------------------------------------------------------------
- static
- inline
- rtl::OUString stripExtension( rtl::OUString const & aFileName, rtl::OUString const & aExt )
- {
- OSL_PRECOND( matchesExtension(aFileName,aExt), "File name doesn't have expected extension");
-
- sal_Int32 const nExtStart = aFileName.getLength() - aExt.getLength();
- return aFileName.copy(0,nExtStart);
- }
-//------------------------------------------------------------------------------
- static
- inline
- bool matchesExtension( osl::FileStatus const & aFileDescriptor, rtl::OUString const & aExt )
- {
- OSL_PRECOND( aFileDescriptor.isValid(FileStatusMask_Type | FileStatusMask_FileName),
- "Not all required file-status fields available for filter" );
-
- if (aFileDescriptor.getFileType() != osl::FileStatus::Regular)
- return false;
-
- return matchesExtension(aFileDescriptor.getFileName(),aExt);
- }
-//------------------------------------------------------------------------------
-
- static
- bool makeAbsoluteURL(rtl::OUString & rURL )
- {
- rtl::OUString aBaseDir; tools::getProcessWorkingDir(&aBaseDir);
-
- osl::File::RC errcode = osl::File::getAbsoluteFileURL(aBaseDir,rURL,rURL);
-
- return osl::File::E_None == errcode;
- }
-//------------------------------------------------------------------------------
- static
- inline
- bool getNextDirectoryItem(osl::Directory & aDirectory, osl::DirectoryItem & aItem, osl::Directory::RC & errcode)
- {
- switch (errcode = aDirectory.getNextItem(aItem))
- {
- case osl::Directory::E_None:
- return true;
-
- case osl::Directory::E_NOENT:
- errcode = osl::Directory::E_None;
- return false;
-
- default:
- return false;
- }
- }
-//------------------------------------------------------------------------------
- static inline bool isExcluded(rtl::OUString const & aName, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- for (sal_Int32 i = 0; i<aExcludeList.getLength(); ++i)
- {
- if (aExcludeList[i].equals(aName)) return true;
- }
- return false;
- }
-//------------------------------------------------------------------------------
- static
- osl::FileBase::RC findComponents( std::vector<rtl::OUString> * componentNames, std::vector<rtl::OUString> * componentUrls,
- rtl::OUString const& aDirectoryPath, rtl::OUString const& aComponentExtension,
- rtl::OUString const& aPackagePrefix, rtl::OUString const & aComponentSeparator,
- uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- static sal_Unicode const chDirSep = '/';
- static rtl::OUString const sDirectorySeparator(&chDirSep,1);
-
- osl::Directory aDirectory(aDirectoryPath);
-
- osl::Directory::RC errcode = aDirectory.open();
-
- if (errcode == osl::Directory::E_None)
- {
- sal_uInt32 n_STATUS_FIELDS = FileStatusMask_Type | FileStatusMask_FileName;
- if (componentUrls) n_STATUS_FIELDS |= FileStatusMask_FileURL;
-
- osl::DirectoryItem aItem;
- while( getNextDirectoryItem(aDirectory,aItem,errcode) )
- {
-
- osl::FileStatus aItemDescriptor( n_STATUS_FIELDS );
- errcode = aItem.getFileStatus(aItemDescriptor);
-
- if ( errcode != osl::DirectoryItem::E_None )
- {
- OSL_TRACE("Locating Configuration Components - Error (%u) getting status of directory item - skipping\n", unsigned(errcode));
- continue;
- }
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_Type), "Could not get type of directory item");
-
- if (aItemDescriptor.getFileType() == osl::FileStatus::Directory)
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of subdirectory");
-
- rtl::OUString const aSubdirName = aItemDescriptor.getFileName();
- rtl::OUString const aSubdirPath = aDirectoryPath + sDirectorySeparator + aSubdirName;
- rtl::OUString const aSubpackagePrefix = aPackagePrefix + aSubdirName + aComponentSeparator;
- // recurse
- if (!isExcluded(aSubpackagePrefix,aExcludeList))
- OSL_VERIFY_RC( findComponents( componentNames, componentUrls,
- aSubdirPath, aComponentExtension,
- aSubpackagePrefix, aComponentSeparator,
- aExcludeList) );
- }
- else if (matchesExtension(aItemDescriptor,aComponentExtension))
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of component found");
-
- rtl::OUString const aComponentName = stripExtension( aItemDescriptor.getFileName(), aComponentExtension );
- rtl::OUString const aFullComponentName = aPackagePrefix + aComponentName;
-
- if (!isExcluded(aFullComponentName,aExcludeList))
- {
- if (componentNames)
- {
- componentNames->push_back(aFullComponentName);
- }
-
- if (componentUrls)
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileURL), "Could not get URL of component found");
-
- componentUrls->push_back(aItemDescriptor.getFileURL());
- }
- }
- }
- }
- aDirectory.close();
- }
- return errcode;
- }
-// -----------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > configmgr::localbe::LocalHierarchyBrowserService::findLocalComponentNames( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- rtl::OUString aBaseDirectory(_aBaseDirectory);
- OSL_VERIFY( makeAbsoluteURL(aBaseDirectory) );
-
- static const sal_Unicode chPkgSep = '.';
-
- std::vector< rtl::OUString > components;
-
- osl::Directory::RC errcode = findComponents(&components, NULL,
- aBaseDirectory, _aComponentFileExtension,
- rtl::OUString(), rtl::OUString(&chPkgSep,1),
- aExcludeList );
-
- if (errcode != osl::Directory::E_None)
- {
- OSL_TRACE("Locating Configuration Components failed - Error (%u) trying to locate files\n", unsigned(errcode));
-
- if (errcode != osl::Directory::E_NOENT)
- {
- rtl::OUString sMsg = OUSTRING("LocalHierarchyBrowser - IO Error while scanning for components: ") +
- FileHelper::createOSLErrorString(errcode);
-
- throw com::sun::star::io::IOException(sMsg,*this);
- }
- }
-
- return uno::Sequence< rtl::OUString >(&components.front(),components.size());
- }
-// -----------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > configmgr::localbe::LocalHierarchyBrowserService::findLocalComponentUrls( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- rtl::OUString aBaseDirectory(_aBaseDirectory);
- OSL_VERIFY( makeAbsoluteURL(aBaseDirectory) );
-
- static const sal_Unicode chPkgSep = '.';
-
- std::vector< rtl::OUString > components;
-
- osl::Directory::RC errcode = findComponents(NULL, &components,
- aBaseDirectory, _aComponentFileExtension,
- rtl::OUString(), rtl::OUString(&chPkgSep,1),
- aExcludeList );
-
- if (errcode != osl::Directory::E_None)
- {
- OSL_TRACE("Locating Configuration Components failed - Error (%u) trying to locate files\n", unsigned(errcode));
-
- if (errcode != osl::Directory::E_NOENT)
- {
- rtl::OUString sMsg = OUSTRING("LocalHierarchyBrowser - IO Error while scanning for component files: ") +
- FileHelper::createOSLErrorString(errcode);
-
- throw com::sun::star::io::IOException(sMsg,*this);
- }
- }
-
- return uno::Sequence< rtl::OUString >(&components.front(),components.size());
- }
-//------------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.hxx b/configmgr/source/localbe/localhierarchybrowsersvc.hxx
deleted file mode 100644
index 4aee8e2483e5..000000000000
--- a/configmgr/source/localbe/localhierarchybrowsersvc.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_BROWSERSVC_HXX
-#define CONFIGMGR_LOCALBE_BROWSERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase2.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/task/XJob.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace task = ::com::sun::star::task;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
-
- class LocalHierarchyBrowserService : public ::cppu::WeakImplHelper2<
- task::XJob,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- LocalHierarchyBrowserService(uno::Reference< uno::XComponentContext > const & _xContext);
- ~LocalHierarchyBrowserService();
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XJob
- virtual uno::Any SAL_CALL
- execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException);
-
- private:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- uno::Sequence< rtl::OUString > findLocalComponentNames( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList);
- uno::Sequence< rtl::OUString > findLocalComponentUrls( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList);
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace localbe
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/localbe/localmultistratum.cxx b/configmgr/source/localbe/localmultistratum.cxx
deleted file mode 100644
index 6309921f3d85..000000000000
--- a/configmgr/source/localbe/localmultistratum.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localmultistratum.hxx"
-#include "localfilehelper.hxx"
-#include "filehelper.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-static inline
-rtl::OUString const & impl_getLayerDataDirectory(rtl::OUString const & aLayerBaseUrl)
-{ return aLayerBaseUrl; }
-//------------------------------------------------------------------------------
-static //inline
-rtl::OUString makeLayerId(rtl::OUString const & aComponent,rtl::OUString const & aParticleFile)
-{
- OSL_ASSERT(aParticleFile.endsWithIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(kLocalDataSuffix)));
- const sal_Int32 kExtLength = RTL_CONSTASCII_LENGTH(kLocalDataSuffix);
- rtl::OUString const aParticleName = aParticleFile.copy(0,aParticleFile.getLength() - kExtLength);
-
- rtl::OUStringBuffer aLayerId(aComponent);
- aLayerId.append(k_cLayerIdSeparator);
- aLayerId.append(aParticleName);
-
- return aLayerId.makeStringAndClear();
-}
-
-LocalMultiStratum::LocalMultiStratum(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XMultiLayerStratum >(xContext)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalMultiStratum::~LocalMultiStratum() {}
-
-//------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL
- LocalMultiStratum::listLayerIds( const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/ )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- rtl::OUString const aLayerUrl = impl_getLayerDataDirectory(getBaseUrl());
- rtl::OUString const aComponentUrl = aLayerUrl + componentToPath(aComponent);
-
- const sal_uInt32 k_STATUS_FIELDS = FileStatusMask_Type | FileStatusMask_FileName;
- osl::Directory aComponentDirectory(aComponentUrl);
- osl::DirectoryItem aItem;
- std::vector< rtl::OUString > aResult;
-
- osl::Directory::RC errcode = aComponentDirectory.open();
- switch (errcode)
- {
- case osl::Directory::E_NOENT:
- return uno::Sequence< rtl::OUString >();
-
- case osl::Directory::E_None:
- while (osl::Directory::E_None == (errcode=aComponentDirectory.getNextItem(aItem)))
- {
- osl::FileStatus aItemDescriptor( k_STATUS_FIELDS );
- errcode = aItem.getFileStatus(aItemDescriptor);
-
- if ( errcode != osl::DirectoryItem::E_None )
- {
- OSL_ASSERT(errcode != osl::Directory::E_NOENT); // unexpected failure for getFileStatus for existing file
- if (errcode == osl::Directory::E_NOENT) continue;
-
- OSL_TRACE("Reading Component Directory - Error (%u) getting status of directory item.\n", unsigned(errcode));
- break;
- }
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_Type), "Could not get type of directory item");
- if (aItemDescriptor.getFileType() != osl::FileStatus::Regular)
- continue;
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of component found");
- rtl::OUString const aFileName = aItemDescriptor.getFileName();
- if (!aFileName.endsWithIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(kLocalDataSuffix)))
- continue;
-
- aResult.push_back( makeLayerId(aComponent,aFileName) );
- }
- OSL_ASSERT(errcode != osl::Directory::E_None); // Loop postcond
-
- // joint error handling with open failure
- if (errcode != osl::Directory::E_NOENT) // normal loop termination
- {
- default: // if open() truly failed we also go here
- rtl::OUStringBuffer errbuf;
- errbuf.appendAscii("LocalMultiStratum::listLayerIds: ");
- errbuf.appendAscii("Error scanning directory ").append(aComponentUrl)
- .appendAscii(" for particle files. ");
- errbuf.appendAscii("Error: ").append(FileHelper::createOSLErrorString(errcode));
- rtl::OUString const errmsg = errbuf.makeStringAndClear();
- throw backend::BackendAccessException(errmsg,*this,uno::Any());
- }
-
- return aResult.empty()
- ? uno::Sequence< rtl::OUString >()
- : uno::Sequence< rtl::OUString >(
- &aResult.front(), static_cast<sal_Int32>(aResult.size()));
- }
-}
-
-//------------------------------------------------------------------------------
-rtl::OUString SAL_CALL
- LocalMultiStratum::getUpdateLayerId( const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/ )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException)
-{
- failReadonly();
- return aComponent;
-}
-
-//------------------------------------------------------------------------------
-uno::Reference< backend::XLayer > SAL_CALL
- LocalMultiStratum::getLayer( const rtl::OUString& aLayerId,
- const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return LocalStratumBase::getLayer(aLayerId,aTimestamp);
-}
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- LocalMultiStratum::getLayers( const uno::Sequence< rtl::OUString >& aLayerIds,
- const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 const nLayers = aLayerIds.getLength();
- uno::Sequence< uno::Reference< backend::XLayer > > aResult(nLayers);
- for (sal_Int32 ix=0; ix<nLayers; ++ix)
- {
- aResult[ix] = LocalStratumBase::getLayer(aLayerIds[ix],aTimestamp);
- }
- return aResult;
-}
-
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- LocalMultiStratum::getMultipleLayers( const uno::Sequence< rtl::OUString >& aLayerIds,
- const uno::Sequence< rtl::OUString >& aTimestamps )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (aLayerIds.getLength() != aTimestamps.getLength()) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalStratum::getMultipleLayers(): Timestamp count does not match layer count")),
- *this, 0) ;
- }
- sal_Int32 const nLayers = aLayerIds.getLength();
- uno::Sequence< uno::Reference< backend::XLayer > > aResult(nLayers);
- for (sal_Int32 ix=0; ix<nLayers; ++ix)
- {
- aResult[ix] = LocalStratumBase::getLayer(aLayerIds[ix],aTimestamps[ix]);
- }
- return aResult;
-}
-
-//------------------------------------------------------------------------------
-uno::Reference< backend::XUpdatableLayer > SAL_CALL
- LocalMultiStratum::getUpdatableLayer( const rtl::OUString& /*aLayerId*/ )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-//------------------------------------------------------------------------------
-
-void LocalMultiStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- aLayerUrl = impl_getLayerDataDirectory(getBaseUrl());
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kMultiStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalMultiStratum" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.MultiStratum" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalMultiStratum" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kMultiStratumServiceInfo = { kMultiStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalMultiStratumServiceInfo()
-{ return getRegistrationInfo(&kMultiStratumServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalMultiStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalMultiStratum(xContext) ;
-}
-
-//------------------------------------------------------------------------------
-
-const ServiceImplementationInfo * LocalMultiStratum::getServiceInfoData() const
-{
- return &kMultiStratumServiceInfo;
-}
-//------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localmultistratum.hxx b/configmgr/source/localbe/localmultistratum.hxx
deleted file mode 100644
index 1011f8073ae2..000000000000
--- a/configmgr/source/localbe/localmultistratum.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALMULTISTRATUM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALMULTISTRATUM_HXX_
-
-#include "localstratumbase.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
- namespace localbe
- {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the MultiLayerStratum service for local file access.
- */
-class LocalMultiStratum : public cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XMultiLayerStratum >
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalMultiStratum(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalMultiStratum() ;
-
-
- // XMultiLayerStratum
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- listLayerIds( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getUpdateLayerId( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Reference< backend::XLayer > SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- getLayers( const uno::Sequence< rtl::OUString >& aLayerIds, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- getMultipleLayers( const uno::Sequence< rtl::OUString >& aLayerIds, const uno::Sequence< rtl::OUString >& aTimestamps )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Reference< backend::XUpdatableLayer > SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException);
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-} ;
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/localoutputstream.cxx b/configmgr/source/localbe/localoutputstream.cxx
deleted file mode 100644
index e2cac20ed2e8..000000000000
--- a/configmgr/source/localbe/localoutputstream.cxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localoutputstream.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalOutputStream::LocalOutputStream(const rtl::OUString& aFileUrl)
- throw (backend::BackendAccessException, uno::RuntimeException)
-: mFileUrl(aFileUrl)
-, mTemporaryFileUrl(mFileUrl)
-, mWriteFile(NULL)
-{
- // First, ensure the directory where the file is supposed to be
- // put exists.
- mTemporaryFileUrl += rtl::OUString::createFromAscii("_tmp") ;
- rtl::OUString parentDirectory = FileHelper::getParentDir(aFileUrl) ;
-
- if (osl::File::RC errorCode = FileHelper::mkdirs(parentDirectory))
- {
- rtl::OUStringBuffer message ;
- message.appendAscii("Cannot create directory \"") ;
- message.append(parentDirectory).appendAscii("\". Error is ") ;
- message.append(FileHelper::createOSLErrorString(errorCode));
- message.appendAscii(" [").append(sal_Int32(errorCode)).appendAscii("].") ;
-
- rtl::OUString const sIOMsg = message.makeStringAndClear();
- uno::Any ioe = uno::makeAny(io::IOException(sIOMsg,0));
-
- switch (errorCode)
- {
- case osl::File::E_ACCES:
- case osl::File::E_ROFS:
- message.appendAscii("Configuration LocalOutputStream - No Write Access: ");
- message.append(sIOMsg);
- throw backend::InsufficientAccessRightsException(message.makeStringAndClear(), NULL, ioe) ;
-
- case osl::File::E_None: OSL_ASSERT(!"can't happen");
- default:
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.append(sIOMsg);
- throw backend::BackendAccessException(message.makeStringAndClear(), NULL, ioe) ;
- }
- }
-
- osl::File::remove(mTemporaryFileUrl) ;
- mWriteFile = new osl::File(mTemporaryFileUrl) ;
-
- if (osl::File::RC errorCode = mWriteFile->open(OpenFlag_Write | OpenFlag_Create) )
- {
- delete mWriteFile, mWriteFile = NULL;
-
- rtl::OUStringBuffer message ;
- message.appendAscii("Cannot open file \"") ;
- message.append(mTemporaryFileUrl).appendAscii("\" for writing. ");
- message.appendAscii("Error is ").append(FileHelper::createOSLErrorString(errorCode));
- message.appendAscii(" [").append(sal_Int32(errorCode)).appendAscii("].") ;
-
- rtl::OUString const sIOMsg = message.makeStringAndClear();
- uno::Any ioe = uno::makeAny(io::IOException(sIOMsg,0));
-
- switch (errorCode)
- {
- case osl::File::E_EXIST: // take inability to remove as indicator of missing rights
- case osl::File::E_ACCES:
- case osl::File::E_ROFS:
- message.appendAscii("Configuration LocalOutputStream - No Write Access: ");
- message.append(sIOMsg);
- throw backend::InsufficientAccessRightsException(message.makeStringAndClear(), NULL, ioe) ;
-
- case osl::File::E_None: OSL_ASSERT(!"can't happen");
- default:
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.append(sIOMsg);
- throw backend::BackendAccessException(message.makeStringAndClear(), NULL, ioe) ;
- }
- }
- mTemporaryFile = new OSLOutputStreamWrapper(*mWriteFile) ;
-}
-//------------------------------------------------------------------------------
-
-LocalOutputStream::~LocalOutputStream()
-{
- try
- {
- this->closeOutput();
- }
- catch (uno::Exception&)
- {
- OSL_ENSURE(false,"Exception from closing LocalOutputStream ignored.");
- }
-
- delete mWriteFile;
-}
-//------------------------------------------------------------------------------
-
-void LocalOutputStream::finishOutput()
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- if (mWriteFile)
- try
- {
- this->closeOutput();
- delete mWriteFile, mWriteFile = NULL;
-
- FileHelper::replaceFile(mFileUrl, mTemporaryFileUrl) ;
- }
- catch (io::IOException& ioe)
- {
- rtl::OUStringBuffer message ;
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.appendAscii("Cannot finish output to \"").append(mTemporaryFileUrl) ;
- message.appendAscii("\" or copy the result to \"").append(mFileUrl).appendAscii("\". ");
- message.appendAscii("Error is \"").append(ioe.Message).appendAscii("\". ");
- throw backend::BackendAccessException(message.makeStringAndClear(), *this, uno::makeAny(ioe));
- }
-}
-//------------------------------------------------------------------------------
-
-inline
-uno::Reference<io::XOutputStream> LocalOutputStream::getOutputFile()
-{
- if (!mTemporaryFile.is())
- {
- throw io::NotConnectedException(
- rtl::OUString::createFromAscii("LocalOutputStream: no output file."),
- *this);
- }
- return mTemporaryFile;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::writeBytes(const uno::Sequence<sal_Int8>& aData)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- getOutputFile()->writeBytes(aData) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::flush()
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- getOutputFile()->flush() ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::closeOutput()
- throw (io::NotConnectedException, io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- if (mTemporaryFile.is())
- {
- mTemporaryFile->closeOutput() ;
-
- mTemporaryFile.clear();
- }
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localoutputstream.hxx b/configmgr/source/localbe/localoutputstream.hxx
deleted file mode 100644
index 456111420e82..000000000000
--- a/configmgr/source/localbe/localoutputstream.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
-
-#include "oslstream.hxx"
-#include "filehelper.hxx"
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace io = css::io ;
-namespace backend = css::configuration::backend ;
-
-/**
- Class wrapping the use of the XOutputStream implementation on a file
- to make it handle a temporary file and synch the contents to the
- actual file being accessed only on successful completion of the output
- process.
- */
-class LocalOutputStream : public cppu::WeakImplHelper1<io::XOutputStream>
-{
- public :
- /**
- Constructor using the URL of the file to access.
- The actual writing will occur in a temporary file
- whose name is derived from the URL, and the file
- specified by the parameter will be overwritten
- on closing the stream.
-
- @param aFileUrl URL of the file to write
- @throws com::sun::star::io::IOException
- if access to the temporary file fails.
- */
- LocalOutputStream(const rtl::OUString& aFileUrl)
- throw (backend::BackendAccessException, uno::RuntimeException) ;
- /** Destructor */
- ~LocalOutputStream(void) ;
-
- // closeOutput and mark as successful
- void finishOutput()
- throw (backend::BackendAccessException, uno::RuntimeException) ;
- protected :
- // XOutputStream
- virtual void SAL_CALL writeBytes(const uno::Sequence<sal_Int8>& aData)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL flush(void)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL closeOutput(void)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException) ;
-
-
- private :
- uno::Reference<io::XOutputStream> getOutputFile() ;
-
- /** Temporary file used during access */
- uno::Reference<io::XOutputStream> mTemporaryFile ;
- /** URL of the target file */
- rtl::OUString mFileUrl ;
- /** URL of the temporary file */
- rtl::OUString mTemporaryFileUrl ;
- /** File being written */
- osl::File *mWriteFile ;
-} ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
diff --git a/configmgr/source/localbe/localschemasupplier.cxx b/configmgr/source/localbe/localschemasupplier.cxx
deleted file mode 100644
index 3cb013dfcb26..000000000000
--- a/configmgr/source/localbe/localschemasupplier.cxx
+++ /dev/null
@@ -1,288 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localschemasupplier.hxx"
-#include "localfilehelper.hxx"
-#include "oslstream.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalSchemaSupplier::LocalSchemaSupplier(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper3<backend::XVersionedSchemaSupplier, lang::XInitialization, lang::XServiceInfo>(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-LocalSchemaSupplier::~LocalSchemaSupplier(void) {}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaDataUrl")) ;
-
-static const rtl::OUString kSchemaVersion(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaVersion")) ;
-
-void SAL_CALL LocalSchemaSupplier::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to LocalSchemaSupplier")),
- *this, 0) ;
- }
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
- // Setting: schema version
- // TODO: Add support for repository-specific versions
- uno::Any const aSchemaVersionSetting = context->getValueByName(kSchemaVersion);
- aSchemaVersionSetting >>= mSchemaVersion;
-
- // Setting: schema diretory(ies)
- uno::Any const aSchemaDataSetting = context->getValueByName(kSchemaDataUrl);
- uno::Sequence< rtl::OUString > aSchemas;
- rtl::OUString schemas;
-
- if (aSchemaDataSetting >>= schemas)
- {
- fillFromBlankSeparated(schemas, aSchemas) ;
- }
- else
- {
- aSchemaDataSetting >>= aSchemas;
- }
- //validate SchemaDataUrls
- mSchemaDataUrls.realloc(aSchemas.getLength());
-
- sal_Int32 nSchemaLocations =0;
- sal_Int32 nExistingSchemaLocations = 0;
- for (sal_Int32 j = 0; j < aSchemas.getLength(); ++j)
- {
- bool bOptional = checkOptionalArg(aSchemas[j]);
-
- if(!bOptional)
- validateFileURL(aSchemas[j],*this);
- else if (!isValidFileURL(aSchemas[j]))
- continue;
-
- OSL_ASSERT(isValidFileURL(aSchemas[j]));
-
- //NormalizeURL
- implEnsureAbsoluteURL(aSchemas[j]);
- if(!normalizeURL(aSchemas[j],*this,bOptional))
- continue;
-
- //now we have a correct file URL, which we will use
- mSchemaDataUrls[nSchemaLocations++]= aSchemas[j];
- if (!bOptional)
- checkFileExists(aSchemas[j],*this);
-
- else if(!FileHelper::fileExists(aSchemas[j]))
- continue; // skip the directory check
-
- checkIfDirectory(aSchemas[j],*this);
- ++nExistingSchemaLocations;
- }
- if (0 == nExistingSchemaLocations)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("LocalBackend: No schema directories found");
- throw backend::BackendSetupException(sMsg,*this, uno::Any()) ;
- }
- mSchemaDataUrls.realloc(nSchemaLocations);
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- LocalSchemaSupplier::getSchemaVersion(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- // TODO: Add support for repository-specific versions
- return mSchemaVersion;
-}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcs")) ;
-static const rtl::OUString kXMLSchemaParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.SchemaParser")) ;
-
-uno::Reference<backend::XSchema> SAL_CALL
- LocalSchemaSupplier::getComponentSchema(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString subPath = componentToPath(aComponent) ;
-
- osl::File * schemaFile = NULL;
- rtl::OUString errorMessage;
- bool bInsufficientAccess = false;
- for (sal_Int32 ix = 0; ix < mSchemaDataUrls.getLength(); ++ix)
- {
- rtl::OUStringBuffer schemaUrl(mSchemaDataUrls[ix]) ;
-
- schemaUrl.append(subPath).append(kSchemaSuffix) ;
-
- rtl::OUString const aFileUrl = schemaUrl.makeStringAndClear();
-
- std::auto_ptr<osl::File> checkFile( new osl::File(aFileUrl) );
- osl::File::RC rc = checkFile->open(OpenFlag_Read) ;
-
- if (rc == osl::File::E_None)
- {
- schemaFile = checkFile.release();
- break;
- }
- else if (rc != osl::File::E_NOENT)
- {
- if (rc == osl::File::E_ACCES)
- bInsufficientAccess =true;
-
- // accumulate error messages
- rtl::OUStringBuffer sMsg(errorMessage);
- if (errorMessage.getLength())
- sMsg.appendAscii("LocalFile SchemaSupplier - Error accessing schema: ");
-
- sMsg.appendAscii("\n- Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(rc));
-
- errorMessage = sMsg.makeStringAndClear();
- }
- }
-
- if (NULL == schemaFile)
- {
- if (errorMessage.getLength() != 0)
- {
- // a real error occured
- io::IOException ioe(errorMessage,*this);
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(errorMessage);
-
- if (bInsufficientAccess)
- throw backend::InsufficientAccessRightsException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- else
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- }
- // simply not found
- return NULL;
- }
-
- uno::Sequence<uno::Any> arguments(1) ;
- uno::Reference<io::XInputStream> stream( new OSLInputStreamWrapper(schemaFile, true) );
-
- arguments [0] <<= stream ;
- uno::Reference<backend::XSchema> schema(
- mFactory->createInstanceWithArguments(kXMLSchemaParser, arguments),
- uno::UNO_QUERY) ;
-
- if (!schema.is())
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Cannot instantiate Schema Parser for ")) + aComponent,
- *this) ;
- }
- return schema ;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.LocalSchemaSupplier" ;
-static const sal_Char * const kSchemaService =
- "com.sun.star.configuration.backend.SchemaSupplier" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSchemaSupplier" ;
-
-static sal_Char const * kServiceNames [] = {kLocalService, 0, kSchemaService, 0 } ;
-static const ServiceImplementationInfo kServiceInfo = { kImplementation, kServiceNames,kServiceNames+2 } ;
-
-const ServiceRegistrationInfo *getLocalSchemaSupplierServiceInfo()
-{ return getRegistrationInfo(&kServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalSchemaSupplier(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSchemaSupplier(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSchemaSupplier::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSchemaSupplier::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL LocalSchemaSupplier::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localschemasupplier.hxx b/configmgr/source/localbe/localschemasupplier.hxx
deleted file mode 100644
index 52008b983c72..000000000000
--- a/configmgr/source/localbe/localschemasupplier.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
-
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SchemaSupplier service for local schema file access.
- */
-class LocalSchemaSupplier : public cppu::WeakComponentImplHelper3<backend::XVersionedSchemaSupplier, lang::XInitialization, lang::XServiceInfo> {
- public :
- /**
- Service constructor from a service factory.
-
- @param xConxtext Component Context
- */
- LocalSchemaSupplier(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSchemaSupplier(void) ;
-
-
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
- // XVersionedSchemaSupplier
- virtual rtl::OUString SAL_CALL
- getSchemaVersion( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backend::XSchema> SAL_CALL
- getComponentSchema( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resources protection */
- osl::Mutex mMutex ;
- /**
- Base of the schema data. Is a list to allow
- for multiple schema directories.
- */
- uno::Sequence<rtl::OUString> mSchemaDataUrls ;
- /** Version of the schema repository */
- // TODO: Add support for repository-specific versions
- rtl::OUString mSchemaVersion;
-} ;
-
-} } // configmgr.localschemasupplirt
-
-#endif // CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
diff --git a/configmgr/source/localbe/localsinglebackend.cxx b/configmgr/source/localbe/localsinglebackend.cxx
deleted file mode 100644
index 20e572068a37..000000000000
--- a/configmgr/source/localbe/localsinglebackend.cxx
+++ /dev/null
@@ -1,798 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localsinglebackend.hxx"
-#include "localfilehelper.hxx"
-#include "localfilelayer.hxx"
-#include "oslstream.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalSingleBackend::LocalSingleBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper5<backend::XSchemaSupplier, backend::XMultiLayerStratum, backend::XBackendEntities, lang::XInitialization, lang::XServiceInfo>(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-LocalSingleBackend::~LocalSingleBackend(void) {}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaDataUrl")) ;
-static const rtl::OUString kDefaultDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"DefaultLayerUrls")) ;
-static const rtl::OUString kUserDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"UserLayerUrl")) ;
-static const rtl::OUString kEntity(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"EntityLayer")) ;
-
-static const rtl::OUString kAdminModeFlag(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_ADMINFLAG)) ;
-
-void SAL_CALL LocalSingleBackend::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to SingleBackend")),
- *this, 0) ;
- }
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
- // Setting: schema diretory(ies)
- uno::Any const aSchemaDataSetting = context->getValueByName(kSchemaDataUrl);
- uno::Sequence< rtl::OUString > aSchemas;
- rtl::OUString schemas;
-
- if (aSchemaDataSetting >>= schemas)
- {
- fillFromBlankSeparated(schemas, aSchemas) ;
- }
- else
- {
- aSchemaDataSetting >>= aSchemas;
- }
- //validate SchemaDataUrls
- mSchemaDataUrls.realloc(aSchemas.getLength());
-
- sal_Int32 nSchemaLocations = 0;
- sal_Int32 nExistingSchemaLocations = 0;
- for (sal_Int32 j = 0; j < aSchemas.getLength(); ++j)
- {
- bool bOptional = checkOptionalArg(aSchemas[j]);
-
- if (!bOptional)
- validateFileURL(aSchemas[j],*this);
-
- else if (!isValidFileURL(aSchemas[j]))
- continue;
-
- OSL_ASSERT(isValidFileURL(aSchemas[j]));
-
- //NormalizeURL
- implEnsureAbsoluteURL(aSchemas[j]);
- if (!normalizeURL(aSchemas[j],*this,bOptional))
- continue;
-
- // now we have a correct file URL, which we will use
- mSchemaDataUrls[nSchemaLocations++] = aSchemas[j];
-
- // check existence
- if (!bOptional)
- checkFileExists(aSchemas[j], *this);
-
- else if(!FileHelper::fileExists(aSchemas[j]))
- continue; // skip the directory check
-
-
- checkIfDirectory(aSchemas[j],*this);
-
- ++nExistingSchemaLocations;
- }
- mSchemaDataUrls.realloc(nSchemaLocations);
-
- if (0 == nExistingSchemaLocations)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("LocalBackend: No schema directories found");
- throw backend::BackendSetupException(sMsg,*this, uno::Any()) ;
- }
-
- // Setting: default layer(s)
- uno::Any const aDefaultDataSetting = context->getValueByName(kDefaultDataUrl);
- uno::Sequence< rtl::OUString > aDefaults;
- rtl::OUString defaults;
-
- if (aDefaultDataSetting >>= defaults)
- {
- fillFromBlankSeparated(defaults, aDefaults) ;
- }
- else
- {
- aDefaultDataSetting >>= aDefaults ;
- }
-
- //validate DefaultDataUrls
- mDefaultDataUrls.realloc(aDefaults.getLength());
- sal_Int32 nDefaultLayers = 0;
-
- for (sal_Int32 ix = 0; ix < aDefaults.getLength(); ++ix)
- {
- // skip invalid URLs
- if (!isValidFileURL(aDefaults[ix]))
- continue;
-
- //NormalizeURL
- implEnsureAbsoluteURL(aDefaults[ix]);
- if (!normalizeURL(aDefaults[ix],*this,true))
- continue;
-
- if(FileHelper::fileExists(aDefaults[ix]))
- {
- checkIfDirectory(aDefaults[ix],*this);
- }
-
- // good URL -> use it
- mDefaultDataUrls[nDefaultLayers++] = aDefaults[ix];
- }
- mDefaultDataUrls.realloc(nDefaultLayers);
-
- // Setting: admin mode tag
- sal_Bool bAdminMode = false;
- context->getValueByName(kAdminModeFlag) >>= bAdminMode;
-
- if (bAdminMode)
- {
- // find given entity
- if ( (context->getValueByName(kEntity) >>= mUserDataUrl) && mUserDataUrl.getLength() )
- {
- //Validate UserDataUrl
- validateFileURL(mUserDataUrl,*this);
- //NormalizeURL
- implEnsureAbsoluteURL(mUserDataUrl);
- normalizeURL(mUserDataUrl,*this);
- if(FileHelper::fileExists(mUserDataUrl))
- {
- checkIfDirectory(mUserDataUrl,*this);
- }
-
- for (sal_Int32 ix = 0; ix < mDefaultDataUrls.getLength(); ++ix)
- {
- if (mDefaultDataUrls.getConstArray()[ix].equals(mUserDataUrl))
- {
- mDefaultDataUrls.realloc(ix);
- // this is the last round through the loop
- }
- }
- }
- else if (aDefaults.getLength()) // administrate first default layer
- {
- mUserDataUrl = aDefaults[0];
- mDefaultDataUrls.realloc(0);
- }
- else
- {
- OSL_ENSURE(false, "Cannot find target entity for admin mode - fallback to local mode");
- bAdminMode = false;
- }
- }
-
- if (!bAdminMode)
- {
- context->getValueByName(kUserDataUrl) >>= mUserDataUrl ;
- //Validate UserDataUrl
- if (isValidFileURL(mUserDataUrl))
- {
- implEnsureAbsoluteURL(mUserDataUrl);
- normalizeURL(mUserDataUrl,*this);
- if(FileHelper::fileExists(mUserDataUrl))
- {
- checkIfDirectory(mUserDataUrl,*this);
- }
- }
- }
-
- if (mUserDataUrl.getLength() == 0)
- {
- mUserDataUrl = rtl::OUString::createFromAscii("*");
- OSL_ASSERT(!isValidFileURL(mUserDataUrl));
- }
-}
-//------------------------------------------------------------------------------
-const sal_Int32 k_UserLayerEntity = 0;
-const sal_Int32 k_InvalidEntity = k_UserLayerEntity - 1;
-const sal_Int32 k_DefaultEntityOffset = k_UserLayerEntity + 1;
-//------------------------------------------------------------------------------
-static inline bool isValidEntity(sal_Int32 ent)
-{
- return ent > k_InvalidEntity;
-}
-//------------------------------------------------------------------------------
-static inline sal_Int32 indexToEntity(sal_Int32 ix)
-{
- OSL_ASSERT(0 <= ix);
- return ix + k_DefaultEntityOffset;
-}
-static inline sal_Int32 entityToIndex(sal_Int32 ent)
-{
- OSL_ASSERT(k_DefaultEntityOffset <= ent);
- return ent - k_DefaultEntityOffset;
-}
-//------------------------------------------------------------------------------
-
-
-/**
- Transforms a file url into a layer id. The layer id will
- contain the URL passed plus an integer indicating which
- layer the URL points to. If the integer is 0, the URL
- is a user layer, otherwise it is one of the default layers.
-
- @param aFileUrl URL to encode
- @param aIndex index of the layer concerned (0 = user, other = default)
- @return layer id
- */
-static
-rtl::OUString urlToLayerId(const rtl::OUString& aFileUrl,sal_Int32 aIndex)
-{
- rtl::OUStringBuffer id ;
-
- OSL_ASSERT(isValidEntity(aIndex));
- if (aIndex)
- id.append(aIndex).appendAscii(" ",1); // non-user layers
- else
- id.appendAscii("U ",2); // user layer
-
- id.append(aFileUrl) ;
- return id.makeStringAndClear() ;
-}
-
-static
-inline
-bool layerIdToUrl( const rtl::OUString& aLayerId,
- rtl::OUString& aFileUrl,
- sal_Int32& aIndex)
-{
- sal_Int32 const sep = aLayerId.indexOf(sal_Unicode(' ')) ;
-
- if (sep < 0) return false;
-
- // detect user layer id
- if (aLayerId[0] == sal_Unicode('U'))
- {
- if (sep != 1) return false;
- aIndex = 0;
- }
- else
- {
- aIndex = aLayerId.copy(0, sep).toInt32() ;
- if (0 == aIndex || !isValidEntity(aIndex)) return false;
-
- OSL_ENSURE( aLayerId.copy(0, sep).equals(rtl::OUString::valueOf(aIndex)),
- "Invalid layer id was not detected");
- }
- aFileUrl = aLayerId.copy(sep + 1);
-
- return true;
-}
-//------------------------------------------------------------------------------
-sal_Int32 LocalSingleBackend::resolveLayerId(const rtl::OUString& aLayerId,
- rtl::OUString& aFileUrl)
-{
- sal_Int32 nIndex = k_InvalidEntity;
- if (!layerIdToUrl(aLayerId,aFileUrl,nIndex))
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid layer id: "));
-
- // layer id is always the second parameter
- throw lang::IllegalArgumentException(sMsg.concat(aLayerId), *this, 2);
- }
- OSL_ASSERT(isValidEntity(nIndex));
- return nIndex;
-}
-//------------------------------------------------------------------------------
-
-sal_Int32 LocalSingleBackend::findEntity(const rtl::OUString& aEntity)
-{
- if (aEntity.getLength() == 0)
- {
- return k_InvalidEntity;
- }
-
- // quick check for OwnerEntity first
- if (aEntity.equals(mUserDataUrl))
- {
- return k_UserLayerEntity;
- }
-
- rtl::OUString sNormalizedEntityUrl(aEntity);
- normalizeURL(sNormalizedEntityUrl,*this);
-
- for (sal_Int32 ix = 0; ix < mDefaultDataUrls.getLength(); ++ix)
- {
- rtl::OUString sNormalizedDefaultUrl(mDefaultDataUrls[ix]);
- OSL_VERIFY(normalizeURL(sNormalizedDefaultUrl,*this,true));
-
- if (sNormalizedEntityUrl.equals(sNormalizedDefaultUrl))
- {
- // found it
- return indexToEntity(ix);
- }
- }
-
- //Try normalized version of mUserDataUrl
- rtl::OUString sNormalizedUserUrl(mUserDataUrl);
-
- if (normalizeURL(sNormalizedUserUrl,*this,true))
- {
- if (sNormalizedEntityUrl.equals(sNormalizedUserUrl))
- {
- return k_UserLayerEntity;
- }
- }
-
- // not found
- return k_InvalidEntity;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kDataSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcu")) ;
-
-uno::Sequence<rtl::OUString> SAL_CALL LocalSingleBackend::listLayerIds(
- const rtl::OUString& aComponent, const rtl::OUString& aEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 nEntity = findEntity(aEntity);
- if ( !isValidEntity(nEntity) )
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Unknown entity: "));
-
- throw lang::IllegalArgumentException(sMsg.concat(aEntity), *this, 2);
- }
-
- sal_Int32 nDefLayers = (k_UserLayerEntity == nEntity)
- ? mDefaultDataUrls.getLength()
- : entityToIndex(nEntity);
-
- OSL_ASSERT(0 <= nDefLayers && nDefLayers <= mDefaultDataUrls.getLength());
-
- rtl::OUString const componentSubPath = componentToPath(aComponent) + kDataSuffix ;
-
- uno::Sequence<rtl::OUString> aLayerIds(nDefLayers + 1) ;
- OSL_ASSERT(0 < aLayerIds.getLength());
-
- // First, the defaults...
- for (sal_Int32 ix = 0; ix < nDefLayers ; ++ ix)
- {
- aLayerIds[ix] = urlToLayerId(componentSubPath, indexToEntity(ix)) ;
- }
- // Then the entity data.
- aLayerIds [nDefLayers] = urlToLayerId(componentSubPath, nEntity) ;
-
- return aLayerIds;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getUpdateLayerId(
- const rtl::OUString& aComponent, const rtl::OUString& aEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 nEntity = findEntity(aEntity);
- if ( !isValidEntity(nEntity) )
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Unknown entity for update: "));
-
- throw lang::IllegalArgumentException(sMsg.concat(aEntity), *this, 2);
- }
-
- return urlToLayerId(componentToPath(aComponent) + kDataSuffix, nEntity) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getOwnerEntity()
- throw (uno::RuntimeException)
-{
- return mUserDataUrl ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getAdminEntity()
- throw (uno::RuntimeException)
-{
- return mDefaultDataUrls.getLength() > 0 ? mDefaultDataUrls[0] : mUserDataUrl;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- return isValidEntity(findEntity(aEntity)) ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::isEqualEntity(const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
- rtl::OUString aNormalizedEntity(aEntity);
- normalizeURL(aNormalizedEntity,*this);
-
- rtl::OUString aNormalizedOther(aOtherEntity);
- normalizeURL(aNormalizedOther,*this);
-
- return aNormalizedEntity == aNormalizedOther;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool LocalSingleBackend::isMoreRecent(const rtl::OUString& aFileUrl,
- sal_Int32 aLayerIndex,
- const rtl::OUString& aTimestamp) {
- rtl::OUString layerUrl ;
- rtl::OUString subLayerUrl ;
-
- // if we don't find a layer, but have a non-empty timestamp -> modified
- if (!getLayerDirectories(aLayerIndex,layerUrl, subLayerUrl))
- return aTimestamp.getLength() != 0;
-
- return layerUrl.getLength() == 0 ||
- BasicLocalFileLayer::getTimestamp(layerUrl + aFileUrl).compareTo( aTimestamp) != 0;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kDataSubPath(
- RTL_CONSTASCII_USTRINGPARAM("/data")) ;
-static const rtl::OUString kLocalisedDataSubPath(
- RTL_CONSTASCII_USTRINGPARAM("/res")) ;
-
-uno::Reference<backend::XLayer> SAL_CALL LocalSingleBackend::getLayer(
- const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString fileUrl ;
-
- sal_Int32 defaultIndex = resolveLayerId(aLayerId, fileUrl) ;
-
- if (!isMoreRecent(fileUrl, defaultIndex, aTimestamp)) { return NULL ; }
-
- uno::Reference<backend::XUpdatableLayer> xLayer = getFileLayer(fileUrl,defaultIndex);
- uno::Reference<backend::XLayer> xResult = xLayer.get();
- return xResult;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
-LocalSingleBackend::getLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- uno::Sequence<uno::Reference<backend::XLayer> >
- retCode(aLayerIds.getLength()) ;
-
- for (sal_Int32 i = 0 ; i < aLayerIds.getLength() ; ++ i) {
- retCode [i] = getLayer(aLayerIds [i], aTimestamp) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
-LocalSingleBackend::getMultipleLayers(
- const uno::Sequence<rtl::OUString>& aLayerIds,
- const uno::Sequence<rtl::OUString>& aTimestamps)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (aLayerIds.getLength() != aTimestamps.getLength()) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Not enough or too many timestamps")),
- *this, 0) ;
- }
- uno::Sequence<uno::Reference<backend::XLayer> >
- retCode(aLayerIds.getLength()) ;
-
- for (sal_Int32 i = 0 ; i < aLayerIds.getLength() ; ++ i) {
- retCode [i] = getLayer(aLayerIds [i], aTimestamps [i]) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-LocalSingleBackend::getUpdatableLayer(const rtl::OUString& aLayerId)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return getFileLayer(aLayerId) ;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kSchemaSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcs")) ;
-static const rtl::OUString kXMLSchemaParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.SchemaParser")) ;
-
-uno::Reference<backend::XSchema> SAL_CALL
- LocalSingleBackend::getComponentSchema(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString subPath = componentToPath(aComponent) ;
-
- osl::File * schemaFile = NULL;
- rtl::OUString errorMessage;
- bool bInsufficientAccess = false;
- for (sal_Int32 ix = 0; ix < mSchemaDataUrls.getLength(); ++ix)
- {
- rtl::OUStringBuffer schemaUrl(mSchemaDataUrls[ix]) ;
-
- schemaUrl.append(subPath).append(kSchemaSuffix) ;
-
- rtl::OUString const aFileUrl = schemaUrl.makeStringAndClear();
-
- std::auto_ptr<osl::File> checkFile( new osl::File(aFileUrl) );
- osl::File::RC rc = checkFile->open(OpenFlag_Read) ;
-
- if (rc == osl::File::E_None)
- {
- schemaFile = checkFile.release();
- break;
- }
- else if (rc != osl::File::E_NOENT)
- {
- if (rc == osl::File::E_ACCES)
- bInsufficientAccess =true;
-
- // accumulate error messages
- rtl::OUStringBuffer sMsg(errorMessage);
- if (errorMessage.getLength())
- sMsg.appendAscii("LocalFile SchemaSupplier - Error accessing schema: ");
-
- sMsg.appendAscii("\n- Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(rc));
-
- errorMessage = sMsg.makeStringAndClear();
- }
- }
-
- if (NULL == schemaFile)
- {
- if (errorMessage.getLength() != 0)
- {
- // a real error occured
- io::IOException ioe(errorMessage,*this);
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(errorMessage);
-
- if (bInsufficientAccess)
- throw backend::InsufficientAccessRightsException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- else
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- }
- // simply not found
- return NULL;
- }
-
- uno::Sequence<uno::Any> arguments(1) ;
- uno::Reference<io::XInputStream> stream( new OSLInputStreamWrapper(schemaFile, true) );
-
- arguments [0] <<= stream ;
- uno::Reference<backend::XSchema> schema(
- mFactory->createInstanceWithArguments(kXMLSchemaParser, arguments),
- uno::UNO_QUERY) ;
-
- if (!schema.is())
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Cannot instantiate Schema Parser for ")) + aComponent,
- *this) ;
- }
- return schema ;
-}
-//------------------------------------------------------------------------------
-
-static
-inline
-bool impl_getLayerSubDirectories(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- if (!isValidFileURL(aLayerBaseUrl)) return false;
-
- aMainLayerUrl = aLayerBaseUrl + kDataSubPath ;
- aSubLayerUrl = aLayerBaseUrl + kLocalisedDataSubPath ;
- return true;
-}
-//------------------------------------------------------------------------------
-
-bool LocalSingleBackend::getLayerSubDirectories(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- return impl_getLayerSubDirectories(aLayerBaseUrl,aMainLayerUrl,aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-bool LocalSingleBackend::getLayerDirectories(sal_Int32 aLayerIndex,
- rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- OSL_ASSERT(isValidEntity(aLayerIndex));
- rtl::OUString aLayerBaseUrl = (aLayerIndex == k_UserLayerEntity) ? mUserDataUrl : mDefaultDataUrls [entityToIndex(aLayerIndex)] ;
-
- return impl_getLayerSubDirectories(aLayerBaseUrl,aLayerUrl,aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> LocalSingleBackend::createSimpleLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aComponentUrl)
-{
- SimpleLocalFileLayer * pLayer = new SimpleLocalFileLayer(xFactory, aComponentUrl);
- return pLayer;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> LocalSingleBackend::createSimpleLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aLayerBaseUrl,
- rtl::OUString const & aComponent)
-{
- rtl::OUString aLayerUrl, aSubLayerUrl;
- if (!impl_getLayerSubDirectories(aLayerBaseUrl,aLayerUrl,aSubLayerUrl))
- return NULL;
-
- SimpleLocalFileLayer * pLayer = new SimpleLocalFileLayer(xFactory, aLayerUrl, componentToPath(aComponent) + kDataSuffix);
- return pLayer;
-}
-//------------------------------------------------------------------------------
-
-
-uno::Reference<backend::XUpdatableLayer> LocalSingleBackend::getFileLayer(const rtl::OUString& aLayerId)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString fileUrl ;
- sal_Int32 defaultIndex = resolveLayerId(aLayerId, fileUrl) ;
-
- return getFileLayer(fileUrl, defaultIndex) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> LocalSingleBackend::getFileLayer(
- const rtl::OUString& aComponent, sal_Int32 aLayerIndex) {
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- if (!getLayerDirectories(aLayerIndex, layerPath, subLayerPath))
- {
- OSL_ENSURE(aLayerIndex == k_UserLayerEntity, "Unexpected: Invalid non-user layer url");
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalSingleBackend: Cannot create file layer - Layer URL '");
- sMsg.append(mUserDataUrl).appendAscii("' is invalid.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),*this,1);
- }
-
- return createUpdatableLocalFileLayer(mFactory, layerPath, aComponent, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.LocalSingleBackend" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.SingleBackend" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSingleBackend" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kServiceInfo = { kImplementation, kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalBackendServiceInfo()
-{ return getRegistrationInfo(&kServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalBackend(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSingleBackend(xContext) ;
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL LocalSingleBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localsinglebackend.hxx b/configmgr/source/localbe/localsinglebackend.hxx
deleted file mode 100644
index 10da6fec5743..000000000000
--- a/configmgr/source/localbe/localsinglebackend.hxx
+++ /dev/null
@@ -1,245 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
-
-#include <com/sun/star/configuration/backend/XSchemaSupplier.hpp>
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase5.hxx>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleBackend service for local file access.
- Layer identifiers in that backend are file URLs.
- */
-class LocalSingleBackend : public cppu::WeakComponentImplHelper5<backend::XSchemaSupplier, backend::XMultiLayerStratum, backend::XBackendEntities, lang::XInitialization, lang::XServiceInfo> {
- public :
- /**
- Service constructor from a service factory.
-
- @param xFactory service factory
- */
- LocalSingleBackend(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSingleBackend(void) ;
-
-
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
- // XSchemaSupplier
- virtual uno::Reference<backend::XSchema> SAL_CALL
- getComponentSchema( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XMultiLayerStratum
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- listLayerIds( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual rtl::OUString SAL_CALL
- getUpdateLayerId( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
- getLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
- getMultipleLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const uno::Sequence<rtl::OUString>& aTimestamps)
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- public: // helpers for other implementation that need to use the same data
- /**
- Locates the main layer data and localized data directories in a layer directory hierarchy
- */
- static bool getLayerSubDirectories( rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl);
- /**
- Creates a simple readonly non-composite layer for a component in a base directory
- */
- static uno::Reference<backend::XLayer>
- createSimpleLayer(const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aLayerBaseUrl,
- rtl::OUString const & aComponent);
-
- /**
- Creates a simple readonly non-composite layer for a component in a given file
- */
- static uno::Reference<backend::XLayer>
- createSimpleLayer(const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aComponentUrl);
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resources protection */
- osl::Mutex mMutex ;
- /**
- Base of the schema data. Is a list to allow
- for multiple schema directories.
- */
- uno::Sequence<rtl::OUString> mSchemaDataUrls ;
- /**
- Base of the default data. Is a list to allow
- for multiple layers of default data.
- */
- uno::Sequence<rtl::OUString> mDefaultDataUrls ;
- /** Base of the user data */
- rtl::OUString mUserDataUrl ;
-
- /** special index for entity */
- sal_Int32 findEntity(rtl::OUString const & _aEntity);
- /** parse and translate layer-id */
- sal_Int32 resolveLayerId(rtl::OUString const & _aLayerId, rtl::OUString & _aFile);
-
- /**
- Builds a LocalFileLayer object given a layer id.
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one. This method handles the layer id mapping
- and the existence or not of sublayers.
-
- @param aLayerId layer id
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the layer id is invalid.
- */
- uno::Reference<backend::XUpdatableLayer> getFileLayer(const rtl::OUString& aLayerId)
- throw (lang::IllegalArgumentException) ;
- /**
- Same as above, but using a component URL and layer index
- combination instead of a layer id (which encodes both).
-
- @param aComponent component URL
- @param aLayerIndex layer index
- @return local file layer
- */
- uno::Reference<backend::XUpdatableLayer> getFileLayer(const rtl::OUString& aComponent,
- sal_Int32 aLayerIndex) ;
- /**
- Maps a layer index (-1 for user layer, 0-x for defaults)
- to the appropriate layer and sublayers base directories.
-
- @param aLayerIndex layer index
- @param aLayerUrl layer base URL, filled on return
- @param aSubLayerUrl sublayer base URL, filled on return
- */
- bool getLayerDirectories(sal_Int32 aLayerIndex,
- rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) ;
- /**
- Tells if a file is more recent than a given date.
- The date is formatted YYYYMMDDhhmmssZ.
-
- @param aComponent URL of the component to check
- @param aLayerIndex index of the layer involved (-1 = user)
- @param aTimestamp timestamp to check against
- @return sal_True if the file is more recent, sal_False otherwise
- */
- sal_Bool isMoreRecent(const rtl::OUString& aComponent,
- sal_Int32 aLayerId,
- const rtl::OUString& aTimestamp) ;
- } ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
diff --git a/configmgr/source/localbe/localsinglestratum.cxx b/configmgr/source/localbe/localsinglestratum.cxx
deleted file mode 100644
index 87a5b52325d5..000000000000
--- a/configmgr/source/localbe/localsinglestratum.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localsinglestratum.hxx"
-#include "localfilehelper.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-static inline rtl::OUString getDataSubPath()
-{ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/data")); }
-
-static inline rtl::OUString getLocalisedDataSubPath()
-{ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/res")); }
-//------------------------------------------------------------------------------
-
-LocalSingleStratumBase::LocalSingleStratumBase(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XSingleLayerStratum >(xContext)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalSingleStratumBase::~LocalSingleStratumBase() {}
-
-//------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL
- LocalSingleStratumBase::getLayer( const rtl::OUString& aComponent, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return LocalStratumBase::getLayer(aComponent,aTimestamp);
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalSingleStratumBase::getUpdatableLayer(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- if (aComponent.getLength() == 0){
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleStratum:getLayer - no component specified")),
- *this, 0) ;
- }
- rtl::OUString const componentSubPath = componentToPath(aComponent) + getDataSuffix();
- return createUpdatableFileLayer( componentSubPath) ;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalReadonlyStratum::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalResourceStratum::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-//------------------------------------------------------------------------------
-static
-inline
-void impl_getLayerDataDirectory(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl)
-{
- aMainLayerUrl = aLayerBaseUrl + getDataSubPath() ;
-}
-//------------------------------------------------------------------------------
-static
-inline
-void impl_getLayerResDirectory(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aSubLayerUrl)
-{
- aSubLayerUrl = aLayerBaseUrl + getLocalisedDataSubPath() ;
-}
-//------------------------------------------------------------------------------
-
-void LocalSingleStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- impl_getLayerResDirectory(getBaseUrl(),aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-void LocalDataStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-void LocalReadonlyStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-void LocalResourceStratum::adjustBaseURL(rtl::OUString& aBaseUrl)
-{
- impl_getLayerResDirectory(aBaseUrl,aBaseUrl);
-}
-//------------------------------------------------------------------------------
-
-void LocalResourceStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- aLayerUrl = rtl::OUString();
- aSubLayerUrl = getBaseUrl();
- // impl_getLayerResDirectory(getBaseUrl(),aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kLegacyStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalSingleStratum" ;
-static const sal_Char * const kDataStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalStratum" ;
-static const sal_Char * const kReadonlyStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalReadonlyStratum" ;
-static const sal_Char * const kResourceStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalResourceStratum" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.SingleStratum" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSingleStratum" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kLegacyStratumServiceInfo = { kLegacyStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kDataStratumServiceInfo = { kDataStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kReadonlyStratumServiceInfo = { kReadonlyStratumImplementation, kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kResourceStratumServiceInfo = { kResourceStratumImplementation, kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalLegacyStratumServiceInfo()
-{ return getRegistrationInfo(&kLegacyStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalDataStratumServiceInfo()
-{ return getRegistrationInfo(&kDataStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalReadonlyStratumServiceInfo()
-{ return getRegistrationInfo(&kReadonlyStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalResourceStratumServiceInfo()
-{ return getRegistrationInfo(&kResourceStratumServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalLegacyStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSingleStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalDataStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalDataStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalReadonlyStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalReadonlyStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalResourceStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalResourceStratum(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-const ServiceImplementationInfo * LocalSingleStratum::getServiceInfoData() const
-{
- return &kLegacyStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalDataStratum::getServiceInfoData() const
-{
- return &kDataStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalReadonlyStratum::getServiceInfoData() const
-{
- return &kReadonlyStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalResourceStratum::getServiceInfoData() const
-{
- return &kResourceStratumServiceInfo;
-}
-//------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localsinglestratum.hxx b/configmgr/source/localbe/localsinglestratum.hxx
deleted file mode 100644
index 671d7e096a26..000000000000
--- a/configmgr/source/localbe/localsinglestratum.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
-
-#include "localstratumbase.hxx"
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
- namespace localbe
- {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service for local file access.
- */
-class LocalSingleStratumBase : public cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XSingleLayerStratum >
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalSingleStratumBase(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSingleStratumBase() ;
-
-
- // XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-} ;
-
-class LocalSingleStratum : public LocalSingleStratumBase
-{
-public:
- LocalSingleStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalDataStratum : public LocalSingleStratumBase
-{
-public:
- LocalDataStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalReadonlyStratum : public LocalSingleStratumBase
-{
-public:
- LocalReadonlyStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
- // XSingleLayerStratum - readonly implementation
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalResourceStratum : public LocalSingleStratumBase
-{
-public:
- LocalResourceStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
- // XSingleLayerStratum - readonly implementation
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-private:
- virtual void adjustBaseURL(rtl::OUString& aBaseURL);
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/localstratumbase.cxx b/configmgr/source/localbe/localstratumbase.cxx
deleted file mode 100644
index 2e0061cbf484..000000000000
--- a/configmgr/source/localbe/localstratumbase.cxx
+++ /dev/null
@@ -1,253 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localstratumbase.hxx"
-#include "localfilehelper.hxx"
-#include "localfilelayer.hxx"
-#include "oslstream.hxx"
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/NoSupportException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalStratumBase::LocalStratumBase(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::WeakComponentImplHelper3<lang::XInitialization, backend::XBackendEntities, lang::XServiceInfo>(mMutex)
-, mFactory(xContext->getServiceManager(),uno::UNO_QUERY)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalStratumBase::~LocalStratumBase()
-{}
-
-//------------------------------------------------------------------------------
-void SAL_CALL LocalStratumBase::initialize(const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
-
-
-
- if (aParameters.getLength() == 0)
- {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to local Stratum")),
- *this, 0) ;
- }
-
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i)
- {
- if (aParameters [i] >>= mStrataDataUrl )
- { break ; }
-
- }
-
- // get modified base for special layer implementations (e.g. resources)
- this->adjustBaseURL(mStrataDataUrl);
-
- validateFileURL(mStrataDataUrl, *this);
- implEnsureAbsoluteURL(mStrataDataUrl);
- normalizeURL(mStrataDataUrl,*this, true);
-
- if(FileHelper::fileExists(mStrataDataUrl))
- {
- checkIfDirectory(mStrataDataUrl, *this);
- }
-}
-
-//------------------------------------------------------------------------------
-
-void LocalStratumBase::adjustBaseURL(rtl::OUString& )
-{
-}
-//------------------------------------------------------------------------------
-
-sal_Bool LocalStratumBase::isMoreRecent(const rtl::OUString& aFileUrl,
- const rtl::OUString& aTimestamp) {
- rtl::OUString layerUrl ;
- rtl::OUString subLayerUrl ;
-
- getLayerDirectories(layerUrl, subLayerUrl) ;
-
- return layerUrl.getLength() == 0 ||
- !BasicLocalFileLayer::getTimestamp(layerUrl + aFileUrl).equals( aTimestamp);
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL
- LocalStratumBase::getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- if (aLayerId.getLength() == 0){
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalStratum:getLayer - no LayerId specified")),
- *this, 0) ;
- }
- rtl::OUString const componentSubPath = layeridToPath(aLayerId) + getDataSuffix();
- if (!isMoreRecent(componentSubPath, aTimestamp)) { return NULL ; }
-
- return createReadonlyFileLayer(componentSubPath);
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getOwnerEntity()
- throw (uno::RuntimeException)
-{
- return mStrataDataUrl ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getAdminEntity()
- throw (uno::RuntimeException)
-{
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- if(mStrataDataUrl.getLength() == 0)
- {
- return false;
- }
- if (aEntity.getLength() == 0)
- {
- return false;
- }
- return isEqualEntity(mStrataDataUrl,aEntity);
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::isEqualEntity(const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
- rtl::OUString aNormalizedEntity(aEntity);
- normalizeURL(aNormalizedEntity,*this);
-
- rtl::OUString aNormalizedOther(aOtherEntity);
- normalizeURL(aNormalizedOther,*this);
-
- return aNormalizedEntity == aNormalizedOther;
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-uno::Reference<backend::XLayer>
- LocalStratumBase::createReadonlyFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- getLayerDirectories(layerPath, subLayerPath) ;
- return createReadonlyLocalFileLayer(mFactory, layerPath, aSubpath, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer>
- LocalStratumBase::createUpdatableFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- getLayerDirectories(layerPath, subLayerPath) ;
- return createUpdatableLocalFileLayer(mFactory, layerPath, aSubpath, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getImplementationName()
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL LocalStratumBase::getSupportedServiceNames()
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-void LocalStratumBase::failReadonly()
-{
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Configurations - ")
- .appendAscii("Cannot get update access to layer: ")
- .appendAscii("Local file-based stratum at ")
- .append(this->getBaseUrl())
- .appendAscii(" is readonly.");
- throw lang::NoSupportException(aMessage.makeStringAndClear(),*this);
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localstratumbase.hxx b/configmgr/source/localbe/localstratumbase.hxx
deleted file mode 100644
index 6b598e755dab..000000000000
--- a/configmgr/source/localbe/localstratumbase.hxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSTRATUMBASE_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSTRATUMBASE_HXX_
-
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-namespace configmgr
-{
- struct ServiceImplementationInfo;
-
- namespace localbe
- {
-//------------------------------------------------------------------------------
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-//------------------------------------------------------------------------------
-
-struct LocalStratumMutexHolder { osl::Mutex mMutex; };
-//------------------------------------------------------------------------------
-static const char kLocalDataSuffix[] = ".xcu";
-//------------------------------------------------------------------------------
-
-/**
- Helper for implementing the [Single|Multi]LayerStratum service for local file access.
- */
-class LocalStratumBase : protected LocalStratumMutexHolder, public cppu::WeakComponentImplHelper3<lang::XInitialization, backend::XBackendEntities, lang::XServiceInfo>
-{
-protected :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalStratumBase(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalStratumBase() ;
-
-
-public:
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
-protected:
- rtl::OUString const & getBaseUrl() const
- { return mStrataDataUrl; }
-
- static rtl::OUString getDataSuffix()
- { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(kLocalDataSuffix)); }
-//------------------------------------------------------------------------------
- /// raise a NoSupportException for an attempt to update this layer
- void failReadonly();
-
- // helper for implementing the stratum getLayer[s] function[s]
- uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- /**
- Builds a LocalFileLayer object given a subpath
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one.
-
- @param aSubpath Subpath
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the subpath is invalid.
- */
- uno::Reference<backend::XLayer> createReadonlyFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException) ;
-
- /**
- Builds a LocalFileLayer object given a subpath.
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one.
-
- @param aSubpath subpath
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the subpath is invalid.
- */
- uno::Reference<backend::XUpdatableLayer> createUpdatableFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException) ;
-
- /**
- Tells if a file is more recent than a given date.
- The date is formatted YYYYMMDDhhmmssZ.
-
- @param aSubpath relative URL of the component to check
- @param aTimestamp timestamp to check against
- @return sal_True if the file is more recent, sal_False otherwise
- */
- sal_Bool isMoreRecent(const rtl::OUString& aSubpath,
- const rtl::OUString& aTimestamp) ;
-
-protected:
- /// Parses and adjusts the passed base URL
- virtual void adjustBaseURL(rtl::OUString& aBaseURL);
-
-private:
- /**
- Retrieves the appropriate layer and sublayers base directories.
-
- @param aLayerUrl layer base URL, filled on return
- @param aSubLayerUrl sublayer base URL, filled on return
- */
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const = 0;
- virtual const ServiceImplementationInfo * getServiceInfoData() const = 0;
-
-private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /**
- Base of the strata data.
- */
- rtl::OUString mStrataDataUrl ;
-
-} ;
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/makefile.mk b/configmgr/source/localbe/makefile.mk
deleted file mode 100644
index a0445f7a9d76..000000000000
--- a/configmgr/source/localbe/makefile.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=localbe
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/localsinglebackend.obj \
- $(SLO)$/localfilelayer.obj \
- $(SLO)$/localoutputstream.obj \
- $(SLO)$/localdataimportsvc.obj \
- $(SLO)$/localhierarchybrowsersvc.obj \
- $(SLO)$/localschemasupplier.obj \
- $(SLO)$/localstratumbase.obj \
- $(SLO)$/localsinglestratum.obj \
- $(SLO)$/localmultistratum.obj \
- $(SLO)$/localfilehelper.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/localizedpropertynode.cxx b/configmgr/source/localizedpropertynode.cxx
new file mode 100644
index 000000000000..9c5fa3328a58
--- /dev/null
+++ b/configmgr/source/localizedpropertynode.cxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "localizedpropertynode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+LocalizedPropertyNode::LocalizedPropertyNode(
+ int layer, Type staticType, bool nillable):
+ Node(layer), staticType_(staticType), nillable_(nillable)
+{}
+
+rtl::Reference< Node > LocalizedPropertyNode::clone() const {
+ return new LocalizedPropertyNode(*this);
+}
+
+NodeMap & LocalizedPropertyNode::getMembers() {
+ return members_;
+}
+
+Type LocalizedPropertyNode::getStaticType() const {
+ return staticType_;
+}
+
+bool LocalizedPropertyNode::isNillable() const {
+ return nillable_;
+}
+
+LocalizedPropertyNode::LocalizedPropertyNode(
+ LocalizedPropertyNode const & other):
+ Node(other), staticType_(other.staticType_), nillable_(other.nillable_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+LocalizedPropertyNode::~LocalizedPropertyNode() {}
+
+Node::Kind LocalizedPropertyNode::kind() const {
+ return KIND_LOCALIZED_PROPERTY;
+}
+
+void LocalizedPropertyNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx
new file mode 100644
index 000000000000..d5a16af0e54d
--- /dev/null
+++ b/configmgr/source/localizedpropertynode.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDPROPERTYNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDPROPERTYNODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "type.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class LocalizedPropertyNode: public Node {
+public:
+ LocalizedPropertyNode(int layer, Type staticType, bool nillable);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ Type getStaticType() const;
+
+ bool isNillable() const;
+
+private:
+ LocalizedPropertyNode(LocalizedPropertyNode const & other);
+
+ virtual ~LocalizedPropertyNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ Type staticType_;
+ // as specified in the component-schema (TYPE_ANY, ...,
+ // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+ bool nillable_;
+ NodeMap members_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx
new file mode 100644
index 000000000000..f6246106c8fe
--- /dev/null
+++ b/configmgr/source/localizedvaluenode.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any const & value):
+ Node(layer), value_(value)
+{}
+
+rtl::Reference< Node > LocalizedValueNode::clone() const {
+ return new LocalizedValueNode(*this);
+}
+
+rtl::OUString LocalizedValueNode::getTemplateName() const {
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
+}
+
+css::uno::Any LocalizedValueNode::getValue() const {
+ return value_;
+}
+
+void LocalizedValueNode::setValue(int layer, css::uno::Any const & value) {
+ setLayer(layer);
+ value_ = value;
+}
+
+LocalizedValueNode::LocalizedValueNode(LocalizedValueNode const & other):
+ Node(other), value_(other.value_)
+{}
+
+LocalizedValueNode::~LocalizedValueNode() {}
+
+Node::Kind LocalizedValueNode::kind() const {
+ return KIND_LOCALIZED_VALUE;
+}
+
+}
diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx
new file mode 100644
index 000000000000..7f8a5dd987ce
--- /dev/null
+++ b/configmgr/source/localizedvaluenode.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDVALUENODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDVALUENODE_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class LocalizedValueNode: public Node {
+public:
+ LocalizedValueNode(int layer, com::sun::star::uno::Any const & value);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual rtl::OUString getTemplateName() const;
+
+ com::sun::star::uno::Any getValue() const;
+
+ void setValue(int layer, com::sun::star::uno::Any const & value);
+
+private:
+ LocalizedValueNode(LocalizedValueNode const & other);
+
+ virtual ~LocalizedValueNode();
+
+ virtual Kind kind() const;
+
+ com::sun::star::uno::Any value_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
new file mode 100644
index 000000000000..dc7f26a34e73
--- /dev/null
+++ b/configmgr/source/lock.cxx
@@ -0,0 +1,39 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "osl/mutex.hxx"
+
+#include "lock.hxx"
+
+namespace configmgr {
+
+osl::Mutex lock;
+
+}
diff --git a/configmgr/source/lock.hxx b/configmgr/source/lock.hxx
new file mode 100644
index 000000000000..b541f48fbe77
--- /dev/null
+++ b/configmgr/source/lock.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCK_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCK_HXX
+
+#include "sal/config.h"
+
+#include "osl/mutex.hxx"
+
+namespace configmgr {
+
+extern osl::Mutex lock;
+
+}
+
+#endif
diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk
new file mode 100644
index 000000000000..d6972e12b9d8
--- /dev/null
+++ b/configmgr/source/makefile.mk
@@ -0,0 +1,83 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+PRJ = ..
+PRJNAME = configmgr
+TARGET = configmgr
+
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
+
+.INCLUDE: settings.mk
+
+CDEFS += -DOOO_DLLIMPLEMENTATION_CONFIGMGR
+
+SLOFILES = \
+ $(SLO)/access.obj \
+ $(SLO)/broadcaster.obj \
+ $(SLO)/childaccess.obj \
+ $(SLO)/components.obj \
+ $(SLO)/configurationprovider.obj \
+ $(SLO)/configurationregistry.obj \
+ $(SLO)/data.obj \
+ $(SLO)/defaultprovider.obj \
+ $(SLO)/groupnode.obj \
+ $(SLO)/localizedpropertynode.obj \
+ $(SLO)/localizedvaluenode.obj \
+ $(SLO)/lock.obj \
+ $(SLO)/modifications.obj \
+ $(SLO)/node.obj \
+ $(SLO)/nodemap.obj \
+ $(SLO)/pad.obj \
+ $(SLO)/parsemanager.obj \
+ $(SLO)/propertynode.obj \
+ $(SLO)/rootaccess.obj \
+ $(SLO)/services.obj \
+ $(SLO)/setnode.obj \
+ $(SLO)/type.obj \
+ $(SLO)/update.obj \
+ $(SLO)/valueparser.obj \
+ $(SLO)/writemodfile.obj \
+ $(SLO)/xcdparser.obj \
+ $(SLO)/xcsparser.obj \
+ $(SLO)/xcuparser.obj \
+ $(SLO)/xmldata.obj \
+ $(SLO)/xmlreader.obj
+
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALHELPERLIB) \
+ $(SALLIB)
+SHL1TARGET = configmgr
+SHL1USE_EXPORTS = name
+DEF1NAME = $(SHL1TARGET)
+
+.INCLUDE: target.mk
diff --git a/configmgr/source/misc/anypair.cxx b/configmgr/source/misc/anypair.cxx
deleted file mode 100644
index 7574e883336b..000000000000
--- a/configmgr/source/misc/anypair.cxx
+++ /dev/null
@@ -1,688 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <anypair.hxx>
-#include <uno/any2.h>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-#define CFG_PRECOND( expr ) OSL_PRECOND ( expr, "Violated Precondition: " #expr)
-#define CFG_POSTCOND( expr ) OSL_POSTCOND( expr, "Violated Postcondition: " #expr)
-
-namespace configmgr
-{
- namespace css = com::sun::star;
- namespace uno = css::uno;
-
-// -----------------------------------------------------------------------------
- static inline bool impl_Any_hasValue(uno_Any const * _pData)
- { return (typelib_TypeClass_VOID != _pData->pType->eTypeClass); }
-
-// -----------------------------------------------------------------------------
- static inline bool impl_Any_storesData(uno_Any const * _pData)
- {
- const void * pAnyData = _pData->pData;
-
- const bool bSelfReferential = (pAnyData == &_pData->pReserved);
- OSL_ENSURE( bSelfReferential == ( _pData <= pAnyData && pAnyData < _pData+1 ),
- "uno_Any layout changed: Unreckognized self-referentiality" );
-
- return bSelfReferential;
- }
-
-// -----------------------------------------------------------------------------
- static inline void * impl_getDataPointer(const void * const * _pAnyPairData)
- {
- const void * const pResult = *_pAnyPairData;
-
- return const_cast<void*>(pResult);
- }
-
-// -----------------------------------------------------------------------------
- static inline void * impl_getData(const void * const * _pAnyPairData, bool _bStoredData)
- {
- const void * const pResult = _bStoredData ? _pAnyPairData : *_pAnyPairData;
-
- return const_cast<void*>(pResult);
- }
-
-// -----------------------------------------------------------------------------
- static inline void impl_setDataPointer(const void * * _pAnyPairData, void* _pData)
- {
- *_pAnyPairData = _pData;
- }
-// -----------------------------------------------------------------------------
- static const unsigned SHIFT_DATA_FLAG = 4;
-// -----------------------------------------------------------------------------
- static
- inline void impl_state_setState(sal_uInt8* _pState, sal_uInt8 _nState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- OSL_ENSURE( (_nState & nSelectMask) == _nState, "State specified does not belong to the selector");
-
- *_pState &= ~nSelectMask;
- *_pState |= _nState;
- }
-
-// -----------------------------------------------------------------------------
- static
- inline void impl_state_setNull(sal_uInt8* _pState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- *_pState &= ~nSelectMask;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void impl_state_setData(sal_uInt8* _pState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- *_pState |= nSelectMask;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void impl_state_setValue(sal_uInt8* _pState, sal_uInt8 _nSelect, bool _bStoresData)
- {
- *_pState |= _nSelect;
-
- _nSelect <<= SHIFT_DATA_FLAG;
- if (_bStoresData)
- *_pState |= _nSelect;
- else
- *_pState &= ~_nSelect;
- }
-
-// -----------------------------------------------------------------------------
- static
- inline bool impl_state_isNull(sal_uInt8 const _nState, sal_uInt8 _nSelect)
- {
- return 0 == (_nState & _nSelect);
- }
-
-// -----------------------------------------------------------------------------
- static
- inline bool impl_state_isData(sal_uInt8 const _nState, sal_uInt8 _nSelect)
- {
- return 0 != (_nState & (_nSelect<<SHIFT_DATA_FLAG));
- }
-
-
-// -----------------------------------------------------------------------------
- static
- typelib_TypeDescriptionReference * impl_getVoidType()
- {
- static const uno::Type aNullType;
- return aNullType.getTypeLibType();
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_type_construct_Desc( cfgmgr_AnyPair_Desc* _pAnyPairDesc,
- typelib_TypeDescriptionReference * _pType)
- {
- _pAnyPairDesc->nState = 0;
- _pAnyPairDesc->pType = _pType;
-
- typelib_typedescriptionreference_acquire( _pAnyPairDesc->pType );
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_default_construct_Desc( cfgmgr_AnyPair_Desc* _pAnyPairDesc )
- {
- anypair_type_construct_Desc(_pAnyPairDesc, impl_getVoidType());
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_empty_set_Data( const void ** _pAnyPairData )
- {
- impl_setDataPointer(_pAnyPairData, NULL);
- OSL_DEBUG_ONLY( impl_setDataPointer(_pAnyPairData, reinterpret_cast<void*>(0xdeadbeef)) );
- }
-
-// -----------------------------------------------------------------------------
- // returns a state for the specified selector
- static inline
- sal_uInt8 anypair_any_set_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- uno_Any const *_pUnoAny)
- {
- sal_uInt8 nState = 0;
-
- bool bValue = impl_Any_hasValue(_pUnoAny);
- if (bValue)
- {
- uno_Any aTmpAny;
- uno_type_any_construct(&aTmpAny, _pUnoAny->pData, _pUnoAny->pType, reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ));
-
- bool bData = impl_Any_storesData(&aTmpAny);
-
- impl_setDataPointer(_pAnyPairData, bData ? aTmpAny.pReserved : aTmpAny.pData);
-
- impl_state_setValue(&nState, _nSelect, bData);
- }
- else
- anypair_empty_set_Data(_pAnyPairData);
-
- return nState;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- sal_uInt8 anypair_copy_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- cfgmgr_AnyPair_Desc const* _pAnyPairDescFrom,
- const void * const* _pAnyPairDataFrom )
- {
- sal_uInt8 nState = 0;
-
- if (impl_state_isNull(_pAnyPairDescFrom->nState, _nSelect))
- {
- anypair_empty_set_Data(_pAnyPairData);
- }
-
- else
- {
- bool bOldIsData = impl_state_isData(_pAnyPairDescFrom->nState, _nSelect);
-
- void * pFromData = impl_getData(_pAnyPairDataFrom, bOldIsData);
-
- uno_Any aTmpAny;
- uno_type_any_construct(&aTmpAny, pFromData, _pAnyPairDescFrom->pType, reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ));
-
- bool bNewIsData = impl_Any_storesData(&aTmpAny);
- OSL_ENSURE(bOldIsData == bNewIsData, "INFO [safe to ignore]: Copy of uno_Any changes directness !?");
-
- impl_setDataPointer(_pAnyPairData, bNewIsData ? aTmpAny.pReserved : aTmpAny.pData);
-
- impl_state_setValue(&nState, _nSelect, bNewIsData);
- }
-
- return nState;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_destruct_Desc(cfgmgr_AnyPair_Desc* _pAnyPairDesc)
- {
- typelib_typedescriptionreference_release( _pAnyPairDesc->pType );
- OSL_DEBUG_ONLY(_pAnyPairDesc->nState = 0xDD);
- OSL_DEBUG_ONLY(_pAnyPairDesc->pType = (typelib_TypeDescriptionReference*)0xdeadbeef);
- }
-
-// -----------------------------------------------------------------------------
- static
- void anypair_clear_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- cfgmgr_AnyPair_Desc const* _pAnyPairDesc
- )
- {
- if (!impl_state_isNull(_pAnyPairDesc->nState,_nSelect))
- {
- uno_Any aTmpAny;
- aTmpAny.pType = _pAnyPairDesc->pType;
-
- if (impl_state_isData(_pAnyPairDesc->nState,_nSelect))
- {
- aTmpAny.pReserved = impl_getDataPointer(_pAnyPairData);
- aTmpAny.pData = &aTmpAny.pReserved;
- }
- else
- {
- aTmpAny.pReserved = NULL;
- aTmpAny.pData = impl_getDataPointer(_pAnyPairData);
- }
-
- typelib_typedescriptionreference_acquire( aTmpAny.pType );
- uno_any_destruct(&aTmpAny, reinterpret_cast< uno_ReleaseFunc >( uno::cpp_release ));
-
- impl_setDataPointer(_pAnyPairData, NULL);
- OSL_DEBUG_ONLY(impl_setDataPointer(_pAnyPairData, reinterpret_cast<void*>(0xDeadBeef)));
- }
- }
-
-// -----------------------------------------------------------------------------
- static
- void anypair_Data_fill_Any( uno_Any* _pUnoAny,
- cfgmgr_AnyPair_Desc const* _pAnyPairDesc,
- const void * const* _pAnyPairData,
- sal_uInt8 _nSelect )
- {
- if (impl_state_isNull(_pAnyPairDesc->nState,_nSelect))
- {
- _pUnoAny->pType = impl_getVoidType();
- _pUnoAny->pReserved = NULL;
- _pUnoAny->pData = NULL;
- }
- else if (impl_state_isData(_pAnyPairDesc->nState,_nSelect))
- {
- _pUnoAny->pType = _pAnyPairDesc->pType;
- _pUnoAny->pReserved = impl_getDataPointer(_pAnyPairData);
- _pUnoAny->pData = &_pUnoAny->pReserved;
- }
- else
- {
- _pUnoAny->pType = _pAnyPairDesc->pType;
- _pUnoAny->pReserved = NULL;
- _pUnoAny->pData = impl_getDataPointer(_pAnyPairData);
- }
- }
-
-// -----------------------------------------------------------------------------
- static inline
- typelib_TypeDescriptionReference*
- anypair_test_assigned_type( typelib_TypeDescriptionReference* _pOldType,
- typelib_TypeDescriptionReference* _pNewType)
- {
- typelib_TypeDescriptionReference* pResult;
- if ( _pNewType->eTypeClass == typelib_TypeClass_VOID)
- pResult = _pOldType;
-
- else if (_pOldType->eTypeClass == typelib_TypeClass_VOID || _pOldType->eTypeClass == typelib_TypeClass_ANY )
- pResult = _pNewType;
-
- else if ( typelib_typedescriptionreference_equals(_pOldType,_pNewType) )
- pResult = _pOldType;
-
- else
- pResult = NULL;
-
- return pResult;
- }
-
-// -----------------------------------------------------------------------------
- static
- sal_Bool anypair_any_assign_Data( cfgmgr_AnyPair_Desc* _pAnyPairDesc,
- const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- uno_Any const *_pUnoAny)
- {
- typelib_TypeDescriptionReference* pOldType = _pAnyPairDesc->pType;
- typelib_TypeDescriptionReference* pNewType = anypair_test_assigned_type(pOldType,_pUnoAny->pType);
-
- if (pNewType != NULL)
- {
- uno_Any aTmpAny;
- anypair_Data_fill_Any(&aTmpAny,_pAnyPairDesc,_pAnyPairData,_nSelect);
-
- typelib_typedescriptionreference_acquire(aTmpAny.pType);
-
- uno_type_any_assign(&aTmpAny,
- _pUnoAny->pData,
- _pUnoAny->pType,
- reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ),
- reinterpret_cast< uno_AcquireFunc >( uno::cpp_release ));
-
- sal_uInt8 nNewState = anypair_any_set_Data(_pAnyPairData,_nSelect,&aTmpAny);
- impl_state_setState(&_pAnyPairDesc->nState, nNewState, _nSelect);
-
- uno_any_destruct(
- &aTmpAny,
- reinterpret_cast< uno_ReleaseFunc >(uno::cpp_release));
-
- if (pNewType != pOldType)
- {
- typelib_typedescriptionreference_acquire(pNewType);
- typelib_typedescriptionreference_release(pOldType);
- _pAnyPairDesc->pType = pNewType;
- }
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(_pAnyPairDesc,_nSelect) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPairDesc->pType,pNewType) );
- }
- else
- OSL_ENSURE(false, "anypair_assign_XXX(): Cannot assign - Type mismatch");
-
- return (pNewType != NULL);
- }
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- void anypair_construct_default(cfgmgr_AnyPair * _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_default_construct_Desc(&_pAnyPair->desc);
- anypair_empty_set_Data(&_pAnyPair->first);
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- CFG_POSTCOND( cfgmgr_AnyPair_isEmpty(&_pAnyPair->desc) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_type(cfgmgr_AnyPair * _pAnyPair, typelib_TypeDescriptionReference* _pType)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pType != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pType);
- anypair_empty_set_Data(&_pAnyPair->first);
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_first(cfgmgr_AnyPair * _pAnyPair, uno_Any const *_pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pUnoAny->pType);
-
- _pAnyPair->desc.nState = anypair_any_set_Data (&_pAnyPair->first, cfgmgr_SELECT_FIRST, _pUnoAny);
-
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pUnoAny ->pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_second(cfgmgr_AnyPair * _pAnyPair, uno_Any const *_pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pUnoAny->pType);
-
- anypair_empty_set_Data(&_pAnyPair->first);
-
- _pAnyPair->desc.nState = anypair_any_set_Data (&_pAnyPair->second, cfgmgr_SELECT_SECOND, _pUnoAny);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pUnoAny ->pType) );
- }
-
-// -----------------------------------------------------------------------------
- // if type not equal, you got false and the struct contains undefined values
- sal_Bool anypair_construct(cfgmgr_AnyPair * _pAnyPair, uno_Any const * _pFirstAny, uno_Any const *_pSecondAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pFirstAny != NULL );
- CFG_PRECOND( _pSecondAny != NULL );
-
- bool bHasFirst = impl_Any_hasValue(_pFirstAny);
- bool bHasSecond = impl_Any_hasValue(_pSecondAny);
-
- if (bHasFirst && bHasSecond)
- {
- if ( ! typelib_typedescriptionreference_equals(_pFirstAny->pType,_pSecondAny->pType))
- {
- OSL_ENSURE(false, "anypair_construct(): Cannot construct - Different types");
- return false;
- }
- }
-
- anypair_type_construct_Desc(&_pAnyPair->desc, bHasFirst ? _pFirstAny->pType : _pSecondAny->pType);
-
- sal_uInt8 nState = 0;
-
- nState |= anypair_any_set_Data (&_pAnyPair->first, cfgmgr_SELECT_FIRST, _pFirstAny);
- nState |= anypair_any_set_Data (&_pAnyPair->second, cfgmgr_SELECT_SECOND, _pSecondAny);
-
- _pAnyPair->desc.nState = nState;
-
- CFG_POSTCOND((bHasFirst || bHasSecond) == !cfgmgr_AnyPair_isEmpty(&_pAnyPair->desc) );
- CFG_POSTCOND( bHasFirst == !cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- CFG_POSTCOND( bHasSecond == !cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- CFG_POSTCOND( !bHasFirst || typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pFirstAny ->pType) );
- CFG_POSTCOND( !bHasSecond || typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pSecondAny->pType) );
-
- return true;
- }
-
-// -----------------------------------------------------------------------------
- void anypair_copy_construct(cfgmgr_AnyPair* _pAnyPair, cfgmgr_AnyPair const * _pAnyPairFrom)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pAnyPairFrom != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pAnyPairFrom->desc.pType);
-
- sal_uInt8 nState = 0;
-
- nState |= anypair_copy_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST,
- &_pAnyPairFrom->desc, &_pAnyPairFrom->first );
-
- nState |= anypair_copy_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND,
- &_pAnyPairFrom->desc, &_pAnyPairFrom->second );
-
- _pAnyPair->desc.nState = nState;
-
- OSL_ENSURE(_pAnyPairFrom->desc.nState == nState, "Unexpected: Copy changes state");
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pAnyPairFrom->desc.pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_destruct(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc);
- anypair_destruct_Desc(&_pAnyPair->desc );
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool anypair_assign_first(cfgmgr_AnyPair* _pAnyPair, uno_Any const * _pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- return anypair_any_assign_Data(&_pAnyPair->desc, &_pAnyPair->first, cfgmgr_SELECT_FIRST, _pUnoAny);
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool anypair_assign_second(cfgmgr_AnyPair* _pAnyPair, uno_Any const * _pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- return anypair_any_assign_Data(&_pAnyPair->desc, &_pAnyPair->second, cfgmgr_SELECT_SECOND, _pUnoAny);
- }
-
-// -----------------------------------------------------------------------------
- void anypair_assign(cfgmgr_AnyPair* _pAnyPair, cfgmgr_AnyPair const * _pAnyPairFrom)
- {
- if (_pAnyPair != _pAnyPairFrom)
- {
- anypair_destruct(_pAnyPair);
- anypair_copy_construct(_pAnyPair, _pAnyPairFrom);
- }
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_first(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_FIRST);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_second(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc );
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_SECOND);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_values(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc );
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_BOTH);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- }
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- static
- inline
- uno::Any anypair_Data_toAny(cfgmgr_AnyPair_Desc const* _pAnyPairDesc,
- const void * const* _pAnyPairData,
- sal_uInt8 _nSelect)
- {
- uno_Any aTmpAny;
- anypair_Data_fill_Any(&aTmpAny,_pAnyPairDesc,_pAnyPairData,_nSelect);
-
- return uno::Any( aTmpAny.pData, aTmpAny.pType );
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Type const& _aType) // one Type, any's are null
- {
- anypair_construct_type(&m_aAnyPair, _aType.getTypeLibType());
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Any const& _aAny, SelectMember _select)
- {
- switch (_select)
- {
- case SELECT_FIRST: anypair_construct_first(&m_aAnyPair,&_aAny); break;
- case SELECT_SECOND: anypair_construct_second(&m_aAnyPair,&_aAny); break;
- case SELECT_BOTH: OSL_VERIFY( anypair_construct(&m_aAnyPair,&_aAny,&_aAny) ); break;
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- anypair_construct_default(&m_aAnyPair); break;
- }
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Any const& _aAny, uno::Any const& _aAny2) SAL_THROW((lang::IllegalArgumentException))
- {
- if (!anypair_construct(&m_aAnyPair,&_aAny, &_aAny2))
- {
- throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnyPair: Type mismatch in constructor.")),NULL,-1);
- }
- }
-
-// -----------------------------------------------------------------------------
- // copy-ctor
- AnyPair::AnyPair(AnyPair const& _aOther)
- {
- anypair_copy_construct(&m_aAnyPair, &_aOther.m_aAnyPair);
- }
-
-// -----------------------------------------------------------------------------
- // assign operator
- AnyPair& AnyPair::operator=(AnyPair const& _aOther)
- {
- anypair_assign(&m_aAnyPair, &_aOther.m_aAnyPair);
- return *this;
- }
-
-// -----------------------------------------------------------------------------
- // d-tor
- AnyPair::~AnyPair()
- {
- anypair_destruct(&m_aAnyPair);
- }
-
-
-// -----------------------------------------------------------------------------
- sal_Bool AnyPair::setFirst(uno::Any const& _aAny)
- {
- return anypair_assign_first(&m_aAnyPair,&_aAny);
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool AnyPair::setSecond(uno::Any const& _aAny)
- {
- return anypair_assign_second(&m_aAnyPair,&_aAny);
- }
-
-// -----------------------------------------------------------------------------
- void AnyPair::clear(SelectMember _select)
- {
- switch (_select)
- {
- case SELECT_FIRST: anypair_clear_first(&m_aAnyPair); break;
- case SELECT_SECOND: anypair_clear_second(&m_aAnyPair); break;
- case SELECT_BOTH: anypair_clear_values(&m_aAnyPair); break;
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
- uno::Type AnyPair::getValueType() const
- {
- return uno::Type(m_aAnyPair.desc.pType);
- }
-
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getFirst() const
- {
- return anypair_Data_toAny( &m_aAnyPair.desc, &m_aAnyPair.first, cfgmgr_SELECT_FIRST );
- }
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getSecond() const
- {
- return anypair_Data_toAny( &m_aAnyPair.desc, &m_aAnyPair.second, cfgmgr_SELECT_SECOND );
- }
-
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getValue(SelectMember _select) const
- {
- switch (_select)
- {
- case SELECT_FIRST: return getFirst();
- case SELECT_SECOND: return getSecond();
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- case SELECT_BOTH: OSL_ENSURE(false, "AnyPair: Cannot get value - Invalid selector");
- return uno::Any();
- }
- }
-
-// -----------------------------------------------------------------------------
-
-} // namespace
-
diff --git a/configmgr/source/misc/bootstrap.cxx b/configmgr/source/misc/bootstrap.cxx
deleted file mode 100644
index 7a0d31a2d132..000000000000
--- a/configmgr/source/misc/bootstrap.cxx
+++ /dev/null
@@ -1,701 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "bootstrap.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "serviceinfohelper.hxx"
-#include "matchlocale.hxx"
-#include "tracer.hxx"
-#include <cppuhelper/component_context.hxx>
-#include <rtl/bootstrap.hxx>
-#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <osl/diagnose.h>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InstallationIncompleteException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-// ---------------------------------------------------------------------------------------
-// legacy argument names
-#define ARGUMENT_LOCALE_COMPAT "locale"
-#define ARGUMENT_ASYNC_COMPAT "lazywrite"
-#define ARGUMENT_SERVERTYPE_COMPAT "servertype"
-
-// legacy servertype setting
-#define SETTING_SERVERTYPE_COMPAT "ServerType"
-#define BOOTSTRAP_SERVERTYPE_COMPAT CONTEXT_ITEM_PREFIX_ SETTING_SERVERTYPE_COMPAT
-
-#define SERVERTYPE_UNO_COMPAT "uno"
-#define SERVERTYPE_PLUGIN_COMPAT "plugin"
-// ---------------------------------------------------------------------------------------
-
-#define NAME( N ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(N))
-#define ITEM( N ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(N))
-// ---------------------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-// ---------------------------------------------------------------------------------------
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
- static void convertToBool(const uno::Any& aValue, sal_Bool& bValue)
- {
- rtl::OUString aStrValue;
- if (aValue >>= aStrValue)
- {
- if (aStrValue.equalsIgnoreAsciiCaseAscii("true"))
- {
- bValue = sal_True;
- }
- else if (aStrValue.equalsIgnoreAsciiCaseAscii("false"))
- {
- bValue = sal_False;
- }
- }
- }
- // ----------------------------------------------------------------------------------
- const sal_Char k_BootstrapContextImplName[] = "com.sun.star.comp.configuration.bootstrap.BootstrapContext" ;
- const sal_Char k_BootstrapContextServiceName[] = "com.sun.star.configuration.bootstrap.BootstrapContext" ;
-
- // -------------------------------------------------------------------------
- static sal_Char const * const k_BootstrapContextServiceNames [] =
- {
- k_BootstrapContextServiceName,
- 0
- };
- static const ServiceImplementationInfo k_BootstrapContextServiceInfo =
- {
- k_BootstrapContextImplName,
- k_BootstrapContextServiceNames,
- 0
- };
- static const SingletonRegistrationInfo k_BootstrapContextSingletonInfo =
- {
- A_BootstrapContextSingletonName,
- k_BootstrapContextImplName,
- k_BootstrapContextServiceName,
- 0
- };
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xTargetContext )
- {
- uno::Reference< uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- BootstrapContext * pContext = new BootstrapContext(xContext);
- uno::Reference< uno::XComponentContext > xResult(pContext);
-
- pContext->initialize();
-
- return uno::Reference< uno::XInterface >( xResult, uno::UNO_QUERY );
- }
-
- const SingletonRegistrationInfo * getBootstrapContextSingletonInfo()
- {
- return &k_BootstrapContextSingletonInfo;
- }
- const ServiceRegistrationInfo * getBootstrapContextServiceInfo()
- {
- return getRegistrationInfo(&k_BootstrapContextServiceInfo);
- }
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
- static
- inline
- cppu::ContextEntry_Init makeEntry(beans::NamedValue const & aOverride)
- {
- return cppu::ContextEntry_Init(aOverride.Name,aOverride.Value);
- }
-// ---------------------------------------------------------------------------
-
- static
- cppu::ContextEntry_Init makeSingleton(SingletonRegistrationInfo const * pSingletonInfo)
- {
- OSL_ASSERT( pSingletonInfo &&
- pSingletonInfo->singletonName &&
- pSingletonInfo->instantiatedServiceName );
-
- rtl::OUStringBuffer aSingletonName;
- aSingletonName.appendAscii( RTL_CONSTASCII_STRINGPARAM(SINGLETON_) );
- aSingletonName.appendAscii(pSingletonInfo->singletonName);
-
- rtl::OUString const aServiceName = rtl::OUString::createFromAscii(pSingletonInfo->instantiatedServiceName);
-
- return cppu::ContextEntry_Init(aSingletonName.makeStringAndClear(), uno::makeAny(aServiceName), true);
- }
-// ---------------------------------------------------------------------------
-
-uno::Reference< uno::XComponentContext > BootstrapContext::createWrapper(uno::Reference< uno::XComponentContext > const & _xContext, uno::Sequence < beans::NamedValue > const & _aOverrides)
-{
- std::vector< cppu::ContextEntry_Init > aContextEntries;
- aContextEntries.reserve(_aOverrides.getLength() + 5);
-
- // marker + bootstrap context
- aContextEntries.push_back( cppu::ContextEntry_Init(NAME(CONTEXT_ITEM_IS_WRAPPER_CONTEXT), uno::makeAny(sal_True)) );
- aContextEntries.push_back( cppu::ContextEntry_Init(NAME(CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT), uno::makeAny(sal_False)) );
-
- aContextEntries.push_back( makeSingleton(getBootstrapContextSingletonInfo()) );
-
- // singletons except for passthrough
- if (!isPassthrough(_xContext))
- {
- aContextEntries.push_back( makeSingleton(getDefaultProviderSingletonInfo()) );
- aContextEntries.push_back( makeSingleton(backend::getDefaultBackendSingletonInfo()) );
- }
-
- for (sal_Int32 i = 0; i<_aOverrides.getLength(); ++i)
- aContextEntries.push_back( makeEntry(_aOverrides[i]) );
-
- return cppu::createComponentContext(&aContextEntries.front(),aContextEntries.size(),_xContext);
-}
-// ---------------------------------------------------------------------------
-
-sal_Bool BootstrapContext::isWrapper(uno::Reference< uno::XComponentContext > const & _xContext)
-{
- OSL_ASSERT(_xContext.is());
- if (!_xContext.is()) return false;
-
- uno::Any aSetting = _xContext->getValueByName( NAME(CONTEXT_ITEM_IS_WRAPPER_CONTEXT) );
-
- if (!aSetting.hasValue()) return false;
-
- sal_Bool bValue = false;
- OSL_VERIFY(aSetting >>= bValue);
-
- return bValue;
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-BootstrapContext::BootstrapContext(uno::Reference< uno::XComponentContext > const & _xContext)
-: ComponentContext(_xContext)
-{
-}
-// ---------------------------------------------------------------------------
-
-BootstrapContext::~BootstrapContext()
-{
-}
-// ---------------------------------------------------------------------------
-
-void BootstrapContext::initialize()
-{
- // get default Bootstrap URL
- rtl::OUString sURL;
- uno::Any aExplicitURL;
- if ( this->lookupInContext(aExplicitURL,NAME(CONTEXT_ITEM_PREFIX_ SETTING_INIFILE)) )
- {
- OSL_VERIFY(aExplicitURL >>= sURL);
- }
- else if (!rtl::Bootstrap::get(NAME(BOOTSTRAP_ITEM_INIFILE),sURL))
- {
- sURL = getDefaultConfigurationBootstrapURL();
- }
-
- ComponentContext::initialize(sURL);
-}
-// ---------------------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::getDefaultConfigurationBootstrapURL()
-{
- rtl::OUString url(
- RTL_CONSTASCII_USTRINGPARAM(
- "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("configmgr")));
- rtl::Bootstrap::expandMacros(url); //TODO: detect failure
- return url;
-}
-// ---------------------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::makeContextName(rtl::OUString const & _aName)
-{
- // check that it isn't long already
- OSL_ENSURE(!_aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_MODULE_PREFIX_) ),
- "configmgr::BootstrapContext: passing argument in long context form won't work");
-
- return NAME(CONTEXT_ITEM_PREFIX_).concat(_aName);
-}
-// ---------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::makeBootstrapName(rtl::OUString const & _aName)
-{
- // check if already is short
- if (!_aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_) ) )
- {
- OSL_TRACE( "configmgr: Cannot map name to bootstrap name: %s",
- rtl::OUStringToOString(_aName,RTL_TEXTENCODING_ASCII_US).getStr() );
- return _aName;
- }
- return NAME(BOOTSTRAP_ITEM_PREFIX_).concat(_aName.copy(RTL_CONSTASCII_LENGTH(CONTEXT_ITEM_PREFIX_)));
-}
-// ---------------------------------------------------------------------------
-
-uno::Any SAL_CALL
- BootstrapContext::getValueByName( const rtl::OUString& aName )
- throw (uno::RuntimeException)
-{
- sal_Bool const bOurName = aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_MODULE_PREFIX_) );
-
- if (bOurName)
- {
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_BOOTSTRAP_ERROR) ) )
- return this->makeBootstrapException();
-
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_INIFILE) ) )
- return uno::makeAny( this->getBootstrapURL() );
-
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT) ) )
- return uno::makeAny( sal_True );
- }
- else if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SINGLETON_ A_BootstrapContextSingletonName) ) )
- {
- return uno::makeAny( uno::Reference< uno::XComponentContext >(this) );
- }
-
- uno::Any aResult;
-
- bool bFound = lookupInContext ( aResult, aName );
-
- if (!bFound && bOurName) // requires: CONTEXT_ITEM_PREFIX_ starts with CONTEXT_MODULE_PREFIX_
- {
- if ( aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_) ) )
- {
- bFound = lookupInBootstrap( aResult, makeBootstrapName(aName) );
- }
- }
- return aResult;
-}
-
-// ---------------------------------------------------------------------------
-// class ContextReader
-// ---------------------------------------------------------------------------
-
- ContextReader::ContextReader(uno::Reference< uno::XComponentContext > const & context)
- : m_basecontext(context)
- , m_fullcontext()
- {
- OSL_ENSURE(context.is(), "ERROR: trying to create reader on NULL context\n");
- if (context.is())
- {
- uno::Any aBootstrapContext = context->getValueByName( SINGLETON(A_BootstrapContextSingletonName) );
- aBootstrapContext >>= m_fullcontext;
- }
- }
-// ---------------------------------------------------------------------------
-
- uno::Reference< lang::XMultiComponentFactory > ContextReader::getServiceManager() const
- {
- OSL_ASSERT(m_basecontext.is());
- return m_basecontext->getServiceManager();
- }
-// ---------------------------------------------------------------------------
- inline
- uno::Any ContextReader::getSetting(rtl::OUString const & _aSetting) const
- {
- OSL_ASSERT(m_basecontext.is());
- return getBestContext()->getValueByName(_aSetting);
- }
-
- inline
- sal_Bool ContextReader::hasSetting(rtl::OUString const & _aSetting) const
- {
- return getSetting(_aSetting).hasValue();
- }
-
- inline
- sal_Bool ContextReader::getBoolSetting(rtl::OUString const & _aSetting, sal_Bool bValue = false) const
- {
- uno::Any aValue = getSetting(_aSetting);
- if (!(aValue >>= bValue))
- convertToBool(aValue, bValue);
-
- return bValue;
- }
-
- inline
- rtl::OUString ContextReader::getStringSetting(rtl::OUString const & _aSetting, rtl::OUString aValue = rtl::OUString()) const
- {
- getSetting(_aSetting) >>= aValue;
- return aValue;
- }
-// ---------------------------------------------------------------------------------------
-
- sal_Bool ContextReader::isUnoBackend() const
- {
- rtl::OUString aSettingName = NAME(BOOTSTRAP_SERVERTYPE_COMPAT);
-
- rtl::OUString aValue;
- if (getSetting(aSettingName) >>= aValue)
- {
- return aValue.equalsAscii(SERVERTYPE_UNO_COMPAT);
- }
- else
- {
- return true;
- }
- }
-// ---------------------------------------------------------------------------------------
-
- sal_Bool ContextReader::hasUnoBackendService() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOSERVICE) );
- }
- sal_Bool ContextReader::hasUnoBackendWrapper() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOWRAPPER) );
- }
-
- sal_Bool ContextReader::hasLocale() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW) );
- }
- sal_Bool ContextReader::hasAsyncSetting() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW) );
- }
- sal_Bool ContextReader::hasOfflineSetting() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_OFFLINE) );
- }
-// ---------------------------------------------------------------------------------------
-
- rtl::OUString ContextReader::getUnoBackendService() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOSERVICE) );
- }
- rtl::OUString ContextReader::getUnoBackendWrapper() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOWRAPPER) );
- }
-
- rtl::OUString ContextReader::getLocale() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW) );
- }
- sal_Bool ContextReader::getAsyncSetting() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW) );
- }
- sal_Bool ContextReader::getOfflineSetting() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_OFFLINE) );
- }
-
- // get a special setting
- sal_Bool ContextReader::isAdminService() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_ADMINFLAG) );
- }
-
- sal_Bool ContextReader::isBootstrapValid() const
- {
- return this->isUnoBackend() &&
- this->hasUnoBackendService() &&
- (this->hasUnoBackendWrapper() || !this->getOfflineSetting());
- }
-
- uno::Any ContextReader::getBootstrapError() const
- {
- return getSetting( NAME(CONTEXT_ITEM_BOOTSTRAP_ERROR) );
- }
-// ---------------------------------------------------------------------------------------
-
- bool ContextReader::testAdminService(uno::Reference< uno::XComponentContext > const & context, bool bAdmin)
- {
- OSL_ASSERT(context.is());
- if (!context.is()) return false;
-
- uno::Any aSetting = context->getValueByName( NAME(CONTEXT_ITEM_ADMINFLAG) );
-
- sal_Bool bValue = false;
- bool bTest = (aSetting >>= bValue) && bValue;
-
- return bTest == bAdmin;
- }
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::extractArgument(beans::NamedValue & rValue, const uno::Any & aOverride)
- {
- if ( ! (aOverride >>= rValue) )
- {
- // it must be a PropertyValue, if it isn't a NamedValue
- beans::PropertyValue aPV;
- if ( !(aOverride >>= aPV) )
- return false;
-
- rValue.Name = aPV.Name;
- rValue.Value = aPV.Value;
- }
-
- return true;
- }
-
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::checkBackendArgument(beans::NamedValue const & aAdjustedValue)
- {
- bool isWrappable =
- aAdjustedValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW)) ||
- aAdjustedValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW));
-
- if (isWrappable) return false;
-
- m_bHasBackendArguments = true;
- return true;
- }
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::filterAndAdjustArgument(beans::NamedValue & rValue)
- {
- // handle old servertype argument and filter the 'plugin' value
- if (rValue.Name.equalsAscii(ARGUMENT_SERVERTYPE_COMPAT))
- {
- rtl::OUString aServertype;
- if (! (rValue.Value >>= aServertype))
- return false;
-
- if (aServertype.equalsAscii(SERVERTYPE_PLUGIN_COMPAT))
- return false;
-
- rValue.Name = NAME(BOOTSTRAP_SERVERTYPE_COMPAT);
- // check, if it is already there
- uno::Any const aExistingValue = m_context->getValueByName(rValue.Name);
-
- if (aExistingValue.hasValue())
- return !(aExistingValue == rValue.Value);
-
- else
- return !aServertype.equalsAscii(SERVERTYPE_UNO_COMPAT);
- }
-
- // map old argument names for comatibility
- else if (rValue.Name.equalsAscii(ARGUMENT_LOCALE_COMPAT))
- rValue.Name = NAME(SETTING_LOCALE_NEW);
-
- else if (rValue.Name.equalsAscii(ARGUMENT_ASYNC_COMPAT))
- rValue.Name = NAME(SETTING_ASYNC_NEW);
-
- // give the item a long name
- rValue.Name = BootstrapContext::makeContextName(rValue.Name);
-
- // check, if it is already there
- uno::Any const aExistingValue = m_context->getValueByName(rValue.Name);
-
- return ! (aExistingValue == rValue.Value);
- }
-// ---------------------------------------------------------------------------------------
-
- beans::NamedValue ArgumentHelper::makeAdminServiceOverride(sal_Bool bAdmin)
- {
- return beans::NamedValue( NAME(CONTEXT_ITEM_ADMINFLAG), uno::makeAny(bAdmin) );
- }
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-// - bootstrapping error checking helper
-// ---------------------------------------------------------------------------------------
-namespace {
-// ---------------------------------------------------------------------------------------
-// error handling
-// ---------------------------------------------------------------------------------------
- enum BootstrapResult
- {
- BOOTSTRAP_DATA_OK,
- INCOMPLETE_BOOTSTRAP_DATA,
- INCOMPLETE_BOOTSTRAP_FILE,
- MISSING_BOOTSTRAP_FILE,
- BOOTSTRAP_FAILURE
- };
-// ---------------------------------------------------------------------------------------
- static
- rtl::OUString getFallbackErrorMessage( BootstrapResult _rc )
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("The program cannot start. "));
-
- switch (_rc)
- {
- case MISSING_BOOTSTRAP_FILE:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A main configuration file is missing"));
- break;
-
- case INCOMPLETE_BOOTSTRAP_FILE:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A main configuration file is invalid"));
- break;
-
- case INCOMPLETE_BOOTSTRAP_DATA:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Required bootstrap data is not available"));
- break;
-
- default:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unexpected bootstrap failure"));
- break;
-
- case BOOTSTRAP_DATA_OK:
- break;
- }
- sMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (No detailed error message available.)"));
-
- return sMessage;
- }
-// ---------------------------------------------------------------------------------------
-
- static
- uno::Any impl_makeBootstrapException( BootstrapResult _rc, rtl::OUString const& _sMessage, rtl::OUString const& _sURL, uno::Reference< uno::XInterface > _xContext )
- {
- rtl::OUString sMessage(_sMessage);
- // ensure a message
- if (sMessage.getLength()== 0)
- {
- OSL_ENSURE(false, "Bootstrap error message missing");
-
- sMessage = getFallbackErrorMessage(_rc);
- }
-
- // raise the error
- switch (_rc)
- {
- case MISSING_BOOTSTRAP_FILE:
- return uno::makeAny( com::sun::star::configuration::MissingBootstrapFileException(sMessage, _xContext, _sURL) );
-
- case INCOMPLETE_BOOTSTRAP_FILE:
- return uno::makeAny( com::sun::star::configuration::InvalidBootstrapFileException(sMessage, _xContext, _sURL) );
-
- default: OSL_ENSURE(false, "Undefined BootstrapResult code");
- case INCOMPLETE_BOOTSTRAP_DATA:
- case BOOTSTRAP_FAILURE:
- return uno::makeAny( com::sun::star::configuration::CannotLoadConfigurationException(sMessage, _xContext) );
-
- case BOOTSTRAP_DATA_OK:
- break;
- }
- return uno::Any();
- }
-// ---------------------------------------------------------------------------------------
-
- static
- inline
- bool urlExists(rtl::OUString const& _sURL)
- {
- osl::DirectoryItem aCheck;
- return (osl::DirectoryItem::get(_sURL,aCheck) == osl::DirectoryItem::E_None);
- }
-// ---------------------------------------------------------------------------------------
-
- static
- rtl::OUString buildBootstrapError( sal_Char const* _sWhat, rtl::OUString const& _sName, sal_Char const* _sHow)
- {
- rtl::OUStringBuffer sMessage;
-
- sMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM("The program cannot start. "));
- sMessage.appendAscii(_sWhat);
- sMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM(" '")).append(_sName).appendAscii(RTL_CONSTASCII_STRINGPARAM("' "));
- sMessage.appendAscii(_sHow).appendAscii(". ");
-
- return sMessage.makeStringAndClear();
- }
-// ---------------------------------------------------------------------------------------
-
- BootstrapResult getBootstrapErrorMessage(BootstrapContext const & aContext, ContextReader const & aSettings, rtl::OUString& _rMessage, rtl::OUString& _rIniFile )
- {
- BootstrapResult eResult = BOOTSTRAP_DATA_OK;
-
- _rIniFile = aContext.getBootstrapURL();
-
- if ( !urlExists(_rIniFile) )
- {
- _rMessage = buildBootstrapError("The configuration file ",_rIniFile.copy(1+_rIniFile.lastIndexOf('/')),"is missing");
- eResult = MISSING_BOOTSTRAP_FILE;
- }
- else if (!aSettings.isUnoBackend())
- {
- _rMessage = buildBootstrapError("The configuration file ",_rIniFile.copy(1+_rIniFile.lastIndexOf('/')),"is for an older version of the configuration database");
- eResult = INCOMPLETE_BOOTSTRAP_FILE;
- }
- else if (!aSettings.isBootstrapValid() )
- {
- _rMessage = buildBootstrapError("Needed information to access",rtl::OUString::createFromAscii("application"), "configuration data is missing");
- eResult = INCOMPLETE_BOOTSTRAP_DATA;
- }
-
- return eResult;
- }
-// ---------------------------------------------------------------------------------------
-} // anonymous namespace
-// ---------------------------------------------------------------------------------------
-uno::Any BootstrapContext::makeBootstrapException()
-{
- ContextReader aReader(this);
-
- if (aReader.isBootstrapValid()) return uno::Any();
-
- rtl::OUString sMessage,sURL;
-
- BootstrapResult rc = getBootstrapErrorMessage(*this,aReader,sMessage,sURL);
-
- return impl_makeBootstrapException(rc,sMessage,sURL,*this);
-}
-// ---------------------------------------------------------------------------
-rtl::OUString SAL_CALL
- BootstrapContext::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- BootstrapContext::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<rtl::OUString> SAL_CALL
- BootstrapContext::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).getSupportedServiceNames() ;
-}
-// ---------------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/bootstrapcontext.cxx b/configmgr/source/misc/bootstrapcontext.cxx
deleted file mode 100644
index 0d6b13fe4d02..000000000000
--- a/configmgr/source/misc/bootstrapcontext.cxx
+++ /dev/null
@@ -1,414 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "bootstrapcontext.hxx"
-#include "datalock.hxx"
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "utility.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-#define IMPL_ITEM_PREFIX_ "/implementations/com.sun.star.com.configuration.bootstrap.ComponentContext/"
-#define IMPL_ITEM_PASSTHRU IMPL_ITEM_PREFIX_"isPassthrough"
-#define IMPL_ITEM_BASECONTEXT IMPL_ITEM_PREFIX_"theBaseContext"
-#define A_SERVICEMANAGER "com.sun.star.lang.theServiceManager"
-// ---------------------------------------------------------------------------
-
-#define OUSTR( text ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( text ) )
-#define OU2ASCII( str ) ( rtl::OUStringToOString(str,RTL_TEXTENCODING_ASCII_US) .getStr() )
-// ---------------------------------------------------------------------------
-#if 0
-static void testComplete()
-{
- uno::Reference< uno::XInterface > test = * new ComponentContext(uno::Reference< uno::XComponentContext >,uno::Sequence < beans::NamedValue >(),true);
-}
-#endif
-// ---------------------------------------------------------------------------
-
-ComponentContext::ComponentContext(uno::Reference< uno::XComponentContext > const & _xContext)
-: cppu::WeakComponentImplHelper3 < uno::XComponentContext, uno::XCurrentContext, lang::XServiceInfo >(UnoApiLock::getLock())
-, m_xContext(_xContext)
-, m_hBootstrapData(NULL)
-, m_xServiceManager()
-{
-}
-// ---------------------------------------------------------------------------
-
-ComponentContext::~ComponentContext()
-{
- if (m_hBootstrapData) rtl_bootstrap_args_close(m_hBootstrapData);
-}
-// ---------------------------------------------------------------------------
-
-void ComponentContext::initialize( const rtl::OUString& _aURL )
-{
- UnoApiLock aLock;
-
- OSL_ASSERT(!m_hBootstrapData);
- m_hBootstrapData = rtl_bootstrap_args_open(_aURL.pData);
-
- uno::Reference< lang::XComponent > xOwner(m_xContext, uno::UNO_QUERY);
-
- if (xOwner.is()) DisposingForwarder::forward(xOwner,this);
-
- if (!m_xContext.is())
- {
- OSL_ENSURE(rBHelper.bDisposed,"ComponentContext::initialize - Context unexpectedly missing");
- throw lang::DisposedException(OUSTR("Parent context has been disposed early"),*this);
- }
-}
-// ---------------------------------------------------------------------------
-
-// ComponentHelper
-void SAL_CALL ComponentContext::disposing()
-{
- UnoApiLock aLock;
-
- m_xContext.clear();
-
- if (m_hBootstrapData)
- {
- rtl_bootstrap_args_close(m_hBootstrapData);
- m_hBootstrapData = NULL;
- }
-}
-// ---------------------------------------------------------------------------
-
-rtl::OUString ComponentContext::getBootstrapURL() const
-{
- rtl::OUString aResult;
-
- UnoApiLock aLock;
-
- if (m_hBootstrapData)
- {
- rtl_bootstrap_get_iniName_from_handle(m_hBootstrapData,&aResult.pData);
- }
- else
- {
- OSL_TRACE( "configmgr: No bootstrap data URL set");
- }
-
- return aResult;
-}
-// ---------------------------------------------------------------------------
-
-uno::Reference< lang::XMultiComponentFactory > SAL_CALL
- ComponentContext::getServiceManager( )
- throw (uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!m_xServiceManager.is())
- {
- uno::Reference< uno::XComponentContext > xBase = basecontext();
- if (!xBase.is())
- throw lang::DisposedException(OUSTR("Parent context has been disposed"),*this);
-
- uno::Reference< lang::XMultiComponentFactory > xBaseServiceManager = xBase->getServiceManager();
- OSL_ENSURE( xBaseServiceManager.is(), "Base context has no service manager");
-
- if (xBaseServiceManager.is())
- {
- // create new smgr based on delegate's one
- m_xServiceManager.set(
- xBaseServiceManager->createInstanceWithContext( OUSTR("com.sun.star.comp.stoc.OServiceManagerWrapper"), xBase ),
- uno::UNO_QUERY );
- // patch DefaultContext property of new one
- uno::Reference< beans::XPropertySet > xProps( m_xServiceManager, uno::UNO_QUERY );
- OSL_ASSERT( xProps.is() );
- if (xProps.is())
- {
- uno::Reference< XComponentContext > xThis( this );
- xProps->setPropertyValue( OUSTR("DefaultContext"), uno::makeAny( xThis ) );
- }
- else
- OSL_ENSURE(!m_xServiceManager.is(), "Cannot set Default Context of Service Manager Wrapper: no property set");
- }
- }
- return m_xServiceManager;
-}
-// ---------------------------------------------------------------------------
-
-
-// ---------------------------------------------------------------------------
-
-sal_Bool ComponentContext::isPassthrough(uno::Reference< uno::XComponentContext > const & _xContext)
-{
- OSL_ENSURE(_xContext.is(),"Unexpected NULL context");
- if (!_xContext.is()) return false;
-
- sal_Bool bValue = false;
- _xContext->getValueByName(OUSTR(IMPL_ITEM_PASSTHRU)) >>= bValue;
- return bValue;
-}
-// ---------------------------------------------------------------------------
-
-beans::NamedValue ComponentContext::makePassthroughMarker(sal_Bool bPassthrough)
-{
- return beans::NamedValue(OUSTR(IMPL_ITEM_PASSTHRU),uno::makeAny(bPassthrough));
-}
-// ---------------------------------------------------------------------------
-
-bool ComponentContext::lookupInContext( uno::Any & _rValue, const rtl::OUString& _aName ) const
-{
- uno::Reference< uno::XComponentContext > xBase = basecontext();
- if (!xBase.is())
- throw lang::DisposedException(OUSTR("Parent context has been disposed"),const_cast<ComponentContext&>(*this));
-
- if (_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( IMPL_ITEM_BASECONTEXT )))
- {
- _rValue = uno::makeAny(xBase);
- return true;
- }
-
- uno::Any aCtxValue = xBase->getValueByName( _aName );
-
- if (aCtxValue.hasValue())
- {
- _rValue = aCtxValue;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------
-
-bool ComponentContext::lookupInBootstrap( uno::Any & _rValue, const rtl::OUString& _aName ) const
-{
- UnoApiLock aLock;
- rtl::OUString sResult;
- if ( rtl_bootstrap_get_from_handle( m_hBootstrapData, _aName.pData, &sResult.pData, 0) )
- {
- _rValue <<= sResult;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-static const char k_TunneledContext[] = "/services/com.sun.star.configuration.bootstrap.Context";
-
-class UnoContextTunnel::Tunnel
-: public ::cppu::WeakImplHelper2< uno::XCurrentContext, lang::XUnoTunnel >
-{
- uno::Reference< uno::XComponentContext > m_xTunneledContext;
- uno::Reference< uno::XCurrentContext > m_xOldContext;
- uno::Any m_aFailure;
-public:
- Tunnel(uno::Reference< uno::XComponentContext > const & xTunneledContext, uno::Reference< uno::XCurrentContext > const & xOldContext)
- : m_xTunneledContext(xTunneledContext)
- , m_xOldContext(xOldContext)
- , m_aFailure()
- {}
-
- virtual uno::Any SAL_CALL
- getValueByName( const rtl::OUString& name )
- throw (uno::RuntimeException)
- {
- if (name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(k_TunneledContext) ) )
- {
- return uno::makeAny(m_xTunneledContext);
- }
- else if (m_xOldContext.is())
- {
- return m_xOldContext->getValueByName(name);
- }
- else
- {
- return uno::Any();
- }
- }
-
- virtual sal_Int64 SAL_CALL
- getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw (uno::RuntimeException)
- {
- if (getTunnelId() == aIdentifier)
- return reinterpret_cast<sal_Int64>(&m_aFailure);
- else
- return 0;
- }
-
- static uno::Any * getFailure(uno::Reference< lang::XUnoTunnel > const & xTunnel);
-
- static uno::Sequence< sal_Int8 > getTunnelId();
-};
-// ---------------------------------------------------------------------------
-
-uno::Sequence< sal_Int8 > UnoContextTunnel::Tunnel::getTunnelId()
-{
- static ::cppu::OImplementationId aTunnelId;
- return aTunnelId.getImplementationId();
-}
-// ---------------------------------------------------------------------------
-
-uno::Any * UnoContextTunnel::Tunnel::getFailure(uno::Reference< lang::XUnoTunnel > const & xTunnel)
-{
- if (xTunnel.is())
- {
- if (sal_Int64 nSomething = xTunnel->getSomething(getTunnelId()))
- {
- return reinterpret_cast<uno::Any *>(nSomething);
- }
- }
- return NULL;
-}
-// ---------------------------------------------------------------------------
-
-UnoContextTunnel::UnoContextTunnel()
-: m_xOldContext( uno::getCurrentContext() )
-, m_xActiveTunnel()
-{
-}
-// ---------------------------------------------------------------------------
-
-UnoContextTunnel::~UnoContextTunnel()
-{
- uno::setCurrentContext( m_xOldContext );
-}
-// ---------------------------------------------------------------------------
-
-void UnoContextTunnel::passthru(uno::Reference< uno::XComponentContext > const & xContext)
-{
- OSL_ASSERT( xContext.is() );
- if ( ComponentContext::isPassthrough(xContext) )
- {
- this ->tunnel(xContext);
- }
- else
- {
- this->tunnel(NULL);
- }
-}
-// ---------------------------------------------------------------------------
-
-void UnoContextTunnel::tunnel(uno::Reference< uno::XComponentContext > const & xContext)
-{
- Tunnel * pNewTunnel = new Tunnel(xContext,m_xOldContext);
- m_xActiveTunnel = pNewTunnel;
- uno::setCurrentContext( pNewTunnel );
-}
-// ---------------------------------------------------------------------------
-
-uno::Reference< uno::XComponentContext > UnoContextTunnel::recoverContext(uno::Reference< uno::XComponentContext > const & xFallback )
-{
- try
- {
- uno::Reference< uno::XCurrentContext > const xCurrContext = uno::getCurrentContext();
-
- if (xCurrContext.is())
- {
- rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(k_TunneledContext));
- uno::Reference< uno::XComponentContext > xResult;
- if (xCurrContext->getValueByName(aName) >>= xResult)
- {
- if (xResult.is())
- return xResult;
- }
- else
- {
- OSL_ASSERT( !xResult.is() );
- OSL_ENSURE( !xCurrContext->getValueByName(aName).hasValue(),
- "Value in context has wrong type");
- }
- }
- }
- catch (uno::Exception &)
- {
- OSL_ENSURE(false, "Unexpected: Exception from accessing current context");
- }
-
- return xFallback;
-}
-// ---------------------------------------------------------------------------
-
-uno::Any UnoContextTunnel::recoverFailure(bool bRaise)
-{
- if (uno::Any * pFail = UnoContextTunnel::Tunnel::getFailure(m_xActiveTunnel))
- {
- if (bRaise)
- {
- if (pFail->hasValue())
- cppu::throwException(*pFail);
- else
- throw;
- }
- return *pFail;
- }
-
- return uno::Any();
-}
-// ---------------------------------------------------------------------------
-
-bool UnoContextTunnel::tunnelFailure(uno::Any const & aException, bool bRaise)
-{
- OSL_ASSERT( !aException.hasValue() || aException.getValueTypeClass() == uno::TypeClass_EXCEPTION );
-
- uno::Reference< lang::XUnoTunnel > xTunnel( uno::getCurrentContext(), uno::UNO_QUERY );
-
- if (uno::Any * pFail = Tunnel::getFailure(xTunnel))
- {
- *pFail = aException;
-
- if (bRaise && aException.hasValue())
- cppu::throwException(aException);
-
- if (bRaise) throw;
- return true;
- }
- else
- {
- if (bRaise) throw;
- return false;
- }
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-void DisposingForwarder::disposing( lang::EventObject const & /*rSource*/ )
-throw (uno::RuntimeException)
-{
- m_xTarget->dispose();
- m_xTarget.clear();
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/bufferedfile.cxx b/configmgr/source/misc/bufferedfile.cxx
deleted file mode 100644
index b9d3f51d419d..000000000000
--- a/configmgr/source/misc/bufferedfile.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <string.h>
-#include "bufferedfile.hxx"
-
-#include "filehelper.hxx"
-
-#include <algorithm>
-
-
-namespace configmgr
-{
-
-BufferedOutputFile::BufferedOutputFile( rtl::OUString const& aFileURL, sal_uInt32 nBufferSizeHint )
-: m_pFile(new osl::File(aFileURL))
-, m_buffer()
-{
- m_buffer.reserve( nBufferSizeHint ? nBufferSizeHint : 512 );
-}
-
-BufferedOutputFile::~BufferedOutputFile ()
-{
- delete m_pFile;
-}
-
-
-BufferedOutputFile::RC BufferedOutputFile::open( sal_uInt32 uFlags )
-{
- if (!m_pFile) return E_BADF;
-
- return m_pFile->open(uFlags);
-}
-
-BufferedOutputFile::RC BufferedOutputFile::close()
-{
- if (!m_pFile) return E_BADF;
-
- RC rc = this->sync();
- RC rc2 = m_pFile->close();
-
- delete m_pFile, m_pFile = 0;
- if (rc == E_None)
- rc = rc2;
- return rc;
-}
-
-
-//BufferedOutputFile::RC BufferedOutputFile::getPos( sal_uInt64& uPos )
-
-BufferedOutputFile::RC BufferedOutputFile::write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten)
-{
- if (!m_pFile) return E_BADF;
-
- if (uBytesToWrite > m_buffer.max_size()-m_buffer.size())
- {
- // write big chunks natively
- RC rc = this->sync();
- if (rc == E_None)
- {
- OSL_ASSERT(m_buffer.empty());
- rc = m_pFile->write(pBuffer, uBytesToWrite, rBytesWritten);
- }
- return rc;
- }
-
- // FIXME: handle out-out-memory here
- const sal_uInt8 * data = static_cast<const sal_uInt8 *>(pBuffer);
- m_buffer.insert(m_buffer.end(), data, data + uBytesToWrite);
- rBytesWritten = uBytesToWrite;
-
- return E_None;
-}
-
-BufferedOutputFile::RC BufferedOutputFile::sync()
-{
- if (!m_pFile) return E_BADF;
-
- sal_uInt64 size = m_buffer.size();
- sal_uInt64 written = 0;
-
- RC rc = m_pFile->write(&m_buffer.front(),size,written);
-
- if (rc != E_None)
- return rc;
-
- // we don't support special files where multiple write passes are needed
- if (written < size)
- {
- // but we try our best to stay consistent
- m_buffer.erase(m_buffer.begin(),
- m_buffer.end() + sal::static_int_cast<sal_uInt32>( written ));
-
- return E_IO;
- }
-
- m_buffer.clear();
-
- return E_None;
-}
-
-} // namespace configmgr
-
diff --git a/configmgr/source/misc/configinteractionhandler.cxx b/configmgr/source/misc/configinteractionhandler.cxx
deleted file mode 100644
index 0abf589d95bd..000000000000
--- a/configmgr/source/misc/configinteractionhandler.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "sal/config.h"
-
-#include "configinteractionhandler.hxx"
-
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/XCurrentContext.hpp"
-#include "cppuhelper/implbase1.hxx"
-#include "rtl/string.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-#include "uno/current_context.hxx"
-
-namespace {
-
-namespace css = com::sun::star;
-
-static char const INTERACTION_HANDLER[] = "configuration.interaction-handler";
-
-}
-
-namespace configmgr { namespace apihelper {
-
-class ConfigurationInteractionHandler::Context:
- public cppu::WeakImplHelper1< css::uno::XCurrentContext >
-{
-public:
- explicit Context(ConfigurationInteractionHandler * parent):
- m_parent(parent) {}
-
- virtual css::uno::Any SAL_CALL getValueByName(rtl::OUString const & name)
- throw (css::uno::RuntimeException)
- {
- return
- name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(INTERACTION_HANDLER))
- ? m_handler : m_parent->getPreviousContextValue(name);
- }
-
- void setInteractionHandler(
- css::uno::Reference< css::task::XInteractionHandler > const & handler)
- { m_handler <<= handler; }
-
-private:
- Context(Context &); // not defined
- void operator =(Context &); // not defined
-
- virtual ~Context() {}
-
- ConfigurationInteractionHandler * m_parent;
- css::uno::Any m_handler;
-};
-
-ConfigurationInteractionHandler::ConfigurationInteractionHandler():
- m_context(new Context(this)), m_layer(m_context.get()) {}
-
-ConfigurationInteractionHandler::~ConfigurationInteractionHandler() {}
-
-css::uno::Reference< css::task::XInteractionHandler >
-ConfigurationInteractionHandler::get() const {
- return css::uno::Reference< css::task::XInteractionHandler >(
- getPreviousContextValue(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(INTERACTION_HANDLER))),
- css::uno::UNO_QUERY);
-}
-
-void ConfigurationInteractionHandler::setRecursive(
- css::uno::Reference< css::task::XInteractionHandler > const & handler)
-{
- m_context->setInteractionHandler(handler);
-}
-
-css::uno::Any ConfigurationInteractionHandler::getPreviousContextValue(
- rtl::OUString const & name) const
-{
- css::uno::Reference< css::uno::XCurrentContext > c(
- m_layer.getPreviousContext());
- return c.is() ? c->getValueByName(name) : css::uno::Any();
-}
-
-} }
diff --git a/configmgr/source/misc/configunoreg.cxx b/configmgr/source/misc/configunoreg.cxx
deleted file mode 100644
index 2ab55dec6e5a..000000000000
--- a/configmgr/source/misc/configunoreg.cxx
+++ /dev/null
@@ -1,386 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "confapifactory.hxx"
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/factory.hxx>
-#include <rtl/ustrbuf.hxx>
-
-// ***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void RegisterService(
- const configmgr::ServiceRegistrationInfo* pInfo,
- const com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > & xKey)
-{
- if (pInfo == 0 || pInfo->registeredServiceNames==0 || pInfo->implementationName==0)
- return;
-
- rtl::OUStringBuffer aMainKeyName;
- aMainKeyName.appendAscii("/");
- aMainKeyName.appendAscii(pInfo->implementationName);
- aMainKeyName.appendAscii("/UNO/SERVICES");
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName.makeStringAndClear()) );
- OSL_ENSURE(xNewKey.is(), "CONFMGR::component_writeInfo : could not create a registry key !");
-
- for(sal_Char const * const* p = pInfo->registeredServiceNames ; *p; ++p)
- {
- xNewKey->createKey(rtl::OUString::createFromAscii(*p));
- }
-}
-
-//---------------------------------------------------------------------------------------
-
-void RegisterSingleton(
- const configmgr::SingletonRegistrationInfo* pInfo,
- const com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > & xKey)
-{
- if (pInfo == 0 || pInfo->singletonName ==0 ||
- pInfo->implementationName ==0 ||
- pInfo->instantiatedServiceName ==0 )
- return;
-
- rtl::OUStringBuffer aSingletonKeyName;
- aSingletonKeyName.appendAscii("/");
- aSingletonKeyName.appendAscii(pInfo->implementationName);
- aSingletonKeyName.appendAscii("/UNO/SINGLETONS/");
- aSingletonKeyName.appendAscii(pInfo->singletonName);
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aSingletonKeyName.makeStringAndClear()) );
- OSL_ENSURE(xNewKey.is(), "CONFMGR::component_writeInfo : could not create a registry key !");
-
- xNewKey->setStringValue(rtl::OUString::createFromAscii(pInfo->instantiatedServiceName));
-
- if (pInfo->mappedImplementation != 0)
- RegisterService(pInfo->mappedImplementation,xKey);
-}
-
-
-//-----------------------------------------------------------------------------
-struct ServiceImplementationRequest
-{
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xRet;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const m_xServiceManager;
- rtl::OUString const sImplementationName;
-
- //-------------------------------------------------------------------------
- ServiceImplementationRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : m_xServiceManager(reinterpret_cast<com::sun::star::lang::XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(rtl::OUString::createFromAscii(pImplementationName))
- {
- }
- //-------------------------------------------------------------------------
- inline
- sal_Bool shouldCreate(const configmgr::ServiceRegistrationInfo* pInfo) const
- {
- OSL_ENSURE(!xRet.is(), "CreateProvider : invalid creation request: we already have a return value !");
- return !xRet.is() &&
- pInfo != 0 &&
- 0 == sImplementationName.compareToAscii(pInfo->implementationName);
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateProviderFactory(
- const configmgr::ServiceRegistrationInfo* pInfo,
- bool bAdmin
- )
- {
- if (this->shouldCreate(pInfo))
- try
- {
- configmgr::ServiceRegistrationHelper aInfo(pInfo);
-
- const com::sun::star::uno::Sequence< rtl::OUString > Services= aInfo.getRegisteredServiceNames();
-
- xRet = configmgr::createProviderFactory( aInfo.getImplementationName(), bAdmin);
-
- OSL_ENSURE(xRet.is(), "CreateProvider : WHERE IS THE return value !");
- }
- catch(com::sun::star::uno::Exception&)
- {
- }
- return xRet.is();
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateServiceFactory(
- const configmgr::ServiceRegistrationInfo* pInfo,
- ::cppu::ComponentFactoryFunc Factory
- )
- {
- if (this->shouldCreate(pInfo))
- try
- {
- configmgr::ServiceRegistrationHelper aInfo(pInfo);
-
- const com::sun::star::uno::Sequence< rtl::OUString > Services= aInfo.getRegisteredServiceNames();
-
- xRet = cppu::createSingleComponentFactory( Factory, aInfo.getImplementationName(), Services, 0);
-
- OSL_ENSURE(xRet.is(), "CreateProvider : WHERE IS THE return value !");
- }
- catch(com::sun::star::uno::Exception&)
- {
- }
- return xRet.is();
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateSingletonMapperFactory(
- const configmgr::SingletonRegistrationInfo* pInfo,
- ::cppu::ComponentFactoryFunc Mapper
- )
- {
- OSL_ENSURE(pInfo && pInfo->mappedImplementation, "CreateProvider : Cannot map unmapped singleton !");
-
- return pInfo && pInfo->mappedImplementation &&
- CreateServiceFactory(pInfo->mappedImplementation,Mapper);
- }
-
- //-------------------------------------------------------------------------
- void* getService() const
- {
- // we want to transport the interface pointer as flat C void pointer, so this prevents deletion
- if (xRet.is())
- xRet->acquire();
-
- return xRet.get();
- }
-};
-
-//---------------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT
-void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /* pServiceManager */,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast<com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- // configuration access entry points: configuration provider
- RegisterSingleton(configmgr::getDefaultProviderSingletonInfo(), xKey) ;
-
- RegisterService(configmgr::getConfigurationProviderServiceInfo(), xKey);
- RegisterService(configmgr::getDefaultProviderServiceInfo(), xKey);
- RegisterService(configmgr::getAdminProviderServiceInfo(), xKey);
-
- // registry wrapper (deprecated)
- RegisterService(configmgr::getConfigurationRegistryServiceInfo(), xKey);
-
- // updating
- RegisterService(configmgr::backend::getUpdateMergerServiceInfo(), xKey);
-
- // xml handling
- RegisterService(configmgr::xml::getSchemaParserServiceInfo(), xKey);
- RegisterService(configmgr::xml::getLayerParserServiceInfo(), xKey);
- RegisterService(configmgr::xml::getLayerWriterServiceInfo(), xKey);
-
- // bootstrap handling
- RegisterSingleton(configmgr::getBootstrapContextSingletonInfo(), xKey) ;
- RegisterService(configmgr::getBootstrapContextServiceInfo(), xKey) ;
-
- // backend singletons
- RegisterSingleton(configmgr::backend::getDefaultBackendSingletonInfo(), xKey) ;
-
- // backends
- RegisterService(configmgr::backend::getDefaultBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::backend::getSingleBackendAdapterServiceInfo(), xKey) ;
- RegisterService(configmgr::backend::getMultiStratumBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalDataImportServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalHierarchyBrowserServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalSchemaSupplierServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalLegacyStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalDataStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalReadonlyStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalResourceStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalMultiStratumServiceInfo(), xKey) ;
-
- // im/export
- RegisterService(configmgr::backend::getMergeImportServiceInfo(), xKey);
- RegisterService(configmgr::backend::getCopyImportServiceInfo(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "configmgr: component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ServiceImplementationRequest aReq(pServiceManager,pImplementationName);
-
- // configuration access entry points: configuration provider
- aReq.CreateProviderFactory(
- configmgr::getConfigurationProviderServiceInfo(),
- false)
- ||
- aReq.CreateProviderFactory(
- configmgr::getAdminProviderServiceInfo(),
- true)
- ||
- aReq.CreateServiceFactory(
- configmgr::getDefaultProviderServiceInfo(),
- &configmgr::instantiateDefaultProvider)
- ||
- // registry wrapper (deprecated)
- aReq.CreateServiceFactory(
- configmgr::getConfigurationRegistryServiceInfo(),
- &configmgr::instantiateConfigRegistry)
- ||
- // updating
- aReq.CreateServiceFactory(
- configmgr::backend::getUpdateMergerServiceInfo(),
- &configmgr::backend::instantiateUpdateMerger)
- ||
- // xml handling
- aReq.CreateServiceFactory(
- configmgr::xml::getSchemaParserServiceInfo(),
- &configmgr::xml::instantiateSchemaParser)
- ||
- aReq.CreateServiceFactory(
- configmgr::xml::getLayerParserServiceInfo(),
- &configmgr::xml::instantiateLayerParser)
- ||
- aReq.CreateServiceFactory(
- configmgr::xml::getLayerWriterServiceInfo(),
- &configmgr::xml::instantiateLayerWriter)
- ||
- // bootstrap handling
- aReq.CreateServiceFactory(
- configmgr::getBootstrapContextServiceInfo(),
- &configmgr::instantiateBootstrapContext)
- ||
- // backend singletons
- aReq.CreateSingletonMapperFactory(
- configmgr::backend::getDefaultBackendSingletonInfo(),
- configmgr::backend::getDefaultBackendSingleton)
- ||
- // backends
- aReq.CreateServiceFactory(
- configmgr::backend::getDefaultBackendServiceInfo(),
- configmgr::backend::instantiateDefaultBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getSingleBackendAdapterServiceInfo(),
- configmgr::backend::instantiateSingleBackendAdapter)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getMultiStratumBackendServiceInfo(),
- configmgr::backend::instantiateMultiStratumBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalBackendServiceInfo(),
- configmgr::localbe::instantiateLocalBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalDataImportServiceInfo(),
- configmgr::localbe::instantiateLocalDataImporter)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalHierarchyBrowserServiceInfo(),
- configmgr::localbe::instantiateLocalHierarchyBrowser)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalSchemaSupplierServiceInfo(),
- configmgr::localbe::instantiateLocalSchemaSupplier)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalLegacyStratumServiceInfo(),
- configmgr::localbe::instantiateLocalLegacyStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalDataStratumServiceInfo(),
- configmgr::localbe::instantiateLocalDataStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalReadonlyStratumServiceInfo(),
- configmgr::localbe::instantiateLocalReadonlyStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalResourceStratumServiceInfo(),
- configmgr::localbe::instantiateLocalResourceStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalMultiStratumServiceInfo(),
- configmgr::localbe::instantiateLocalMultiStratum)
- ||
- // im/export
- aReq.CreateServiceFactory(
- configmgr::backend::getMergeImportServiceInfo(),
- &configmgr::backend::instantiateMergeImporter)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getCopyImportServiceInfo(),
- &configmgr::backend::instantiateCopyImporter);
-
- pRet = aReq.getService();
- }
-
- return pRet;
-}
-//---------------------------------------------------------------------------------------
-
diff --git a/configmgr/source/misc/filehelper.cxx b/configmgr/source/misc/filehelper.cxx
deleted file mode 100644
index 2f8998fd3f03..000000000000
--- a/configmgr/source/misc/filehelper.cxx
+++ /dev/null
@@ -1,387 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#ifndef _RTL_USTRING_H_
-#include <rtl/ustring.hxx>
-#endif
-#include <osl/file.hxx>
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- //==========================================================================
- //= FileHelper
- //==========================================================================
-
- // -----------------------------------------------------------------------------
- bool FileHelper::tryToRemoveFile(const rtl::OUString& _aURL, bool tryBackupFirst)
- {
- if (tryBackupFirst)
- {
- rtl::OUString aBakURL = _aURL.concat( ASCII(".bak") );
- osl::File::RC eBakError = osl::File::move(_aURL,aBakURL);
- if (eBakError == osl::File::E_None)
- return true;
- }
- osl::File::RC eError = osl::File::remove(_aURL);
- return eError == osl::File::E_None || eError == osl::File::E_NOENT;
- }
- // -----------------------------------------------------------------------------
- void FileHelper::replaceFile(
- const rtl::OUString& _aToURL, const rtl::OUString &_aFromURL) SAL_THROW((io::IOException))
- {
- osl::File::remove(_aToURL);
- osl::File::RC eError = osl::File::move(_aFromURL, _aToURL);
- if (eError != osl::File::E_None &&
- eError != osl::File::E_NOENT)
- {
- rtl::OUStringBuffer sErrorBuf;
- sErrorBuf.appendAscii("Configmgr: replaceFile failed ");
- sErrorBuf.appendAscii("for replacing file \"").append(_aFromURL).appendAscii("\". ");
- sErrorBuf.appendAscii("by file \"").append(_aToURL).appendAscii("\". ");
- sErrorBuf.appendAscii("Error = \"").append(FileHelper::createOSLErrorString(eError)).appendAscii("\" ");
- sErrorBuf.appendAscii("[").append(sal_Int32(eError)).appendAscii("] ");
-
- rtl::OUString const sError = sErrorBuf.makeStringAndClear();
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- throw io::IOException(sError, NULL);
- }
- }
-
- // -----------------------------------------------------------------------------
- bool FileHelper::fileExists(rtl::OUString const& _sFileURL)
- {
- osl::DirectoryItem aItem;
- return osl::DirectoryItem::get(_sFileURL, aItem) == osl::Directory::E_None;
- }
-
- // -----------------------------------------------------------------------------
- bool FileHelper::dirExists(rtl::OUString const& _sDirURL)
- {
- return osl::Directory(_sDirURL).open() == osl::Directory::E_None;
- }
-
- // -----------------------------------------------------------------------------
- sal_uInt64 FileHelper::getModifyStatus(rtl::OUString const& _sURL, TimeValue & rModifyTime)
- {
- static const TimeValue k_NullTime = {0,0};
- sal_uInt64 aSize = 0;
- rModifyTime = k_NullTime;
-
- osl::DirectoryItem aItem;
- if (osl::FileBase::E_None == osl::DirectoryItem::get(_sURL, aItem))
- {
- osl::FileStatus aStatus(osl_FileStatus_Mask_ModifyTime|osl_FileStatus_Mask_Type|osl_FileStatus_Mask_FileSize);
- if (osl::FileBase::E_None == aItem.getFileStatus(aStatus))
- {
- if (aStatus.isValid(osl_FileStatus_Mask_ModifyTime))
- rModifyTime = aStatus.getModifyTime();
-
- if (aStatus.isValid(osl_FileStatus_Mask_FileSize))
- aSize = aStatus.getFileSize();
- }
- }
- return aSize;
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::createOSLErrorString(osl::FileBase::RC eError)
- {
- rtl::OUString aRet;
- switch(eError)
- {
- case osl::FileBase::E_None:
- break;
-
- case osl::FileBase::E_PERM:
- aRet = ASCII("Operation not permitted");
- break;
-
- case osl::FileBase::E_NOENT:
- aRet = ASCII("No such file or directory");
- break;
-
- case osl::FileBase::E_SRCH:
- aRet = ASCII("unknown error: osl_File_E_SRCH");
- break;
-
- case osl::FileBase::E_INTR:
- aRet = ASCII("function call was interrupted");
- break;
-
- case osl::FileBase::E_IO:
- aRet = ASCII("I/O error");
- break;
-
- case osl::FileBase::E_NXIO:
- aRet = ASCII("No such device or address");
- break;
-
- case osl::FileBase::E_2BIG:
- aRet = ASCII("unknown error: osl_File_E_2BIG");
- break;
-
- case osl::FileBase::E_NOEXEC:
- aRet = ASCII("unknown error: osl_File_E_NOEXEC");
- break;
-
- case osl::FileBase::E_BADF:
- aRet = ASCII("Bad file");
- break;
-
- case osl::FileBase::E_CHILD:
- aRet = ASCII("unknown error: osl_File_E_CHILD");
- break;
-
- case osl::FileBase::E_AGAIN:
- aRet = ASCII("Operation would block");
- break;
-
- case osl::FileBase::E_NOMEM:
- aRet = ASCII("not enough memory for allocating structures");
- break;
-
- case osl::FileBase::E_ACCES:
- aRet = ASCII("Permission denied");
- break;
-
- case osl::FileBase::E_FAULT:
- aRet = ASCII("Bad address");
- break;
-
- case osl::FileBase::E_BUSY:
- aRet = ASCII("Text file busy");
- break;
-
- case osl::FileBase::E_EXIST:
- aRet = ASCII("File exists");
- break;
-
- case osl::FileBase::E_XDEV:
- aRet = ASCII("unknown error: osl_File_E_XDEV");
- break;
-
- case osl::FileBase::E_NODEV:
- aRet = ASCII("No such device");
- break;
-
- case osl::FileBase::E_NOTDIR:
- aRet = ASCII("Not a directory");
- break;
-
- case osl::FileBase::E_ISDIR:
- aRet = ASCII("Is a director");
- break;
-
- case osl::FileBase::E_INVAL:
- aRet = ASCII("the format of the parameters was not valid");
- break;
-
- case osl::FileBase::E_NFILE:
- aRet = ASCII("too many open files in the system");
- break;
-
- case osl::FileBase::E_MFILE:
- aRet = ASCII("too many open files used by the process");
- break;
-
- case osl::FileBase::E_NOTTY:
- aRet = ASCII("unknown error: osl_File_E_NOTTY");
- break;
-
- case osl::FileBase::E_FBIG:
- aRet = ASCII("File too large");
- break;
-
- case osl::FileBase::E_NOSPC:
- aRet = ASCII("No space left on device");
- break;
-
- case osl::FileBase::E_SPIPE:
- aRet = ASCII("unknown error: osl_File_E_SPIPE");
- break;
-
- case osl::FileBase::E_ROFS:
- aRet = ASCII("Read-only file system");
- break;
-
- case osl::FileBase::E_MLINK:
- aRet = ASCII("Too many links");
- break;
-
- case osl::FileBase::E_PIPE:
- aRet = ASCII("unknown error: osl_File_E_PIPE");
- break;
-
- case osl::FileBase::E_DOM:
- aRet = ASCII("unknown error: osl_File_E_DOM");
- break;
-
- case osl::FileBase::E_RANGE:
- aRet = ASCII("unknown error: osl_File_E_RANGE");
- break;
-
- case osl::FileBase::E_DEADLK:
- aRet = ASCII("unknown error: osl_File_E_DEADLK");
- break;
-
- case osl::FileBase::E_NAMETOOLONG:
- aRet = ASCII("File name too long");
- break;
-
- case osl::FileBase::E_NOLCK:
- aRet = ASCII("No record locks available");
- break;
-
- case osl::FileBase::E_NOSYS:
- aRet = ASCII("Function not implemente");
- break;
-
- case osl::FileBase::E_NOTEMPTY:
- aRet = ASCII("Directory not empt");
- break;
-
- case osl::FileBase::E_LOOP:
- aRet = ASCII("Too many symbolic links encountered");
- break;
-
- case osl::FileBase::E_ILSEQ:
- aRet = ASCII("unknown error: osl_File_E_ILSEQ");
- break;
-
- case osl::FileBase::E_NOLINK:
- aRet = ASCII("Link has been severed");
- break;
-
- case osl::FileBase::E_MULTIHOP:
- aRet = ASCII("Multihop attempted");
- break;
-
- case osl::FileBase::E_USERS:
- aRet = ASCII("unknown error: osl_File_E_USERS");
- break;
-
- case osl::FileBase::E_OVERFLOW:
- aRet = ASCII("Value too large for defined data type");
- break;
-
- /* unmapped error: always last entry in enum! */
- default: OSL_ENSURE(false, "Found unknown OSL File Error");
- case osl::FileBase::E_invalidError:
- aRet = ASCII("unmapped Error");
- break;
- }
- return aRet;
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::getParentDir(rtl::OUString const& _sURL)
- {
- rtl::OUString parentDirectory ;
- rtl::OUString fileName ;
-
- splitFileUrl(_sURL, parentDirectory, fileName) ;
- return parentDirectory ;
- }
-
- // -----------------------------------------------------------------------------
- void FileHelper::splitFileUrl(const rtl::OUString& aFileUrl,
- rtl::OUString& aParentDirectory,
- rtl::OUString& aFileName) {
- // goto last '/' and cut the rest.
- sal_Int32 nIdx = aFileUrl.lastIndexOf(delimiter, aFileUrl.getLength());
- if (nIdx > 0) {
- aParentDirectory = aFileUrl.copy(0, nIdx);
- aFileName = aFileUrl.copy(nIdx + 1) ;
- }
- else {
- aParentDirectory = rtl::OUString() ;
- aFileName = aFileUrl ;
- }
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::getFileName(const rtl::OUString& aFileUrl) {
- rtl::OUString parentDirectory ;
- rtl::OUString fileName ;
-
- splitFileUrl(aFileUrl, parentDirectory, fileName) ;
- return fileName ;
- }
- // -----------------------------------------------------------------------------
- osl::FileBase::RC FileHelper::mkdir(rtl::OUString const& _sDirURL)
- {
- // direct create a directory
- osl::FileBase::RC eError = osl::Directory::create(_sDirURL); // try to create the directory
- if (eError == osl::FileBase::E_EXIST ||
- eError == osl::FileBase::E_None ||
- FileHelper::dirExists(_sDirURL))
- {
- eError = osl::FileBase::E_None; // Exists or created
- }
- return eError;
- }
-
- // -----------------------------------------------------------------------------
- osl::FileBase::RC FileHelper::mkdirs(rtl::OUString const& _sDirURL)
- {
- osl::FileBase::RC eError = mkdir(_sDirURL);
- switch (eError)
- {
- case osl::FileBase::E_EXIST: OSL_ASSERT(false);
- case osl::FileBase::E_None:
- break;
-
- case osl::FileBase::E_NOENT:
- {
- rtl::OUString sParentDir = FileHelper::getParentDir(_sDirURL);
- if (sParentDir.getLength() == 0)
- break;
-
- eError = mkdirs(sParentDir);
- if (eError != osl::FileBase::E_None)
- break;
-
- eError = mkdir(_sDirURL);
- }
- break;
-
- default: OSL_TRACE("configmgr: Could not create directory (%d).", int(eError));
- break;
- }
- return eError;
- }
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/interactionrequest.cxx b/configmgr/source/misc/interactionrequest.cxx
deleted file mode 100644
index 912125a1e608..000000000000
--- a/configmgr/source/misc/interactionrequest.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "interactionrequest.hxx"
-
-namespace configmgr {
-namespace apihelper {
- namespace uno = com::sun::star::uno;
- namespace task = com::sun::star::task;
-//=========================================================================
-//=========================================================================
-//
-// InteractionRequest Implementation.
-//
-//=========================================================================
-//=========================================================================
-
-struct InteractionRequest::Impl
-{
- uno::Reference< task::XInteractionContinuation > m_xSelection;
- uno::Any m_aRequest;
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > m_aContinuations;
-
- Impl() {}
- Impl( const uno::Any & rRequest )
- : m_aRequest( rRequest )
- {}
-};
-
-//=========================================================================
-InteractionRequest::InteractionRequest( const uno::Any & rRequest )
-: m_pImpl( new Impl( rRequest ) )
-{
-}
-
-//=========================================================================
-// virtual
-InteractionRequest::~InteractionRequest()
-{
- delete m_pImpl;
-}
-
-//=========================================================================
-void InteractionRequest::setContinuations(
- const uno::Sequence< uno::Reference<
- task::XInteractionContinuation > > & rContinuations )
-{
- m_pImpl->m_aContinuations = rContinuations;
-}
-
-//=========================================================================
-uno::Reference< task::XInteractionContinuation > InteractionRequest::getSelection() const
-{
- return m_pImpl->m_xSelection;
-}
-
-//=========================================================================
-void InteractionRequest::setSelection( const uno::Reference< task::XInteractionContinuation > & rxSelection )
-{
- m_pImpl->m_xSelection = rxSelection;
-}
-
-//=========================================================================
-//
-// XInteractionRequest methods.
-//
-//=========================================================================
-
-// virtual
-uno::Any SAL_CALL InteractionRequest::getRequest()
- throw( uno::RuntimeException )
-{
- return m_pImpl->m_aRequest;
-}
-
-//=========================================================================
-// virtual
-uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
- InteractionRequest::getContinuations()
- throw( uno::RuntimeException )
-{
- return m_pImpl->m_aContinuations;
-}
-
-//=========================================================================
-
-} // namespace apihelper
-} // namespace configmgr
diff --git a/configmgr/source/misc/logger.cxx b/configmgr/source/misc/logger.cxx
deleted file mode 100644
index f60f64231fcb..000000000000
--- a/configmgr/source/misc/logger.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "logger.hxx"
-
-#define CONFIG_LOGGER_SINGLETON "/singletons/com.sun.star.configuration.theLogger"
-#define OUSTR( lit ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( lit ) )
-#define OU2A( ustr ) rtl::OUStringToOString( ustr, RTL_TEXTENCODING_UTF8 ).getStr()
-#define A2OU( astr ) rtl::OUString::createFromAscii( astr )
-
-static const sal_Char k_unspecifiedClass[] = "configmgr";
-static const sal_Char k_unspecifiedMethod[] = "log-message";
-
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------
-void Logger::log(sal_Int32 nLevel, const char * msg, const char * sourceMethod, const char * sourceClass) const
-{
- OSL_ASSERT(msg);
- if (!msg) msg = "";
-
- this->log(nLevel,A2OU(msg),sourceMethod,sourceClass);
-}
-
-//--------------------------------------------------------------------------
-void Logger::log(sal_Int32 nLevel, const rtl::OUString & msg, const char * sourceMethod, const char * sourceClass) const
-{
- if (!sourceClass) sourceClass = k_unspecifiedClass;
- if (!sourceMethod) sourceMethod = k_unspecifiedMethod;
-
- // this place can be used to further enrich or instrument log output
- if (m_xLogger.is())
- try
- {
- m_xLogger->logp(nLevel,A2OU(sourceClass),A2OU(sourceMethod),msg);
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration Log failure: %s\n"
- "Log message was [Level=%04d] %s::%s : %s\n",
- OU2A(e.Message),int(nLevel),sourceClass,sourceMethod,OU2A(msg));
- }
- else if (nLevel >= (LogLevel::SEVERE - OSL_DEBUG_LEVEL*(LogLevel::SEVERE-LogLevel::WARNING)))
- OSL_TRACE("Configuration Log [%04d] %s::%s : %s\n", int(nLevel),sourceClass,sourceMethod,OU2A(msg));
-
-}
-
-//--------------------------------------------------------------------------
-uno::Reference< logging::XLogger >
- Logger::getUnoLoggerFromContext(uno::Reference< uno::XComponentContext > const & xContext)
-{
- uno::Reference< logging::XLogger > xLogger;
-
- if (xContext.is())
- try { xContext->getValueByName( OUSTR(CONFIG_LOGGER_SINGLETON) ) >>= xLogger; }
- catch (uno::Exception & ) {}
-
- return xLogger;
-}
-
-//--------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/makefile.mk b/configmgr/source/misc/makefile.mk
deleted file mode 100644
index 0c5abcc7ef2a..000000000000
--- a/configmgr/source/misc/makefile.mk
+++ /dev/null
@@ -1,73 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=misc
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/bootstrap.obj \
- $(SLO)$/providerfactory.obj \
- $(SLO)$/providerwrapper.obj \
- $(SLO)$/logger.obj \
- $(SLO)$/tracer.obj \
- $(SLO)$/configunoreg.obj \
- $(SLO)$/serviceinfohelper.obj \
- $(SLO)$/bootstrapcontext.obj \
- $(SLO)$/anypair.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/mergechange.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/bufferedfile.obj \
- $(SLO)$/requestoptions.obj \
- $(SLO)$/interactionrequest.obj \
- $(SLO)$/configinteractionhandler.obj \
- $(SLO)$/simpleinteractionrequest.obj \
- $(SLO)$/propertysethelper.obj \
-
-OBJFILES= \
- $(OBJ)$/oslstream.obj \
- $(OBJ)$/filehelper.obj \
- $(OBJ)$/bufferedfile.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/misc/mergechange.cxx b/configmgr/source/misc/mergechange.cxx
deleted file mode 100644
index df2299352d2d..000000000000
--- a/configmgr/source/misc/mergechange.cxx
+++ /dev/null
@@ -1,828 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "builddata.hxx"
-#include "mergechange.hxx"
-#include "updatehelper.hxx"
-#include "treeactions.hxx"
-#include "treefragment.hxx"
-#include "change.hxx"
-#include "treechangefactory.hxx"
-#include "treechangelist.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- class OMergeChanges : private ChangeTreeAction, private OPathCreator<configuration::RelativePath>
- {
- SubtreeChange &m_rSubtreeChange; // ChangeList, which will be grown
- SubtreeChange *m_pCurrentParent; // our current position
-
- // ------- Helper for Path stack -------
- SubtreeChange* pushTree(SubtreeChange& _rTree);
- void popTree(SubtreeChange* _pSaveTree);
-
- public:
- // CTor
- OMergeChanges(SubtreeChange& _rTree);
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void mergeChanges(const SubtreeChange &_rChange, const configuration::RelativePath& _aPathToChange);
- void mergeChanges(const SubtreeChange &_rChange);
-
- private:
- void initRoot(const SubtreeChange &_rRootChange, const configuration::RelativePath& _aPathToChange);
- private:
- virtual void handle(ValueChange const& _rValueNode);
- virtual void handle(AddNode const& _rAddNode);
- virtual void handle(RemoveNode const& _rRemoveNode);
- virtual void handle(SubtreeChange const& _rSubtree);
-
- };
- // -----------------------------------------------------------------------------
- void combineUpdates(SubtreeChange const& _anUpdate, SubtreeChange& _aCombinedUpdate)
- {
- OMergeChanges aCombined(_aCombinedUpdate);
- aCombined.mergeChanges(_anUpdate);
- }
- // -----------------------------------------------------------------------------
-
- configuration::Path::Component ONameCreator::createName(Change const& _rChange, SubtreeChange const* _pParent)
- {
- OSL_ENSURE(_pParent, "ONameCreator: Cannot create proper name without a parent");
- if (_pParent && _pParent->isSetNodeChange())
- {
- rtl::OUString sElementName = _rChange.getNodeName();
- rtl::OUString sTypeName = _pParent->getElementTemplateName();
-
- return configuration::Path::makeCompositeName(sElementName, sTypeName);
- }
- else
- {
- rtl::OUString sElementName = _rChange.getNodeName();
-
- // OSL_ENSURE(isSimpleName(sElementName),"Unexpected: Non-simple name in non-set node");
-
- return configuration::Path::wrapSafeName(sElementName);
- }
- }
-
-
- // -----------------------------------------------------------------------------
- class OMergeValueChange : private ChangeTreeModification
- {
- SubtreeChange& m_rTargetParent;
- const ValueChange& m_aValueChange;
- public:
- OMergeValueChange(SubtreeChange& _rTargetParent, const ValueChange& _aValueChange)
- :m_rTargetParent(_rTargetParent)
- ,m_aValueChange(_aValueChange)
- {
-
- }
- void handleChange(Change &_rNode)
- {
- this->applyToChange(_rNode);
- }
- private:
- virtual void handle(ValueChange& _rValueChange)
- {
- // POST: Handle ValueChange
- _rValueChange.setNewValue(m_aValueChange.getNewValue(), m_aValueChange.getMode());
- }
- virtual void handle(RemoveNode& /*_rRemoveNode*/)
- {
- OSL_ENSURE(false, "OMergeValueChange::handle(ValueChange): have a ValueChange for a removed node!");
- // should never happen. How did the user change a value for a node which is obviously flagged as removed?
- }
- virtual void handle(AddNode& _rAddNode);
- virtual void handle(SubtreeChange& _rSubtree)
- {
- if ( isLocalizedValueSet(_rSubtree) )
- {
- std::auto_ptr<ValueChange> pNewValueChange( new ValueChange(m_aValueChange) );
- OSL_ENSURE(pNewValueChange->isLocalizedValue(), "OMergeValueChange:handle(SubtreeChange): have a non-localized ValueChange a for a localized node!");
-
- std::auto_ptr<Change> pNewChange( pNewValueChange.release() );
-
- replaceExistingEntry(pNewChange);
- }
- else
- OSL_ENSURE(false, "OMergeValueChange:handle(SubtreeChange): have a ValueChange for a sub tree!");
- }
-
- void replaceExistingEntry(std::auto_ptr<Change> pNewChange)
- {
- m_rTargetParent.removeChange(pNewChange->getNodeName());
- m_rTargetParent.addChange(pNewChange);
- }
- static std::auto_ptr<ValueNode> createNodeFromChange(ValueChange const& rChange)
- {
- std::auto_ptr<ValueNode> aRet;
-
- uno::Any aNewValue = rChange.getNewValue();
-
- // currently not supporting change modes !
- if (aNewValue.hasValue())
- aRet.reset( new ValueNode(rChange.getNodeName(), aNewValue, rChange.getAttributes()) );
-
- else // NULL
- {
- aRet.reset( new ValueNode(rChange.getNodeName(), rChange.getValueType(), rChange.getAttributes()) );
-
- OSL_ENSURE(aRet->isValid(), "Cannot recover type for change to NULL");
- }
- return aRet;
- }
-
- };
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- // TODO: operate directly on new data structures
-
- void OMergeValueChange::handle(AddNode& _rAddNode)
- {
- if (m_aValueChange.isToDefault())
- {
- std::auto_ptr<Change> aChangeToDefault(m_aValueChange.clone());
- m_rTargetParent.removeChange(_rAddNode.getNodeName());
- m_rTargetParent.addChange( aChangeToDefault );
- }
- else
- {
- // POST: Handle ValueChange in AddNode
- rtl::Reference< data::TreeSegment > seg(_rAddNode.getNewTree());
- std::auto_ptr<INode> pAddedNode = data::convertTree(seg.is() ? seg->fragment : 0, false);
-
- if (ValueNode *pValueNode = pAddedNode->asValueNode())
- {
- m_aValueChange.applyChangeNoRecover(*pValueNode);
- }
-
- else if (ISubtree* pValueSetNode = pAddedNode->asISubtree() )
- {
- if ( isLocalizedValueSet(*pValueSetNode) )
- {
- std::auto_ptr<ValueNode> pNewValueNode = createNodeFromChange(m_aValueChange);
- if (pNewValueNode.get())
- {
- OSL_ENSURE(pNewValueNode->isLocalized(), "OMergeValueChange:handle(AddNode): have a non-localized ValueChange a for a localized node!");
- pNewValueNode->setName(pAddedNode->getName());
- }
- else
- OSL_ENSURE(false, "OMergeValueChange:handle(SubtreeChange): Creating a NULL node to replace a localized value set not yet supported");
-
-
- pAddedNode.reset(pNewValueNode.release());
- }
- else
- {
- OSL_ENSURE(sal_False, "OMergeValueChange:handle(AddNode): have a ValueChange a for non-value node!");
- pAddedNode.reset(); // leave unchanged
- }
-
- }
- else
- {
- OSL_ENSURE(sal_False, "OMergeValueChange:handle(AddNode): Found unknown node type!");
- pAddedNode.reset(); // leave unchanged
- }
-
- if (pAddedNode.get() != NULL)
- {
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(_rAddNode.getNodeName(),pAddedNode);
-
- std::auto_ptr<AddNode> pNewAdd( new AddNode(aNewTree,m_aValueChange.getNodeName(), m_aValueChange.isToDefault()) );
- if (_rAddNode.isReplacing())
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
- replaceExistingEntry(pNewChange);
- }
- }
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- class OMergeRemoveNode : private ChangeTreeModification
- {
- public:
- // actions to take with the remove node change
- enum Action
- {
- RemoveCompletely,
- FlagDeleted,
- Undetermined
- };
-
- protected:
- Action m_eAction;
-
- public:
- OMergeRemoveNode() : m_eAction(Undetermined) { }
-
- Action getAction() const { return m_eAction; }
-
- void handleChange(Change* _pChange)
- {
- if (_pChange)
- applyToChange(*_pChange);
- else
- // no change -> flag as deleted
- m_eAction = FlagDeleted;
- }
-
- private:
- virtual void handle(ValueChange& aValueChange)
- {
- if (aValueChange.getAttributes().existsInDefault())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
-
- virtual void handle(RemoveNode& /*_rRemoveNode*/)
- {
- OSL_ENSURE(false, "OMergeRemoveNode::handle(RemoveNode): should never happen!");
- // how can a RemoveNode change exist if in the file we're merging it into
- // there already is such a RemoveNode change (_rRemoveNode)?
- }
-
- virtual void handle(AddNode& _rAddNode)
- {
- if (_rAddNode.isReplacing())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
-
- virtual void handle(SubtreeChange& _rSubtree)
- {
- if (_rSubtree.getAttributes().existsInDefault())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
- };
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- static
- inline
- Change* findExistingChange(SubtreeChange* pCurrentParent, configuration::Path::Component const & _aName)
- {
- OSL_ASSERT(pCurrentParent);
-
- Change *pChange = pCurrentParent->getChange(_aName.getName());
-
- if (!pChange && !_aName.isSimpleName())
- {
- pChange = pCurrentParent->getChange(_aName.toPathString());
- OSL_ENSURE(!pChange, "Update trouble: Existing node found only by composite name while merging");
- }
-
- return pChange;
- }
-
- static
- inline
- Change* findExistingChange(SubtreeChange* pCurrentParent, rtl::OUString const & _aName)
- {
- OSL_ASSERT(pCurrentParent);
-
- Change *pChange = pCurrentParent->getChange(_aName);
-
- return pChange;
- }
- // -----------------------------------------------------------------------------
-
- void adjustElementTemplate(SubtreeChange& _rChange, const rtl::OUString& _rName, const rtl::OUString& _rModule)
- {
- if (!_rChange.isSetNodeChange() || isGenericSetElementType(_rChange.getElementTemplateName()))
- {
- _rChange.setElementTemplate(_rName,_rModule);
- }
- else if ( isDummySetElementModule(_rChange.getElementTemplateModule()) &&
- !isGenericSetElementType(_rName) && !isDummySetElementModule(_rModule))
- {
- OSL_ENSURE(_rChange.getElementTemplateName() == _rName, "Adjusting: Template modules do not match");
-
- _rChange.setElementTemplate(_rName,_rModule);
- }
- OSL_POSTCOND(_rChange.getElementTemplateName() == _rName || isGenericSetElementType(_rName),
- "Adjusting: Template modules do not match");
- OSL_POSTCOND(_rChange.getElementTemplateModule() == _rModule || isDummySetElementModule(_rModule),
- "Adjusting: Template modules do not match");
- }
- // -----------------------------------------------------------------------------
-
- inline void adjustElementTemplate(SubtreeChange& _rChange, SubtreeChange const& _rSource)
- {
- if (_rSource.isSetNodeChange())
- adjustElementTemplate(_rChange, _rSource.getElementTemplateName(), _rSource.getElementTemplateModule());
- }
-
- // -----------------------------------------------------------------------------
-
- // CTor
- OMergeChanges::OMergeChanges(SubtreeChange& _rTree)
- : m_rSubtreeChange(_rTree), m_pCurrentParent(NULL)
- {
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::initRoot(const SubtreeChange &_rRootChange, const configuration::RelativePath& _aPathToChange)
- {
- SubtreeChange* pCurrentParent = &m_rSubtreeChange;
-
- if (!_aPathToChange.isEmpty())
- {
- OSL_PRECOND(_aPathToChange.getLocalName().getName() == _rRootChange.getNodeName(),
- "Path to change root does not match change being merged" );
-
- std::vector<configuration::Path::Component>::const_reverse_iterator const firstEnsure = _aPathToChange.begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator lastEnsure = _aPathToChange.end();
- std::vector<configuration::Path::Component>::const_reverse_iterator it;
-
- OSL_ASSERT( firstEnsure != lastEnsure );
- --lastEnsure; // last to ensure is the actual root
-
- for( it = firstEnsure; it != lastEnsure; ++it)
- {
- OSL_ASSERT( it != _aPathToChange.end() );
-
- Change *pChange = findExistingChange(pCurrentParent,*it);
-
- if (!pChange)
- {
- OSL_ASSERT( it+1 != _aPathToChange.end());
- rtl::OUString const aElementTypeName = (it+1)->getTypeName();
-
- // create a correspondens for the name, we did not find.
- std::auto_ptr<SubtreeChange> pNewChange =
- OTreeChangeFactory::createDummyChange(it->getName(), aElementTypeName);
-
- pChange = pNewChange.get();
-
- pCurrentParent->addChange(base_ptr(pNewChange));
-
- OSL_ENSURE(pChange == findExistingChange(pCurrentParent,*it),
- "ERROR: Newly added change cannot be found in parent change");
- }
-
- pCurrentParent = dynamic_cast<SubtreeChange*>( pChange);
- if (pCurrentParent == 0)
- {
- OSL_ENSURE(false, "Change to merge does not point to a Subtree Change");
- throw configuration::InvalidName(_aPathToChange.toString(), "points to a non- subtree change in this changes list, but a subtree change is required as root.");
- }
- }
-
- Change *pRootChange = findExistingChange(pCurrentParent,*lastEnsure);
-
- if (!pRootChange)
- {
- // create a correspondens for the name, we did not find.
- std::auto_ptr<SubtreeChange> pNewChange(
- new SubtreeChange(_rRootChange, treeop::NoChildCopy()) );
-
- pRootChange = pNewChange.get();
-
- pCurrentParent->addChange(base_ptr(pNewChange));
-
- OSL_ENSURE(pRootChange == findExistingChange(pCurrentParent,*it),
- "ERROR: Newly added change cannot be found in parent change");
- }
-
- pCurrentParent = dynamic_cast<SubtreeChange*>( pRootChange);
- if (pCurrentParent == 0)
- {
- OSL_ENSURE(false, "Change to merge does not point to a Subtree Change");
- throw configuration::InvalidName(_aPathToChange.toString(), "points to a non-subtree change in this changes list, but a subtree change is required as root.");
- }
- }
-
- OSL_ENSURE(pCurrentParent->getNodeName() == _rRootChange.getNodeName(),
- "Change being merged has a different name");
-
- adjustElementTemplate(*pCurrentParent,_rRootChange);
-
- this->init(_aPathToChange);
-
- m_pCurrentParent = pCurrentParent;
- }
- // -----------------------------------------------------------------------------
-
- // ------- Helper for Path stack -------
- SubtreeChange* OMergeChanges::pushTree(SubtreeChange& _rTree)
- {
- pushName( ONameCreator::createName(_rTree,m_pCurrentParent) );
-
- SubtreeChange* pSave = m_pCurrentParent;
- m_pCurrentParent = &_rTree;
- return pSave;
- }
- void OMergeChanges::popTree(SubtreeChange* _pSaveTree)
- {
- m_pCurrentParent = _pSaveTree;
-
- popName();
- }
- // -----------------------------------------------------------------------------
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void OMergeChanges::mergeChanges(const SubtreeChange &_rChange)
- {
- mergeChanges(_rChange, configuration::RelativePath());
- }
- // -----------------------------------------------------------------------------
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void OMergeChanges::mergeChanges(const SubtreeChange &_rChange, const configuration::RelativePath& _aPathToChange)
- {
- initRoot(_rChange, _aPathToChange); // path location being merged must exist
-
- this->applyToChildren(_rChange); //- semantics ?
- }
- // -----------------------------------------------------------------------------
-
- // Algorithm: search the actual path in the out m_aSubtreeChange
- // if we found something, we must merge/convert the Node with our Node
- // if we found nothing, we must create a new Node with our change
- // thats it.
-
- // the merge is contructed with helper classes because, it's possible that we
- // are a ValueChange but in the TreeChangeList this change is an AddNode, so
- // we have something to do.
-
- void OMergeChanges::handle(ValueChange const& _rValueNode)
- {
- // Handle a ValueChange,
- rtl::OUString aNodeName = _rValueNode.getNodeName();
-
- if (Change *pChange = findExistingChange(m_pCurrentParent,aNodeName))
- {
- // Value found, merge content
- OMergeValueChange aMergeValue(*m_pCurrentParent,_rValueNode);
- aMergeValue.handleChange(*pChange);
- }
- else
- {
- // there is no ValueChange in the List, insert new one
- std::auto_ptr<Change> pNewChange(new ValueChange(_rValueNode));
- m_pCurrentParent->addChange(pNewChange);
- }
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::handle(AddNode const& _rAddNode)
- {
- // Handle an AddNode
- bool bReplacing = _rAddNode.isReplacing();
-
- rtl::OUString aNodeName = _rAddNode.getNodeName();
-
- if (Change *pChange = findExistingChange(m_pCurrentParent,aNodeName))
- {
- OSL_ENSURE(dynamic_cast< RemoveNode * >(pChange) != 0 || bReplacing, "OMergeChanges::handle(AddNode): the changes tree given already contains a change for this!");
-
- m_pCurrentParent->removeChange(pChange->getNodeName());
-
- bReplacing = true;
- }
-
- // insert manually
- rtl::Reference< data::TreeSegment > aAddedTree = data::TreeSegment::create(_rAddNode.getNewTree());
-
- std::auto_ptr<AddNode> pNewAdd(new AddNode(aAddedTree, _rAddNode.getNodeName(), _rAddNode.isToDefault()));
- if (bReplacing)
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
- m_pCurrentParent->addChange(pNewChange);
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::handle(RemoveNode const& _rRemoveNode)
- {
- // Handle a RemoveNode
- rtl::OUString aNodeName = _rRemoveNode.getNodeName();
-
- Change *pChange = findExistingChange(m_pCurrentParent,aNodeName);
-
- // examine what to do with this change
- OMergeRemoveNode aExaminer;
- aExaminer.handleChange(pChange);
-
- // remove the change from it's parent (may it's re-inserted in another form below)
- if (pChange)
- m_pCurrentParent->removeChange(pChange->getNodeName());
-
- // insert a new change if necessary
- switch (aExaminer.getAction())
- {
- case OMergeRemoveNode::RemoveCompletely:
- // nothing to do, we already removed it
- break;
- default:
- OSL_ENSURE(sal_False, "OMergeChanges::handle(RemoveNode): don't know what to do with this!");
- // NO BREAK.
- // defaulting this so that the node will be marked as deleted
- case OMergeRemoveNode::FlagDeleted:
- {
- std::auto_ptr<Change> pNewChange(new RemoveNode(_rRemoveNode.getNodeName(),_rRemoveNode.isToDefault()));
- m_pCurrentParent->addChange(pNewChange);
- }
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
- inline
- void OStripDefaults::stripOne(Change& _rChange)
- {
- m_rParent.removeChange(_rChange.getNodeName());
- }
-
- void OStripDefaults::handle(ValueChange& _rValueNode)
- {
- if (_rValueNode.isToDefault())
- stripOne(_rValueNode);
- }
- void OStripDefaults::handle(AddNode& _rAddNode)
- {
- if (_rAddNode.isToDefault())
- {
- sharable::TreeFragment const * pAdded = _rAddNode.getNewTreeData();
- OSL_ENSURE(pAdded,"No Data in AddNode");
- if (pAdded == NULL || pAdded->getAttributes().isDefault())
- stripOne(_rAddNode);
-
- // else we should strip the defaults from the added node
- }
- }
- void OStripDefaults::handle(RemoveNode& _rRemoveNode)
- {
- if (_rRemoveNode.isToDefault())
- stripOne(_rRemoveNode);
- }
- void OStripDefaults::handle(SubtreeChange& _rSubtree)
- {
- if ( strip(_rSubtree) )
- if (_rSubtree.isToDefault() || !_rSubtree.isSetNodeChange())
- stripOne(_rSubtree);
- }
-
- OStripDefaults& OStripDefaults::strip()
- {
- SubtreeChange::MutatingChildIterator it = m_rParent.begin_changes(), stop = m_rParent.end_changes();
-
- while (it != stop)
- {
- this->applyToChange(*it++);
- }
-
- return *this;
- }
-
-
-// -----------------------------------------------------------------------------
- class TreeUpdater : public ChangeTreeAction
- {
- ISubtree* m_pCurrentSubtree;
-#if OSL_DEBUG_LEVEL > 1
- std::vector<rtl::OString> aLog;
-#endif
-
- public:
- TreeUpdater(ISubtree* pSubtree):m_pCurrentSubtree(pSubtree){}
-
- void handle(ValueChange const& aValueNode);
- void handle(AddNode const& aAddNode);
- void handle(RemoveNode const& aRemoveNode);
- void handle(SubtreeChange const& aSubtree);
- };
-
-// -----------------------------------------------------------------------------
-
-
- void OMergeChanges::handle(SubtreeChange const& _rSubtree)
- {
- // Handle a SubtreeChange
- // we must check if exact this SubtreeChange is in the TreeChangeList, if not,
- // we must add this SubtreeChange to the TreeChangeList
- // with the pointer m_pCurrentParent we remember our SubtreeChange in witch we
- // add all other Changes.
-
- rtl::OUString aNodeName = _rSubtree.getNodeName();
-
- Change *pChange = findExistingChange(m_pCurrentParent,aNodeName);
-
- // const sal_Char* pType = pChange ? pChange->getType() : NULL;
- SubtreeChange* pSubtreeChange = NULL;
- if (pChange == NULL || dynamic_cast< SubtreeChange * >(pChange) != 0)
- {
- // need to create a new Subtreechange
- if (!pChange)
- {
- // create a new SubtreeChange
- std::auto_ptr<SubtreeChange> pNewChange(new SubtreeChange(_rSubtree, treeop::NoChildCopy()));
- pSubtreeChange = pNewChange.get();
-
- // add the new SubtreeChange in m_aTreeChangeList
- m_pCurrentParent->addChange(std::auto_ptr<Change>(pNewChange.release()));
- // check list for this new SubtreeChange
- OSL_ASSERT(pSubtreeChange == findExistingChange(m_pCurrentParent,aNodeName));
- }
- else
- {
- pSubtreeChange = dynamic_cast<SubtreeChange*>(pChange);
- OSL_ASSERT(pSubtreeChange != 0);
- adjustElementTemplate(*pSubtreeChange,_rSubtree);
- }
-
- // save this SubtreeChange so we allways have the last Subtree
- SubtreeChange* pSaveParent = pushTree(*pSubtreeChange);
- this->applyToChildren(_rSubtree);
- popTree( pSaveParent );
- }
- else if (AddNode* pAddNode = dynamic_cast<AddNode*>(pChange))
- {
- rtl::Reference< data::TreeSegment > seg(pAddNode->getNewTree());
- std::auto_ptr<INode> pAddedNode = data::convertTree(seg.is() ? seg->fragment : 0, false);
- ISubtree* pSubtree = pAddedNode.get() ? pAddedNode->asISubtree() : 0;
- if (pSubtree)
- {
- pSubtree->markAsDefault( _rSubtree.isToDefault() );
-
- // Now apply _rSubtree to the subtree
- TreeUpdater aTreeUpdate(pSubtree);
- aTreeUpdate.applyToChildren(_rSubtree);
-
- // make a new subtree with the changed data
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(pAddNode->getNodeName(), pAddedNode);
-
- std::auto_ptr<AddNode> pNewAdd( new AddNode(aNewTree, pAddNode->getNodeName(), pAddNode->isToDefault()) );
- if (pAddNode->isReplacing())
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
-
- m_pCurrentParent->removeChange(pAddNode->getNodeName());
- m_pCurrentParent->addChange( pNewChange );
- }
- else
- {
- OSL_ENSURE(false, "OMergeChanges: Unexpected node type found in an AddNode.");
- /* wrong type of node found: böse ASSERTEN/WERFEN */;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- }
- else
- {
- OSL_ENSURE(false, "OMergeChanges: Unexpected change type found for a subtree.");
- /* wrong type of node found: böse ASSERTEN/WERFEN */;
- }
- }
-
- // --------------------------------- updateTree ---------------------------------
- void TreeUpdater::handle(ValueChange const& aValueNode)
- {
- // Change a Value
- OSL_ENSURE(m_pCurrentSubtree,"Cannot apply ValueChange without subtree");
-
- INode* pBaseNode = m_pCurrentSubtree ? m_pCurrentSubtree->getChild(aValueNode.getNodeName()) : 0;
- OSL_ENSURE(pBaseNode,"Cannot apply Change: No node to change");
-
- ValueNode* pValue = pBaseNode ? pBaseNode->asValueNode() : 0;
- OSL_ENSURE(pValue,"Cannot apply ValueChange: Node is not a value");
-
- if (pValue)
- aValueNode.applyChangeNoRecover(*pValue);
-#if OSL_DEBUG_LEVEL > 1
- else
- {
- ::rtl::OString aStr("TreeUpdater: Can't find value with name:=");
- aStr += rtl::OUStringToOString(aValueNode.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(pValue, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- }
-
- void TreeUpdater::handle(AddNode const& aAddNode)
- {
- // Add a new Value
- if (m_pCurrentSubtree)
- {
- if (aAddNode.isReplacing())
- {
- std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aAddNode.getNodeName());
-
-#if OSL_DEBUG_LEVEL > 1
- OSL_ENSURE(aOldNode.get(), "TreeUpdater:AddNode: can't recover node being replaced");
- if (aOldNode.get() == NULL)
- aLog.push_back(rtl::OString("TreeUpdater: can't recover node being replaced (for AddNode)"));
-#endif
- }
-
- rtl::Reference< data::TreeSegment > seg(aAddNode.getNewTree());
- std::auto_ptr<INode> pNode(data::convertTree(seg.is() ? seg->fragment : 0, true));
-
- m_pCurrentSubtree->addChild(pNode);
- }
-#if OSL_DEBUG_LEVEL > 1
- else
- aLog.push_back(rtl::OString("TreeUpdater: no CurrentSubtree for AddNode"));
-#endif
-
- }
-
- void TreeUpdater::handle(RemoveNode const& aRemoveNode)
- {
- // remove a Value
- if (m_pCurrentSubtree)
- {
- std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aRemoveNode.getNodeName());
-
-#if OSL_DEBUG_LEVEL > 1
- if (NULL == aOldNode.get())
- {
- ::rtl::OString aStr("TreeUpdater: Can't remove child with name:=");
- aStr += rtl::OUStringToOString(aRemoveNode.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(false, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- }
- }
-
- void TreeUpdater::handle(SubtreeChange const& _aSubtree)
- {
- // handle traversion
- ISubtree *pOldSubtree = m_pCurrentSubtree;
- rtl::OUString aNodeName = _aSubtree.getNodeName();
-
- INode* pChild = m_pCurrentSubtree->getChild(aNodeName);
- OSL_ENSURE(pChild, "TreeUpdater::handle : invalid subtree change ... no child for change !");
- m_pCurrentSubtree = pChild ? pChild->asISubtree() : NULL;
-
-#if OSL_DEBUG_LEVEL > 1
- if (!m_pCurrentSubtree)
- {
- ::rtl::OString aStr("TreeUpdater: there is no Subtree for name:=");
- aStr += rtl::OUStringToOString(_aSubtree.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(false, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- // recurse
- if (m_pCurrentSubtree)
- {
- m_pCurrentSubtree->markAsDefault( _aSubtree.isToDefault() );
- _aSubtree.forEachChange(*this);
- }
-
- m_pCurrentSubtree = pOldSubtree;
- }
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/oslstream.cxx b/configmgr/source/misc/oslstream.cxx
deleted file mode 100644
index c0772a5abc3a..000000000000
--- a/configmgr/source/misc/oslstream.cxx
+++ /dev/null
@@ -1,261 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "oslstream.hxx"
-
-#include "filehelper.hxx"
-
-namespace configmgr
-{
- static void raiseIOException(osl::File::RC error, staruno::Reference<staruno::XInterface> const & context)
- {
- const rtl::OUString message = FileHelper::createOSLErrorString(error);
- switch (error)
- {
- case osl::File::E_NOMEM:
- throw stario::BufferSizeExceededException(message, context);
-
- case osl::File::E_BADF:
- throw stario::NotConnectedException(message, context);
-
- default:
- throw stario::IOException(message, context);
- }
- }
-//------------------------------------------------------------------
-OSLInputStreamWrapper::OSLInputStreamWrapper( osl::File& _rFile )
- :m_pFile(&_rFile)
- ,m_bFileOwner(sal_False)
-{
-}
-
-//------------------------------------------------------------------
-OSLInputStreamWrapper::OSLInputStreamWrapper( osl::File* pStream, sal_Bool bOwner )
- :m_pFile( pStream )
- ,m_bFileOwner( bOwner )
-{
-}
-
-//------------------------------------------------------------------
-OSLInputStreamWrapper::~OSLInputStreamWrapper()
-{
- if( m_bFileOwner )
- delete m_pFile;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
- throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- if (nBytesToRead < 0)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- osl::MutexGuard aGuard( m_aMutex );
-
- aData.realloc(nBytesToRead);
-
- sal_uInt64 nRead = 0;
- osl::File::RC eError = m_pFile->read(aData.getArray(), nBytesToRead, nRead);
- if (eError != osl::File::E_None)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- // Wenn gelesene Zeichen < MaxLength, staruno::Sequence anpassen
- if (nRead < (sal_uInt64)nBytesToRead)
- aData.realloc( sal::static_int_cast<sal_Int32>( nRead ));
-
- return sal::static_int_cast<sal_Int32>( nRead );
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- if (nMaxBytesToRead < 0)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- /*
- if (m_pFile->IsEof())
- {
- aData.realloc(0);
- return 0;
- }
- else
- */
- return readBytes(aData, nMaxBytesToRead);
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- osl::MutexGuard aGuard( m_aMutex );
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nCurrentPos;
- m_pFile->getPos(nCurrentPos);
-
- sal_uInt64 nNewPos = nCurrentPos + nBytesToSkip;
- osl::File::RC eError = m_pFile->setPos(osl_Pos_Absolut, nNewPos);
- if (eError != osl::File::E_None)
- {
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
- }
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::available() throw( stario::NotConnectedException, staruno::RuntimeException )
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nPos;
- osl::File::RC eError = m_pFile->getPos(nPos);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nDummy = 0;
- eError = m_pFile->setPos(Pos_End, nDummy);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nAvailable;
- eError = m_pFile->getPos(nAvailable);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- nAvailable = nAvailable - nPos;
- eError = m_pFile->setPos(Pos_Absolut, nPos);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
- return sal::static_int_cast<sal_Int32>( nAvailable );
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OSLInputStreamWrapper::closeInput() throw( stario::NotConnectedException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- m_pFile->close();
- if (m_bFileOwner)
- delete m_pFile;
-
- m_pFile = NULL;
-}
-
-/*************************************************************************/
-// stario::XOutputStream
-//------------------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- sal_uInt32 const nLength = sal_uInt32(aData.getLength());
- if (nLength != 0)
- {
- sal_uInt64 nWritten;
- osl::File::RC eError = rFile.write(aData.getConstArray(),nLength, nWritten);
- if (eError != osl::File::E_None || nWritten != nLength)
- {
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
- }
- }
-}
-
-
-//------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::flush() throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
-}
-
-//------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::closeOutput() throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- rFile.close();
-}
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-BufferedFileOutputStream::BufferedFileOutputStream( rtl::OUString const & aFileURL, bool bCreate, sal_uInt32 nBufferSizeHint)
-: m_aFile( aFileURL, nBufferSizeHint )
-{
- sal_Int32 flags = bCreate ? OpenFlag_Write|OpenFlag_Create : OpenFlag_Write;
-
- osl::File::RC rc = m_aFile.open(flags);
- if (rc != osl::File::E_None)
- raiseIOException(rc,NULL);
-}
-
-//------------------------------------------------------------------
-BufferedFileOutputStream::~BufferedFileOutputStream()
-{
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL BufferedFileOutputStream::writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- const sal_uInt64 size = sal_uInt64(aData.getLength());
- sal_uInt64 written = 0;
-
- osl::File::RC rc = m_aFile.write(aData.getConstArray(), size, written);
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-
- // we don't support special files where multiple write passes are needed
- if (written < size)
- raiseIOException(osl::File::E_IO,*this);
-}
-
-void SAL_CALL BufferedFileOutputStream::flush()
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- osl::File::RC rc = m_aFile.sync();
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-}
-
-void SAL_CALL BufferedFileOutputStream::closeOutput()
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- osl::File::RC rc = m_aFile.close();
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-}
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/propertysethelper.cxx b/configmgr/source/misc/propertysethelper.cxx
deleted file mode 100644
index 24a27fb0d2be..000000000000
--- a/configmgr/source/misc/propertysethelper.cxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/lang/XTypeProvider.hpp>
-
-#include <cppuhelper/typeprovider.hxx>
-
-//..........................................................................
-namespace configmgr {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-PropertySetHelper::PropertySetHelper()
-: BroadcasterBase()
-, cppu::OWeakObject()
-, cppu::OPropertySetHelper( BroadcasterBase::getBroadcastHelper() )
-, m_pHelper(0)
-{
-}
-
-//..........................................................................
-PropertySetHelper::~PropertySetHelper()
-{
- delete m_pHelper;
-}
-
-//..........................................................................
-// XInterface
-uno::Any SAL_CALL PropertySetHelper::queryInterface( uno::Type const & rType ) throw (uno::RuntimeException)
-{
- uno::Any aResult = cppu::OPropertySetHelper::queryInterface(rType);
- if (!aResult.hasValue())
- aResult = OWeakObject::queryInterface(rType);
- return aResult;
-}
-
-void SAL_CALL PropertySetHelper::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL PropertySetHelper::release() throw ()
-{
- if (m_refCount == 1)
- this->disposing();
-
- OWeakObject::release();
-}
-
-//..........................................................................
-// XTypeProvider
-uno::Sequence< uno::Type > SAL_CALL PropertySetHelper::getTypes() throw (uno::RuntimeException)
-{
- // could be static instance
- cppu::OTypeCollection aTypes(
- ::getCppuType( static_cast< uno::Reference< beans::XPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XMultiPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XFastPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< lang::XTypeProvider > const * >(0) ) );
-
- return aTypes.getTypes();
-}
-
-//..........................................................................
-// cppu::OPropertySetHelper
-uno::Reference< beans::XPropertySetInfo > SAL_CALL PropertySetHelper::getPropertySetInfo( )
- throw (uno::RuntimeException)
-{
- return createPropertySetInfo(getInfoHelper());
-}
-
-//..........................................................................
-cppu::IPropertyArrayHelper & SAL_CALL PropertySetHelper::getInfoHelper()
-{
- osl::MutexGuard aGuard( getBroadcastMutex() );
- if (!m_pHelper)
- m_pHelper = newInfoHelper();
-
- OSL_ENSURE(m_pHelper,"Derived class did not create new PropertyInfoHelper");
- if (!m_pHelper)
- throw uno::RuntimeException(rtl::OUString::createFromAscii("No PropertyArrayHelper available"),*this);
-
- return *m_pHelper;
-}
-
-//..........................................................................
-sal_Bool SAL_CALL PropertySetHelper::convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue, sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException)
-{
- this->getFastPropertyValue(rOldValue, nHandle);
- rConvertedValue = rValue;
- return rValue.isExtractableTo( rOldValue.getValueType() );
-}
-//..........................................................................
- } // namespace apihelper
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/misc/providerfactory.cxx b/configmgr/source/misc/providerfactory.cxx
deleted file mode 100644
index 85ed2ca266a9..000000000000
--- a/configmgr/source/misc/providerfactory.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "providerfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "bootstrap.hxx"
-#include "providerwrapper.hxx"
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-//---------------------------------------------------------------------------------------
-namespace configmgr
-{
- //---------------------------------------------------------------------------------------
- //= OProviderFactory
- //---------------------------------------------------------------------------------------
-
- //---------------------------------------------------------------------------------------
-
- ProviderFactory::ProviderFactory(rtl::OUString const & aImplementationName, bool bAdmin)
- : m_aImplementationName(aImplementationName)
- , m_bAdmin(bAdmin)
- {
- }
- //---------------------------------------------------------------------------------------
-
- ProviderFactory::~ProviderFactory()
- {
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > ProviderFactory::getProviderAlways(uno::Reference< uno::XComponentContext > const & xContext)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::getProviderAlways()");
- uno::Reference< uno::XInterface > xResult = getDefaultConfigProviderSingleton(xContext);
-
- // check for success
- OSL_ENSURE(xResult.is(), "Context could not create provider, but returned NULL instead of throwing an exception");
- if (!xResult.is())
- {
- static sal_Char const sCannotCreate[] = "Cannot create ConfigurationProvider. Unknown backend or factory error.";
-
- throw com::sun::star::configuration::CannotLoadConfigurationException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCannotCreate)), *this );
- }
-
- return xResult;
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::getProviderFromContext(uno::Reference< uno::XComponentContext > const & xContext)
- {
- OSL_ENSURE(ContextReader::testAdminService(xContext, this->m_bAdmin),
- "Creation context admin flag does not match service being created");
-
- try
- {
- return getProviderAlways(xContext);
- }
- catch(uno::Exception& e)
- {
- ContextReader aContext(xContext);
-
- uno::Any aError = aContext.getBootstrapError();
- if (aError.hasValue())
- {
- OSL_ASSERT(aError.getValueTypeClass() == uno::TypeClass_EXCEPTION);
- cppu::throwException(aError);
- }
-
- OSL_ASSERT(aContext.isBootstrapValid());
-
- static const sal_Char sErrContext[] = "Cannot open Configuration: ";
- rtl::OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext));
- e.Message = sContext.concat(e.Message);
- throw;
- }
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProviderWithArguments(uno::Reference< uno::XComponentContext > const & xContext, uno::Sequence < uno::Any > const & _aArguments)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProviderWithArguments()");
-
- ContextReader aContext(xContext);
- ArgumentHelper aParser(aContext.getBootstrapContext());
-
- uno::Sequence < beans::NamedValue > aValues(_aArguments.getLength() + 2);
- sal_Int32 nCount = parseArguments(aParser,aValues,_aArguments);
-
- bool bNeedNewBackend = aParser.hasBackendArguments();
-
- if (!aContext.testAdminService(aContext.getBaseContext(),m_bAdmin))
- {
- bNeedNewBackend = true;
- OSL_ASSERT( nCount+2 <= aValues.getLength());
- aValues[nCount++] = ArgumentHelper::makeAdminServiceOverride(m_bAdmin);
- aValues[nCount++] = BootstrapContext::makePassthroughMarker(sal_False);
- }
-
- OSL_ASSERT(nCount <= aValues.getLength());
- aValues.realloc(nCount);
-
- if (bNeedNewBackend)
- {
- uno::Reference< uno::XComponentContext > xMergedContext = BootstrapContext::createWrapper(xContext,aValues);
- uno::Reference< uno::XInterface > xResult = getProviderFromContext(xMergedContext);
-
- return xResult;
- }
- else
- {
- uno::Reference< uno::XInterface > xBaseProvider = getProviderFromContext(xContext);
- uno::Reference< uno::XInterface > xResult = ProviderWrapper::create(xBaseProvider,aValues);
-
- return xResult;
- }
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProvider(uno::Reference< uno::XComponentContext > const & xContext, bool bAdmin)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProvider(bAdmin)");
-
- uno::Sequence < beans::NamedValue > aValues(2);
- aValues[0] = ArgumentHelper::makeAdminServiceOverride(bAdmin);
- aValues[1] = BootstrapContext::makePassthroughMarker(sal_False);
-
- uno::Reference< uno::XComponentContext > xMergedContext = BootstrapContext::createWrapper(xContext,aValues);
- uno::Reference< uno::XInterface > xResult = getProviderFromContext(xMergedContext);
-
- return xResult;
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProvider(uno::Reference< uno::XComponentContext > const & xContext)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProvider()");
-
- if (BootstrapContext::isPassthrough(xContext))
- {
- // make sure this uses a new BootstrapContext !
- uno::Reference< uno::XComponentContext > xPatchedContext = BootstrapContext::createWrapper(xContext,uno::Sequence < beans::NamedValue >());
- return getProviderFromContext(xPatchedContext);
- }
- else
- return getProviderFromContext(xContext);
- }
- //---------------------------------------------------------------------------------------
-
- sal_Int32 ProviderFactory::parseArguments(ArgumentHelper & aParser, uno::Sequence < beans::NamedValue > & rValues, uno::Sequence < uno::Any > const & _aArguments)
- {
- OSL_ASSERT(rValues.getLength() >= _aArguments.getLength());
-
- sal_Int32 nCount = 0;
- for (sal_Int32 i = 0; i < _aArguments.getLength(); ++i)
- {
- if (!aParser.extractArgument(rValues[nCount],_aArguments[i]))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("ProviderFactory: Unexpected Argument Type. ");
- sMsg.appendAscii("Expected NamedValue or PropertyValue, ");
- sMsg.appendAscii("found ").append(_aArguments[i].getValueTypeName()).appendAscii(". ");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),*this,static_cast<sal_Int16>(i));
- }
-
- if (aParser.filterAndAdjustArgument(rValues[nCount]))
- {
- aParser.checkBackendArgument(rValues[nCount]);
- ++nCount;
- }
- }
- return nCount;
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface >
- SAL_CALL ProviderFactory::createInstanceWithContext( const uno::Reference< uno::XComponentContext >& xContext )
- throw (uno::Exception, ::com::sun::star::uno::RuntimeException)
- {
- // default provider ?
- if (ContextReader::testAdminService(xContext,m_bAdmin))
- return createProvider( xContext );
-
- else
- return createProvider(xContext,m_bAdmin);
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderFactory::createInstanceWithArgumentsAndContext( const uno::Sequence< uno::Any >& aArguments, const uno::Reference< uno::XComponentContext >& xContext )
- throw (uno::Exception, uno::RuntimeException)
- {
- // default request
- return createProviderWithArguments(xContext, aArguments);
- }
-
- //---------------------------------------------------------------------------------------
- //---------------------------------------------------------------------------------------
-
- uno::Reference< lang::XSingleComponentFactory > SAL_CALL createProviderFactory(
- rtl::OUString const & aImplementationName,
- bool bAdmin
- )
- {
- return new ProviderFactory(aImplementationName, bAdmin);
- }
- //---------------------------------------------------------------------------------------
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/misc/providerfactory.hxx b/configmgr/source/misc/providerfactory.hxx
deleted file mode 100644
index 68a6747fd97e..000000000000
--- a/configmgr/source/misc/providerfactory.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_PROVIDER_FACTORY_HXX_
-#define _CONFIGMGR_PROVIDER_FACTORY_HXX_
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-/*
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <comphelper/stl_types.hxx>
-*/
-//------------------------------------------------------------------------
-namespace configmgr
-{
- //------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- //------------------------------------------------------------------------
- class ContextReader;
- class ArgumentHelper;
- //------------------------------------------------------------------------
- //= OProviderFactory
- //------------------------------------------------------------------------
- /** a special factory for the configuration provider,
- which maps creation arguments into a context.
- */
- class ProviderFactory : public cppu::WeakImplHelper1< lang::XSingleComponentFactory >
- {
- rtl::OUString const m_aImplementationName;
- bool m_bAdmin;
-
- public:
- explicit
- ProviderFactory(rtl::OUString const & aImplementationName, bool bAdmin);
- ~ProviderFactory();
-
- virtual uno::Reference< uno::XInterface >
- SAL_CALL createInstanceWithContext(uno::Reference< uno::XComponentContext > const & xContext )
- throw (uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArgumentsAndContext( uno::Sequence < uno::Any > const & aArguments, uno::Reference< uno::XComponentContext > const & xContext )
- throw (uno::Exception, uno::RuntimeException);
-
- private:
- uno::Reference< uno::XInterface > getProviderFromContext(uno::Reference< uno::XComponentContext > const & aContext);
- uno::Reference< uno::XInterface > getProviderAlways(uno::Reference< uno::XComponentContext > const & xContext);
- uno::Reference< uno::XInterface > createProviderWithArguments(uno::Reference< uno::XComponentContext > const & xContext, uno::Sequence < uno::Any > const & _aArguments);
- uno::Reference< uno::XInterface > createProvider(uno::Reference< uno::XComponentContext > const & xContext,bool bAdmin);
- uno::Reference< uno::XInterface > createProvider(uno::Reference< uno::XComponentContext > const & xContext);
- sal_Int32 parseArguments(ArgumentHelper & aParser, uno::Sequence < beans::NamedValue > & rValues, uno::Sequence < uno::Any > const & _aArguments);
- };
-//------------------------------------------------------------------------
-} // namespace configmgr
-//------------------------------------------------------------------------
-
-#endif // _CONFIGMGR_PROVIDER_FACTORY_HXX_
-
diff --git a/configmgr/source/misc/providerwrapper.cxx b/configmgr/source/misc/providerwrapper.cxx
deleted file mode 100644
index 52de10d10525..000000000000
--- a/configmgr/source/misc/providerwrapper.cxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "providerwrapper.hxx"
-#include "bootstrap.hxx"
-#include "bootstrapcontext.hxx"
-
-
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-
-#include <algorithm>
-
-
-namespace configmgr
-{
- //==========================================================================
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- //==========================================================================
- //= ProviderWrapper
- //==========================================================================
-
- uno::Reference< uno::XInterface > ProviderWrapper::create( uno::Reference< uno::XInterface > xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets)
- {
- uno::Reference< lang::XMultiServiceFactory > xProvDelegate(xDelegate, uno::UNO_QUERY);
- if (!xProvDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Cannot wrap a NULL provider"));
- throw lang::NullPointerException(sMsg,NULL);
- }
- //Strip prefixes
- uno::Sequence< com::sun::star::beans::NamedValue > aStrippedPresets = aPresets;
-
- for (sal_Int32 i = 0; i < aPresets.getLength(); ++i)
- {
- if(aPresets[i].Name.matchAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ )))
- {
- aStrippedPresets[i].Name = aPresets[i].Name.copy(RTL_CONSTASCII_LENGTH(CONTEXT_ITEM_PREFIX_ ));
- }
- }
-
- uno::Reference< lang::XMultiServiceFactory > xResult( new ProviderWrapper(xProvDelegate,aStrippedPresets) );
-
- DisposingForwarder::forward( uno::Reference< lang::XComponent >::query(xProvDelegate),uno::Reference< lang::XComponent >::query(xResult) );
- return uno::Reference< uno::XInterface >( xResult, uno::UNO_QUERY );
- }
-
-
- ProviderWrapper::ProviderWrapper(uno::Reference< lang::XMultiServiceFactory > const & xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets)
- : cppu::WeakComponentImplHelper2< lang::XMultiServiceFactory, lang::XServiceInfo >( PWMutexHolder::mutex )
- , m_xDelegate(xDelegate)
- , m_aDefaults(aPresets.getLength())
- {
- OSL_ASSERT(m_xDelegate.is());
-
- for (sal_Int32 i = 0; i<aPresets.getLength(); ++i)
- {
- m_aDefaults[i] <<= aPresets[i];
- }
- }
-
- ProviderWrapper::~ProviderWrapper() {}
-
- void SAL_CALL ProviderWrapper::disposing()
- {
- osl::MutexGuard lock(mutex);
- m_xDelegate.clear();
- }
-
- uno::Reference< lang::XMultiServiceFactory > ProviderWrapper::getDelegate()
- {
- osl::MutexGuard lock(mutex);
- if (!m_xDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Delegate Provider has been disposed"));
- throw lang::DisposedException(sMsg,*this);
- }
- return m_xDelegate;
- }
-
-
- uno::Reference<lang::XServiceInfo> ProviderWrapper::getDelegateInfo()
- {
- uno::Reference<lang::XServiceInfo> xDelegate( this->getDelegate(), uno::UNO_QUERY );
- if (!xDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Delegate Provider has no service info"));
- throw uno::RuntimeException(sMsg,*this);
- }
- return xDelegate;
- }
-
- /// XMultiServiceFactory
- static inline uno::Any const * begin(uno::Sequence< uno::Any > const & aArgs)
- { return aArgs.getConstArray(); }
- static inline uno::Any const * end(uno::Sequence< uno::Any > const & aArgs)
- { return aArgs.getConstArray() + aArgs.getLength(); }
- static inline uno::Any * begin(uno::Sequence< uno::Any > & aArgs)
- { return aArgs.getArray(); }
- static inline uno::Any * end(uno::Sequence< uno::Any > & aArgs)
- { return aArgs.getArray() + aArgs.getLength(); }
-
- uno::Sequence< uno::Any > ProviderWrapper::patchArguments(uno::Sequence< uno::Any > const & aArgs) const
- {
- // rely on evaluation order front to back
- if (m_aDefaults.getLength() == 0) return aArgs;
-
- uno::Sequence< uno::Any > aResult(m_aDefaults.getLength() + aArgs.getLength());
-
- uno::Any * pNext = std::copy(begin(m_aDefaults),end(m_aDefaults),begin(aResult));
- pNext = std::copy(begin(aArgs),end(aArgs),pNext);
-
- OSL_ASSERT(end(aResult) == pNext);
-
- return aResult;
- }
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderWrapper::createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException)
- {
- return getDelegate()->createInstanceWithArguments(aServiceSpecifier,m_aDefaults);
- }
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderWrapper::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& rArguments )
- throw(uno::Exception, uno::RuntimeException)
- {
- return getDelegate()->createInstanceWithArguments(ServiceSpecifier,patchArguments(rArguments));
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL
- ProviderWrapper::getAvailableServiceNames( )
- throw(uno::RuntimeException)
- {
- return getDelegate()->getAvailableServiceNames( );
- }
-
- /// XServiceInfo
- rtl::OUString SAL_CALL
- ProviderWrapper::getImplementationName( )
- throw(uno::RuntimeException)
- {
- return rtl::OUString::createFromAscii("com.sun.star.comp.configuration.ConfigurationProviderWrapper");
- }
-
- sal_Bool SAL_CALL
- ProviderWrapper::supportsService( const ::rtl::OUString& ServiceName )
- throw(uno::RuntimeException)
- {
- return getDelegateInfo()->supportsService( ServiceName );
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL
- ProviderWrapper::getSupportedServiceNames( )
- throw(uno::RuntimeException)
- {
- return getDelegateInfo()->getSupportedServiceNames( );
- }
-
-
-} // namespace configmgr
-
-
-
diff --git a/configmgr/source/misc/providerwrapper.hxx b/configmgr/source/misc/providerwrapper.hxx
deleted file mode 100644
index fe6de39df485..000000000000
--- a/configmgr/source/misc/providerwrapper.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_API_PROVIDERWRAPPER_HXX_
-#define CONFIGMGR_API_PROVIDERWRAPPER_HXX_
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/compbase2.hxx>
-#include <osl/mutex.hxx>
-
-namespace configmgr
-{
- //==========================================================================
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- //==========================================================================
- //= ProviderWrapper
- //==========================================================================
- struct PWMutexHolder { osl::Mutex mutex; }; // ad hoc ...
-
- class ProviderWrapper : private PWMutexHolder, public cppu::WeakComponentImplHelper2< lang::XMultiServiceFactory, lang::XServiceInfo >
- {
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xDelegate;
- uno::Sequence< uno::Any > m_aDefaults;
- private:
- ProviderWrapper(uno::Reference< lang::XMultiServiceFactory > const & xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets);
-
- public:
- static uno::Reference< uno::XInterface > create( uno::Reference< uno::XInterface > xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets);
- ~ProviderWrapper();
-
- /// XMultiServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getAvailableServiceNames( )
- throw(uno::RuntimeException);
-
- /// XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- protected:
- virtual void SAL_CALL disposing();
- private:
- uno::Reference< lang::XMultiServiceFactory > getDelegate();
- uno::Reference<lang::XServiceInfo> getDelegateInfo();
- uno::Sequence< uno::Any > patchArguments(uno::Sequence< uno::Any > const & aArgs) const;
- };
-
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_CONFPROVIDER2_HXX_
-
-
diff --git a/configmgr/source/misc/requestoptions.cxx b/configmgr/source/misc/requestoptions.cxx
deleted file mode 100644
index a3ff375c3d78..000000000000
--- a/configmgr/source/misc/requestoptions.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "requestoptions.hxx"
-#include "matchlocale.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- rtl::OUString RequestOptions::getIsoLocale() const
- {
- return localehelper::makeIsoLocale( m_sLocale );
- }
-// ---------------------------------------------------------------------------
-
- bool RequestOptions::isForAllLocales() const
- {
- return localehelper::designatesAllLocales( m_sLocale );
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::setIsoLocale(rtl::OUString const & _sLocale)
- {
- setLocale( localehelper::makeLocale( _sLocale ) );
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::setAllLocales()
- {
- m_sLocale = localehelper::getAnyLocale();
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::ensureLocaleSet()
- {
- if (!hasLocale())
- m_sLocale = localehelper::getDefaultLocale();
- }
-// ---------------------------------------------------------------------------
-
- static inline
- sal_Int32 hashRequestLocale(com::sun::star::lang::Locale const & aLocale)
- {
- return aLocale.Language.hashCode() ^ aLocale.Country.hashCode();
- }
-// ---------------------------------------------------------------------------
-
- static inline
- sal_Int32 compareRequestLocale(com::sun::star::lang::Locale const& lhs, com::sun::star::lang::Locale const& rhs)
- {
- sal_Int32 nDiff = lhs.Language.compareTo(rhs.Language);
- if (nDiff == 0)
- {
- nDiff = lhs.Country.compareTo(rhs.Country);
- }
-
- return nDiff;
- }
-// ---------------------------------------------------------------------------
-
- sal_Int32 compareRequestOptions(RequestOptions const& lhs, RequestOptions const& rhs)
- {
- sal_Int32 nDiff = lhs.getEntity().compareTo(rhs.getEntity());
- if (nDiff == 0)
- {
- nDiff = compareRequestLocale(lhs.getUnoLocale(),rhs.getUnoLocale());
- }
-
- return nDiff;
- }
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/serviceinfohelper.cxx b/configmgr/source/misc/serviceinfohelper.cxx
deleted file mode 100644
index e3d795113dde..000000000000
--- a/configmgr/source/misc/serviceinfohelper.cxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "serviceinfohelper.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- sal_Int32 ServiceInfoHelper::countServices( ) const
- {
- if (m_info == 0)
- return 0;
-
- sal_Int32 nCount = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
-
- return nCount;
- }
-// ---------------------------------------------------------------------------
-
- rtl::OUString ServiceInfoHelper::getImplementationName( ) const
- throw(uno::RuntimeException)
- {
- sal_Char const * p= m_info ? m_info->implementationName : 0;
-
- return p ? rtl::OUString::createFromAscii(p) : rtl::OUString();
- }
-// ---------------------------------------------------------------------------
-
- sal_Bool ServiceInfoHelper::supportsService( rtl::OUString const & ServiceName ) const
- throw(uno::RuntimeException)
- {
- if (m_info == 0)
- return false;
-
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- if (ServiceName.equalsAscii(*p))
- return true;
- ++p;
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- if (ServiceName.equalsAscii(*p))
- return true;
- ++p;
- }
- }
-
- return false;
- }
-// ---------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > ServiceInfoHelper::getSupportedServiceNames( ) const
- throw(uno::RuntimeException)
- {
- sal_Int32 const nCount = countServices();
-
- uno::Sequence< rtl::OUString > aServices( nCount );
-
- if (nCount)
- {
- OSL_ASSERT(m_info);
- sal_Int32 i = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- OSL_ASSERT( i == nCount );
- }
-
- return aServices;
- }
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
- sal_Int32 ServiceRegistrationHelper::countServices( ) const
- {
- if (m_info == 0)
- return 0;
-
- sal_Int32 nCount = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
-
- return nCount;
- }
-// ---------------------------------------------------------------------------
-
- rtl::OUString ServiceRegistrationHelper::getImplementationName( ) const
- throw(uno::RuntimeException)
- {
- sal_Char const * p= m_info ? m_info->implementationName : 0;
-
- return p ? rtl::OUString::createFromAscii(p) : rtl::OUString();
- }
-// ---------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > ServiceRegistrationHelper::getRegisteredServiceNames( ) const
- throw(uno::RuntimeException)
- {
- sal_Int32 const nCount = countServices();
-
- uno::Sequence< rtl::OUString > aServices( nCount );
-
- if (nCount)
- {
- OSL_ASSERT(m_info);
- sal_Int32 i = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- OSL_ASSERT( i == nCount );
- }
-
- return aServices;
- }
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/simpleinteractionrequest.cxx b/configmgr/source/misc/simpleinteractionrequest.cxx
deleted file mode 100644
index f7e18cca2cd6..000000000000
--- a/configmgr/source/misc/simpleinteractionrequest.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simpleinteractionrequest.hxx"
-
-namespace configmgr { namespace apihelper {
-
-namespace uno = com::sun::star::uno;
-namespace task = com::sun::star::task;
-//=========================================================================
-SimpleInteractionRequest::SimpleInteractionRequest(
- const uno::Any & rRequest,
- const sal_uInt32 nContinuations )
-: InteractionRequest( rRequest )
-{
- // Set continuations.
- OSL_ENSURE( nContinuations != CONTINUATION_UNKNOWN,
- "SimpleInteractionRequest - No continuation!" );
-
- sal_Int32 nLength = 0;
-
- const sal_uInt32 k_NumContinuationTypes = 4;
- uno::Reference< task::XInteractionContinuation > xContinuations[ k_NumContinuationTypes ];
-
- if ( nContinuations & CONTINUATION_ABORT )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionAbort >( this );
-
- if ( nContinuations & CONTINUATION_RETRY )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionRetry >( this );
-
- if ( nContinuations & CONTINUATION_APPROVE )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionApprove >( this );
-
- if ( nContinuations & CONTINUATION_DISAPPROVE )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionDisapprove >( this );
-
- OSL_ENSURE( nLength > 0,
- "SimpleInteractionRequest - No continuation!" );
-
- uno::Sequence< uno::Reference< task::XInteractionContinuation > >
- aContinuations( xContinuations, nLength );
-
- this->setContinuations( aContinuations );
-}
-
-//=========================================================================
-sal_uInt32 SimpleInteractionRequest::getResponse() const
-{
- uno::Reference< task::XInteractionContinuation > xSelection = this->getSelection();
- if ( xSelection.is() )
- {
- if ( uno::Reference< task::XInteractionApprove >::query(xSelection).is() )
- return CONTINUATION_APPROVE;
-
- if ( uno::Reference< task::XInteractionDisapprove >::query(xSelection).is() )
- return CONTINUATION_DISAPPROVE;
-
- if ( uno::Reference< task::XInteractionRetry >::query(xSelection).is() )
- return CONTINUATION_RETRY;
-
- if ( uno::Reference< task::XInteractionAbort >::query(xSelection).is() )
- return CONTINUATION_ABORT;
-
- OSL_ENSURE( sal_False,
- "SimpleInteractionRequest::getResponse - Unknown continuation!" );
- }
- return CONTINUATION_UNKNOWN;
-}
-
-} }
diff --git a/configmgr/source/misc/strimpl.cxx b/configmgr/source/misc/strimpl.cxx
deleted file mode 100644
index 7c2f52622d87..000000000000
--- a/configmgr/source/misc/strimpl.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "strdecl.hxx"
-
-namespace configmgr
-{
- // simple types names
- IMPLEMENT_CONSTASCII_USTRING(TYPE_BOOLEAN, "boolean");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_SHORT, "short");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_INT, "int");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_LONG, "long");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_DOUBLE, "double");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_STRING, "string");
- // Type: Sequence<bytes>
- IMPLEMENT_CONSTASCII_USTRING(TYPE_BINARY, "binary");
- // Universal type: Any
- IMPLEMENT_CONSTASCII_USTRING(TYPE_ANY, "any");
-
- // special template names for native/localized value types
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_PREFIX, "cfg:");
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_VALUE, "cfg:value");
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_LOCALIZED_VALUE, "cfg:localized");
-
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_LIST_SUFFIX, "-list");
-
-
-
-// emacs:
-// create the declare from the implement
-// (fset 'create-declare-from-implement
-// [home M-right ?\C- ?\C-s ?, left right left ?\M-w f12 return up tab ?D ?E ?C ?L ?A ?R ?E ?\C-y ?) ?; home down f12 home down])
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/tracer.cxx b/configmgr/source/misc/tracer.cxx
deleted file mode 100644
index f574213dfd28..000000000000
--- a/configmgr/source/misc/tracer.cxx
+++ /dev/null
@@ -1,471 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-// SUNPRO5 does not like the following to be done after including stdio.h, that's why it's here at the very
-// beginning of the file
-#undef _TIME_T_DEFINED
-#include <time.h>
-#include <rtl/string.hxx>
-#include <map>
-
-#include "tracer.hxx"
-
-#ifdef CFG_ENABLE_TRACING
-
-#include <cstdarg>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <osl/process.h>
-#include <osl/thread.h>
-#include <osl/diagnose.h>
-#include <rtl/ustring.hxx>
-#include <rtl/instance.hxx>
-
-namespace configmgr
-{
-
-extern "C"
-{
- static void call_freeThreadData(void*);
-}
-
-struct OTracerSetup
-{
- enum {
- INFO = 0x01,
- WARNING = 0x02,
- ERROR = 0x04,
- LEVEL_MASK = 0x0f,
-
- TIME = 0x10,
- THREAD = 0x20,
- DATA_MASK = 0xf0
- };
-
- sal_uInt32 m_nTraceMask;
- FILE* m_pOutputMedium;
- sal_Bool m_bInitialized;
- oslThreadKey m_nThreadKey;
-
- ::std::map< ::rtl::OString, void*, ::std::less< ::rtl::OString > > m_aDevices;
-
- OTracerSetup()
- :m_nTraceMask(WARNING | ERROR)
- ,m_pOutputMedium(NULL)
- ,m_bInitialized(sal_False)
- {
- m_nThreadKey = ::osl_createThreadKey(call_freeThreadData);
- }
- ~OTracerSetup()
- {
- ::osl_destroyThreadKey(m_nThreadKey);
- }
-
- bool isTracing(sal_uInt32 nTraceValue) const
- { return (nTraceValue & this->m_nTraceMask) == nTraceValue; }
-
- void setTracing(sal_uInt32 nTraceValue)
- { this->m_nTraceMask |= nTraceValue; }
-
- void setTracing(sal_uInt32 nTraceValue, sal_uInt32 nMask)
- {
- OSL_ENSURE( (nTraceValue&nMask) == nTraceValue, "Flags being set must be part of mask");
- this->m_nTraceMask &= ~nMask;
- this->m_nTraceMask |= nTraceValue;
- }
-
- sal_Int32& indentDepth();
-
- struct ThreadData
- {
- ThreadData() : m_nIndentDepth(0) {}
- sal_Int32 m_nIndentDepth;
- };
-
- ThreadData& ensureThreadData();
- static void freeThreadData(void*p);
-};
-
-//==========================================================================
-//= OConfigTracer
-//==========================================================================
-OTracerSetup* OConfigTracer::s_pImpl = NULL;
-#ifdef WNT
-timeb OConfigTracer::s_aStartTime;
-#else
-timeval OConfigTracer::s_aStartTime;
-#endif
-
-::osl::Mutex & OConfigTracer::getMutex()
-{
- return rtl::Static<osl::Mutex,OConfigTracer>::get();
-}
-//--------------------------------------------------------------------------
-void OConfigTracer::startGlobalTimer()
-{
-#ifdef WNT
- ftime( &s_aStartTime );
-#else
- gettimeofday( &s_aStartTime, NULL );
-#endif
-}
-
-//--------------------------------------------------------------------------
-sal_uInt32 OConfigTracer::getGlobalTimer()
-{
-#ifdef WNT
- struct timeb currentTime;
- sal_uInt32 nSeconds;
- ftime( &currentTime );
- nSeconds = (sal_uInt32)( currentTime.time - s_aStartTime.time );
- return ( nSeconds * 1000 ) + (long)( currentTime.millitm - s_aStartTime.millitm );
-#else
- struct timeval currentTime;
- sal_uInt32 nSeconds;
- gettimeofday( &currentTime, NULL );
- nSeconds = (sal_uInt32)( currentTime.tv_sec - s_aStartTime.tv_sec );
- return ( nSeconds * 1000 ) + (long)( currentTime.tv_usec - s_aStartTime.tv_usec )/1000;
-#endif
-}
-
-//--------------------------------------------------------------------------
-sal_Int32& OTracerSetup::indentDepth()
-{
- return ensureThreadData().m_nIndentDepth;
-}
-
-//--------------------------------------------------------------------------
-OTracerSetup::ThreadData& OTracerSetup::ensureThreadData()
-{
- void * pThreadData = ::osl_getThreadKeyData(m_nThreadKey);
-
- OTracerSetup::ThreadData* pRet
- = static_cast< OTracerSetup::ThreadData * >(pThreadData);
-
- if (pRet == NULL)
- {
- pThreadData = pRet = new ThreadData();
-
- if (!::osl_setThreadKeyData(m_nThreadKey,pThreadData))
- {
- OSL_ENSURE(false, "Cannot create per-thread data for tracing");
- freeThreadData(pThreadData);
-
- static ThreadData sharedThreadData;
- pRet = &sharedThreadData;
- }
- else
- OSL_ASSERT( pThreadData == ::osl_getThreadKeyData(m_nThreadKey) );
-
- OSL_ASSERT( pRet != NULL );
- }
-
- return *pRet;
-}
-
-static void call_freeThreadData( void* p )
-{
- OTracerSetup::freeThreadData( p );
-}
-
-//--------------------------------------------------------------------------
-void OTracerSetup::freeThreadData(void* p)
-{
- delete static_cast< OTracerSetup::ThreadData * > (p);
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::ensureData()
-{
- if (s_pImpl)
- return;
- s_pImpl = new OTracerSetup;
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::inc()
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ++s_pImpl->indentDepth();
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::dec()
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- --s_pImpl->indentDepth();
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::traceInfo(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::INFO) )
- {
-
-
- va_list args;
- va_start(args, _pFormat);
- implTrace("info", _pFormat, args);
- va_end(args);
- }
-}
-#if OSL_DEBUG_LEVEL > 0
-//--------------------------------------------------------------------------
-void OConfigTracer::traceWarning(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::WARNING))
- {
- va_list args;
- va_start(args, _pFormat);
- implTrace("warning", _pFormat, args);
- va_end(args);
- }
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::traceError(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::ERROR))
- {
- va_list args;
- va_start(args, _pFormat);
- implTrace("error", _pFormat, args);
- va_end(args);
- }
-}
-#endif
-//--------------------------------------------------------------------------
-void OConfigTracer::indent()
-{
- sal_Int32 nIndent = s_pImpl->indentDepth();
- for (sal_Int32 i=0; i<nIndent; ++i)
- fprintf(s_pImpl->m_pOutputMedium, " ");
-}
-
-//--------------------------------------------------------------------------
-FILE* disambiguate(const ::rtl::OString& _rFileName)
-{
- FILE* pExistenceCheck = NULL;
- sal_Int32 i = 1;
- ::rtl::OString sLoop;
- while (i <= 256)
- {
- sLoop = _rFileName;
- sLoop += ".";
- sLoop += ::rtl::OString::valueOf(i);
-
- pExistenceCheck = fopen(sLoop.getStr(), "r");
- if (!pExistenceCheck)
- // does not exist
- return fopen(sLoop.getStr(), "w+");
-
- // already exists, try the next name
- fclose(pExistenceCheck);
- ++i;
- }
-
- // could not open such a file
- return NULL;
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::ensureInitalized()
-{
- if (s_pImpl->m_bInitialized)
- return;
-
- s_pImpl->m_bInitialized = sal_True;
-
- char* pSettings = getenv("ENVCFGFLAGS");
- if (!pSettings)
- return;
-
- /* currently recognized structure :
- + switches have to be separated by whitespaces
- + valid switches are:
- -m[e|o|f<file>] - output to stderr (e), stdout (o) or a file (f). In the latter case the whole rest
- of the param ('til the next one, means 'til the next whitespace) is the filename
- -t{i,w,e,p,d}* - type of output : i includes infos, w includes warnings, e includes errors
- content : p includes timestamp, d includes thread-id
- */
-
- s_pImpl->m_pOutputMedium = stderr;
- s_pImpl->setTracing(0, OTracerSetup::LEVEL_MASK);
- s_pImpl->setTracing(0, OTracerSetup::DATA_MASK);
-
- char* pParamLoop = pSettings;
- while (*pParamLoop)
- {
- while (!isspace(*pParamLoop) && *pParamLoop)
- ++pParamLoop;
-
- sal_Int32 nLen = pParamLoop - pSettings;
- if ((nLen > 1) && (*pSettings == '-'))
- {
- ++pSettings;
- switch (*pSettings)
- {
- case 'm':
- case 'w':
- if (nLen > 2)
- {
- ++pSettings;
- switch (*pSettings)
- {
- case 'e':
- s_pImpl->m_pOutputMedium = stderr;
- break;
- case 'o':
- s_pImpl->m_pOutputMedium = stdout;
- break;
- case 'f':
- {
- ++pSettings;
- // copy the filename into an own buffer
- ::rtl::OString sFileName(pSettings, pParamLoop - pSettings);
-
- // open the file
- s_pImpl->m_pOutputMedium = disambiguate(sFileName);
-
- break;
- }
- }
- }
- break;
- case 'd':
- { // assign a virtual device
- // copy the device assingment description
- ::rtl::OString sDescription(pSettings + 1, pParamLoop - pSettings - 1);
- sal_Int32 nSep = sDescription.indexOf(':');
- if (-1 == nSep)
- break; // invalid format
-
- ::rtl::OString sVirtualDeviceName, sFileName;
- sVirtualDeviceName = sDescription.copy(0, nSep);
- sFileName = sDescription.copy(nSep + 1);
-
- FILE* pVirtualDevice = disambiguate(sFileName);
- if (pVirtualDevice)
- s_pImpl->m_aDevices[sVirtualDeviceName] = pVirtualDevice;
- }
- case 't':
- {
- ++pSettings;
- while (pSettings != pParamLoop)
- {
- switch (*pSettings)
- {
- case 'i': s_pImpl->setTracing( OTracerSetup::INFO ); break;
- case 'w': s_pImpl->setTracing( OTracerSetup::WARNING ); break;
- case 'e': s_pImpl->setTracing( OTracerSetup::ERROR ); break;
- case 'p': s_pImpl->setTracing( OTracerSetup::TIME );
- startGlobalTimer();
- break;
- case 'd': s_pImpl->setTracing( OTracerSetup::THREAD ); break;
- }
- ++pSettings;
- }
- }
- }
- }
-
- if (!*pParamLoop)
- break;
-
- ++pParamLoop;
- pSettings = pParamLoop;
- }
-
- // trace some initial information
- CFG_TRACE_INFO_NI("initialization: process id: 0x%08X", osl_getProcess(0));
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- CFG_TRACE_INFO_NI("initialization: executable file name: %s", OUSTRING2ASCII(sExecutable));
-}
-
-//--------------------------------------------------------------------------
-//-----------------------------------------------------------
-// need raw unsigned int to safely printf a value
-static inline
-unsigned int getThreadID()
-{
- oslThreadIdentifier nRealThreadID = ::osl_getThreadIdentifier(NULL);
-
- return nRealThreadID; // if this loses data, we can still hope that lsb is changing between thraeds
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::implTrace(const sal_Char* _pType, const sal_Char* _pFormat, va_list args)
-{
- ensureInitalized();
- if (!s_pImpl->m_pOutputMedium)
- // no tracing enabled
- return;
-
- if (_pType && strlen(_pType))
- {
- if (s_pImpl->isTracing(OTracerSetup::THREAD))
- {
- fprintf(s_pImpl->m_pOutputMedium, "[%04x] ", getThreadID());
- }
-
- fprintf(s_pImpl->m_pOutputMedium, "%s ", _pType);
-
- if (s_pImpl->isTracing(OTracerSetup::TIME))
- {
- fprintf(s_pImpl->m_pOutputMedium, "(%06" SAL_PRIuUINT32 ")", getGlobalTimer());
- }
- }
- fprintf(s_pImpl->m_pOutputMedium, ": ");
-
- indent();
-
- vfprintf(s_pImpl->m_pOutputMedium, _pFormat, args);
- fprintf(s_pImpl->m_pOutputMedium,"\n");
- fflush(s_pImpl->m_pOutputMedium);
-}
-
-} // namespace configmgr
-
-#endif // CFG_ENABLE_TRACING
-
diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx
new file mode 100644
index 000000000000..2ad3b5ef8bd1
--- /dev/null
+++ b/configmgr/source/modifications.cxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "rtl/ustring.hxx"
+
+#include "modifications.hxx"
+#include "path.hxx"
+
+namespace configmgr {
+
+Modifications::Modifications() {}
+
+Modifications::~Modifications() {}
+
+void Modifications::add(Path const & path) {
+ Node * p = &root_;
+ bool wasPresent = false;
+ for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
+ Node::Children::iterator j(p->children.find(*i));
+ if (j == p->children.end()) {
+ if (wasPresent && p->children.empty()) {
+ return;
+ }
+ j = p->children.insert(Node::Children::value_type(*i, Node())).
+ first;
+ wasPresent = false;
+ } else {
+ wasPresent = true;
+ }
+ p = &j->second;
+ }
+ p->children.clear();
+}
+
+Modifications::Node const & Modifications::getRoot() const {
+ return root_;
+}
+
+}
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
new file mode 100644
index 000000000000..e29a10150148
--- /dev/null
+++ b/configmgr/source/modifications.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+
+#include "boost/noncopyable.hpp"
+
+#include "path.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Modifications: private boost::noncopyable {
+public:
+ struct Node {
+ typedef std::map< rtl::OUString, Node > Children;
+
+ Children children;
+ };
+
+ Modifications();
+
+ ~Modifications();
+
+ void add(Path const & path);
+
+ Node const & getRoot() const;
+
+private:
+ Node root_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx
new file mode 100644
index 000000000000..a5a089106b2a
--- /dev/null
+++ b/configmgr/source/node.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+NodeMap & Node::getMembers() {
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+rtl::OUString Node::getTemplateName() const {
+ return rtl::OUString();
+}
+
+void Node::setMandatory(int layer) {
+ (void) layer; // avoid warnings
+ OSL_ASSERT(layer == Data::NO_LAYER);
+}
+
+int Node::getMandatory() const {
+ return Data::NO_LAYER;
+}
+
+void Node::setLayer(int layer) {
+ OSL_ASSERT(layer >= layer_);
+ layer_ = layer;
+}
+
+int Node::getLayer() const {
+ return layer_;
+}
+
+void Node::setFinalized(int layer) {
+ finalized_ = layer;
+}
+
+int Node::getFinalized() const {
+ return finalized_;
+}
+
+rtl::Reference< Node > Node::getMember(rtl::OUString const & name) {
+ NodeMap & members = getMembers();
+ NodeMap::iterator i(members.find(name));
+ return i == members.end() ? rtl::Reference< Node >() : i->second;
+}
+
+Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER) {}
+
+Node::Node(const Node & other):
+ SimpleReferenceObject(), layer_(other.layer_), finalized_(other.finalized_)
+{}
+
+Node::~Node() {}
+
+void Node::clear() {}
+
+rtl::Reference< Node > Node::findMember(rtl::OUString const &) {
+ return rtl::Reference< Node >();
+}
+
+}
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
new file mode 100644
index 000000000000..10f168520595
--- /dev/null
+++ b/configmgr/source/node.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_NODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_NODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class Node: public salhelper::SimpleReferenceObject {
+public:
+ enum Kind {
+ KIND_PROPERTY, KIND_LOCALIZED_PROPERTY, KIND_LOCALIZED_VALUE,
+ KIND_GROUP, KIND_SET };
+
+ virtual Kind kind() const = 0;
+
+ virtual rtl::Reference< Node > clone() const = 0;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ void setLayer(int layer);
+
+ int getLayer() const;
+
+ void setFinalized(int layer);
+
+ int getFinalized() const;
+
+ rtl::Reference< Node > getMember(rtl::OUString const & name);
+
+protected:
+ explicit Node(int layer);
+
+ Node(const Node & other);
+
+ virtual ~Node();
+
+ virtual void clear();
+
+ virtual rtl::Reference< Node > findMember(rtl::OUString const & name);
+
+ int layer_;
+ int finalized_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
new file mode 100644
index 000000000000..6b22863b5672
--- /dev/null
+++ b/configmgr/source/nodemap.cxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "osl/diagnose.h"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+void cloneNodeMap(NodeMap const & source, NodeMap * target) {
+ OSL_ASSERT(target != 0 && target->empty());
+ NodeMap clone(source);
+ for (NodeMap::iterator i(clone.begin()); i != clone.end(); ++i) {
+ i->second = i->second->clone();
+ }
+ std::swap(clone, *target);
+}
+
+}
diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx
new file mode 100644
index 000000000000..92ea324091cd
--- /dev/null
+++ b/configmgr/source/nodemap.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_NODEMAP_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_NODEMAP_HXX
+
+#include "sal/config.h"
+
+#include <map>
+
+#include "rtl/ref.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Node;
+
+typedef std::map< rtl::OUString, rtl::Reference< Node > > NodeMap;
+
+void cloneNodeMap(NodeMap const & source, NodeMap * target);
+
+}
+
+#endif
diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx
new file mode 100644
index 000000000000..c8c7218b6da6
--- /dev/null
+++ b/configmgr/source/pad.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+
+namespace configmgr {
+
+void Pad::add(char const * begin, sal_Int32 length) {
+ OSL_ASSERT(
+ begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
+ if (length != 0) {
+ flushSpan();
+ if (buffer_.getLength() == 0) {
+ span_ = Span(begin, length);
+ } else {
+ buffer_.append(begin, length);
+ }
+ }
+}
+
+void Pad::addEphemeral(char const * begin, sal_Int32 length) {
+ OSL_ASSERT(
+ begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
+ if (length != 0) {
+ flushSpan();
+ buffer_.append(begin, length);
+ }
+}
+
+void Pad::clear() {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ span_.clear();
+ buffer_.setLength(0);
+}
+
+bool Pad::is() const {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ return span_.is() || buffer_.getLength() != 0;
+}
+
+Span Pad::get() const {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ if (span_.is()) {
+ return span_;
+ } else if (buffer_.getLength() == 0) {
+ return Span(RTL_CONSTASCII_STRINGPARAM(""));
+ } else {
+ return Span(buffer_.getStr(), buffer_.getLength());
+ }
+}
+
+void Pad::flushSpan() {
+ if (span_.is()) {
+ buffer_.append(span_.begin, span_.length);
+ span_.clear();
+ }
+}
+
+}
diff --git a/configmgr/source/pad.hxx b/configmgr/source/pad.hxx
new file mode 100644
index 000000000000..66a51f480023
--- /dev/null
+++ b/configmgr/source/pad.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
+
+#include "sal/config.h"
+
+#include "rtl/strbuf.hxx"
+#include "sal/types.h"
+
+#include "span.hxx"
+
+namespace configmgr {
+
+class Pad {
+public:
+ void add(char const * begin, sal_Int32 length);
+
+ void addEphemeral(char const * begin, sal_Int32 length);
+
+ void clear();
+
+ bool is() const;
+
+ Span get() const;
+
+private:
+ void flushSpan();
+
+ Span span_;
+ rtl::OStringBuffer buffer_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/parsemanager.cxx b/configmgr/source/parsemanager.cxx
new file mode 100644
index 000000000000..69a5515b977c
--- /dev/null
+++ b/configmgr/source/parsemanager.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/diagnose.h"
+#include "sal/types.h"
+
+#include "parsemanager.hxx"
+#include "parser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+ParseManager::ParseManager(
+ rtl::OUString const & url, rtl::Reference< Parser > const & parser)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException)):
+ reader_(url), parser_(parser)
+{
+ OSL_ASSERT(parser.is());
+}
+
+bool ParseManager::parse() {
+ for (;;) {
+ switch (itemData_.is()
+ ? XmlReader::RESULT_BEGIN
+ : reader_.nextItem(
+ parser_->getTextMode(), &itemData_, &itemNamespace_))
+ {
+ case XmlReader::RESULT_BEGIN:
+ if (!parser_->startElement(reader_, itemNamespace_, itemData_))
+ {
+ return false;
+ }
+ break;
+ case XmlReader::RESULT_END:
+ parser_->endElement(reader_);
+ break;
+ case XmlReader::RESULT_TEXT:
+ parser_->characters(itemData_);
+ break;
+ case XmlReader::RESULT_DONE:
+ return true;
+ }
+ itemData_.clear();
+ }
+}
+
+ParseManager::~ParseManager() {}
+
+}
diff --git a/configmgr/source/parsemanager.hxx b/configmgr/source/parsemanager.hxx
new file mode 100644
index 000000000000..18292859ab98
--- /dev/null
+++ b/configmgr/source/parsemanager.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "span.hxx"
+#include "xmlreader.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Parser;
+
+class ParseManager: public salhelper::SimpleReferenceObject {
+public:
+ ParseManager(
+ rtl::OUString const & url, rtl::Reference< Parser > const & parser)
+ SAL_THROW((
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException));
+
+ bool parse();
+
+private:
+ virtual ~ParseManager();
+
+ XmlReader reader_;
+ rtl::Reference< Parser > parser_;
+ Span itemData_;
+ XmlReader::Namespace itemNamespace_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/parser.hxx b/configmgr/source/parser.hxx
new file mode 100644
index 000000000000..da29941953b5
--- /dev/null
+++ b/configmgr/source/parser.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PARSER_HXX
+
+#include "sal/config.h"
+
+#include <memory>
+
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+struct Span;
+
+class Parser: public salhelper::SimpleReferenceObject {
+public:
+ virtual XmlReader::Text getTextMode() = 0;
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0;
+
+ virtual void endElement(XmlReader const & reader) = 0;
+
+ virtual void characters(Span const & text) = 0;
+
+protected:
+ Parser() {}
+
+ virtual ~Parser() {}
+};
+
+}
+
+#endif
diff --git a/configmgr/source/path.hxx b/configmgr/source/path.hxx
new file mode 100644
index 000000000000..fc70287dfe7b
--- /dev/null
+++ b/configmgr/source/path.hxx
@@ -0,0 +1,43 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+typedef std::vector< rtl::OUString > Path;
+
+}
+
+#endif
diff --git a/configmgr/source/platformbe/componentdefn.cxx b/configmgr/source/platformbe/componentdefn.cxx
deleted file mode 100644
index 8c4ae0645fcc..000000000000
--- a/configmgr/source/platformbe/componentdefn.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "systemintegrationmanager.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-
-//==============================================================================
-
-static com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createSystemIntegrationManager(
- const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& aContext) {
- return * new configmgr::backend::SystemIntegrationManager(aContext) ;
-}
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createSystemIntegrationManager,
- configmgr::backend::SystemIntegrationManager::getSystemIntegrationManagerName,
- configmgr::backend::SystemIntegrationManager::getServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
-component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void *aServiceManager, void *aRegistryKey)
-{
- return cppu::component_writeInfoHelper(aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void *component_getFactory(
- const sal_Char *aImplementationName, void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
diff --git a/configmgr/source/platformbe/exports.dxp b/configmgr/source/platformbe/exports.dxp
deleted file mode 100644
index 9630d7e06768..000000000000
--- a/configmgr/source/platformbe/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/source/platformbe/makefile.mk b/configmgr/source/platformbe/makefile.mk
deleted file mode 100644
index 5818341bbcda..000000000000
--- a/configmgr/source/platformbe/makefile.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=sysmgr
-ENABLE_EXCEPTIONS=TRUE
-
-# Version
-SYSMGR_MAJOR=1
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/systemintegrationmanager.obj \
- $(SLO)$/componentdefn.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET)$(SYSMGR_MAJOR).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: System Integration Manager
-
-# --- Targets ---
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/platformbe/sysmgr1.uno.xml b/configmgr/source/platformbe/sysmgr1.uno.xml
deleted file mode 100644
index 7f1767b3a351..000000000000
--- a/configmgr/source/platformbe/sysmgr1.uno.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-c<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice/DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>sysmgr1</module-name>
- <component-description>
- <author>Sarah Smith</author>
- <name>com.sun.star.comp.configuration.backend.SystemIntegration</name>
- <description>The SystemIntegration backend co-ordinates access to a number of configured backends.Each Backend access configuration data from a configured data source</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>C++</language>
- <status value="final"/>
- <supported-service>com.sun.star.configuration.backend.SystemIntegration</supported-service>
- <type>com.sun.star.configuration.CannotLoadConfigurationException</type>
- <type>com.sun.star.configuration.backend.BackendAccessException</type>
- <type>com.sun.star.configuration.backend.BackendSetupException</type>
- <type>com.sun.star.configuration.backend.XBackend</type>
- <type>com.sun.star.configuration.backend.XLayer</type>
- <type>com.sun.star.configuration.backend.XUpdateHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.container.XContentEnumerationAccess</type>
- <type>com.sun.star.container.XEnumeration</type>
- <type>com.sun.star.beans.XPropertySet</type>
- <type>com.sun.star.lang.IllegalArgumentException</type>
- <type>com.sun.star.lang.XInitialization</type>
- <type>com.sun.star.lang.XMultiServiceFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.uno.Any</type>
- <type>com.sun.star.uno.Sequence</type>
- </component-description>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/source/platformbe/systemintegrationmanager.cxx b/configmgr/source/platformbe/systemintegrationmanager.cxx
deleted file mode 100644
index 721c7230480e..000000000000
--- a/configmgr/source/platformbe/systemintegrationmanager.cxx
+++ /dev/null
@@ -1,366 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "systemintegrationmanager.hxx"
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-namespace configmgr { namespace backend {
-
-
-//==============================================================================
-#define OU2A( oustr ) (rtl::OUStringToOString( oustr, RTL_TEXTENCODING_ASCII_US ).getStr())
-//==============================================================================
-uno::Reference<backenduno::XSingleLayerStratum> BackendRef::getBackend(uno::Reference<uno::XComponentContext> const & xContext)
-{
- if (!mBackend.is() && mFactory.is())
- try
- {
- mBackend.set( mFactory->createInstanceWithContext(xContext), uno::UNO_QUERY_THROW );
- }
- catch(uno::Exception& e)
- {
- OSL_TRACE("SystemIntegration::getSupportingBackend - could not create platform Backend: %s",
- OU2A(e.Message) );
- }
- return mBackend;
-}
-//------------------------------------------------------------------------------
-void BackendRef::disposeBackend()
-{
- uno::Reference< lang::XComponent> xComp( mBackend, uno::UNO_QUERY );
- if (xComp.is())
- try
- {
- xComp->dispose();
- }
- catch(uno::Exception &)
- {}
- mBackend.clear();
-}
-//==============================================================================
-SystemIntegrationManager::SystemIntegrationManager(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::WeakComponentImplHelper4< backenduno::XBackend, backenduno::XBackendChangesNotifier, lang::XInitialization, lang::XServiceInfo>(mMutex)
-, mMutex()
-, mContext(xContext)
-, mPlatformBackends()
-{
-}
-//------------------------------------------------------------------------------
-SystemIntegrationManager::~SystemIntegrationManager()
-{
-}
-//------------------------------------------------------------------------------
-void SAL_CALL SystemIntegrationManager::initialize(
- const uno::Sequence<uno::Any>& /*aParameters*/)
- throw (uno::RuntimeException, uno::Exception,
- lang::IllegalArgumentException,
- backenduno::BackendSetupException)
-{
- buildLookupTable();
-}
-//------------------------------------------------------------------------------
-static const rtl::OUString getAllComponentsName()
-{
- sal_Unicode const kStar = '*';
- return rtl::OUString(&kStar,1);
-}
-
-//------------------------------------------------------------------------------
-
-void SystemIntegrationManager::buildLookupTable()
-{
- static const rtl::OUString kPlatformServiceName(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
- //Build platform backend map componentName -> servicefactory
- uno::Reference<css::container::XContentEnumerationAccess> xEnumAccess
- (mContext->getServiceManager(),uno::UNO_QUERY_THROW);
-
- uno::Reference<css::container::XEnumeration> xEnum =
- xEnumAccess->createContentEnumeration(kPlatformServiceName);
- if (xEnum.is())
- {
- osl::MutexGuard lock(mMutex);
- while (xEnum->hasMoreElements())
- {
- uno::Reference<lang::XSingleComponentFactory> xServiceFactory( xEnum->nextElement(),uno::UNO_QUERY);
- if (xServiceFactory.is())
- {
- uno::Sequence<rtl::OUString> aKeys = getSupportedComponents(xServiceFactory);
-
- for (sal_Int32 i = 0 ; i < aKeys.getLength() ; ++i)
- {
- BackendRef aBackendRef(xServiceFactory);
- //OSL_TRACE("SystemInteg -Adding Factory Backend to map for key %s",
- //rtl::OUStringToOString(aKeys[i], RTL_TEXTENCODING_ASCII_US).getStr() );
- mPlatformBackends.insert( std::multimap<rtl::OUString, BackendRef>::value_type(aKeys[i],aBackendRef));
- }
- }
- }
- }
-}
-//---------------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SystemIntegrationManager::getSupportedComponents(const uno::Reference<lang::XSingleComponentFactory>& xFactory)
-{
- static const rtl::OUString kProperSubkeyName( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents")) ;
- static const rtl::OUString kImplKeyPropertyName( RTL_CONSTASCII_USTRINGPARAM("ImplementationKey")) ;
-
- uno::Reference<css::beans::XPropertySet> xSMProp(xFactory,uno::UNO_QUERY);
- if (xSMProp.is())
- {
- try
- {
- uno::Reference< css::registry::XRegistryKey > xImplKey(
- xSMProp->getPropertyValue(kImplKeyPropertyName), uno::UNO_QUERY);
-
- if (xImplKey.is())
- {
- uno::Reference< css::registry::XRegistryKey > xKey(
- xImplKey->openKey(kProperSubkeyName));
- if(xKey.is())
- return xKey->getAsciiListValue();
- }
- }
- catch(css::beans::UnknownPropertyException&){}
- catch(css::registry::InvalidValueException&){}
- catch(css::registry::InvalidRegistryException&){}
- }
- static const rtl::OUString kAllComponentsName = getAllComponentsName();
- return uno::Sequence<rtl::OUString>(&kAllComponentsName, 1);
-}
-//---------------------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SystemIntegrationManager::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return listLayers(aComponent, rtl::OUString() ) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SystemIntegrationManager::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- return getUpdateHandler(aComponent, rtl::OUString()) ;
-}
-//------------------------------------------------------------------------------
-
-std::vector< uno::Reference<backenduno::XSingleLayerStratum> > SystemIntegrationManager::getSupportingBackends(const rtl::OUString& aComponent)
-{
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > backends;
-
- osl::MutexGuard lock(mMutex);
- std::pair<std::multimap<rtl::OUString, BackendRef>::iterator, std::multimap<rtl::OUString, BackendRef>::iterator> aRange = mPlatformBackends.equal_range(aComponent);
- for (std::multimap<rtl::OUString, BackendRef>::iterator it=aRange.first; it != aRange.second; )
- {
- std::multimap<rtl::OUString, BackendRef>::iterator cur = it++; // increment here, as erase() may invalidate cur
- uno::Reference<backenduno::XSingleLayerStratum> xBackend = cur->second.getBackend(mContext);
- if (xBackend.is())
- backends.push_back(xBackend);
-
- else // prevent repeated attempts to create
- mPlatformBackends.erase(cur);
- }
- return backends;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SystemIntegrationManager::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > const aUniversalBackends = getSupportingBackends(getAllComponentsName());
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > const aSpecialBackends = getSupportingBackends(aComponent);
-
- uno::Sequence< uno::Reference<backenduno::XLayer> > aLayers(aUniversalBackends.size() + aSpecialBackends.size());
-
- uno::Reference<backenduno::XLayer> * pLayer = aLayers.getArray();
-
- for (std::vector< uno::Reference<backenduno::XSingleLayerStratum> >::size_type i=0 ; i< aUniversalBackends.size(); ++i, ++pLayer)
- *pLayer = aUniversalBackends[i]->getLayer(aComponent, rtl::OUString());
-
- for (std::vector< uno::Reference<backenduno::XSingleLayerStratum> >::size_type j=0 ; j< aSpecialBackends.size(); ++j, ++pLayer)
- *pLayer = aSpecialBackends[j]->getLayer(aComponent, rtl::OUString());
-
- OSL_ASSERT( aLayers.getConstArray()+aLayers.getLength() == pLayer );
- return aLayers;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SystemIntegrationManager::getUpdateHandler(const rtl::OUString& /*aComponent*/,
- const rtl::OUString& /*aEntity*/)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- throw lang::NoSupportException(
- rtl::OUString::createFromAscii(
- "SystemIntegrationManager: No Update Operation allowed, Read Only access"),
- *this) ;
-}
-// ---------------------------------------------------------------------------
-// ComponentHelper
-void SAL_CALL SystemIntegrationManager::disposing()
-{
- osl::MutexGuard lock(mMutex);
- for (std::multimap<rtl::OUString, BackendRef>::iterator it = mPlatformBackends.begin(); it != mPlatformBackends.end(); ++it)
- it->second.disposeBackend();
-
- mPlatformBackends.clear();
- mContext.clear();
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SystemIntegrationManager::
- getSystemIntegrationManagerName(void)
-{
- static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.SystemIntegration")) ;
-
- return kImplementationName ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SystemIntegrationManager::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getSystemIntegrationManagerName() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL SystemIntegrationManager::
- getServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.SystemIntegration")) ;
- aServices[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.Backend")) ;
-
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL SystemIntegrationManager::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL SystemIntegrationManager::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return getServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SystemIntegrationManager::addChangesListener(
- const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- // FIXME: we really need our own InterfaceContainer plus a helper object
- // that listens on the backends and forwards notifications
-
- //Simply forward listener to platform backend that support listening
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aUniversalBackends = getSupportingBackends(getAllComponentsName());
- for (sal_uInt32 i=0; i< aUniversalBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aUniversalBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->addChangesListener(xListener, aComponent);
- }
- }
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aSpecialBackends = getSupportingBackends(aComponent);
- for (sal_uInt32 i=0; i< aSpecialBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aSpecialBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->addChangesListener(xListener, aComponent);
- }
- }
-}
-//------------------------------------------------------------------------------
-void SAL_CALL SystemIntegrationManager::removeChangesListener(
- const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aUniversalBackends = getSupportingBackends(getAllComponentsName());
- for (sal_uInt32 i=0; i< aUniversalBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aUniversalBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->removeChangesListener(xListener, aComponent);
- }
- }
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aSpecialBackends = getSupportingBackends(aComponent);
- for (sal_uInt32 i=0; i< aSpecialBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aSpecialBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->removeChangesListener(xListener, aComponent);
- }
- }
-}
-//------------------------------------------------------------------------------
-
-
-} } // configmgr.backend
diff --git a/configmgr/source/platformbe/systemintegrationmanager.hxx b/configmgr/source/platformbe/systemintegrationmanager.hxx
deleted file mode 100644
index b42d902a912c..000000000000
--- a/configmgr/source/platformbe/systemintegrationmanager.hxx
+++ /dev/null
@@ -1,161 +0,0 @@
-#ifndef CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
-#define CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <cppuhelper/compbase4.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/* Class containing a reference to a service factory(XSingleComponentFactory)
- object and a platform backend (XSingleLayerStratum).
- The reference to the platform backend will be NULL until the platform backend
- is initialised
- */
-class BackendRef
-{
- uno::Reference<lang::XSingleComponentFactory> mFactory;
- uno::Reference<backenduno::XSingleLayerStratum> mBackend;
-public:
- explicit
- BackendRef(const uno::Reference<lang::XSingleComponentFactory>& aFactory)
- :mFactory(aFactory)
- ,mBackend()
- {}
-
- uno::Reference<backenduno::XSingleLayerStratum> getBackend(uno::Reference<uno::XComponentContext> const & xContext);
- void disposeBackend();
-};
-
-/**
- Class implementing the Backend service for system integration backend access.
- It creates the required backends and coordinates access to them.
- */
-class SystemIntegrationManager : public cppu::WeakComponentImplHelper4< backenduno::XBackend, backenduno::XBackendChangesNotifier, lang::XInitialization, lang::XServiceInfo>
-{
-public:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- SystemIntegrationManager( const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~SystemIntegrationManager() ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XInitialize
- virtual void SAL_CALL initialize(const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- lang::IllegalArgumentException,
- backenduno::BackendSetupException) ;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (uno::RuntimeException);
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getSystemIntegrationManagerName(void) ;
- /**
- Provides the list of supported services.
-
- @return list of service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getServiceNames(void) ;
-protected:
-// ComponentHelper
- virtual void SAL_CALL disposing();
-private :
- /** build lookup up table
- */
- void buildLookupTable();
-
- /** get list of supported components
- */
- uno::Sequence<rtl::OUString> getSupportedComponents(const uno::Reference<lang::XSingleComponentFactory>& xFactory);
-
- /**
- get supporting backends from lookup table
- */
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > getSupportingBackends(const rtl::OUString& aComponent);
-
-private :
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
- /** Component Context */
- uno::Reference<uno::XComponentContext> mContext ;
-
- std::multimap<rtl::OUString, BackendRef> mPlatformBackends;
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx
new file mode 100644
index 000000000000..070b56d9be9a
--- /dev/null
+++ b/configmgr/source/propertynode.cxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "components.hxx"
+#include "node.hxx"
+#include "propertynode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+PropertyNode::PropertyNode(
+ int layer, Type staticType, bool nillable, css::uno::Any const & value,
+ bool extension):
+ Node(layer), staticType_(staticType), nillable_(nillable), value_(value),
+ extension_(extension)
+{}
+
+rtl::Reference< Node > PropertyNode::clone() const {
+ return new PropertyNode(*this);
+}
+
+Type PropertyNode::getStaticType() const {
+ return staticType_;
+}
+
+bool PropertyNode::isNillable() const {
+ return nillable_;
+}
+
+css::uno::Any PropertyNode::getValue(Components & components) {
+ if (externalDescriptor_.getLength() != 0) {
+ css::beans::Optional< css::uno::Any > val(
+ components.getExternalValue(externalDescriptor_));
+ if (val.IsPresent) {
+ value_ = val.Value; //TODO: check value type
+ }
+ externalDescriptor_ = rtl::OUString(); // must not throw
+ }
+ return value_;
+}
+
+void PropertyNode::setValue(int layer, css::uno::Any const & value) {
+ setLayer(layer);
+ value_ = value;
+ externalDescriptor_ = rtl::OUString();
+}
+
+void PropertyNode::setExternal(int layer, rtl::OUString const & descriptor) {
+ OSL_ASSERT(descriptor.getLength() != 0);
+ setLayer(layer);
+ externalDescriptor_ = descriptor;
+}
+
+bool PropertyNode::isExtension() const {
+ return extension_;
+}
+
+PropertyNode::PropertyNode(PropertyNode const & other):
+ Node(other), staticType_(other.staticType_), nillable_(other.nillable_),
+ value_(other.value_), externalDescriptor_(other.externalDescriptor_),
+ extension_(other.extension_)
+{}
+
+PropertyNode::~PropertyNode() {}
+
+Node::Kind PropertyNode::kind() const {
+ return KIND_PROPERTY;
+}
+
+}
diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx
new file mode 100644
index 000000000000..1566cbf72dbe
--- /dev/null
+++ b/configmgr/source/propertynode.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PROPERTYNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PROPERTYNODE_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+#include "type.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Components;
+
+class PropertyNode: public Node {
+public:
+ PropertyNode(
+ int layer, Type staticType, bool nillable,
+ com::sun::star::uno::Any const & value, bool extension);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ Type getStaticType() const;
+
+ bool isNillable() const;
+
+ com::sun::star::uno::Any getValue(Components & components);
+
+ void setValue(int layer, com::sun::star::uno::Any const & value);
+
+ void setExternal(int layer, rtl::OUString const & descriptor);
+
+ bool isExtension() const;
+
+private:
+ PropertyNode(PropertyNode const & other);
+
+ virtual ~PropertyNode();
+
+ virtual Kind kind() const;
+
+ Type staticType_;
+ // as specified in the component-schema (TYPE_ANY, ...,
+ // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+ bool nillable_;
+ com::sun::star::uno::Any value_;
+ rtl::OUString externalDescriptor_;
+ bool extension_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/registry/cfgregistrykey.cxx b/configmgr/source/registry/cfgregistrykey.cxx
deleted file mode 100644
index 5a190dc7ff93..000000000000
--- a/configmgr/source/registry/cfgregistrykey.cxx
+++ /dev/null
@@ -1,1479 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "cfgregistrykey.hxx"
-#include "datalock.hxx"
-#include "typeconverter.hxx"
-#include <osl/diagnose.h>
-#include <cppuhelper/extract.hxx>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/util/XStringEscape.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <typelib/typedescription.hxx>
-
-#include <limits>
-
-#define THISREF() static_cast< ::cppu::OWeakObject* >(this)
-#define UNISTRING(c) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(c) )
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//--------------------------------------------------------------------------
-namespace {
- inline
- com::sun::star::uno::Type getBinaryDataType()
- {
- com::sun::star::uno::Sequence<sal_Int8> const * const p= 0;
- return ::getCppuType(p);
- }
- inline
- bool isAscii(sal_Unicode ch)
- {
- return 0 < ch && ch < 128;
- }
- inline
- bool isAscii(sal_Unicode const * ps, sal_Int32 nLen )
- {
- for (int i= 0; i< nLen; ++i)
- if ( !isAscii( ps[i] ) )
- return false;
- return true;
- }
- inline
- bool isAscii(rtl::OUString const& str)
- {
- return isAscii(str.getStr(),str.getLength());
- }
- inline
- bool isAscii(com::sun::star::uno::Sequence< rtl::OUString > const& strList)
- {
- for (int i= 0; i< strList.getLength(); ++i)
- if ( !isAscii( strList[i] ) )
- return false;
- return true;
- }
-}
-// temporary helper
-inline static void checkNullable() {}
-
-//==========================================================================
-//= OConfigurationRegistryKey
-//==========================================================================
-
-static
-rtl::OUString getNodeName(const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _xNode)
-{
- com::sun::star::uno::Reference< com::sun::star::container::XNamed > xName( _xNode, com::sun::star::uno::UNO_QUERY );
- if (xName.is())
- return xName->getName();
-
- OSL_ENSURE( !_xNode.is(), "Cannot get name of node");
- return rtl::OUString();
-}
-//--------------------------------------------------------------------------
-
-static bool splitPath(const rtl::OUString& _sPath, rtl::OUString& _rsParentPath, rtl::OUString& _rsLocalName);
-//--------------------------------------------------------------------------
-
-OConfigurationRegistryKey::OConfigurationRegistryKey
- (const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxRootNode
- ,sal_Bool _bWriteable
- ,SubtreeRoot
- )
- :m_bReadOnly(!_bWriteable)
- ,m_xNode(_rxRootNode)
- ,m_xParentNode()
- ,m_sLocalName() // this will be treated as root - maybe use hierarchical name (ß)
-{
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid config node param !");
-}
-
-//--------------------------------------------------------------------------
-OConfigurationRegistryKey::OConfigurationRegistryKey
- (const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxNode
- ,sal_Bool _bWriteable
- )
- :m_bReadOnly(!_bWriteable)
- ,m_xNode(_rxNode)
- ,m_xParentNode()
- ,m_sLocalName( getNodeName(_rxNode) ) // this will not be treated as root
-{
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid config node param !");
-}
-
-//--------------------------------------------------------------------------
-OConfigurationRegistryKey::OConfigurationRegistryKey(
- com::sun::star::uno::Any _rCurrentValue,
- const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxParentNode,
- const ::rtl::OUString& _rLocalName,
- sal_Bool _bWriteable)
- :m_bReadOnly(!_bWriteable)
- ,m_xNode()
- ,m_xParentNode(_rxParentNode)
- ,m_sLocalName(_rLocalName)
-{
- OSL_ENSURE(m_xParentNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid parent node param !");
- OSL_ENSURE(m_sLocalName.getLength(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid relative name !");
- OSL_ENSURE(m_xParentNode->hasByName( m_sLocalName ), "OConfigurationRegistryKey::OConfigurationRegistryKey : key not found in parent node !" ); //
- OSL_ENSURE(m_xParentNode->getByName( m_sLocalName ) == _rCurrentValue, "OConfigurationRegistryKey::OConfigurationRegistryKey : wrong value parameter !" ); //
-
- _rCurrentValue >>= m_xNode; // we don't care if that fails
-}
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> OConfigurationRegistryKey::implGetParentPropertyInfo() throw(com::sun::star::uno::RuntimeException)
-{
- if (!m_xParentNode.is())
- {
- com::sun::star::uno::Reference< com::sun::star::container::XChild > xChild(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xChild.is())
- m_xParentNode = m_xParentNode.query(xChild->getParent());
- }
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo; // the result
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xParentProperties(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentProperties.is())
- {
- xParentInfo = xParentProperties->getPropertySetInfo();
- if (xParentInfo.is() && !xParentInfo->hasPropertyByName(m_sLocalName))
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey: This key is unknown in the parent node's PropertySetInfo !");
- xParentInfo.clear(); // this key is unknow, so don't return the info
- }
- }
-
- return xParentInfo;
-}
-//--------------------------------------------------------------------------
-
-static
-sal_Bool isNodeReadOnly(com::sun::star::uno::Reference< com::sun::star::uno::XInterface > const& _xNode) throw(com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT( _xNode.is() );
-
- com::sun::star::uno::Reference< com::sun::star::beans::XProperty > xProperty(_xNode, com::sun::star::uno::UNO_QUERY);
- if (xProperty.is())
- {
- com::sun::star::beans::Property aProperty = xProperty->getAsProperty();
-
- return (aProperty.Attributes & com::sun::star::beans::PropertyAttribute::READONLY) != 0;
- }
-
- com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( _xNode, com::sun::star::uno::UNO_QUERY );
- if (xServiceInfo.is())
- {
- // does it announce update capability ?
- if (xServiceInfo->supportsService(UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess")))
- return false;
-
- // else does it announce the expected service at all ?
- else if (xServiceInfo->supportsService(UNISTRING("com.sun.star.configuration.ConfigurationAccess")))
- return true;
- }
-
- // no XProperty, no (meaningful) ServiceInfo - what can we do
- return false;
-}
-
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implIsReadOnly() throw (com::sun::star::uno::RuntimeException)
-{
- sal_Bool bResult = m_bReadOnly;;
-
- // do checks only if this was requested to be writable
- if (m_bReadOnly)
- {
- // nothing to check
- }
-
- // try to ask the node itself
- else if (m_xNode.is())
- {
- bResult = m_bReadOnly = isNodeReadOnly( m_xNode );
- }
-
- // else use the parent
- else if (m_xParentNode.is())
- {
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo = implGetParentPropertyInfo();
-
- if (xParentInfo.is())
- {
- com::sun::star::beans::Property aProperty = xParentInfo->getPropertyByName(m_sLocalName);
-
- bResult = m_bReadOnly = ((aProperty.Attributes & com::sun::star::beans::PropertyAttribute::READONLY) != 0);
- }
- else
- {
- // no property info about this key ? - check if the parent itself is writable
-
- // NOTE: do not set m_bReadOnly here, as we haven't really found out about this object
- bResult = isNodeReadOnly( m_xParentNode );
- }
- }
- else
- {
- // no data at all
- OSL_ENSURE(false, "implIsReadOnly called for invalid object");
- bResult = true; // no object is certainly not writable ;-)
- }
-
- return bResult;
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implEnsureNode() throw (com::sun::star::registry::InvalidRegistryException,com::sun::star::uno::RuntimeException)
-{
- if (!m_xNode.is())
- {
- OSL_ENSURE( m_xParentNode.is(), "implEnsureNode called for invalid registry key");
- if (m_xParentNode.is())
- {
- try
- {
- com::sun::star::uno::Any aNode = m_xParentNode->getByName( m_sLocalName );
-
- if ( !(aNode >>= m_xNode) )
- OSL_ENSURE( ! (aNode.hasValue() && aNode.getValueTypeClass() == com::sun::star::uno::TypeClass_INTERFACE),
- "OConfigurationRegistryKey: Node object does not implement expected interface");
- }
- catch (com::sun::star::container::NoSuchElementException& e)
- {
- m_xParentNode.clear();
-
- rtl::OUString sMessage = UNISTRING("Invalid OConfigurationRegistryKey. The node \"");
- sMessage += m_sLocalName;
- sMessage += UNISTRING("\" was not found in the parent. Parent error message: \n");
- sMessage += e.Message;
-
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- }
- }
- return m_xNode.is();
-}
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Type OConfigurationRegistryKey::implGetUnoType() throw (com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Type aType;
- if (m_xNode.is())
- {
- aType = getCppuType(&m_xNode); // Its just an interface type
- }
- else if (m_xParentNode.is())
- {
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo = implGetParentPropertyInfo();
- if (xParentInfo.is())
- {
- aType = xParentInfo->getPropertyByName( m_sLocalName ).Type;
- }
- else
- {
- aType = m_xParentNode->getElementType();
- }
- }
- else
- {
- OSL_ASSERT( aType.getTypeClass() == com::sun::star::uno::TypeClass_VOID );
- OSL_ENSURE( false, "implGetUnoType called for invalid registry key");
- }
- return aType;
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implEnsureValue() throw (com::sun::star::uno::RuntimeException)
-{
- if (m_xNode.is())
- return false;
-
- OSL_ENSURE( m_xParentNode.is(), "implEnsureValue called for invalid registry key");
- if (!m_xParentNode.is())
- return false;
-
- switch (implGetUnoType().getTypeClass())
- {
- case com::sun::star::uno::TypeClass_INTERFACE:
- return false;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_FLOAT:
- OSL_ENSURE(false, "Unexpected (UNSIGNED INTERGRAL or FLOAT) type found for configuration node");
-
- case com::sun::star::uno::TypeClass_STRING:
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- case com::sun::star::uno::TypeClass_HYPER:
- case com::sun::star::uno::TypeClass_DOUBLE:
- case com::sun::star::uno::TypeClass_SEQUENCE:
- return true;
-
- case com::sun::star::uno::TypeClass_ANY:
- return true;
-
- case com::sun::star::uno::TypeClass_VOID:
- OSL_ENSURE(false, "OConfigurationRegistryKey: Key does not exist or has VOID type");
- return false;
-
- default:
- OSL_ENSURE(false, "OConfigurationRegistryKey: Key has unexpected UNO type (class)");
- return false;
- }
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implIsValid() throw ()
-{
- return m_xNode.is() || (m_xParentNode.is() && m_xParentNode->hasByName( m_sLocalName ) );
-}
-//--------------------------------------------------------------------------
-
-void OConfigurationRegistryKey::checkValid(KEY_ACCESS_TYPE _eIntentedAccess) throw (com::sun::star::registry::InvalidRegistryException,com::sun::star::uno::RuntimeException)
-{
- if (!implIsValid())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The registry is not bound to a configuration node anymore."), THISREF());
- // "anymore", because at the moment the ctor was called it probably was bound ....
-
- switch (_eIntentedAccess)
- {
- case KAT_VALUE_WRITE:
- if (implIsReadOnly())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is not writeable."), THISREF());
-
- // !!! NO !!! BREAK !!!
- case KAT_VALUE:
- if (m_xNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is not a value, but an internal container."), THISREF());
-
- if (!m_xParentNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is invalid. It has no parent."), THISREF());
-
- if (!implEnsureValue())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration does not have a legal value type."), THISREF());
- break;
-
- case KAT_CHILD:
- if (!implEnsureNode())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node does not have children, it is a value node."), THISREF());
- break;
-
- case KAT_META:
- break;
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any OConfigurationRegistryKey::implCreateDefaultElement(com::sun::star::uno::Type const& _aValueType) throw (com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aReturn;
-
- switch (_aValueType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- aReturn <<= rtl::OUString();
- break;
-
- // we don't distinguish between the different integer types or boolean
- // (the RegistryKeyType is not granular enough),
- // but we can't handle them all the same way here
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_SHORT:
- aReturn <<= (sal_Int16)0;
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_LONG:
- aReturn <<= (sal_Int32)0;
- break;
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- aReturn <<= sal_Bool(false);
- break;
-
- // we cannot really handle 64-bit ints in the registry (but here we can)
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(false, "Warning: cannot handle 64-bit values correctly in registry");
- aReturn <<= (sal_Int64)0;
- break;
-
- // we cannot really handle doubles in the registry (but here we can)
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(false, "Warning: cannot handle DOUBLE correctly in registry");
- aReturn <<= (double)0;
- break;
-
- // we really want to leave an Any as NULL - hopefully this is acceptable to the set
- case com::sun::star::uno::TypeClass_ANY:
- break;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- if (_aValueType == getBinaryDataType())
- aReturn <<= com::sun::star::uno::Sequence< sal_Int8 >();
-
- else
- {
- com::sun::star::uno::Type aElementType = getSequenceElementType(_aValueType);
- switch (aElementType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- aReturn <<= com::sun::star::uno::Sequence< rtl::OUString >();
- break;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_SHORT:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int16 >();
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_LONG:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int32 >();
- break;
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- aReturn <<= com::sun::star::uno::Sequence< sal_Bool >();
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int64 >();
- break;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- aReturn <<= com::sun::star::uno::Sequence< double >();
- break;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- OSL_ENSURE(false, "Warning: cannot handle Sequence< BINARY > correctly in registry");
- if (aElementType == getBinaryDataType())
- {
- OSL_ENSURE(false, "Warning: cannot handle Sequence< BINARY > correctly in registry");
- aReturn <<= com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< sal_Int8 > >();
- break;
- }
-
- // else FALL THRU to default
- default:
- OSL_ENSURE(false, "Unexpected sequence element type for configuration node - returning NULL");
- // throw here ??
- break;
- }
- }
- break;
-
- case com::sun::star::uno::TypeClass_INTERFACE:
- OSL_ENSURE(false, "Invalid call to OConfigurationRegistryKey::implCreateDefaultElement. Inner nodes must be created by a factory");
- break;
-
- default:
- OSL_ENSURE(false, "Unexpected value type for configuration node - returning NULL");
- // throw here ??
- break;
- }
-
- OSL_ENSURE( aReturn.getValueType() == _aValueType || (_aValueType.getTypeClass() == com::sun::star::uno::TypeClass_ANY && !aReturn.hasValue()),
- "Warning: Unexpected data type found in Registry - returning similar value or NULL");
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any OConfigurationRegistryKey::implGetDescendant(const rtl::OUString& _rDescendantName) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aElementReturn;
-
- try
- {
- if (!m_xNode.is())
- {
- // implEnsureNode should have been called before this method
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getDescendant : invalid call !");
-
- // this method should not be called if the object does not represent a container node ...
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("invalid object."), THISREF());
- }
-
- try
- {
- // look for a local member first
- aElementReturn = m_xNode->getByName(_rDescendantName);
- }
- catch(com::sun::star::container::NoSuchElementException&)
- {
- // is it a (possibly) hierarchical name ?
- if ( _rDescendantName.indexOf('/') <0 ) throw;
-
- // Yes, so try deep access
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xDeepAccess( m_xNode, com::sun::star::uno::UNO_QUERY );
- if (!xDeepAccess.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Nested element access not supported by this node."), THISREF());
-
- aElementReturn = xDeepAccess->getByHierarchicalName(_rDescendantName);
- }
- }
- catch(com::sun::star::container::NoSuchElementException&)
- { // not allowed to leave the method, wrap it
- rtl::OUString sMessage(UNISTRING("There is no element named "));
- sMessage += _rDescendantName;
- sMessage += UNISTRING(".");
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- { // allowed to be thrown by XNameAccess::getByName, but not allowed to leave this method
- rtl::OUString sMessage(UNISTRING("The configuration node could not provide an element for "));
- sMessage += _rDescendantName;
- sMessage += UNISTRING(". Original Error: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
-
- return aElementReturn;
-}
-
-//--------------------------------------------------------------------------
-void OConfigurationRegistryKey::implSetValue(const com::sun::star::uno::Any& _rValue) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_VALUE_WRITE);
-
- // one possible interface
- com::sun::star::uno::Reference< com::sun::star::container::XNameReplace > xParentValueAccess(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentValueAccess.is())
- {
- try
- {
- xParentValueAccess->replaceByName(m_sLocalName, _rValue);
- }
- catch(com::sun::star::lang::IllegalArgumentException& iae)
- {
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("IllegalArgumentException: ");
- sMessage += iae.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::container::NoSuchElementException& nse)
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey::writeValueNode : a NoSuchElementException should be impossible !");
-
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("NoSuchElementException: ");
- sMessage += nse.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- {
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("WrappedTargetException: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- return;
- }
-
- // not found - try other interface
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xParentPropertySet(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentPropertySet.is())
- {
- try
- {
- xParentPropertySet->setPropertyValue(m_sLocalName, _rValue);
- }
- catch(com::sun::star::lang::IllegalArgumentException& iae)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("IllegalArgumentException: ");
- sMessage += iae.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::beans::UnknownPropertyException& upe)
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey::writeValueNode : a UnknownPropertyException should be impossible !");
-
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("UnknownPropertyException: ");
- sMessage += upe.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::beans::PropertyVetoException& pve)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("PropertyVetoException: ");
- sMessage += pve.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("WrappedTargetException: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- return;
- }
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("No interface found on parent node for writing to configuration value node."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getKeyName() throw(com::sun::star::uno::RuntimeException)
-{
- return m_sLocalName;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::isReadOnly() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- checkValid(KAT_META);
- return m_bReadOnly;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::isValid() throw(com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- // TODO : perhaps if the registry we're a part of is closed ....
- return implIsValid();
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::registry::RegistryKeyType SAL_CALL OConfigurationRegistryKey::getKeyType( const ::rtl::OUString& /*_rKeyName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
-
- // no further checks are made (for performance reasons) ...
- // Maybe we should check only KAT_META for consistency ?
- checkValid(KAT_CHILD);
-
- return com::sun::star::registry::RegistryKeyType_KEY;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::registry::RegistryValueType SAL_CALL OConfigurationRegistryKey::getValueType() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_META);
-
- const com::sun::star::uno::Type aUnoType = implGetUnoType();
-
- switch (aUnoType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_INTERFACE: // this is really a case of 'no value type'
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- case com::sun::star::uno::TypeClass_ANY: // this is really a case of 'all value types allowed'
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- case com::sun::star::uno::TypeClass_STRING:
- return com::sun::star::registry::RegistryValueType_STRING;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- OSL_ENSURE(false, "Unexpected UNSIGNED type found for configuration node");
- // FALL THRU
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support floating point numbers !");
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support 64-bit integer numbers !");
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- if ( aUnoType.equals( getBinaryDataType() ) )
- return com::sun::star::registry::RegistryValueType_BINARY;
-
- else
- {
- com::sun::star::uno::Type aElementType = getSequenceElementType(aUnoType);
-
- switch (aElementType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- return com::sun::star::registry::RegistryValueType_STRINGLIST;
-
- case com::sun::star::uno::TypeClass_BYTE:
- OSL_ASSERT(false); // this is caught by the 'binary' case
-
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- OSL_ENSURE(false, "Unexpected UNSIGNED-List type found for configuration node");
- // FALL THRU
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support floating point number lists !");
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support 64-bit integer number lists !");
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_ANY:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : Unexpected: Any as sequence element type !");
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- default:
- if (aElementType.equals(getBinaryDataType()))
- OSL_ENSURE(sal_False,"OConfigurationRegistryKey::getValueType : Registry cannot support LIST of BINARY");
- else
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : unknown sequence element type !");
-
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
- }
- }
-
- default:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : unknown entry type !");
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
- }
-}
-
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Any OConfigurationRegistryKey::implGetValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_VALUE);
-
- return m_xParentNode->getByName( m_sLocalName );
-}
-
-//--------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConfigurationRegistryKey::getLongValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- sal_Int32 nLongValue(0);
- switch (aValue.getValueTypeClass())
- {
- // integral types that are small enough are straightforward
- case com::sun::star::uno::TypeClass_BYTE : { sal_Int8 nNativeValue = 0; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_BOOLEAN : { sal_Bool nNativeValue = false; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_SHORT : { sal_Int16 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT : { sal_uInt16 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_LONG : { sal_Int32 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
-
- // this is lossless, but not value-preserving - use cast to avoid warnings
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- {
- sal_uInt32 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
- }
- break;
-
- // the following are larger than Long - check for loss and throw if applicable
- case com::sun::star::uno::TypeClass_HYPER:
- {
- sal_Int64 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
-
- // check for data loss
- if (sal_Int64(nLongValue) != nNativeValue)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Unsigned Hyper value too large for long; Value cannot be retrieved using registry."), THISREF());
- }
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- {
- sal_uInt64 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
-
- // check for data loss
- if (sal_uInt64(sal_uInt32(nLongValue)) != nNativeValue)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Unsigned Hyper value too large for long; Value cannot be retrieved using registry."), THISREF());
- }
- break;
-
- // for floating point types we need a limit for loss checking
- case com::sun::star::uno::TypeClass_FLOAT:
- OSL_ENSURE(false, "Unexpected type FLOAT in configuration node");
- {
- // treat as double
- float fNativeValue = 0;
- if (aValue >>= fNativeValue)
- aValue <<= double(fNativeValue);
- }
- // fall thru
-
- case com::sun::star::uno::TypeClass_DOUBLE:
- {
- double fNativeValue = 0;
- aValue >>= fNativeValue;
-
- // find a reasonable allowed imprecision
- const double fEps = (2.*fNativeValue + 5.) * std::numeric_limits<double>::epsilon();
-
- // should be rounding here
- nLongValue = sal_Int32(fNativeValue);
-
- // check for data loss
- bool bRecheck = false;
-
- double diff = fNativeValue-double(nLongValue);
- if ( diff > fEps)
- {
- // substitute for rounding here
- if (diff > .5)
- {
- ++nLongValue;
- diff = fNativeValue-double(nLongValue);
- }
- bRecheck = true;
- }
- else if ( diff < -fEps)
- {
- // substitute for rounding here
- if (diff < -.5)
- {
- --nLongValue;
- diff = fNativeValue-double(nLongValue);
- }
- bRecheck = true;
- }
-
- if (bRecheck)
- {
- if (diff > fEps || diff < -fEps)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Double value cannot fit in Long; Value cannot be retrieved using registry."), THISREF());
- }
- }
- break;
-
- case com::sun::star::uno::TypeClass_VOID:
- // allow NULL values, if we maybe advertise this node as long
- if (this->getValueType() == com::sun::star::registry::RegistryValueType_LONG)
- break;
- // else FALL THRU to exception
-
- default:
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This node does not contain a long (or a compatible) value."), THISREF());
- }
- return nLongValue;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setLongValue( sal_Int32 _nValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_nValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL OConfigurationRegistryKey::getLongListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< sal_Int32 > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- {
- // TODO : maybe it's a sequence of sal_Int8 or anything like that which we're able to convert ....
-
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of longs !"), THISREF());
- }
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setLongListValue( const com::sun::star::uno::Sequence< sal_Int32 >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_seqValue));
-}
-
-//--------------------------------------------------------------------------
-rtl::OUString SAL_CALL OConfigurationRegistryKey::getAsciiValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- rtl::OUString sReturn = getStringValue();
-
- if (!isAscii(sReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node value (a string) is not pure ASCII !"), THISREF());
-
- return sReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setAsciiValue( const ::rtl::OUString& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ENSURE( isAscii(_rValue), "The string passesd to OConfigurationRegistryKey::setAsciiValue is not pure ASCII");
-
- setStringValue(_rValue);
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL OConfigurationRegistryKey::getAsciiListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Sequence<rtl::OUString> aReturn = getStringListValue();
-
- if (!isAscii(aReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node value (a string list) is not pure ASCII !"), THISREF());
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setAsciiListValue( const com::sun::star::uno::Sequence< ::rtl::OUString >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ENSURE( isAscii(_seqValue), "The string passesd to OConfigurationRegistryKey::setAsciiValue is not pure ASCII");
-
- setStringListValue(_seqValue);
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getStringValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- rtl::OUString sReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= sReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This node does not contain a string value."), THISREF());
-
- return sReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setStringValue( const ::rtl::OUString& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_rValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OConfigurationRegistryKey::getStringListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< rtl::OUString > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setStringListValue( const com::sun::star::uno::Sequence< ::rtl::OUString >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_seqValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OConfigurationRegistryKey::getBinaryValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< sal_Int8 > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- return aReturn;
-
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setBinaryValue( const com::sun::star::uno::Sequence< sal_Int8 >& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_rValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > OConfigurationRegistryKey::implGetKey( const ::rtl::OUString& _rKeyName )
- throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aDescendant = implGetDescendant(_rKeyName);
- if (aDescendant.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_INTERFACE)
- {
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xNode;
- ::cppu::extractInterface(xNode, aDescendant);
- if (!xNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("invalid descendant node. No XNameAccess found."), THISREF());
- return new OConfigurationRegistryKey(xNode, !m_bReadOnly);
- }
- else
- {
-#if OSL_DEBUG_LEVEL > 1
- switch (aDescendant.getValueType().getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_LONG:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SEQUENCE:
- break;
- case com::sun::star::uno::TypeClass_VOID: // NULL value found
- break;
- default:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::openKey : unknown, invalid or unhandled descendant value type !");
- }
-#endif
-
- OSL_ASSERT(m_xNode.is());
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xDescParent(m_xNode); // the parent config node of the descandent
- rtl::OUString sDescRelativeName( _rKeyName ); // local name of the descendant within xDescParent
-
- if (!m_xNode->hasByName(_rKeyName)) // it is a hierarchical Path -> more work
- {
- rtl::OUString sParentLocation;
-
- if ( !splitPath(_rKeyName, sParentLocation, sDescRelativeName) )
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Cannot split path for value. The internal registry structure seems to be corrupt."), THISREF());
- }
-
- if (sParentLocation.getLength())
- {
- com::sun::star::uno::Any aDescParent = implGetDescendant(sParentLocation);
- ::cppu::extractInterface(xDescParent, aDescParent);
- if (!xDescParent.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The internal registry structure seems to be corrupt."), THISREF());
- }
- }
-
- OSL_ENSURE(xDescParent.is(), "No Parent Node found for value ?");
- OSL_ENSURE(xDescParent->hasByName(sDescRelativeName), "Parent Node does not contain found value ?");
-
- return new OConfigurationRegistryKey(aDescendant, xDescParent, sDescRelativeName, !m_bReadOnly);
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistryKey::openKey( const ::rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- return implGetKey(_rKeyName);
-}
-//--------------------------------------------------------------------------
-bool OConfigurationRegistryKey::checkRelativeKeyName(rtl::OUString& _rKeyName) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- // no empty names allowed
- if (!_rKeyName.getLength())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- bool bCleanPath = true;
-
- // cut trailing slashes
- sal_Int32 nCleanEnd = _rKeyName.getLength();
- while (nCleanEnd > 0 && _rKeyName[nCleanEnd - 1] == '/' )
- --nCleanEnd;
-
- if (m_xNode.is())
- {
- if (m_xNode-> hasByName(_rKeyName))
- {
- bCleanPath = false;
- }
-
- else
- {
- com::sun::star::uno::Reference< com::sun::star::util::XStringEscape > xSE(m_xNode, com::sun::star::uno::UNO_QUERY);
-
- sal_Bool bPreferLocal = xSE.is();
-
- if (!bPreferLocal)
- {
- com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xSI(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xSI.is() && xSI->supportsService(rtl::OUString::createFromAscii("com.sun.star.configuration.SetAccess")))
- bPreferLocal = true;
- }
-
- if (bPreferLocal)
- {
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xHA(m_xNode, com::sun::star::uno::UNO_QUERY);
- rtl::OUString sCleanName = _rKeyName.copy(0, nCleanEnd);
-
- if (xHA.is() && xHA->hasByHierarchicalName(sCleanName))
- bPreferLocal = false;
- }
-
- if (bPreferLocal && xSE.is())
- {
- _rKeyName = xSE->escapeString(_rKeyName);
- }
- bCleanPath = !bPreferLocal;
- }
- }
-
- if (bCleanPath)
- {
- // no absolute names ("/...") allowed
- if (_rKeyName.getStr()[0] == '/')
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid. It must be a relative, not an absolute name."), THISREF());
-
- if (nCleanEnd <= 0)
- // the original name consists of slashes only
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
-
- _rKeyName = _rKeyName.copy(0, nCleanEnd);
- }
- return bCleanPath;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistryKey::createKey( const ::rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- if (m_bReadOnly)
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key is read only."), THISREF());
-
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::createKey : somebody changed the checkValid(KAT_CHILD) behaviour !");
-
- rtl::OUString sKeyName(_rKeyName);
- if (checkRelativeKeyName(sKeyName))
- {
- rtl::OUString sParentName, sLocalName;
-
- if (!splitPath(sKeyName,sParentName, sLocalName))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- if (sParentName.getLength()) // it's a nested key name
- {
- // check if we have the key already
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xDeepAccess(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(sKeyName))
- {
- // already there - just open it
- return implGetKey(sKeyName);
- }
-
- // deep access, but not found. delegate it to a registry key which is one level above the to-be-created one
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xSetNode = implGetKey(sParentName);
- if (!xSetNode.is())
- {
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::createKey : somebody changed the implGetKey behaviour !");
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured."), THISREF());
- }
- return xSetNode->createKey(sLocalName); // problem: request for a/['b/c'] might find a/b/c
- }
- else
- sKeyName = sLocalName;
- }
-
- // The requested new key is one level below ourself. Can't delegate the creation.
- if (m_xNode->hasByName(sKeyName) )
- {
- // already there - just open it
- return implGetKey(sKeyName);
- }
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xContainer(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (!xContainer.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The configuration node represented by this key is not a set node, you can't insert keys."), THISREF());
-
- com::sun::star::uno::Any aValueToInsert;
-
- com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xChildFactory(xContainer, com::sun::star::uno::UNO_QUERY);
- if (xChildFactory.is())
- {
- // In the configuration API, the creation of a new child is two-stage process : first you create a child which
- // is "floating", i.e. does not belong to the configuration tree, yet. After filling it with values, you insert
- // it into the container node which was used for the creation.
- // We can't map this behaviour with the registry API, so we have to combine both steps
-
- // create a new floating child for the container node
- try
- {
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xFloatingChild = xChildFactory->createInstance();
- OSL_ENSURE( xFloatingChild.is(), "The newly created element is NULL !");
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xInsertedChild(xFloatingChild, com::sun::star::uno::UNO_QUERY);
- OSL_ENSURE( xInsertedChild.is(), "The newly created element does not provide the required interface");
-
- if (!xInsertedChild.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured. The objects provided by the configuration API are invalid."), THISREF());
-
- aValueToInsert <<= xInsertedChild; // xFloatingChild;
- }
- catch (com::sun::star::uno::RuntimeException&)
- { // allowed to leave this method
- throw;
- }
- catch (com::sun::star::uno::Exception& e)
- { // not allowed to leave this method
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Unable to create a new child for the configuration node. Original error message as provided by the configuration API : ") += e.Message,
- THISREF());
- }
- OSL_ENSURE(aValueToInsert.hasValue(), "New Child node did not get into the Any ?");
- }
- else
- {
- // If the elements of the set are simple values, we need to create a matching value
- com::sun::star::uno::Type aElementType = xContainer->getElementType();
- aValueToInsert = implCreateDefaultElement(aElementType);
-
- OSL_ENSURE(aValueToInsert.hasValue() || aElementType.getTypeClass() == com::sun::star::uno::TypeClass_ANY, "Internal error: NULL value created for new value element ?");
- }
-
- // and immediately insert it into the container
- try
- {
- xContainer->insertByName(sKeyName, aValueToInsert);
- }
- catch (com::sun::star::lang::IllegalArgumentException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("illegal argument to InsertByName: ") += e.Message, THISREF());
- }
- catch (com::sun::star::container::ElementExistException& e)
- {
- OSL_ENSURE(false, "There was an element of the same name inserted just now");
-
- // try to return that one
- try { return implGetKey(sKeyName); }
- catch (com::sun::star::uno::Exception&) { OSL_ENSURE(false, "But the other element cannot be retrieved"); }
-
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Inserting raised a NoSuchElementException for an unavailable element ! Original error message : ") += e.Message, THISREF());
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Inserting raised a WrappedTargetException. Original error message : ") += e.Message, THISREF());
- }
-
- return new OConfigurationRegistryKey(aValueToInsert, m_xNode, sKeyName, !m_bReadOnly);
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::closeKey() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- checkValid(KAT_META);
-
- bool bRoot = (m_sLocalName.getLength() == 0);
-
- if (!bRoot) // don't close, if this is the root key ..
- {
- m_xNode.clear();
- m_xParentNode.clear();
-// m_sLocalName = rtl::OUString(); - local name is const ...
- }
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::deleteKey( const rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
- if (m_bReadOnly)
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key is read only."), THISREF());
-
- rtl::OUString sKeyName(_rKeyName);
- if (checkRelativeKeyName(sKeyName))
- {
- rtl::OUString sParentName, sLocalName;
-
- if (!splitPath(sKeyName,sParentName, sLocalName))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- if (sParentName.getLength()) // it's a nested key name
- {
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xSetNode = implGetKey(sParentName);
- if (!xSetNode.is())
- {
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::createKey : somebody changed the implGetKey behaviour !");
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured."), THISREF());
- }
- xSetNode->deleteKey(sLocalName);
- return;
- }
- else
- sKeyName = sLocalName;
- }
-
- // The requested new key is one level below ourself. Can't delegate the creation.
- com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xContainer(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (!xContainer.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The configuration node represented by this key is not a set node, you can't remove keys."), THISREF());
-
- // and immediately remove it from the container
- try
- {
- xContainer->removeByName(sKeyName);
- }
- catch (com::sun::star::container::NoSuchElementException& e)
- {
- if (e.Message.getLength())
- throw com::sun::star::registry::InvalidRegistryException(e.Message, THISREF());
- else
- throw com::sun::star::registry::InvalidRegistryException((UNISTRING("There is no element named ") += sKeyName) += UNISTRING(" to remove."), THISREF());
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Removing a node caused a WrappedTargetException. Original error message : ") += e.Message, THISREF());
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > > SAL_CALL OConfigurationRegistryKey::openKeys() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- com::sun::star::uno::Sequence< ::rtl::OUString > aNames(m_xNode->getElementNames());
-
- sal_Int32 const nCount = aNames.getLength();
-
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > > aReturn(nCount);
-
- for (sal_Int32 i=0; i<nCount; ++i)
- aReturn[i] = implGetKey(aNames[i]);
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OConfigurationRegistryKey::getKeyNames() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
- return m_xNode->getElementNames();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::createLink( const ::rtl::OUString& /*aLinkName*/, const ::rtl::OUString& /*aLinkTarget*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::deleteLink( const ::rtl::OUString& /*rLinkName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getLinkTarget( const ::rtl::OUString& /*rLinkName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getResolvedName( const ::rtl::OUString& /*aKeyName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-//--------------------------------------------------------------------------
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-// split path
-#include "configpath.hxx"
-#include "configexcept.hxx"
-
-bool configmgr::splitPath(const rtl::OUString& _sPath, rtl::OUString& _rsParentPath, rtl::OUString& _rsLocalName)
-{
- bool bResult = false;
- try
- {
- bool bAbsolute = configmgr::configuration::Path::isAbsolutePath(_sPath);
- configmgr::configuration::Path::Rep aPath ;
-
- if (bAbsolute)
- {
- configmgr::configuration::AbsolutePath parsedPath = configmgr::configuration::AbsolutePath::parse(_sPath) ;
-
- aPath = parsedPath.rep() ;
- }
- else
- {
- configmgr::configuration::RelativePath parsedPath = configmgr::configuration::RelativePath::parse(_sPath) ;
-
- aPath = parsedPath.rep() ;
- }
- //configmgr::configuration::Path::Rep aPath = bAbsolute ? configmgr::configuration::AbsolutePath::parse(_sPath).rep() : configmgr::configuration::RelativePath::parse(_sPath).rep();
-
- OSL_ENSURE(!aPath.isEmpty(), "Trying to split an empty or root path");
- std::vector<configuration::Path::Component>::const_reverse_iterator aFirst = aPath.begin(), aLast = aPath.end();
-
- if (aFirst != aLast)
- {
- --aLast;
-
- _rsLocalName = aLast->getName();
- _rsParentPath = configmgr::configuration::Path::Rep(aFirst,aLast).toString(bAbsolute);
-
- bResult = true;
- }
- // else go on to fail
- }
- catch (configuration::Exception&)
- {
- }
- return bResult;
-}
-//..........................................................................
-
-
diff --git a/configmgr/source/registry/cfgregistrykey.hxx b/configmgr/source/registry/cfgregistrykey.hxx
deleted file mode 100644
index 9ee01d547412..000000000000
--- a/configmgr/source/registry/cfgregistrykey.hxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-#define _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//==========================================================================
-//= OConfigurationRegistryKey
-//==========================================================================
-/** wraps the registry-like access to a single node of a configuration sub tree
-*/
-class OConfigurationRegistryKey
- :public cppu::WeakImplHelper1< com::sun::star::registry::XRegistryKey >
-{
- sal_Bool m_bReadOnly; /// is the key readonly ?
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- m_xNode; /// the config node object, if it is a container
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- m_xParentNode; /// if the key is not the root, this is it's parent.
-
- const ::rtl::OUString m_sLocalName; /** the name of the element relative to the parent, which is
- m_xParentNode if that is present
- */
-
- // TODO : the current concept does not recognize when config keys are disposed (e.g. when the registry is closed)
- //
- // Possible solutions:
- // 1. each registry key is a listener on the component containing its node
- // may be is expensive ?.
- //
- // At the moment we ignore this restriction, but perhaps we can't do that forever ....
-
-public:
- /// when used as ctor parameter, this indicates that the key wraps a config tree subtree root
- struct SubtreeRoot { };
-
- /** builds an registry key which wraps the root of a configuration registry
- */
- OConfigurationRegistryKey(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxRootNode
- ,sal_Bool _bWriteable
- ,SubtreeRoot
- );
-
- /** builds an registry key for a configuration node
- @param _rxContainerNode the node the key should represent
- @param _bWriteable should the key be writeable ?
- */
- OConfigurationRegistryKey(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxNode
- ,sal_Bool _bWriteable
- );
-
- /** builds an registry key for a configuration value container node.
- @param _rCurrentValue the current value of the node. Must be the same as _rxParentNode->getByName(_rRelativeName) would provide
- @param _rxParentNode the parent of the value node. Used for update access and for obtaining the initial value.
- @param _rRelativeName te relative name within the parent
- @param _bWriteable should the key be writeable ?
- */
- OConfigurationRegistryKey(
- ::com::sun::star::uno::Any _rCurrentValue
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxParentNode
- ,const ::rtl::OUString& _rRelativeName
- ,sal_Bool _bWriteable
- );
-
- // XRegistryKey
- virtual ::rtl::OUString SAL_CALL getKeyName() throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isValid( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::registry::RegistryKeyType SAL_CALL getKeyType( const ::rtl::OUString& rKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::registry::RegistryValueType SAL_CALL getValueType( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getLongValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLongValue( sal_Int32 value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getLongListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLongListValue( const ::com::sun::star::uno::Sequence< sal_Int32 >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getAsciiValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAsciiValue( const ::rtl::OUString& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAsciiListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAsciiListValue( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setStringValue( const ::rtl::OUString& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getStringListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setStringListValue( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinaryValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryValue( const ::com::sun::star::uno::Sequence< sal_Int8 >& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL openKey( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL createKey( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeKey( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteKey( const ::rtl::OUString& rKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > > SAL_CALL openKeys( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getKeyNames( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL createLink( const ::rtl::OUString& aLinkName, const ::rtl::OUString& aLinkTarget ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteLink( const ::rtl::OUString& rLinkName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getLinkTarget( const ::rtl::OUString& rLinkName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getResolvedName( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
-protected:
- /** specifies the kind of access to the key.
- */
- enum KEY_ACCESS_TYPE
- {
- KAT_META, /// access on a meta level, e.g. asking for the read-onyl flag
- KAT_VALUE, /// read access to the value the node represents
- KAT_VALUE_WRITE, /// write access to the value the node represents
- KAT_CHILD /// access to one of the (grand-)children of the node
- };
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- implGetParentPropertyInfo()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsReadOnly()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implEnsureNode()
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Type implGetUnoType()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implEnsureValue()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsValid() throw ();
-
- /** check if the registry key is valid
- @param _eIntentedAccess type of access which the caller wants to perform on the object
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid
- */
- void checkValid(KEY_ACCESS_TYPE _eIntentedAccess)
- throw (::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** return an child element.
- @param _rDescendantName the name of the descendant to open. May have a depth of more than 1, if
- the node container support XHierarchicalNameAccess
- @return the requested element. The caller can assume that the returned
- <type scope="com.sun.star.uno">Any</type> always contains an object, all other cases are
- handled with exceptions
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- the element refered by _rName does not exist, the configuration node threw an exception, or
- the name has a depth of more than one and the config node does not support this.
- */
- ::com::sun::star::uno::Any
- implGetDescendant(const ::rtl::OUString& _rDescendantName)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** write the given value into the configuration node the object represents.
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- not opened for write access or the configurations parent is not able to provide a value access
- @throws <type scope="com.sun.star.uno">RuntimeException</type> if a fatal runtime error occurs
- */
- void implSetValue(const ::com::sun::star::uno::Any& _rValue)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Any implGetValue()
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** open the sub key (depth 1 or more) determined by the given name
- @param _rKeyName the name of the descendant node
- @return a XRegistryKey wrapper for the requested configuration node
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- the element refered by _rName does not exist, the configuration node threw an exception, or
- the name has a depth of more than one and the config node does not support this.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >
- implGetKey( const ::rtl::OUString& _rKeyName )
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** check the given (relative) key name syntactically.
-
- <p>In particular, this means that no checks are made if a node with the given name exists or something like
- that ...<br/>
- In addition, the given name will be normalized. Basically, this means that it does not contain trailing slashes.
- </p>
- @returns
- <TRUE/> if the name is a valid relative path
- <FALSE/> if the name is a local name only
- @throws InvalidRegistryException
- if the name is invalid or not relative (i.e. if it starts with an slash)
- */
- bool checkRelativeKeyName(::rtl::OUString& _rKeyName)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** get a default value for a value of a given type
-
- <p>Creates an Any with an empty or zero value of the given type.</p>
-
- @param _rType the type of the element to create
- @return
- an <type scope="com::sun::star::uno">Any</type> representing a default for the node value type. If the
- return value is still VOID, the node has a nullable type (e.g. any) or is of unsupported type
-
- */
- ::com::sun::star::uno::Any
- implCreateDefaultElement(::com::sun::star::uno::Type const& _rType)
- throw(::com::sun::star::uno::RuntimeException);
-};
-
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-
-
diff --git a/configmgr/source/registry/configregistry.cxx b/configmgr/source/registry/configregistry.cxx
deleted file mode 100644
index a4e2ed80f829..000000000000
--- a/configmgr/source/registry/configregistry.cxx
+++ /dev/null
@@ -1,376 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "configregistry.hxx"
-#include "cfgregistrykey.hxx"
-#include "confapifactory.hxx"
-#include "datalock.hxx"
-#include "utility.hxx"
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <osl/diagnose.h>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#define THISREF() static_cast< ::cppu::OWeakObject* >(this)
-#define UNISTRING(c) makeUniString(c)
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-namespace beans = ::com::sun::star::beans;
-
-//==========================================================================
-//= OConfigurationRegistry
-//==========================================================================
- inline
- static
- rtl::OUString makeUniString(char const* c)
- {
- return rtl::OUString::createFromAscii(c);
- }
-
-
- // #99130# Don't export SimpleRegistry service
- static sal_Char const * const aExportedConfigRegistryServices[] =
- {
- "com.sun.star.configuration.ConfigurationRegistry",
- NULL
- };
- static sal_Char const * const aAdditionalConfigRegistryServices[] =
- {
- "com.sun.star.registry.SimpleRegistry",
- NULL
- };
-
- sal_Char const * const aConfigRegistryImplementationName = "com.sun.star.comp.configuration.OConfigurationRegistry";
-
- const ServiceImplementationInfo OConfigurationRegistry::s_aServiceInfo =
- {
- aConfigRegistryImplementationName,
- aExportedConfigRegistryServices,
- aAdditionalConfigRegistryServices
- };
-
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL instantiateConfigRegistry(uno::Reference< uno::XComponentContext > const& xContext )
- {
- OSL_ASSERT( xContext.is() );
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), com::sun::star::uno::UNO_QUERY );
- ::cppu::OWeakObject * pNewInstance = new OConfigurationRegistry(xServiceManager);
- return pNewInstance;
- }
-
- const ServiceRegistrationInfo* getConfigurationRegistryServiceInfo()
- {
- return getRegistrationInfo(& OConfigurationRegistry::s_aServiceInfo);
- }
-
-//--------------------------------------------------------------------------
-OConfigurationRegistry::OConfigurationRegistry(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rORB) throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
- :ServiceComponentImpl(&s_aServiceInfo)
- ,m_xORB(_rORB)
-{
- // create the configuration provider used for accessing the configuration
- OSL_ENSURE(m_xORB.is(), "OConfigurationRegistry::OConfigurationRegistry : invalid service factory !");
- if (m_xORB.is())
- {
- m_xConfigurationProvider =
- m_xConfigurationProvider.query(
- m_xORB->createInstance(UNISTRING("com.sun.star.configuration.ConfigurationProvider"))
- );
- }
-
- if (!m_xConfigurationProvider.is())
- {
- // it's heavily needed ...
- throw com::sun::star::lang::ServiceNotRegisteredException(UNISTRING("Failed to instantiate the mandatory service com.sun.star.configuration.ConfigurationProvider."),
- THISREF());
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any SAL_CALL OConfigurationRegistry::queryInterface( const com::sun::star::uno::Type& _rType ) throw(com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aReturn = ServiceComponentImpl::queryInterface(_rType);
- if (!aReturn.hasValue())
- aReturn = cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >::queryInterface(_rType);
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL OConfigurationRegistry::getTypes( ) throw(com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::concatSequences(
- ServiceComponentImpl::getTypes(),
- cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >::getTypes());
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OConfigurationRegistry::getImplementationId( ) throw(com::sun::star::uno::RuntimeException)
-{
- static cppu::OImplementationId aId;
- return aId.getImplementationId();
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString OConfigurationRegistry::getNodePathFromURL(const ::rtl::OUString& _rURL)
-{
- // TODO
- return _rURL;
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistry::getURL() throw(com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- return m_sLocation;
-}
-
-//--------------------------------------------------------------------------
-
-// Not guarded !
-void OConfigurationRegistry::implCheckOpen() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- if (!implIsOpen())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The registry is not bound to a configuration node."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::open( const ::rtl::OUString& _rURL, sal_Bool _bReadOnly, sal_Bool /*_bCreate*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (implIsOpen())
- close();
-
- ::rtl::OUString sNodePath = getNodePathFromURL(_rURL);
-
- if (!m_xConfigurationProvider.is())
- throw com::sun::star::lang::DisposedException(UNISTRING("invalid object. configuration provider is already disposed."), THISREF());
-
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xNodeAccess;
- try
- {
- char const * const sAccessType = _bReadOnly ?
- "com.sun.star.configuration.ConfigurationAccess" :
- "com.sun.star.configuration.ConfigurationUpdateAccess";
-
- // prepare parameters for creating the config access : the node path
- beans::PropertyValue aArgValue;
- aArgValue.Handle = -1;
-
- // currently theres is one parameter: the node path
- com::sun::star::uno::Sequence< com::sun::star::uno::Any > aArguments(1);
-
- aArgValue.Name = UNISTRING("nodepath");
- aArgValue.Value <<= sNodePath;
-
- aArguments[0] <<= aArgValue;
-
-
- xNodeAccess = m_xConfigurationProvider->createInstanceWithArguments(UNISTRING(sAccessType), aArguments);
- }
- catch (com::sun::star::uno::RuntimeException&)
- { // allowed to leave this method
- throw;
- }
- catch (com::sun::star::uno::Exception& e)
- { // not allowed to leave this method
- ::rtl::OUString sMessage = UNISTRING("The configuration provider does not supply a registry access for the requested Node.");
- sMessage += UNISTRING(" original error message of the provider : ");
- sMessage += e.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xReadRoot(xNodeAccess, com::sun::star::uno::UNO_QUERY);
- if (!_bReadOnly)
- m_xUpdateRoot = m_xUpdateRoot.query(xReadRoot);
-
- if (!xReadRoot.is() || (!_bReadOnly && !m_xUpdateRoot.is()))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The object supplied the by configuration provider is invalid."), THISREF());
-
- m_xRootKey = new OConfigurationRegistryKey(xReadRoot, !_bReadOnly, OConfigurationRegistryKey::SubtreeRoot());
- m_xSubtreeRoot = xNodeAccess;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistry::isValid( ) throw(com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- return implIsOpen();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool OConfigurationRegistry::implIsOpen( ) throw(com::sun::star::uno::RuntimeException)
-{
- return m_xRootKey.is();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::close( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xRootKey(m_xRootKey);
- m_xRootKey = NULL;
-
- com::sun::star::uno::Reference< XComponent > xRootComponent(m_xSubtreeRoot, com::sun::star::uno::UNO_QUERY);
- m_xSubtreeRoot = NULL;
- m_xUpdateRoot = NULL;
-
- m_sLocation = ::rtl::OUString();
-
- if (xRootKey.is())
- xRootKey->closeKey();
-
- if (xRootComponent.is())
- xRootComponent->dispose();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::disposing()
-{
- close();
-
- {
- UnoApiLock aLock;
-
- m_xConfigurationProvider.clear();
- m_xORB.clear();
- }
-
- ServiceComponentImpl::disposing();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::destroy( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry is a wrapper for a configuration access. It can not be destroyed."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistry::getRootKey( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- return m_xRootKey;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistry::isReadOnly( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- return !m_xUpdateRoot.is();
- // if we don't have the update root, we're readonly
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::mergeKey( const ::rtl::OUString& /*aKeyName*/, const ::rtl::OUString& /*aUrl*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::MergeConflictException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- // not supported. but we can't throw an NoSupportException here ...
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("You can't merge into this registry. It's just a wrapper for a configuration node, which has a fixed structure which can not be modified"), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::flush( ) throw(com::sun::star::uno::RuntimeException)
-{
- {
- UnoApiLock aLock;
- if (m_xUpdateRoot.is())
- {
- try
- {
- m_xUpdateRoot->commitChanges();
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- { // not allowed to leave this method
-
- ::rtl::OUString sMessage;
- sMessage = UNISTRING("The changes made could not be committed. Orginal exception message : ");
- sMessage += e.Message;
-
- // TODO : the specification of XFlushable has to be changed !!!!!
- OSL_ENSURE(sal_False, "OConfigurationRegistry::flush : caught an exception, could not flush the data !");
- // return;
-
- throw com::sun::star::lang::WrappedTargetRuntimeException(sMessage, THISREF(), e.TargetException);
- }
- }
- }
-
- com::sun::star::uno::Reference< com::sun::star::util::XFlushListener > const * const pSelector = 0;
- if (cppu::OInterfaceContainerHelper* pContainer = this->rBHelper.getContainer(::getCppuType(pSelector)) )
- {
- ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
-
- com::sun::star::lang::EventObject aFlushed(THISREF());
- while (aIter.hasMoreElements())
- try
- {
- static_cast< com::sun::star::util::XFlushListener* >(aIter.next())->flushed(aFlushed);
- }
- catch (uno::Exception & )
- {}
- }
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::addFlushListener( const com::sun::star::uno::Reference< com::sun::star::util::XFlushListener >& _rxListener ) throw(com::sun::star::uno::RuntimeException)
-{
- this->rBHelper.addListener(::getCppuType(&_rxListener),_rxListener);
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::removeFlushListener( const com::sun::star::uno::Reference< com::sun::star::util::XFlushListener >& _rxListener ) throw(com::sun::star::uno::RuntimeException)
-{
- this->rBHelper.removeListener(::getCppuType(&_rxListener),_rxListener);
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/registry/configregistry.hxx b/configmgr/source/registry/configregistry.hxx
deleted file mode 100644
index 7664c1292b5d..000000000000
--- a/configmgr/source/registry/configregistry.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-#define _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-
-#include <cppuhelper/implbase2.hxx>
-#include "confsvccomponent.hxx"
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//==========================================================================
-//= OConfigurationRegistry
-//==========================================================================
-/** an object implmenting the <service scope="com.sun.star.configuration">ConfigurationRegistry</service>
- service.
-*/
-class OConfigurationRegistry
- :public ServiceComponentImpl
- ,public cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >
-{
-public:
- static const ServiceImplementationInfo s_aServiceInfo;
-
-protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB; /// the service provider used for creating the instance
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xConfigurationProvider; /// the configuration provider used for creating configuration accesses
-
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >
- m_xRootKey; /// the root key for the registry-like configuration access
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- m_xSubtreeRoot; /// the root of the sub tree the object wraps
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch >
- m_xUpdateRoot; /// the update access to the root of the sub tree, valid if opened for writing
- ::rtl::OUString m_sLocation; /// URL of the configuration node we're representing, if any
-
-
-public:
- OConfigurationRegistry(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rORB)
- throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire( ) throw() { ServiceComponentImpl::acquire(); }
- virtual void SAL_CALL release( ) throw() { ServiceComponentImpl::release(); }
-
- // 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);
-
- // XSimpleRegistry
- virtual ::rtl::OUString SAL_CALL getURL() throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL open( const ::rtl::OUString& rURL, sal_Bool bReadOnly, sal_Bool bCreate ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isValid( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL close( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL destroy( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL getRootKey( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL mergeKey( const ::rtl::OUString& aKeyName, const ::rtl::OUString& aUrl ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::MergeConflictException, ::com::sun::star::uno::RuntimeException);
-
- // XFlushable
- virtual void SAL_CALL flush( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw(::com::sun::star::uno::RuntimeException);
-
-protected:
- virtual void SAL_CALL disposing();
- /// translates the given URL into a nodepath which may be used with the configuration provider
- ::rtl::OUString getNodePathFromURL(const ::rtl::OUString& _rURL);
-
- void implCheckOpen() throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsOpen()
- throw (::com::sun::star::uno::RuntimeException);
-};
-
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-
-
diff --git a/configmgr/source/registry/makefile.mk b/configmgr/source/registry/makefile.mk
deleted file mode 100644
index b3864291e5d2..000000000000
--- a/configmgr/source/registry/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=registry
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/configregistry.obj \
- $(SLO)$/cfgregistrykey.obj \
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
new file mode 100644
index 000000000000..f8ccc6a31546
--- /dev/null
+++ b/configmgr/source/rootaccess.cxx
@@ -0,0 +1,319 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/ChangesEvent.hpp"
+#include "com/sun/star/util/ChangesSet.hpp"
+#include "com/sun/star/util/ElementChange.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "com/sun/star/util/XChangesListener.hpp"
+#include "com/sun/star/util/XChangesNotifier.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "path.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+RootAccess::RootAccess(
+ Components & components, rtl::OUString const & pathRepresentation,
+ rtl::OUString const & locale, bool update):
+ Access(components), pathRepresentation_(pathRepresentation),
+ locale_(locale), update_(update)
+{}
+
+Path RootAccess::getAbsolutePath() {
+ getNode();
+ return path_;
+}
+
+void RootAccess::initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster)
+{
+ OSL_ASSERT(broadcaster != 0);
+ comphelper::SequenceAsVector< css::util::ElementChange > changes;
+ initBroadcasterAndChanges(
+ modifications, broadcaster, changesListeners_.empty() ? 0 : &changes);
+ if (!changes.empty()) {
+ css::util::ChangesSet set(changes.getAsConstList());
+ for (ChangesListeners::iterator i(changesListeners_.begin());
+ i != changesListeners_.end(); ++i)
+ {
+ broadcaster->addChangesNotification(
+ *i,
+ css::util::ChangesEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(pathRepresentation_), set));
+ }
+ }
+}
+
+void RootAccess::acquire() throw () {
+ Access::acquire();
+}
+
+void RootAccess::release() throw () {
+ Access::release();
+}
+
+rtl::OUString RootAccess::getLocale() const {
+ return locale_;
+}
+
+bool RootAccess::isUpdate() const {
+ return update_;
+}
+
+RootAccess::~RootAccess() {
+ osl::MutexGuard g(lock);
+ getComponents().removeRootAccess(this);
+}
+
+Path RootAccess::getRelativePath() {
+ return Path();
+}
+
+rtl::OUString RootAccess::getRelativePathRepresentation() {
+ return rtl::OUString();
+}
+
+rtl::Reference< Node > RootAccess::getNode() {
+ if (!node_.is()) {
+ int finalizedLayer;
+ node_ = getComponents().resolvePathRepresentation(
+ pathRepresentation_, &path_, &finalizedLayer);
+ if (!node_.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot find ")) +
+ pathRepresentation_),
+ 0);
+ // RootAccess::queryInterface indirectly calls
+ // RootAccess::getNode, so if this RootAccess were passed out in
+ // RuntimeException.Context, client code that called
+ // queryInterface on it would cause trouble; therefore,
+ // RuntimeException.Context is left null here
+ }
+ OSL_ASSERT(!path_.empty());
+ name_ = path_.back();
+ finalized_ = finalizedLayer != Data::NO_LAYER;
+ }
+ return node_;
+}
+
+bool RootAccess::isFinalized() {
+ getNode();
+ return finalized_;
+}
+
+rtl::OUString RootAccess::getNameInternal() {
+ getNode();
+ return name_;
+}
+
+rtl::Reference< RootAccess > RootAccess::getRootAccess() {
+ return this;
+}
+
+rtl::Reference< Access > RootAccess::getParentAccess() {
+ return rtl::Reference< Access >();
+}
+
+void RootAccess::addTypes(std::vector< css::uno::Type > * types) const {
+ OSL_ASSERT(types != 0);
+ types->push_back(cppu::UnoType< css::util::XChangesNotifier >::get());
+ types->push_back(cppu::UnoType< css::util::XChangesBatch >::get());
+}
+
+void RootAccess::addSupportedServiceNames(
+ std::vector< rtl::OUString > * services)
+{
+ OSL_ASSERT(services != 0);
+ services->push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.AccessRootElement")));
+ if (update_) {
+ services->push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.UpdateRootElement")));
+ }
+}
+
+void RootAccess::initDisposeBroadcaster(Broadcaster * broadcaster) {
+ OSL_ASSERT(broadcaster != 0);
+ for (ChangesListeners::iterator i(changesListeners_.begin());
+ i != changesListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ Access::initDisposeBroadcaster(broadcaster);
+}
+
+void RootAccess::clearListeners() throw() {
+ changesListeners_.clear();
+ Access::clearListeners();
+}
+
+css::uno::Any RootAccess::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Any res(Access::queryInterface(aType));
+ if (res.hasValue()) {
+ return res;
+ }
+ res = cppu::queryInterface(
+ aType, static_cast< css::util::XChangesNotifier * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (!res.hasValue() && update_) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::util::XChangesBatch * >(this));
+ }
+ return res;
+}
+
+void RootAccess::addChangesListener(
+ css::uno::Reference< css::util::XChangesListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!aListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!isDisposed()) {
+ changesListeners_.insert(aListener);
+ return;
+ }
+ }
+ try {
+ aListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void RootAccess::removeChangesListener(
+ css::uno::Reference< css::util::XChangesListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ ChangesListeners::iterator i(changesListeners_.find(aListener));
+ if (i != changesListeners_.end()) {
+ changesListeners_.erase(i);
+ }
+}
+
+void RootAccess::commitChanges()
+ throw (css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ int finalizedLayer;
+ Modifications globalMods;
+ commitChildChanges(
+ ((getComponents().resolvePathRepresentation(
+ pathRepresentation_, 0, &finalizedLayer)
+ == node_) &&
+ finalizedLayer == Data::NO_LAYER),
+ &globalMods);
+ getComponents().writeModifications();
+ getComponents().initGlobalBroadcaster(globalMods, this, &bc);
+ }
+ bc.send();
+}
+
+sal_Bool RootAccess::hasPendingChanges() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ //TODO: Optimize:
+ std::vector< css::util::ElementChange > changes;
+ reportChildChanges(&changes);
+ return !changes.empty();
+}
+
+css::util::ChangesSet RootAccess::getPendingChanges()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< css::util::ElementChange > changes;
+ reportChildChanges(&changes);
+ return changes.getAsConstList();
+}
+
+}
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
new file mode 100644
index 000000000000..45d4193d70de
--- /dev/null
+++ b/configmgr/source/rootaccess.hxx
@@ -0,0 +1,155 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
+
+#include "sal/config.h"
+
+#include <set>
+#include <vector>
+
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/util/ChangesSet.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "com/sun/star/util/XChangesNotifier.hpp"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "modifications.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class Any;
+ class Type;
+ }
+ namespace util { class XChangesListener; }
+} } }
+
+namespace configmgr {
+
+class Broadcaster;
+class Components;
+class Node;
+
+class RootAccess:
+ public Access, public com::sun::star::util::XChangesNotifier,
+ public com::sun::star::util::XChangesBatch
+{
+public:
+ RootAccess(
+ Components & components, rtl::OUString const & pathRepresenation,
+ rtl::OUString const & locale, bool update);
+
+ virtual Path getAbsolutePath();
+
+ virtual void initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster);
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ rtl::OUString getLocale() const;
+
+ bool isUpdate() const;
+
+private:
+ virtual ~RootAccess();
+
+ virtual Path getRelativePath();
+
+ virtual rtl::OUString getRelativePathRepresentation();
+
+ virtual rtl::Reference< Node > getNode();
+
+ virtual bool isFinalized();
+
+ virtual rtl::OUString getNameInternal();
+
+ virtual rtl::Reference< RootAccess > getRootAccess();
+
+ virtual rtl::Reference< Access > getParentAccess();
+
+ virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
+ const;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services);
+
+ virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
+
+ virtual void clearListeners() throw ();
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addChangesListener(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeChangesListener(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL commitChanges()
+ throw (
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPendingChanges()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
+ throw (com::sun::star::uno::RuntimeException);
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XChangesListener > >
+ ChangesListeners;
+
+ rtl::OUString pathRepresentation_;
+ rtl::OUString locale_;
+ bool update_;
+ Path path_;
+ rtl::Reference< Node > node_;
+ rtl::OUString name_;
+ bool finalized_;
+ ChangesListeners changesListeners_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
new file mode 100644
index 000000000000..3a009b3cee15
--- /dev/null
+++ b/configmgr/source/services.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/implementationentry.hxx"
+#include "osl/diagnose.h"
+#include "uno/lbnames.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "configurationprovider.hxx"
+#include "configurationregistry.hxx"
+#include "defaultprovider.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL dummy(
+ css::uno::Reference< css::uno::XComponentContext > const &)
+ SAL_THROW((css::uno::Exception))
+{
+ OSL_ASSERT(false);
+ return css::uno::Reference< css::uno::XInterface >();
+}
+
+static cppu::ImplementationEntry const services[] = {
+ { &dummy, &configmgr::configuration_provider::getImplementationName,
+ &configmgr::configuration_provider::getSupportedServiceNames,
+ &configmgr::configuration_provider::createFactory, 0, 0 },
+ { &dummy, &configmgr::default_provider::getImplementationName,
+ &configmgr::default_provider::getSupportedServiceNames,
+ &configmgr::default_provider::createFactory, 0, 0 },
+ { &dummy, &configmgr::configuration_registry::getImplementationName,
+ &configmgr::configuration_registry::getSupportedServiceNames,
+ &configmgr::configuration_registry::createFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) {
+ return false;
+ }
+ try {
+ css::uno::Reference< css::registry::XRegistryKey >(
+ (css::uno::Reference< css::registry::XRegistryKey >(
+ static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
+ createKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/com.sun.star.comp.configuration.DefaultProvider/UNO/"
+ "SINGLETONS/"
+ "com.sun.star.configuration.theDefaultProvider")))),
+ css::uno::UNO_SET_THROW)->
+ setStringValue(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider")));
+ } catch (css::uno::Exception & e) {
+ (void) e;
+ OSL_TRACE(
+ "configmgr component_writeInfo exception: %s",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return false;
+ }
+ return true;
+}
diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx
new file mode 100644
index 000000000000..f19c36c0bba5
--- /dev/null
+++ b/configmgr/source/setnode.cxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+#include <functional>
+#include <vector>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "setnode.hxx"
+
+namespace configmgr {
+
+namespace {
+
+// Work around some compilers' failure to accept
+// std::binder1st(std::ptr_fun(&Data::equalTemplateNames), ...):
+class EqualTemplateNames:
+ public std::unary_function< rtl::OUString const &, bool >
+{
+public:
+ inline explicit EqualTemplateNames(rtl::OUString const & shortName):
+ shortName_(shortName) {}
+
+ inline bool operator ()(rtl::OUString const & longName) const
+ { return Data::equalTemplateNames(shortName_, longName); }
+
+private:
+ rtl::OUString const & shortName_;
+};
+
+}
+
+SetNode::SetNode(
+ int layer, rtl::OUString const & defaultTemplateName,
+ rtl::OUString const & templateName):
+ Node(layer), defaultTemplateName_(defaultTemplateName),
+ templateName_(templateName), mandatory_(Data::NO_LAYER)
+{}
+
+rtl::Reference< Node > SetNode::clone() const {
+ return new SetNode(*this);
+}
+
+NodeMap & SetNode::getMembers() {
+ return members_;
+}
+
+rtl::OUString SetNode::getTemplateName() const {
+ return templateName_;
+}
+
+void SetNode::setMandatory(int layer) {
+ mandatory_ = layer;
+}
+
+int SetNode::getMandatory() const {
+ return mandatory_;
+}
+
+rtl::OUString const & SetNode::getDefaultTemplateName() const {
+ return defaultTemplateName_;
+}
+
+std::vector< rtl::OUString > & SetNode::getAdditionalTemplateNames() {
+ return additionalTemplateNames_;
+}
+
+bool SetNode::isValidTemplate(rtl::OUString const & templateName) const {
+ return Data::equalTemplateNames(templateName, defaultTemplateName_) ||
+ (std::find_if(
+ additionalTemplateNames_.begin(),
+ additionalTemplateNames_.end(), EqualTemplateNames(templateName)) !=
+ additionalTemplateNames_.end());
+}
+
+SetNode::SetNode(SetNode const & other):
+ Node(other), defaultTemplateName_(other.defaultTemplateName_),
+ additionalTemplateNames_(other.additionalTemplateNames_),
+ templateName_(other.templateName_), mandatory_(other.mandatory_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+SetNode::~SetNode() {}
+
+Node::Kind SetNode::kind() const {
+ return KIND_SET;
+}
+
+void SetNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx
new file mode 100644
index 000000000000..7bf1ab0a199e
--- /dev/null
+++ b/configmgr/source/setnode.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_SETNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_SETNODE_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class SetNode: public Node {
+public:
+ SetNode(
+ int layer, rtl::OUString const & defaultTemplateName,
+ rtl::OUString const & templateName);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ rtl::OUString const & getDefaultTemplateName() const;
+
+ std::vector< rtl::OUString > & getAdditionalTemplateNames();
+
+ bool isValidTemplate(rtl::OUString const & templateName) const;
+
+private:
+ SetNode(SetNode const & other);
+
+ virtual ~SetNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ rtl::OUString defaultTemplateName_;
+ std::vector< rtl::OUString > additionalTemplateNames_;
+ NodeMap members_;
+ rtl::OUString templateName_;
+ // non-empty iff this node is a template, free node, or set member
+ int mandatory_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/span.hxx b/configmgr/source/span.hxx
new file mode 100644
index 000000000000..689618613700
--- /dev/null
+++ b/configmgr/source/span.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
+
+#include "sal/config.h"
+
+#include "rtl/string.h"
+#include "sal/types.h"
+
+namespace configmgr {
+
+struct Span {
+ char const * begin;
+ sal_Int32 length;
+
+ inline Span(): begin(0), length(0) {}
+ // init length to avoid compiler warnings
+
+ inline Span(char const * theBegin, sal_Int32 theLength):
+ begin(theBegin), length(theLength) {}
+
+ inline void clear() throw() { begin = 0; }
+
+ inline bool is() const { return begin != 0; }
+
+ inline bool equals(Span const & text) const {
+ return rtl_str_compare_WithLength(
+ begin, length, text.begin, text.length) == 0;
+ }
+
+ inline bool equals(char const * textBegin, sal_Int32 textLength) const {
+ return equals(Span(textBegin, textLength));
+ }
+};
+
+}
+
+#endif
diff --git a/configmgr/source/tree/builddata.cxx b/configmgr/source/tree/builddata.cxx
deleted file mode 100644
index 264ce5e759d7..000000000000
--- a/configmgr/source/tree/builddata.cxx
+++ /dev/null
@@ -1,1134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "sal/types.h"
-
-#include "builddata.hxx"
-#include "nodevisitor.hxx"
-#include "node.hxx"
-#include "treefragment.hxx"
-#include "valuenode.hxx"
-#include "treenodefactory.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_CSTDDEF
-#include <cstddef>
-#define INCLUDED_CSTDDEF
-#endif
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include <vector>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data
- {
-//-----------------------------------------------------------------------------
-
- static
- inline
- sharable::Node * offsetNodeBy(sharable::Node * _aNode, sal_uInt16 _nOffset)
- {
- sharable::Node *pNode = _aNode;
- pNode += _nOffset;
- return (sharable::Node *)(pNode);
- }
-
- static
- inline
- sharable::Node * addressOfNodeAt(sharable::TreeFragment * _aTree, sal_uInt16 _nOffset)
- {
- sharable::TreeFragment *pRaw = _aTree;
- return &pRaw->nodes[_nOffset];
- }
-
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder
- {
- sharable::TreeFragmentHeader m_header;
- std::vector< sharable::Node > m_nodes;
- sal_uInt16 m_parent;
- public:
- TreeNodeBuilder() : m_header(), m_nodes(), m_parent() {}
-
- sharable::TreeFragmentHeader & header() { return m_header; }
-
- sharable::Node & nodeAt(sal_uInt16 _pos) { checkOffset(_pos); return m_nodes[_pos]; }
- sharable::NodeInfo & nodeInfoAt(sal_uInt16 _pos) { checkOffset(_pos); return m_nodes[_pos].info; }
-
- sharable::Node & lastNode() { checkOffset(0); return m_nodes.back(); }
- sharable::NodeInfo & lastNodeInfo() { checkOffset(0); return m_nodes.back().info; }
-
- void resetTreeFragment(rtl_uString * _treeName, sal_uInt8 _state);
-
- sharable::TreeFragment * createTreeFragment();
-
- sal_uInt16 startGroup( rtl_uString * _aName, sal_uInt8 _aFlags );
- void endGroup( sal_uInt16 _nPos );
-
- void addSet( rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 * _aElementType );
-
- void addValue( rtl_uString * _aName, sal_uInt8 _aFlags,
- sal_uInt8 _aValueType,
- sharable::AnyData _aUserValue,
- sharable::AnyData _aDefaultName );
- public:
- class CollectSetElements;
- class LinkSetNodes;
-
- private:
- sharable::TreeFragment * allocTreeFragment();
- void linkTreeFragment(sharable::TreeFragment * _aTreeAddr);
-
- sal_uInt16 addNode(rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 _aType);
- void checkOffset(sal_uInt16 _pos);
- };
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder::CollectSetElements
- {
- sharable::TreeFragment * m_head;
- public:
- explicit
- CollectSetElements() : m_head(NULL) {}
-
- void resetElementList();
- void addElement(sharable::TreeFragment * _aNewElement);
- sharable::TreeFragment * getElementListAndClear();
- };
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder::LinkSetNodes: private SetVisitor {
- sharable::Node * m_parent;
- public:
- LinkSetNodes(): m_parent(0) {}
-
- void linkTree(sharable::TreeFragment * tree);
-
- private:
- using SetVisitor::handle;
-
- virtual bool handle(sharable::SetNode * node);
-
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class BasicDataTreeBuilder
- {
- public:
- explicit
- BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * createTree() { return m_builder.createTreeFragment(); }
-
- protected:
- TreeNodeBuilder& builder() { return m_builder; }
- private:
- TreeNodeBuilder m_builder;
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingDataTreeBuilder : private NodeAction, public BasicDataTreeBuilder
- {
- rtl::OUString m_sRootName;
- bool m_bWithDefaults;
- public:
- explicit
- ConvertingDataTreeBuilder() : BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefault);
- sharable::TreeFragment * buildElement(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefault);
- private:
- class ElementListBuilder;
-
- virtual void handle(ISubtree const & _aNode);
- virtual void handle(ValueNode const & _aNode);
-
- sal_uInt8 * makeTemplateData(rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateModule);
-
- rtl_uString * allocName(INode const & _aNode);
- sal_uInt8 makeState(node::Attributes const & _aAttributes);
- sal_uInt8 makeFlags(node::Attributes const & _aAttributes);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingDataTreeBuilder::ElementListBuilder : private NodeAction
- {
- TreeNodeBuilder::CollectSetElements m_aCollector;
-
- rtl::OUString m_sTypeName;
- bool m_bWithDefaults;
- public:
- explicit
- ElementListBuilder()
- : m_aCollector()
- , m_sTypeName()
- , m_bWithDefaults()
- {}
-
- sharable::TreeFragment *buildElementList(ISubtree const & _aSet, bool _bWithDefaults);
- private:
- void handleNode(INode const & _aSourceNode);
-
- void handle(ValueNode const & _aSourceNode);
- void handle(ISubtree const & _aSourceNode);
- };
-//-----------------------------------------------------------------------------
-
- class CopyingDataTreeBuilder : private NodeVisitor, public BasicDataTreeBuilder
- {
- public:
- explicit
- CopyingDataTreeBuilder() : BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * buildTree(sharable::TreeFragment * sourceTree);
-
- private:
- class ElementListBuilder;
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
-
- sal_uInt8 * makeTemplateData(sal_uInt8 * _aSourceTemplate);
- };
-//-----------------------------------------------------------------------------
-
- class CopyingDataTreeBuilder::ElementListBuilder : private SetVisitor
- {
- TreeNodeBuilder::CollectSetElements m_aCollector;
- public:
- explicit
- ElementListBuilder() : m_aCollector() {}
-
- sharable::TreeFragment * buildElementList(sharable::SetNode * set);
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingNodeBuilder : private NodeVisitor
- {
- OTreeNodeFactory & m_rNodeFactory;
-
- std::auto_ptr<INode> m_pNode;
- public:
- ConvertingNodeBuilder(OTreeNodeFactory & _rNodeFactory)
- : m_rNodeFactory(_rNodeFactory)
- , m_pNode()
- {
- }
-
- std::auto_ptr<INode> buildNode(sharable::TreeFragment * tree, bool _bUseTreeName);
- std::auto_ptr<INode> buildNode(sharable::Node * tree);
-
- std::auto_ptr<ISubtree> buildNodeTree(sharable::GroupNode * groupNode) const;
- std::auto_ptr<ISubtree> buildNodeTree(sharable::SetNode * setNode) const;
- std::auto_ptr<ValueNode> buildNodeTree(sharable::ValueNode * valueNode) const
- { return convertNode(valueNode); }
-
- static node::Attributes convertAttributes(sharable::Node * node)
- { return node->getAttributes(); }
-
- private:
- std::auto_ptr<ISubtree> convertNode(sharable::GroupNode * groupNode) const;
- std::auto_ptr<ISubtree> convertNode(sharable::SetNode * setNode) const;
- std::auto_ptr<ValueNode> convertNode(sharable::ValueNode * valueNode) const;
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingSubnodeBuilder : private SetVisitor
- {
- ConvertingNodeBuilder m_aSubnodeBuilder;
- ISubtree & m_rParentNode;
- public:
- ConvertingSubnodeBuilder(OTreeNodeFactory & _rNodeFactory, ISubtree & _rParentNode)
- : m_aSubnodeBuilder(_rNodeFactory)
- , m_rParentNode(_rParentNode)
- {
- }
-
- void addElements(sharable::SetNode * set) { visitElements(set); }
- void addChildren(sharable::GroupNode * group) { visitChildren(group); }
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class DataTreeDefaultMerger : private NodeAction
- {
- public:
- explicit
- DataTreeDefaultMerger() {}
-
- void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode);
- private:
- void handle(ValueNode const & _aNode);
- void handle(ISubtree const & _aNode);
- };
-
-//-----------------------------------------------------------------------------
-
- class DataTreeCleanup
- {
- public:
- explicit
- DataTreeCleanup() {}
-
- sharable::TreeFragment * destroyTree(sharable::TreeFragment * _aBaseAddress);
- private:
- void destroyNode(sharable::Node * _aNodeAddress);
-
- void destroyData(sharable::TreeFragmentHeader * _pHeader);
- void destroyData(sharable::NodeInfo * _pNodeInfo);
-
- void destroyData(sharable::GroupNode * _pNode);
- void destroyData(sharable::ValueNode * _pNode);
- void destroyData(sharable::SetNode * _pNode);
- };
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildTree(sharable::TreeFragment * tree)
-{
- return CopyingDataTreeBuilder().buildTree(tree);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults)
-{
- ConvertingDataTreeBuilder aBuilder;
-
- sharable::TreeFragment * aResult = aBuilder.buildTree(_aTreeName, _aNode,_bWithDefaults);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildElementTree(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults)
-{
- ConvertingDataTreeBuilder aBuilder;
-
- sharable::TreeFragment * aResult = aBuilder.buildElement(_aNode, _aTypeName, _bWithDefaults);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode)
-{
- DataTreeDefaultMerger aMergeHelper;
-
- aMergeHelper.mergeDefaults(_aBaseAddress, _aDefaultNode);
-}
-//-----------------------------------------------------------------------------
-
-void destroyTree(sharable::TreeFragment * _aBaseAddress)
-{
- DataTreeCleanup aCleaner;
-
- aCleaner.destroyTree(_aBaseAddress);
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> convertTree(sharable::TreeFragment * tree, bool _bUseTreeName)
-{
- ConvertingNodeBuilder aBuilder( configmgr::getDefaultTreeNodeFactory() );
-
- return aBuilder.buildNode(tree, _bUseTreeName);
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-inline
-void TreeNodeBuilder::CollectSetElements::resetElementList()
-{
- OSL_ENSURE(m_head == NULL, "Joining to a element list that was forgotten");
-}
-//-----------------------------------------------------------------------------
-
-inline
-sharable::TreeFragment * TreeNodeBuilder::CollectSetElements::getElementListAndClear()
-{
- sharable::TreeFragment * aResult = m_head;
- m_head = NULL;
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::CollectSetElements::addElement(sharable::TreeFragment * _aNewElement)
-{
- if (sharable::TreeFragment * pNewFragment = _aNewElement)
- {
- pNewFragment->header.parent = 0; // data not available here
- pNewFragment->header.next = m_head;
-
- m_head = _aNewElement;
- }
- else
- OSL_ENSURE(false, "Cannot add NULL element");
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::LinkSetNodes::linkTree(sharable::TreeFragment * tree) {
- sharable::Node * old = m_parent;
- m_parent = 0;
- sal_uInt16 n = tree->header.count;
- for (sal_uInt16 i = 0; i < n; ++i) {
- if (visitNode(tree->nodes + i)) {
- break;
- }
- }
- m_parent = old;
-}
-
-bool TreeNodeBuilder::LinkSetNodes::handle(sharable::SetNode * node)
-{
- OSL_ASSERT(m_parent == 0);
- m_parent = sharable::node(node);
- bool done = visitElements(node);
- m_parent = 0;
- return done;
-}
-
-bool TreeNodeBuilder::LinkSetNodes::handle(sharable::TreeFragment * tree)
-{
- OSL_ASSERT(m_parent != 0);
- tree->header.parent = m_parent;
- return false;
-}
-
-//-----------------------------------------------------------------------------
-
-inline void TreeNodeBuilder::checkOffset(sal_uInt16 _pos)
-{
- { (void)_pos; }
- OSL_ENSURE(_pos < m_nodes.size(), "TreeNodeBuilder: Node access past end.");
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt16 TreeNodeBuilder::addNode(rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 _aType)
-{
- OSL_PRECOND(_aName, "TreeNodeBuilder: Unexpected NULL name");
-
- // TODO: consistencý checks for flags
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sal_uInt16 nNewOffset = m_header.count++;
-
- m_nodes.push_back( sharable::Node() );
-
- OSL_ASSERT( &lastNode() == &nodeAt(nNewOffset) );
-
- sharable::NodeInfo & rInfo = lastNode().info;
-
- rInfo.name = _aName;
- rInfo.flags = _aFlags;
- rInfo.type = _aType;
-
- OSL_ENSURE( m_parent <= nNewOffset, "ERROR - TreeNodeBuilder: invalid parent");
- OSL_ENSURE( (nNewOffset == 0) == (nNewOffset == m_parent), "ERROR - TreeNodeBuilder: node is own parent");
-
- rInfo.parent = nNewOffset - m_parent;
-
- return nNewOffset;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::resetTreeFragment(rtl_uString * _name, sal_uInt8 _state)
-{
- m_header.next = 0;
- m_header.name = _name;
-
- m_header.parent = 0;
-
- m_header.count = 0;
- m_header.state = _state;
-
- m_nodes.clear();
- m_parent = 0;
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * TreeNodeBuilder::allocTreeFragment()
-{
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sharable::TreeFragment *pFragment = sharable::TreeFragment::allocate(m_header.count);
- pFragment->header = m_header;
- std::copy(m_nodes.begin(),m_nodes.end(),pFragment->nodes);
-
- return (sharable::TreeFragment *)( pFragment );
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::linkTreeFragment(sharable::TreeFragment * _aTreeFragment)
-{
- LinkSetNodes().linkTree(_aTreeFragment);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * TreeNodeBuilder::createTreeFragment()
-{
- sharable::TreeFragment * aResult = allocTreeFragment();
-
- if (aResult != NULL)
- {
- linkTreeFragment(aResult);
-
- m_nodes.clear(); // ownership of indirect data has gone ...
- }
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt16 TreeNodeBuilder::startGroup( rtl_uString * _aName, sal_uInt8 _aFlags )
-{
- sal_uInt16 nNewIndex = addNode(_aName,_aFlags,Type::nodetype_group);
-
- lastNode().group.numDescendants = 0;
-
- m_parent = nNewIndex;
-
- return nNewIndex;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::endGroup( sal_uInt16 _nPos )
-{
- // while (_nPos < m_parent) endGroup(m_parent);
- OSL_PRECOND(_nPos == m_parent, "TreeNodeBuilder: Group being closed is not the current parent");
-
- OSL_ENSURE(nodeAt(_nPos).isGroup(), "TreeNodeBuilder: Group being closed is not a group");
-
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sharable::GroupNode & rGroup = nodeAt(_nPos).group;
-
- rGroup.numDescendants = sal_uInt16( m_nodes.size() - static_cast< ::std::size_t >(_nPos) - 1 );
- m_parent = m_parent - rGroup.info.parent;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::addSet( rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 * _aElementType )
-{
- addNode(_aName,_aFlags,Type::nodetype_set);
-
- lastNode().set.elementType = _aElementType;
- lastNode().set.elements = 0;
-}
-
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::addValue( rtl_uString * _aName, sal_uInt8 _aFlags,
- sal_uInt8 _aValueType,
- sharable::AnyData _aUserValue,
- sharable::AnyData _aDefaultValue )
-{
- OSL_PRECOND(_aValueType == (_aValueType & Type::mask_valuetype), "TreeNodeBuilder: invalid value type");
-
- addNode(_aName,_aFlags,sal_uInt8(Type::nodetype_value | _aValueType));
-
- lastNode().value.value = _aUserValue;
- lastNode().value.defaultValue = _aDefaultValue;
-}
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * CopyingDataTreeBuilder::buildTree(sharable::TreeFragment * sourceTree)
-{
- OSL_ENSURE(sourceTree != 0, "Trying to build a tree from NULL data");
-
- rtl_uString * aTreeName = acquireString( sourceTree->getName());
- this->builder().resetTreeFragment(aTreeName, sourceTree->header.state);
-
- this->visitNode(sourceTree->getRootNode());
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::ValueNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
-
- sal_uInt8 aType = sal_uInt8( node->info.type & Type::mask_valuetype );
-
- sharable::AnyData aNewValue, aNewDefault;
- if (aFlags & Flags::valueAvailable)
- aNewValue = sharable::allocData(aType, node->getUserValue());
- else
- aNewValue.data = 0;
-
- if (aFlags & Flags::defaultAvailable)
- aNewDefault = sharable::allocData(aType, node->getDefaultValue());
- else
- aNewDefault.data = 0;
-
- this->builder().addValue(aNodeName,aFlags,aType,aNewValue,aNewDefault);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::GroupNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
-
- sal_uInt16 nGroupOffset = this->builder().startGroup(aNodeName,aFlags);
- this->visitChildren(node);
- this->builder().endGroup(nGroupOffset);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::SetNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
- sal_uInt8 * aTemplate = this->makeTemplateData(node->elementType);
-
- this->builder().addSet(aNodeName,aFlags,aTemplate);
-
- OSL_ASSERT( this->builder().lastNode().isSet() );
- sharable::SetNode& _aNewSet = this->builder().lastNode().set;
-
- _aNewSet.elements = ElementListBuilder().buildElementList(node);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * CopyingDataTreeBuilder::makeTemplateData(sal_uInt8 * _aSourceTemplate)
-{
- return sharable::SetNode::copyTemplateData(_aSourceTemplate);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * CopyingDataTreeBuilder::ElementListBuilder::buildElementList(sharable::SetNode * set)
-{
- OSL_ASSERT(set != 0);
-
- m_aCollector.resetElementList();
-
- this->visitElements(set);
-
- return m_aCollector.getElementListAndClear();
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::ElementListBuilder::handle(sharable::TreeFragment * tree)
-{
- sharable::TreeFragment * aNewElement = CopyingDataTreeBuilder().buildTree(tree);
-
- m_aCollector.addElement(aNewElement);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl_uString * ConvertingDataTreeBuilder::allocName(INode const & _aNode)
-{
- rtl::OUString sNextName = _aNode.getName();
-
- if (m_sRootName.getLength())
- {
- sNextName = m_sRootName;
- m_sRootName = rtl::OUString();
- }
-
- return acquireString( sNextName);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::buildElement(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults)
-{
- m_sRootName = _aTypeName;
- m_bWithDefaults = _bWithDefaults;
-
- rtl_uString * aTreeName = acquireString( _aNode.getName());
- this->builder().resetTreeFragment(aTreeName, makeState(_aNode.getAttributes()));
-
-
- this->applyToNode(_aNode);
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults)
-{
- m_sRootName = rtl::OUString();
- m_bWithDefaults = _bWithDefaults;
-
- rtl_uString * aTreeName = acquireString( _aTreeName );
- this->builder().resetTreeFragment(aTreeName, makeState(_aNode.getAttributes()));
-
-
- this->applyToNode(_aNode);
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::handle(ISubtree const & _aNode)
-{
- rtl_uString * aNodeName = allocName( _aNode );
- sal_uInt8 aFlags = makeFlags(_aNode.getAttributes());
-
- if (_aNode.isSetNode())
- {
- sal_uInt8 * aTemplate = this->makeTemplateData(_aNode.getElementTemplateName(),
- _aNode.getElementTemplateModule());
-
- this->builder().addSet(aNodeName,aFlags,aTemplate);
-
- OSL_ASSERT( this->builder().lastNode().isSet() );
- sharable::SetNode& _aNewSet = this->builder().lastNode().set;
-
- _aNewSet.elements = ElementListBuilder().buildElementList(_aNode, m_bWithDefaults);
- }
- else
- {
- sal_uInt16 nGroupOffset = this->builder().startGroup(aNodeName,aFlags);
- this->applyToChildren(_aNode);
- this->builder().endGroup(nGroupOffset);
- }
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::handle(ValueNode const & _aNode)
-{
- rtl_uString * aNodeName = allocName( _aNode );
- sal_uInt8 aFlags = makeFlags(_aNode.getAttributes());
-
- sal_uInt8 aType = sharable::getTypeCode(_aNode.getValueType());
-
- sharable::AnyData aNewValue; aNewValue.data = 0;
- sharable::AnyData aNewDefault; aNewDefault.data = 0;
-
- OSL_ASSERT( !(aFlags & (Flags::valueAvailable | Flags::defaultAvailable)) );
-
- if (!_aNode.isDefault())
- {
- uno::Any aValue = _aNode.getValue();
- if (aValue.hasValue())
- {
- aNewValue = sharable::allocData(aType, aValue);
- aFlags |= Flags::valueAvailable;
- }
- }
-
- if (_aNode.hasUsableDefault())
- {
- uno::Any aDefault = _aNode.getDefault();
- if (aDefault.hasValue())
- {
- aNewDefault = sharable::allocData(aType, aDefault);
- aFlags |= Flags::defaultAvailable;
- }
- }
-
- this->builder().addValue(aNodeName,aFlags,aType,aNewValue,aNewDefault);
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 ConvertingDataTreeBuilder::makeState(node::Attributes const & _aAttributes)
-{
- sal_uInt8 state;
-
- switch (_aAttributes.state())
- {
- case node::isDefault: state = State::defaulted; m_bWithDefaults = true; break;
- case node::isMerged: state = State::merged; break;
- case node::isReplaced: state = State::replaced; m_bWithDefaults = false; break;
- case node::isAdded: state = State::added; m_bWithDefaults = false; break;
-
- default: OSL_ASSERT(false); state = 0; break;
- }
-
- if (_aAttributes.isReadonly())
- state |= State::flag_readonly;
- //Map mandatory and Removable
- if (_aAttributes.isMandatory())
- state |= State::flag_mandatory;
-
- if (_aAttributes.isRemovable())
- state |= State::flag_removable;
-
- if ( m_bWithDefaults )
- state |= State::flag_default_avail;
-
- return state;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 ConvertingDataTreeBuilder::makeFlags(node::Attributes const & _aAttributes)
-{
- sal_uInt8 flags = 0;
-
- if ( _aAttributes.isReadonly())
- flags |= Flags::readonly;
-
- if ( _aAttributes.isFinalized())
- flags |= Flags::finalized;
-
- if ( _aAttributes.isNullable())
- flags |= Flags::nullable;
-
- if ( _aAttributes.isLocalized())
- flags |= Flags::localized;
-
- if (_aAttributes.isDefault())
- flags |= Flags::defaulted; // somewhat redundant with State
-
- if (!_aAttributes.isReplacedForUser())
- flags |= Flags::defaultable; // redundant with State (merged || defaulted)
-
- return flags;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * ConvertingDataTreeBuilder::makeTemplateData(rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateModule)
-{
- return sharable::SetNode::allocTemplateData(_aTemplateName, _aTemplateModule );
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::ElementListBuilder::buildElementList(ISubtree const & _aSet, bool _bWithDefaults)
-{
- OSL_PRECOND(_aSet.isSetNode(), "Node must be a set");
-
- m_aCollector.resetElementList();
-
- m_sTypeName = _aSet.getElementTemplateName();
- m_bWithDefaults = _bWithDefaults;
-
- this->applyToChildren(_aSet);
-
- return m_aCollector.getElementListAndClear();
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handleNode(INode const & _aSourceNode)
-{
- sharable::TreeFragment * aNewElement = ConvertingDataTreeBuilder()
- .buildElement(_aSourceNode,m_sTypeName,m_bWithDefaults);
-
- m_aCollector.addElement(aNewElement);
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handle(ValueNode const & _aSourceNode)
-{
- handleNode(_aSourceNode);
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handle(ISubtree const & _aSourceNode)
-{
- handleNode(_aSourceNode);
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> ConvertingNodeBuilder::buildNode(sharable::TreeFragment * sourceTree, bool _bUseTreeName)
-{
- std::auto_ptr<INode> pResult = this->buildNode(sourceTree == 0 ? 0 : sourceTree->getRootNode());
- if (pResult.get() != NULL)
- {
- // use the element name !
- if (_bUseTreeName) pResult->setName( sourceTree->getName() );
-
- // do something about attributes here ?
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> ConvertingNodeBuilder::buildNode(sharable::Node * sourceNode)
-{
- OSL_ENSURE( !m_pNode.get(), "Old node tree will be dropped");
- visitNode(sourceNode);
- return m_pNode;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::buildNodeTree(sharable::GroupNode * groupNode) const
-{
- std::auto_ptr<ISubtree> pResult = convertNode(groupNode);
-
- if (pResult.get() != NULL)
- {
- ConvertingSubnodeBuilder aCollector(m_rNodeFactory, *pResult);
- aCollector.addChildren(groupNode);
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::buildNodeTree(sharable::SetNode * setNode) const
-{
- std::auto_ptr<ISubtree> pResult = convertNode(setNode);
-
- if (pResult.get() != NULL)
- {
- ConvertingSubnodeBuilder aCollector(m_rNodeFactory, *pResult);
- aCollector.addElements(setNode);
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::convertNode(sharable::GroupNode * groupNode) const
-{
- return m_rNodeFactory.createGroupNode( groupNode->info.getName(),
- convertAttributes(sharable::node(groupNode)));
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::convertNode(sharable::SetNode * setNode) const
-{
- return m_rNodeFactory.createSetNode(setNode->info.getName(),
- setNode->getElementTemplateName(),
- setNode->getElementTemplateModule(),
- convertAttributes(sharable::node(setNode)));
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ValueNode> ConvertingNodeBuilder::convertNode(sharable::ValueNode * valueNode) const
-{
- uno::Any aUserValue = valueNode->getUserValue();
- uno::Any aDefValue = valueNode->getDefaultValue();
-
- if (aUserValue.hasValue() || aDefValue.hasValue())
- {
- return m_rNodeFactory.createValueNode(valueNode->info.getName(),
- aUserValue, aDefValue,
- convertAttributes(sharable::node(valueNode)));
- }
- else
- {
- return m_rNodeFactory.createNullValueNode(valueNode->info.getName(),
- valueNode->getValueType(),
- convertAttributes(sharable::node(valueNode)));
- }
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::ValueNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::GroupNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::SetNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-bool ConvertingSubnodeBuilder::handle(sharable::TreeFragment * tree)
-{
- OSL_ASSERT(m_rParentNode.isSetNode());
- m_rParentNode.addChild(m_aSubnodeBuilder.buildNode(tree, true));
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingSubnodeBuilder::handle(sharable::Node * node)
-{
- OSL_ASSERT(!m_rParentNode.isSetNode());
- m_rParentNode.addChild(m_aSubnodeBuilder.buildNode(node));
- return false;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::mergeDefaults(sharable::TreeFragment * /*_aBaseAddress*/, INode const& /*_aDefaultNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::handle(ISubtree const & /*_aNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::handle(ValueNode const & /*_aNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * DataTreeCleanup::destroyTree(sharable::TreeFragment * _aBaseAddress)
-{
- sharable::TreeFragment *pData = _aBaseAddress;
-
- sharable::TreeFragment *pNext = pData->header.next;
-
- sal_uInt16 const nCount = pData->header.count;
-
- destroyData( & pData->header );
-
- for (sal_uInt16 i = 0; i< nCount; ++i)
- {
- destroyNode( addressOfNodeAt(_aBaseAddress,i) );
- }
-
- sharable::TreeFragment::free_shallow( pData );
-
- return (sharable::TreeFragment *)( pNext );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyNode(sharable::Node * _aNodeAddress)
-{
- sharable::Node * pNode = _aNodeAddress;
-
- sal_uInt8 aTypeTag = pNode->info.type;
- switch ( aTypeTag & Type::mask_nodetype )
- {
- case Type::nodetype_group:
- destroyData( &pNode->group );
- break;
- case Type::nodetype_value:
- destroyData( &pNode->value );
- break;
- case Type::nodetype_set:
- destroyData( &pNode->set );
- break;
- default:
- OSL_ENSURE(false, "Cannot destroy node: Invalid type tag in node");
- break;
- }
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::TreeFragmentHeader * _pHeader)
-{
- // 'component' is owned elsewhere -> leave alone
-
- rtl_uString * aName = _pHeader->name;
-
- rtl_uString_release( aName );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::NodeInfo * _pNodeInfo)
-{
- rtl_uString * aName = _pNodeInfo->name;
-
- if (aName) rtl_uString_release( aName );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::SetNode * _pNode)
-{
- sharable::TreeFragment * aElement( _pNode->elements );
-
- sal_uInt8 * aTemplate = _pNode->elementType;;
-
- destroyData(&_pNode->info);
-
- while (aElement != NULL)
- aElement = destroyTree(aElement);
-
- sharable::SetNode::releaseTemplateData( aTemplate );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::GroupNode * _pNode)
-{
- destroyData(&_pNode->info);
- // nothing more to do
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::ValueNode * _pNode)
-{
- sal_uInt8 aValueType = sal_uInt8( _pNode->info.type & Type::mask_valuetype );
- sal_uInt8 aFlags = _pNode->info.flags;
-
- destroyData(&_pNode->info);
-
- if (aFlags & Flags::valueAvailable)
- freeData( aValueType, _pNode->value );
-
- if (aFlags & Flags::defaultAvailable)
- freeData( aValueType, _pNode->defaultValue );
-
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/changes.cxx b/configmgr/source/tree/changes.cxx
deleted file mode 100644
index 96e3375c99d6..000000000000
--- a/configmgr/source/tree/changes.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include <stdio.h>
-
-#include "change.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-
-//==========================================================================
-//= ValueChange
-//==========================================================================
-
-// works reliably only if old value is set and the value really changes
-uno::Type implGetValueType(uno::Any const & _aValue, uno::Any const & _aOldValue)
-{
- if (_aValue.hasValue())
- {
- OSL_ENSURE(!_aOldValue.hasValue() || _aOldValue.getValueType() == _aValue.getValueType(),
- "ERROR: Type mismatch in value change");
-
- return _aValue.getValueType();
- }
- else
- {
- OSL_ENSURE(_aOldValue.hasValue(),"WARNING: Cannot determine value type of change");
- return _aOldValue.getValueType();
- }
-}
-// -------------------------------------------------------------------------
-static inline bool isDefaultMode(ValueChange::Mode _eMode)
-{ return (_eMode == ValueChange::setToDefault) || (_eMode == ValueChange::changeDefault); }
-// -------------------------------------------------------------------------
-static inline bool isLayerChangeMode(ValueChange::Mode _eMode)
-{ return (_eMode == ValueChange::setToDefault) || (_eMode == ValueChange::wasDefault); }
-// -----------------------------------------------------------------------------
-ValueChange::ValueChange(rtl::OUString const& _rName,
- const node::Attributes& _rAttributes,
- Mode _eMode,
- uno::Any const & aNewValue, uno::Any const & aOldValue)
- : Change(_rName, isDefaultMode(_eMode))
- ,m_aValueType( implGetValueType(aNewValue,aOldValue) )
- ,m_aValue(aNewValue)
- ,m_aOldValue(aOldValue)
- ,m_aAttributes(_rAttributes)
- ,m_eMode(_eMode)
-{
- m_aAttributes.markAsDefault(Change::isToDefault());
-}
-
-// -----------------------------------------------------------------------------
-void ValueChange::setNewValue(const uno::Any& _rNewVal)
-{
- OSL_ENSURE(_rNewVal.getValueType() == m_aValueType || !_rNewVal.hasValue(),
- "ValueChange: Type mismatch in setNewValue" );
-
- m_aValue = _rNewVal;
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> ValueChange::clone() const
-{
- return std::auto_ptr<Change>(new ValueChange(*this));
-}
-
-// -----------------------------------------------------------------------------
-bool ValueChange::isChange() const // makes sense only if old value is set
-{
- return isLayerChangeMode(m_eMode) || (m_aOldValue != m_aValue);
-}
-// -------------------------------------------------------------------------
-namespace tree_changes_internal {
- inline void doAdjust(uno::Any& aActual, uno::Any const& aTarget)
- {
- // If set - it should already match
- OSL_ASSERT(!aActual.hasValue() || aTarget == aActual);
- aActual = aTarget;
- }
-}
-
-// -------------------------------------------------------------------------
-void ValueChange::applyChangeNoRecover(ValueNode& aValue) const
-{
- switch (getMode())
- {
- case wasDefault:
- OSL_ASSERT(aValue.isDefault());
- case changeValue:
- aValue.setValue(getNewValue());
- break;
-
- case setToDefault:
- aValue.setDefault();
- break;
-
- case changeDefault:
- aValue.changeDefault(getNewValue());
- break;
-
- default:
- OSL_ENSURE(0, "Unknown mode found for ValueChange");
- break;
- }
-}
-
-//==========================================================================
-//= AddNode
-//==========================================================================
-AddNode::AddNode(rtl::Reference< data::TreeSegment > const & _aAddedTree, rtl::OUString const& _rName, bool _bToDefault)
- :Change(_rName,_bToDefault)
- ,m_aOwnNewNode(_aAddedTree)
- ,m_aOwnOldNode()
- ,m_aInsertedTree(NULL)
- ,m_bReplacing(false)
-{
-}
-
-//--------------------------------------------------------------------------
-AddNode::~AddNode()
-{
-}
-
-// -----------------------------------------------------------------------------
-AddNode::AddNode(const AddNode& _aObj)
-: Change(_aObj)
-, m_aOwnNewNode(data::TreeSegment::create(_aObj.m_aOwnNewNode))
-, m_aOwnOldNode(data::TreeSegment::create(_aObj.m_aOwnOldNode))
-, m_aInsertedTree(_aObj.m_aInsertedTree)
-, m_bReplacing(_aObj.m_bReplacing)
-{
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> AddNode::clone() const
-{
- return std::auto_ptr<Change>(new AddNode(*this));
-}
-
-//--------------------------------------------------------------------------
-void AddNode::setInsertedAddress(sharable::TreeFragment * const & _aInsertedTree)
-{
- OSL_ENSURE( m_aInsertedTree == NULL, "AddNode already was applied - inserted a second time ?");
- m_aInsertedTree = _aInsertedTree;
-}
-//--------------------------------------------------------------------------
-
-#if 0
-void AddNode::expectReplacedNode(INode const* pOldNode)
-{
- if (pOldNode != m_aOwnOldNode.getRoot())
- {
- OSL_ENSURE(!m_aOwnOldNode.is(), "This AddNode already owns a replaced Node - throwing that away");
- m_aOwnOldNode.clear();
- }
- m_pOldNode = pOldNode;
-}
-#endif
-//--------------------------------------------------------------------------
-
-void AddNode::takeReplacedTree(rtl::Reference< data::TreeSegment > const & _aReplacedTree)
-{
- m_aOwnOldNode = _aReplacedTree;
-
- if (m_aOwnOldNode.is()) m_bReplacing = true;
-}
-
-
-//==========================================================================
-//= RemoveNode
-//==========================================================================
-RemoveNode::RemoveNode(rtl::OUString const& _rName, bool _bToDefault)
- :Change(_rName,_bToDefault)
- ,m_aOwnOldNode()
-{
-}
-
-//--------------------------------------------------------------------------
-RemoveNode::~RemoveNode()
-{
-}
-// -----------------------------------------------------------------------------
-RemoveNode::RemoveNode(const RemoveNode& _aObj)
-: Change(_aObj)
-, m_aOwnOldNode(data::TreeSegment::create(_aObj.m_aOwnOldNode))
-{
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> RemoveNode::clone() const
-{
- return std::auto_ptr<Change>(new RemoveNode(*this));
-}
-//--------------------------------------------------------------------------
-#if 0
-void RemoveNode::expectRemovedNode(INode const* pOldNode)
-{
- if (pOldNode != m_aOwnOldNode.getRoot())
- {
- OSL_ENSURE(!m_aOwnOldNode.is(), "This RemoveNode already owns a Node - throwing that away");
- m_aOwnOldNode.clear();
- }
- m_pOldNode = pOldNode;
-}
-#endif
-//--------------------------------------------------------------------------
-
-void RemoveNode::takeRemovedTree(rtl::Reference< data::TreeSegment > const & _aRemovedTree)
-{
- m_aOwnOldNode = _aRemovedTree;
-}
-
-//--------------------------------------------------------------------------
-} // namespace configmgr
-
diff --git a/configmgr/source/tree/cmtree.cxx b/configmgr/source/tree/cmtree.cxx
deleted file mode 100644
index a7b4fa520f23..000000000000
--- a/configmgr/source/tree/cmtree.cxx
+++ /dev/null
@@ -1,378 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "subtree.hxx"
-#include "change.hxx"
-#include "treechangelist.hxx"
-
-//#include "treeactions.hxx"
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_DEQUE
-#include <deque>
-#define INCLUDED_DEQUE
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#ifndef INCLUDED_EXCEPTION
-#include <exception>
-#define INCLUDED_EXCEPTION
-#endif
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#include <algorithm>
-
-namespace configmgr
-{
-
-// ------------------------ ChildListSet implementations ------------------------
- ChildListSet::ChildListSet(ChildListSet const& aSet, treeop::DeepChildCopy)
- : m_aChildList(aSet.m_aChildList.size())
- {
- for (size_t i = 0; i < aSet.m_aChildList.size(); i++)
- {
- m_aChildList[i] = aSet.m_aChildList[i]->clone().release();
- }
- }
- ChildListSet::~ChildListSet()
- {
- for (size_t i = 0; i < m_aChildList.size(); i++)
- delete m_aChildList[i];
- }
-
- struct ltNode
- {
- ltNode() {}
-
- bool operator()(const configmgr::INode* n1, const configmgr::INode* n2) const
- {
- return n1->getName().compareTo(n2->getName()) < 0;
- }
- };
-
- std::vector< INode* >::iterator ChildListSet::find(INode *pNode) const
- {
- std::vector< INode* > &rList = const_cast<std::vector< INode* > &>(m_aChildList);
- std::pair<std::vector< INode* >::iterator, std::vector< INode* >::iterator> aRange;
- ltNode aCompare;
- aRange = std::equal_range(rList.begin(), rList.end(), pNode, aCompare);
- if (aRange.second - aRange.first == 0)
- return rList.end();
- else
- return aRange.first;
- }
-
- // Keep the list sorted ...
- std::pair<std::vector< INode* >::iterator, bool> ChildListSet::insert(INode *pNode)
- {
- // Inserted records are (mostly) already in order
- if (m_aChildList.size() > 0)
- {
- sal_Int32 nCmp = pNode->getName().compareTo(
- m_aChildList.back()->getName());
- if (nCmp == 0)
- {
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.end(), false);
- }
- else if (nCmp < 0)
- {
- std::vector< INode* >::iterator aIns;
- ltNode aCompare;
- aIns = std::lower_bound(m_aChildList.begin(), m_aChildList.end(), pNode, aCompare);
- if (aIns != m_aChildList.end() && pNode->getName().compareTo((*aIns)->getName()) == 0)
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.end(), false);
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.insert(aIns, pNode), true);
- }
- }
- // simple append - the common case.
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.insert(m_aChildList.end(), pNode), true);
- }
-
- INode *ChildListSet::erase(INode *pNode)
- {
- std::vector< INode* >::iterator aIter = find(pNode);
-
- if (aIter != m_aChildList.end())
- {
- INode *pCopy = *aIter;
- m_aChildList.erase(aIter);
- return pCopy;
- }
- else
- return NULL;
- }
-
-// ---------------------------- Node implementation ----------------------------
-
- INode::INode(rtl::OUString const& aName, node::Attributes _aAttr)
- :m_aName(aName)
- ,m_aAttributes(_aAttr){}
- // CopyCTor will be create automatically
-
- INode::~INode() {}
-
- ISubtree* INode::asISubtree(){return NULL;}
- ISubtree const* INode::asISubtree() const {return NULL;}
- ValueNode* INode::asValueNode() {return NULL;}
- ValueNode const* INode::asValueNode() const {return NULL;}
-
- void INode::modifyState(node::State _eNewState)
- {
- m_aAttributes.setState(_eNewState);
- }
-
- void INode::modifyAccess(node::Access _aAccessLevel)
- {
- OSL_ENSURE( node::accessWritable <= _aAccessLevel && _aAccessLevel <= node::accessReadonly,"Invalid access level for Node");
-
- m_aAttributes.setAccess(_aAccessLevel);
- }
-
- void INode::markMandatory()
- {
- m_aAttributes.markMandatory();
- }
-
- void INode::markRemovable()
- {
- m_aAttributes.markRemovable();
- }
-
- void INode::promoteAccessToDefault()
- {
- if (m_aAttributes.isFinalized())
- m_aAttributes.setAccess(node::accessReadonly);
-
- if ( m_aAttributes.isMandatory())
- m_aAttributes.setRemovability(false,false);
- }
-
-// ------------------------- SearchNode implementation -------------------------
- SearchNode::SearchNode(rtl::OUString const& aName)
- :INode(aName, node::Attributes()){}
-
- std::auto_ptr<INode> SearchNode::clone() const {return std::auto_ptr<INode>(new SearchNode(*this));}
-
- SearchNode::~SearchNode(){}
-
- //==========================================================================
- //= OPropagateLevels
- //==========================================================================
- /** fills a subtree with the correct level informations
- */
- struct OPropagateLevels : public NodeModification
- {
- public:
- OPropagateLevels(sal_Int16 _nParentLevel, sal_Int16 _nParentDefaultLevel)
- : m_nLevel ( childLevel(_nParentLevel) )
- , m_nDefaultLevel ( childLevel(_nParentDefaultLevel) )
- {
- }
- virtual void handle(ValueNode&) { /* not interested in value nodes */ }
- virtual void handle(ISubtree& _rSubtree)
- {
- _rSubtree.setLevels(m_nLevel, m_nDefaultLevel);
- }
-
- static sal_Int16 childLevel(sal_Int16 _nLevel)
- {
- OSL_ASSERT(0 > treeop::ALL_LEVELS);
- return (_nLevel > 0) ? _nLevel-1 : _nLevel;
- }
- protected:
- sal_Int16 m_nLevel;
- sal_Int16 m_nDefaultLevel;
- };
-
-
-// -------------------------- ISubtree implementation --------------------------
- ISubtree* ISubtree::asISubtree() {return this;}
- ISubtree const* ISubtree::asISubtree() const {return this;}
-
- //--------------------------------------------------------------------------
- static inline bool adjustLevel(sal_Int16& _rLevel, sal_Int16 _nNewLevel)
- {
- if (_rLevel == treeop::ALL_LEVELS) return false;
- if (_nNewLevel <= _rLevel &&
- _nNewLevel != treeop::ALL_LEVELS) return false;
-
- _rLevel = _nNewLevel;
- return true;
- }
-
- //--------------------------------------------------------------------------
- void ISubtree::setLevels(sal_Int16 _nLevel, sal_Int16 _nDefaultLevels)
- {
- bool bActive = false;
-
- if (_nLevel && adjustLevel(m_nLevel, _nLevel))
- bActive = true;
-
- if (_nDefaultLevels && adjustLevel(m_nDefaultLevels, _nDefaultLevels))
- bActive = true;
-
- // forward the level numbers to any child subtrees we have
- if (bActive)
- {
- OPropagateLevels aPropagate(_nLevel,_nDefaultLevels);
- aPropagate.applyToChildren(*this);
- }
- }
-
-// --------------------------- Subtree implementation ---------------------------
- std::auto_ptr<INode> Subtree::clone() const
- {
- return std::auto_ptr<INode>(new Subtree(*this, treeop::DeepChildCopy()));
- }
-
- INode* Subtree::doGetChild(rtl::OUString const& aName) const
- {
- SearchNode searchObj(aName);
-
- std::vector< INode* >::iterator aIter = m_aChildren.find(&searchObj);
- return aIter != m_aChildren.end() ? *aIter : NULL;
- }
-
- INode* Subtree::addChild(std::auto_ptr<INode> aNode) // takes ownership
- {
- rtl::OUString aName = aNode->getName();
- std::pair<std::vector< INode* >::iterator, bool> aInserted =
- m_aChildren.insert(aNode.get());
- if (aInserted.second)
- aNode.release();
- return *aInserted.first;
- }
-
- ::std::auto_ptr<INode> Subtree::removeChild(rtl::OUString const& aName)
- {
- SearchNode searchObj(aName);
- return ::std::auto_ptr<INode>(m_aChildren.erase(&searchObj));
- }
-// // -------------------------- ValueNode implementation --------------------------
-
- void Subtree::forEachChild(NodeAction& anAction) const
- {
- for(std::vector< INode* >::const_iterator it = m_aChildren.begin();
- it != m_aChildren.end();
- ++it)
- (**it).dispatch(anAction);
- }
-
- void Subtree::forEachChild(NodeModification& anAction)
- {
- std::vector< INode* >::iterator it = m_aChildren.begin();
- while( it != m_aChildren.end() )
- {
- // modification-safe iteration
- (**it++).dispatch(anAction);
- }
- }
-
-// // -------------------------- ValueNode implementation --------------------------
- bool ValueNode::setValueType(uno::Type const& _aType)
- {
- if (_aType == this->getValueType()) return true;
-
- if (!this->isNull()) return false;
-
- uno::TypeClass eTC = this->getValueType().getTypeClass();
- if (eTC != uno::TypeClass_VOID && eTC != uno::TypeClass_ANY)
- return false;
-
- m_aValuePair = AnyPair(_aType);
-
- OSL_ASSERT(_aType == this->getValueType());
-
- return true;
- }
- bool ValueNode::setValue(com::sun::star::uno::Any const& _aValue)
- {
- sal_Bool bRet = m_aValuePair.setFirst(_aValue);
- if (bRet) this->markAsDefault(false);
- return !! bRet;
- }
-
- bool ValueNode::changeDefault(com::sun::star::uno::Any const& _aValue)
- {
- return !! m_aValuePair.setSecond(_aValue);
- }
-
- void ValueNode::setDefault()
- {
- OSL_PRECOND( hasUsableDefault(), "No default value to set for value node");
- m_aValuePair.clear( selectValue() );
- this->markAsDefault();
- OSL_POSTCOND( isDefault(), "Could not set value node to default");
- }
-
- void ValueNode::promoteToDefault()
- {
- if (!isDefault())
- {
- if (m_aValuePair.hasFirst())
- {
- OSL_VERIFY( m_aValuePair.setSecond(m_aValuePair.getFirst()) );
- m_aValuePair.clear( selectValue() );
- }
- else
- {
- m_aValuePair.clear( selectDeflt() );
- OSL_ASSERT( m_aValuePair.isNull() );
- }
-
- this->markAsDefault();
-
- OSL_ENSURE( !m_aValuePair.hasFirst(), "Leaving orphaned value in after promoting to default");
- }
- else
- OSL_ENSURE( !m_aValuePair.hasFirst(), "Orphaned value in default node won't be promoted");
-
- OSL_POSTCOND( isDefault(), "Could not promote value node to default");
- }
-
- std::auto_ptr<INode> ValueNode::clone() const
- {
- return std::auto_ptr<INode>(new ValueNode(*this));
- }
-
- ValueNode* ValueNode::asValueNode() {return this;}
- ValueNode const* ValueNode::asValueNode() const {return this;}
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/cmtreemodel.cxx b/configmgr/source/tree/cmtreemodel.cxx
deleted file mode 100644
index 685e18c352ea..000000000000
--- a/configmgr/source/tree/cmtreemodel.cxx
+++ /dev/null
@@ -1,371 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "configexcept.hxx"
-#include "strdecl.hxx"
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_ALGORITHM
-#define INCLUDED_ALGORITHM
-#include <algorithm>
-#endif
-
-//..........................................................................
-namespace configmgr
-{
-//==========================================================================
-
-bool isLocalizedValueSet(ISubtree const& _aSubtree)
-{
- if ( !_aSubtree.isSetNode()) return false;
- if ( !_aSubtree.isLocalized()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_LOCALIZED_VALUE) ) return false;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool isLocalizedValueSet(SubtreeChange const& _aSubtree)
-{
- if ( !_aSubtree.isSetNodeChange()) return false;
- if ( !_aSubtree.isLocalizedContainer()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_LOCALIZED_VALUE) ) return false;
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-bool isValueSet(SubtreeChange const& _aSubtree)
-{
- if ( !_aSubtree.isSetNodeChange()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_NATIVE_VALUE) ) return false;
- return true;
-}
-//==========================================================================
-
-//==========================================================================
-//= Change
-//==========================================================================
-void Change::swap(Change& aOther)
-{
- std::swap(m_aName, aOther.m_aName);
- std::swap(m_bIsToDefault, aOther.m_bIsToDefault);
-}
-
-//==========================================================================
-//= SubtreeChange
-//==========================================================================
-//--------------------------------------------------------------------------
-void SubtreeChange::swap(SubtreeChange& aOther)
-{
- Change::swap(aOther);
- m_aChanges.swap(aOther.m_aChanges);
- std::swap(m_sTemplateName, aOther.m_sTemplateName);
- std::swap(m_sTemplateModule, aOther.m_sTemplateModule);
- std::swap(m_aAttributes, aOther.m_aAttributes);
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::~SubtreeChange()
-{
- for(Children::iterator aIter = m_aChanges.begin();
- aIter != m_aChanges.end();
- ++aIter)
- {
- // Change* pChange = aIter->second;
- delete aIter->second;
- }
-}
-
-// -----------------------------------------------------------------------------
-SubtreeChange::SubtreeChange(const SubtreeChange& _aObj, treeop::DeepChildCopy)
- :Change(_aObj),
- m_sTemplateName(_aObj.m_sTemplateName),
- m_sTemplateModule(_aObj.m_sTemplateModule),
- m_aAttributes(_aObj.m_aAttributes)
-{
- for(Children::const_iterator aIter = _aObj.m_aChanges.begin();
- aIter != _aObj.m_aChanges.end();
- ++aIter)
- {
- OSL_ASSERT(aIter->second);
- Children::value_type aCopy(aIter->first, aIter->second->clone().release());
- m_aChanges.insert(m_aChanges.end(), aCopy);
- }
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> SubtreeChange::clone() const
-{
- return std::auto_ptr<Change>(new SubtreeChange(*this, treeop::DeepChildCopy()));
-}
-//--------------------------------------------------------------------------
-void SubtreeChange::addChange(std::auto_ptr<Change> aChange)
-{
- rtl::OUString aNodeName(aChange->getNodeName());
- m_aChanges.find(aNodeName);
- OSL_ENSURE(m_aChanges.end() == m_aChanges.find(aNodeName),
- "SubtreeChange::addChange : overwriting an existent change !");
- delete m_aChanges[aNodeName];
- m_aChanges[aNodeName] = aChange.release();
-}
-
-//--------------------------------------------------------------------------
-::std::auto_ptr<Change> SubtreeChange::removeChange(rtl::OUString const& _rName)
-{
- Children::iterator aIter = m_aChanges.find(_rName);
-
- ::std::auto_ptr<Change> aReturn;
- if (m_aChanges.end() != aIter)
- {
- aReturn = ::std::auto_ptr<Change>(aIter->second);
- m_aChanges.erase(aIter);
- }
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-Change* SubtreeChange::getChange(rtl::OUString const& _rName)
-{
- return doGetChild(_rName);
-}
-
-//--------------------------------------------------------------------------
-Change const* SubtreeChange::getChange(rtl::OUString const& _rName) const
-{
- return doGetChild(_rName);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::dispatch(ChangeTreeAction& _anAction) const
-{
- _anAction.handle(*this);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::dispatch(ChangeTreeModification& _anAction)
-{
- _anAction.handle(*this);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::forEachChange(ChangeTreeAction& _anAction) const
-{
- ::std::map< ::rtl::OUString,Change* >::const_iterator aIter = m_aChanges.begin();
- while (aIter != m_aChanges.end())
- {
- (aIter++)->second->dispatch(_anAction);
- }
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::forEachChange(ChangeTreeModification& _anAction)
-{
- ::std::map< ::rtl::OUString,Change* >::const_iterator aIter = m_aChanges.begin();
- while (aIter != m_aChanges.end())
- {
- (aIter++)->second->dispatch(_anAction);
- }
-}
-
-//--------------------------------------------------------------------------
-Change* SubtreeChange::doGetChild(rtl::OUString const& _rName) const
-{
- Children::const_iterator aIter = m_aChanges.find(_rName);
- return (aIter != m_aChanges.end()) ? aIter->second : NULL;
-}
-
-//--------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SubtreeChange::elementNames() const
-{
- uno::Sequence< rtl::OUString > aReturn(size());
- rtl::OUString* pReturn = aReturn.getArray();
-
- for ( Children::const_iterator aCollector = m_aChanges.begin();
- aCollector != m_aChanges.end();
- ++aCollector, ++pReturn
- )
- {
- *pReturn = aCollector->first;
- }
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::MutatingChildIterator SubtreeChange::begin_changes() throw()
-{
- return MutatingChildIterator(m_aChanges.begin());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::MutatingChildIterator SubtreeChange::end_changes() throw()
-{
- return MutatingChildIterator(m_aChanges.end());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator SubtreeChange::begin() const throw()
-{
- return ChildIterator(this);
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator SubtreeChange::end() const throw()
-{
- return ChildIterator(this, ChildIterator::EndPos());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator::ChildIterator(const SubtreeChange* _pTree)
- :m_aNames(_pTree->elementNames())
- ,m_pTree(_pTree)
- ,m_nPos(0)
-{
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator::ChildIterator(const SubtreeChange* _pTree, struct EndPos)
- :m_aNames(_pTree->elementNames())
- ,m_pTree(_pTree)
- ,m_nPos(_pTree->size())
-{
-}
-
-//--------------------------------------------------------------------------
-Change const & SubtreeChange::ChildIterator::operator*() const
-{
- OSL_ENSURE(isValid(), "SubtreeChange::ChildIterator::operator* : invalid iterator !");
-
- if (!isValid())
- throw configuration::Exception("INTERNAL ERROR: Invalid SubtreeChange::ChildIterator dereferenced");
-
- return *m_pTree->getChange(m_aNames[m_nPos]);
-}
-
-//--------------------------------------------------------------------------
-Change const * SubtreeChange::ChildIterator::operator->() const
-{
- if (isValid())
- return m_pTree->getChange(m_aNames[m_nPos]);
- OSL_ENSURE(sal_False, "SubtreeChange::ChildIterator::operator-> : invalid iterator !");
- return NULL;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator& SubtreeChange::ChildIterator::operator++()
-{
- OSL_ENSURE(m_nPos < m_aNames.getLength(), "SubtreeChange::ChildIterator : can't increment the end iterator !");
- if (m_nPos < m_aNames.getLength())
- ++m_nPos;
- return *this;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator& SubtreeChange::ChildIterator::operator--()
-{
- OSL_ENSURE(m_nPos > 0, "SubtreeChange::ChildIterator : can't decrement the begin iterator !");
- if (m_nPos > 0)
- --m_nPos;
- return *this;
-}
-
-//--------------------------------------------------------------------------
-bool operator==(SubtreeChange::ChildIterator const& lhs, SubtreeChange::ChildIterator const& rhs)
-{
- return (lhs.m_pTree == rhs.m_pTree) && (lhs.m_nPos == rhs.m_nPos);
-}
-
-//==========================================================================
-//= SubtreeChangeReferrer
-//==========================================================================
-//--------------------------------------------------------------------------
-SubtreeChangeReferrer::SubtreeChangeReferrer(const SubtreeChange& _rSource)
- :SubtreeChange(_rSource, treeop::NoChildCopy())
-{
- ChildIterator aSourceChildren = _rSource.begin();
- while (aSourceChildren != _rSource.end())
- {
- const Change* pChange = &*aSourceChildren;
- OSL_ENSURE(pChange, "SubtreeChangeReferrer::SubtreeChangeReferrer : invalid change !");
- if (dynamic_cast< ValueChange const * >(pChange) != 0 ||
- dynamic_cast< RemoveNode const * >(pChange) != 0 ||
- dynamic_cast< AddNode const * >(pChange) != 0)
- SubtreeChange::addChange(::std::auto_ptr<Change>(const_cast<Change*>(pChange)));
- else if (dynamic_cast< SubtreeChange const * >(pChange) != 0 ||
- dynamic_cast< SubtreeChangeReferrer const * >(pChange) != 0)
- {
- SubtreeChange::addChange(::std::auto_ptr<Change>(new SubtreeChangeReferrer(*static_cast<const SubtreeChange*>(pChange))));
- }
- else
- OSL_ENSURE(sal_False, "SubtreeChangeReferrer::SubtreeChangeReferrer : unknown changes type !");
-
- ++aSourceChildren;
- }
-}
-
-//--------------------------------------------------------------------------
-SubtreeChangeReferrer::~SubtreeChangeReferrer()
-{
- for ( Children::iterator aChildren = m_aChanges.begin();
- aChildren != m_aChanges.end();
-
- )
- {
- const Change* pChange = aChildren->second;
- Children::iterator aCurrent = aChildren++;
-
- if (dynamic_cast< ValueChange const * >(pChange) != 0 ||
- dynamic_cast< RemoveNode const * >(pChange) != 0 ||
- dynamic_cast< AddNode const * >(pChange) != 0)
- {
- // we just hold references to the non-SubtreeChange-objects, so don't delete them
- m_aChanges.erase(aCurrent);
- }
- else if (dynamic_cast< SubtreeChange const * >(pChange) != 0 ||
- dynamic_cast< SubtreeChangeReferrer const * >(pChange) != 0)
- {
- // nothing to do
- }
- else
- OSL_ENSURE(sal_False, "SubtreeChangeReferrer::~SubtreeChangeReferrer : unknown changes type !");
- }
-
- // the base class will remove the remaining SubtreeChanges, which are SubtreeChangeReferrer's in real
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/localizedtreeactions.cxx b/configmgr/source/tree/localizedtreeactions.cxx
deleted file mode 100644
index 110e1d0efb98..000000000000
--- a/configmgr/source/tree/localizedtreeactions.cxx
+++ /dev/null
@@ -1,543 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "localizedtreeactions.hxx"
-#include "treeactions.hxx"
-#include "builddata.hxx"
-#include "subtree.hxx"
-#include "matchlocale.hxx"
-#include "typeconverter.hxx"
-#include "change.hxx"
-#include "treechangefactory.hxx"
-#include "treenodefactory.hxx"
-#include "strdecl.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------
-namespace
-{
-//--------------------------------------------------------------------------
- //==========================================================================
- //= OCloneForLocale
- //==========================================================================
- //= clones a subtree , in the process selecting only the best match locale
- //= from the set representation of localized values
- //==========================================================================
- class OCloneForLocale : public NodeAction
- {
- rtl::OUString m_sTargetLocale;
- std::auto_ptr<INode> m_pClone;
- public:
- OCloneForLocale(rtl::OUString const& aLocale) : m_sTargetLocale(aLocale) {}
- std::auto_ptr<INode> getResult() { return m_pClone; }
-
- private:
- void handle(ValueNode const& _aValue);
- void handle(ISubtree const& _aSubtree);
- };
-//--------------------------------------------------------------------------
- struct OCloneChildrenForLocale : NodeAction
- {
- ISubtree& m_rParent;
- localehelper::FindBestLocale& m_rLocaleMatcher;
- public:
- OCloneChildrenForLocale(ISubtree& _rParent, localehelper::FindBestLocale& _rLocaleMatcher)
- : m_rParent(_rParent)
- , m_rLocaleMatcher(_rLocaleMatcher)
- {}
-
- virtual void handle(ValueNode const& _aValue);
- virtual void handle(ISubtree const& _aSubtree);
- };
-
-//--------------------------------------------------------------------------
- struct OSelectForLocale : NodeAction
- {
- ValueNode const* m_pFound;
- localehelper::FindBestLocale& m_rLocaleMatcher;
- public:
- OSelectForLocale(localehelper::FindBestLocale& _rLocaleMatcher)
- : m_pFound(NULL)
- , m_rLocaleMatcher(_rLocaleMatcher)
- {}
-
-
- bool hasResult() const
- { return m_pFound != NULL; }
-
- ValueNode const* getResult() const
- { return m_pFound; }
-
- private:
- virtual void handle(ValueNode const& _aValue);
- virtual void handle(ISubtree const& _aSubtree);
-
- void maybeSelect(ValueNode const& _aNode);
- };
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
- void OSelectForLocale::handle(ValueNode const& _aValue)
- {
- maybeSelect(_aValue);
- }
-//--------------------------------------------------------------------------
- void OSelectForLocale::handle(ISubtree const& /*_aSubtree*/)
- {
- OSL_ENSURE(false, "INTERNAL ERROR: Inconsistent data: Found a Subtree in a set of localized values");
- }
-//--------------------------------------------------------------------------
- void OSelectForLocale::maybeSelect(ValueNode const& _aNode)
- {
- if (m_rLocaleMatcher.accept( localehelper::makeLocale(_aNode.getName()) ) )
- m_pFound = &_aNode;
-
- else
- OSL_ENSURE(m_pFound, "WARNING: Node Locale wasn't accepted, but no node had been found before");
- }
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
- std::auto_ptr< INode > implReduceLocalizedSet(ISubtree const& _aSubtree, localehelper::FindBestLocale& _rLocaleMatcher)
- {
- // -- find the best-match locale -----------------------------
- _rLocaleMatcher.reset();
-
- OSelectForLocale aSelector(_rLocaleMatcher);
-
- aSelector.applyToChildren(_aSubtree);
-
- std::auto_ptr< INode > pResult;
-
- // -- look for a non-NULL value -----------------------------
- uno::Type aValueType;
- if (aSelector.hasResult())
- {
- ValueNode const& rSelected = *aSelector.getResult();
-
- aValueType = rSelected.getValueType();
-
- if (!rSelected.isNull()) // values are present - clone it from the values
- {
- pResult.reset ( new ValueNode( _aSubtree.getName(),
- rSelected.getValue(), rSelected.getDefault(),
- _aSubtree.getAttributes()
- ) );
-
- }
- }
- else // no entry - exract the type to be used from the template name
- aValueType = parseTemplateName(_aSubtree.getElementTemplateName());
-
- // -- create NULL value, if none was found -----------------------------
- // create a NULL of the found type
- if (pResult.get() == NULL)
- {
- pResult.reset( new ValueNode( _aSubtree.getName(),
- aValueType,
- _aSubtree.getAttributes()
- ) );
- }
-
- // -- -----------------------------
- OSL_ENSURE( aValueType != uno::Type(), "VOID result type found");
-#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" );
-
- return pResult;
- }
-//--------------------------------------------------------------------------
- std::auto_ptr< INode > implCloneForLocale(ISubtree const& _aSubtree, localehelper::FindBestLocale& _rLocaleMatcher)
- {
- std::auto_ptr< INode > pClone;
-
- if (isLocalizedValueSet(_aSubtree))
- {
- pClone = implReduceLocalizedSet(_aSubtree, _rLocaleMatcher);
- }
- else
- {
- // ISubtree should get a clone(NoChildCopy) member ...
- std::auto_ptr< Subtree > pCloneTree( new Subtree(_aSubtree, treeop::NoChildCopy()) );
-
- OCloneChildrenForLocale aSubCloner(*pCloneTree,_rLocaleMatcher);
-
- aSubCloner.applyToChildren(_aSubtree);
-
- pClone.reset( pCloneTree.release() );
- }
-
- return pClone;
- }
-//--------------------------------------------------------------------------
-//--- OCloneChildrenForLocale:-----------------------------------------------------------------------
-
- void OCloneChildrenForLocale::handle(ValueNode const& _aValue)
- {
- // just a single value - nothing to do
- std::auto_ptr< INode > pClone( _aValue.clone() );
-
- m_rParent.addChild(pClone);
-
- }
-//--------------------------------------------------------------------------
- void OCloneChildrenForLocale::handle(ISubtree const& _aSubtree)
- {
- std::auto_ptr< INode > pClone = implCloneForLocale(_aSubtree,m_rLocaleMatcher);
-
- m_rParent.addChild(pClone);
- }
-
- //--------------------------------------------------------------------------
- //= OCloneForLocale
-
- // rtl::OUString m_sTargetLocale;
- // std::auto_ptr<INode> m_pClone;
-
- void OCloneForLocale::handle(ValueNode const& _aValue)
- {
- // just a single value - nothing to do
- std::auto_ptr< INode > pClone( _aValue.clone() );
-
- m_pClone = pClone;
- }
- //--------------------------------------------------------------------------
- void OCloneForLocale::handle(ISubtree const& _aSubtree)
- {
- localehelper::FindBestLocale aLocaleMatcher( localehelper::makeLocale(m_sTargetLocale) );
-
- m_pClone = implCloneForLocale(_aSubtree,aLocaleMatcher);
- }
- //--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-} // anonymous namespace
-
-//==========================================================================
-// Helper function to invoke the previous ones properly
-
-// convert to the given locale format, assuming the original representation was expanded
-static std::auto_ptr<INode> impl_cloneExpandedForLocale(INode const* _pNode, rtl::OUString const& _sLocale)
-{
- OSL_ASSERT(_pNode != NULL);
-
- if ( localehelper::designatesAllLocales(localehelper::makeLocale(_sLocale)) ) // from expanded to expanded
- {
- return _pNode->clone();
- }
-
- else // needs reduction
- {
- OCloneForLocale aCloner(_sLocale);
- aCloner.applyToNode(*_pNode);
- return aCloner.getResult();
- }
-}
-//--------------------------------------------------------------------------
-
-// convert to the given locale format, assuming the original representation was expanded
-static rtl::Reference< data::TreeSegment > old_cloneExpandedForLocale(rtl::OUString const& _sName, INode const* _pNode, rtl::OUString const& _sLocale)
-{
- if (_pNode == NULL)
- return rtl::Reference< data::TreeSegment >();
-
- std::auto_ptr<INode> aResult;
- if (dynamic_cast< ISubtree const * >(_pNode) == 0) // simple value - nothing to reduce
- aResult = _pNode->clone();
-
- else
- aResult = impl_cloneExpandedForLocale(_pNode,_sLocale);
-
- return data::TreeSegment::create(_sName,aResult);
-}
-//--------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-rtl::Reference< data::TreeSegment > cloneExpandedForLocale(sharable::TreeFragment * tree, rtl::OUString const& _sLocale)
-{
- std::auto_ptr<INode> aOldTree = data::convertTree(tree, true);
-
- return old_cloneExpandedForLocale(tree->getName(), aOldTree.get(), _sLocale);
-}
-//--------------------------------------------------------------------------
-// convert to the given locale format, assuming the original representation was expanded
-std::auto_ptr<INode> reduceExpandedForLocale(std::auto_ptr<ISubtree> _pNode, rtl::OUString const& _sLocale)
-{
- std::auto_ptr<INode> aResult;
-
- if ( _pNode.get() == NULL || // nothing to reduce
- localehelper::designatesAllLocales(localehelper::makeLocale(_sLocale)) ) // from expanded to expanded
- {
- aResult.reset( _pNode.release() );
- }
-
- else // needs reduction
- {
- OCloneForLocale aCloner(_sLocale);
- aCloner.applyToNode(*_pNode);
- aResult = aCloner.getResult();
-
- OSL_ENSURE(aResult.get(),"Cloning a tree for a locale unexpectedly produced NOTHING");
- }
- return aResult;
-}
-//--------------------------------------------------------------------------
-namespace
-{
-//--------------------------------------------------------------------------
- class ExpandTreeForLocale : NodeModification
- {
- ISubtree & m_rParent;
- rtl::OUString const & m_aSourceLocale;
-
- ExpandTreeForLocale(ISubtree & _rParent,rtl::OUString const & _aSourceLocale)
- : m_rParent(_rParent)
- , m_aSourceLocale(_aSourceLocale)
- {}
-
- void handle(ISubtree& _rNode);
- void handle(ValueNode& _rNode);
-
- void substitute(std::auto_ptr<INode> _aExpanded);
- public:
- static void expand(ISubtree& _rTree, rtl::OUString const & _aSourceLocale)
- {
- ExpandTreeForLocale(_rTree,_aSourceLocale).applyToChildren(_rTree);
- }
-
- // returns NULL, if not a localized value
- static std::auto_ptr<ISubtree> expanded(ValueNode const& _aNode, rtl::OUString const & _aSourceLocale);
- };
-
-//--------------------------------------------------------------------------
- class ExpandChangesForLocale : ChangeTreeModification
- {
- SubtreeChange & m_rParent;
- rtl::OUString const & m_aSourceLocale;
-
- ExpandChangesForLocale(SubtreeChange & _rParent,rtl::OUString const & _aSourceLocale)
- : m_rParent(_rParent)
- , m_aSourceLocale(_aSourceLocale)
- {}
-
- void handle(SubtreeChange& _rNode);
- void handle(ValueChange& _rNode);
-
- void handle(AddNode& _rNode);
- void handle(RemoveNode& _rNode);
-
- void substitute(std::auto_ptr<Change> _aExpanded);
- public:
- static void expand(SubtreeChange& _rTree, rtl::OUString const & _aSourceLocale)
- {
- ExpandChangesForLocale(_rTree,_aSourceLocale).applyToChildren(_rTree);
- }
-
- // returns NULL, if not a localized value
- static std::auto_ptr<SubtreeChange> expanded(ValueChange const& _aNode, rtl::OUString const & _aSourceLocale);
- };
-//--------------------------------------------------------------------------
-inline
-void ExpandTreeForLocale::substitute(std::auto_ptr<INode> _aExpanded)
-{
- m_rParent.removeChild(_aExpanded->getName());
- m_rParent.addChild(_aExpanded);
-}
-
-//--------------------------------------------------------------------------
-void ExpandTreeForLocale::handle(ISubtree& _rNode)
-{
- expand(_rNode,m_aSourceLocale);
-}
-
-//--------------------------------------------------------------------------
-void ExpandTreeForLocale::handle(ValueNode& _rNode)
-{
- std::auto_ptr<ISubtree> aExpanded = expanded(_rNode,m_aSourceLocale);
-
- if (aExpanded.get())
- substitute( base_ptr(aExpanded) );
-}
-
-//--------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ExpandTreeForLocale::expanded(ValueNode const& _aNode, rtl::OUString const & _aSourceLocale)
-{
- if (!_aNode.isLocalized()) return std::auto_ptr<ISubtree>();
-
- OTreeNodeFactory & rFactory = getDefaultTreeNodeFactory();
-
- node::Attributes aValueAttributes = _aNode.getAttributes();
-
- aValueAttributes.setLocalized(false);
- if (aValueAttributes.state() == node::isMerged)
- aValueAttributes.setState( node::isReplaced );
-
-
- std::auto_ptr<ValueNode> aValue = _aNode.isNull()
- ? rFactory.createNullValueNode(_aSourceLocale,_aNode.getValueType(),aValueAttributes)
- : rFactory.createValueNode(_aSourceLocale,_aNode.getValue(),aValueAttributes);
-
- std::auto_ptr<ISubtree> aRet = rFactory.createSetNode( _aNode.getName(),
- toTemplateName(_aNode.getValueType()),
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- _aNode.getAttributes() );
-
- aRet->addChild(base_ptr(aValue));
-
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-inline
-void ExpandChangesForLocale::substitute(std::auto_ptr<Change> _aExpanded)
-{
- m_rParent.removeChange(_aExpanded->getNodeName());
- m_rParent.addChange(_aExpanded);
-}
-
-//--------------------------------------------------------------------------
-
-void ExpandChangesForLocale::handle(SubtreeChange& _rNode)
-{
- expand(_rNode,m_aSourceLocale);
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(ValueChange& _rNode)
-{
- std::auto_ptr<SubtreeChange> aExpanded = expanded(_rNode,m_aSourceLocale);
-
- if (aExpanded.get())
- substitute( base_ptr( aExpanded ) );
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(AddNode& _rNode)
-{
- rtl::Reference< data::TreeSegment > seg(_rNode.getNewTree());
- std::auto_ptr<INode> pAdded(data::convertTree(seg.is() ? seg->fragment : 0, false));
- if (pAdded.get() != NULL)
- {
- std::auto_ptr<INode> pExpanded;
- if (ISubtree * pAddedTree = pAdded->asISubtree())
- {
- ExpandTreeForLocale::expand(*pAddedTree,m_aSourceLocale);
- pExpanded = pAdded;
- }
- else if(ValueNode * pAddedValue = pAdded->asValueNode())
- {
- pExpanded = base_ptr(ExpandTreeForLocale::expanded(*pAddedValue,m_aSourceLocale));
- }
- else
- OSL_ENSURE(false, "Cannot expand unknown Node type (found in AddNode)");
-
-
- if (pExpanded.get())
- {
- rtl::Reference< data::TreeSegment > aExpanded = data::TreeSegment::create( _rNode.getNodeName(),pExpanded);
- std::auto_ptr<AddNode> aExpandedAdd( new AddNode( aExpanded, _rNode.getNodeName(), _rNode.isToDefault() ) );
-
- if (_rNode.isReplacing()) aExpandedAdd->setReplacing();
-
- substitute( base_ptr( aExpandedAdd ) );
- }
- }
- else
- OSL_ENSURE(false, "Cannot expand AddNode without content");
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(RemoveNode& )
-{
- // nothing to do
-}
-
-//--------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> ExpandChangesForLocale::expanded(ValueChange const& _aNode, rtl::OUString const & _aSourceLocale)
-{
- std::auto_ptr<SubtreeChange> aRet;
- if (_aNode.isLocalizedValue())
- {
- OTreeNodeFactory & rNodeFactory = getDefaultTreeNodeFactory();
- OTreeChangeFactory & rFactory = getDefaultTreeChangeFactory();
-
- node::Attributes aValueAttributes = _aNode.getAttributes();
-
- aValueAttributes.setLocalized(false);
- if (aValueAttributes.state() == node::isMerged)
- aValueAttributes.setState( node::isReplaced );
-
-
- rtl::OUString const sTemplateName = toTemplateName(_aNode.getValueType());
-
- std::auto_ptr<ValueNode> aValue = _aNode.getNewValue().hasValue()
- ? rNodeFactory.createValueNode(sTemplateName,_aNode.getNewValue(),aValueAttributes)
- : rNodeFactory.createNullValueNode(sTemplateName,_aNode.getValueType(),aValueAttributes);
-
- rtl::Reference< data::TreeSegment > aValueSegment = data::TreeSegment::create(_aSourceLocale, base_ptr(aValue));
-
- std::auto_ptr<AddNode> aAddValue = rFactory.createAddNodeChange(aValueSegment,_aSourceLocale,_aNode.isToDefault());
- aAddValue->setReplacing();
-
- aRet = rFactory.createSetNodeChange( _aNode.getNodeName(),
- sTemplateName,
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- _aNode.getAttributes() );
-
- aRet->addChange(base_ptr(aAddValue));
- }
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-} // anonymous namespace
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/makefile.mk b/configmgr/source/tree/makefile.mk
deleted file mode 100644
index 1609db28878b..000000000000
--- a/configmgr/source/tree/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-TARGET=cm
-ENABLE_EXCEPTIONS=TRUE
-
-
-# --- Settings ---
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files ---
-
-SLOFILES=\
- $(SLO)$/builddata.obj \
- $(SLO)$/node.obj \
- $(SLO)$/treefragment.obj \
- $(SLO)$/treesegment.obj \
- $(SLO)$/nodevisitor.obj \
- $(SLO)$/changes.obj \
- $(SLO)$/treenodefactory.obj \
- $(SLO)$/treechangefactory.obj \
- $(SLO)$/localizedtreeactions.obj \
- $(SLO)$/treeactions.obj \
- $(SLO)$/cmtreemodel.obj \
- $(SLO)$/cmtree.obj \
- $(SLO)$/nodeconverter.obj \
- $(SLO)$/updatehelper.obj \
- $(SLO)$/mergehelper.obj \
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/tree/mergehelper.cxx b/configmgr/source/tree/mergehelper.cxx
deleted file mode 100644
index 1188ac0d51f6..000000000000
--- a/configmgr/source/tree/mergehelper.cxx
+++ /dev/null
@@ -1,456 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "builddata.hxx"
-#include "nodeconverter.hxx"
-#include "treefragment.hxx"
-#include "treenodefactory.hxx"
-#include "treechangefactory.hxx"
-#include "configpath.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-namespace
-{
-//==========================================================================
-//= OCleanupLayerAction
-//==========================================================================
-//= This class cleans up a layer to be merged into an existing tree
-//==========================================================================
-class OCleanupLayerAction : ChangeTreeModification
-{
- SubtreeChange& m_rResultTree; // list which containes changes merged with the existing nodes
- ISubtree const & m_rTargetTree; // reference node needed for merging
- OTreeNodeConverter m_aNodeConverter;
-public:
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aLayerTree, ISubtree const& _aTargetTree)
- {
- return OCleanupLayerAction(_rResultTree,_aTargetTree).impl_cleanup(_aLayerTree);
- }
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aLayerTree, ISubtree const& _aTargetTree, OTreeNodeFactory& _rNodeFactory)
- {
- return OCleanupLayerAction(_rResultTree,_aTargetTree,_rNodeFactory).impl_cleanup(_aLayerTree);
- }
-
-private:
- OCleanupLayerAction(SubtreeChange& _rResult, ISubtree const& _rTree)
- :m_rResultTree(_rResult)
- ,m_rTargetTree(_rTree)
- ,m_aNodeConverter()
- {}
-
- OCleanupLayerAction(SubtreeChange& _rResult, ISubtree const& _rTree, OTreeNodeFactory& _rNodeFactory)
- :m_rResultTree(_rResult)
- ,m_rTargetTree(_rTree)
- ,m_aNodeConverter(_rNodeFactory)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- bool impl_cleanup(SubtreeChange& _aUpdateTree);
-
- void add(std::auto_ptr<Change> _pChange);
- void addReplacedNode(rtl::Reference< data::TreeSegment > const & _aReplacedTree);
- void addReplacedNode(std::auto_ptr<INode> _aReplacedNode);
-};
-
-// --------------------------------- MergeLayerToTree ---------------------------------
-
-class MergeLayerToTree : ChangeTreeModification
-{
- ISubtree& m_rTree;
-
-public:
- explicit
- MergeLayerToTree(ISubtree& _rTree):m_rTree(_rTree) {}
-
- MergeLayerToTree& merge(SubtreeChange & _rLayerTree);
-private:
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- static void mergeAttributes(INode& _rNode, node::Attributes const& _aChangeAttributes);
-};
-// --------------------------------- AttributeSetter ---------------------------------
-
-class AttributeSetter : NodeModification
-{
- node::State m_state;
- bool m_bPromoteFinalized;
-public:
- explicit
- AttributeSetter(node::State _state, bool _bPromoteFinalized)
- : m_state(_state)
- , m_bPromoteFinalized(_bPromoteFinalized)
- {}
-
- void setNodeAttributes(INode& _rNode);
-
- using NodeModification::applyToNode;
-private:
- void handle(ValueNode& _rValueNode);
- void handle(ISubtree& _rSubtree);
-};
-// -----------------------------------------------------------------------------
-
-} // anon namepsace
-// -----------------------------------------------------------------------------
-// this is our 'exported' function
-
-// -----------------------------------------------------------------------------
-namespace
-{
-//==========================================================================
-//= OCleanupLayerAction
-//==========================================================================
-static inline bool isFinal(node::Attributes const& _aAttributes)
-{
- return _aAttributes.isFinalized() || _aAttributes.isReadonly();
-}
-//==========================================================================
-bool OCleanupLayerAction::impl_cleanup(SubtreeChange& _aUpdateTree)
-{
- OSL_ENSURE(!_aUpdateTree.isReplacedNode(), "Layer cleanup: A replaced tree should not be merged");
-
- if (isFinal(m_rTargetTree.getAttributes()))
- {
- CFG_TRACE_WARNING("Layer cleanup : Ignoring change to write-protected tree '%s'",OUSTRING2ASCII(m_rTargetTree.getName()));
- return false;
- }
-
- // first check the changes
- this->applyToChildren(_aUpdateTree);
-
- return m_rResultTree.size() != 0;
-}
-//--------------------------------------------------------------------------
-inline void OCleanupLayerAction::add(std::auto_ptr<Change> _aChange)
-{
- m_rResultTree.addChange(_aChange);
-}
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(ValueChange& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- // replaced state -> should be a full (added/replaced) node
- //if (_rChange.isReplacedNode() && m_rTargetTree.isSetNodeChange())
- if ( _rChange.isReplacedValue() )
- {
- std::auto_ptr<ValueNode> pNode( m_aNodeConverter.createCorrespondingNode(_rChange) );
-
- this->addReplacedNode( base_ptr(pNode) );
-
- }
- else if (INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName))
- {
- // this mismatch is not discarded here (should be ignored while merging though)
- OSL_ENSURE(pTargetNode->asValueNode(), "Layer cleanup : Node type mismatch: Value change applied to non-value node !");
-
- if (!isFinal(pTargetNode->getAttributes()))
- {
- std::auto_ptr<Change> pResult( new ValueChange(_rChange) );
- this->add(pResult);
- }
- else
- {
- CFG_TRACE_WARNING("Layer cleanup : Ignoring change to write-protected value '%s'",OUSTRING2ASCII(sNodeName));
- }
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (value) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (value) '%s'",OUSTRING2ASCII(sNodeName));
- OSL_ENSURE(false, "Layer cleanup : Found orphaned Value");
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(SubtreeChange& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- // replaced state -> should be a full (added/replaced) node
- if (_rChange.isReplacedNode())
- {
- std::auto_ptr<ISubtree> pNode = m_aNodeConverter.createCorrespondingTree(_rChange);
-
- // mark as complete with defaults)
- pNode->setLevels(treeop::ALL_LEVELS,treeop::ALL_LEVELS);
-
- this->addReplacedNode( base_ptr(pNode) );
- }
- else if ( INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName) )
- {
- ISubtree const * pTargetTree = pTargetNode->asISubtree();
-
- if (pTargetTree)
- {
- // generate a new change
- std::auto_ptr<SubtreeChange> pResult( new SubtreeChange(_rChange, treeop::NoChildCopy()) );
-
- // recurse
- if ( adjust(*pResult,_rChange,*pTargetTree,m_aNodeConverter.nodeFactory()) )
- this->add(base_ptr(pResult));
-
- else
- CFG_TRACE_INFO("Layer cleanup : Found void modification tree '%s'",OUSTRING2ASCII(sNodeName));
- }
- else
- {
- OSL_ENSURE(false, "Layer cleanup : Node type mismatch: Tree change applied to non-tree node !");
- CFG_TRACE_ERROR("Layer cleanup : Discarding schema violation for node '%s'",OUSTRING2ASCII(sNodeName));
- //throw Whatever();
- }
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (subtree) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (subtree) '%s'",OUSTRING2ASCII(sNodeName));
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(RemoveNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found RemoveNode for non-set-element in layer being merged");
-
- // look up the corresponding node
- INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName);
-
- if (pTargetNode)
- {
- // generate the same change
- std::auto_ptr<Change> pResult( new RemoveNode(sNodeName,false) );
- this->add(pResult);
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (removal) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (removal) '%s'",OUSTRING2ASCII(sNodeName));
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(AddNode& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
-// generate the same change
- this->addReplacedNode( _rChange.getNewTree() );
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::addReplacedNode(std::auto_ptr<INode> _aReplacedNode)
-{
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found replaced node for non-set-element in layer being merged");
-
- OSL_ASSERT(_aReplacedNode.get());
-
- rtl::OUString sTypeName = m_rTargetTree.getElementTemplateName();
-
- this->addReplacedNode( data::TreeSegment::create(_aReplacedNode,sTypeName) );
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::addReplacedNode(rtl::Reference< data::TreeSegment > const & _aReplacedTree)
-{
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found replaced node for non-set-element in layer being merged");
-
- OSL_ASSERT(_aReplacedTree.is());
-
- rtl::OUString sNodeName = _aReplacedTree->fragment->getName();
-
- // add the tree to the change list
- std::auto_ptr<AddNode> pResult( new AddNode(_aReplacedTree,sNodeName, false) );
-
- // look up the corresponding existing node
- INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName);
-
- if (pTargetNode) pResult->setReplacing();
-
- this->add( base_ptr(pResult) );
-}
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::mergeAttributes(INode& _rNode, node::Attributes const& _aChangeAttributes)
-{
- OSL_ENSURE(!isFinal(_rNode.getAttributes()),"Layer merge: Node being merged is READONLY - cleanup broken");
- OSL_ENSURE(_aChangeAttributes.state() == node::isMerged,"Layer merge: Found unexpected state for change being merged");
-
- _rNode.modifyState(node::isMerged);
- _rNode.modifyAccess(_aChangeAttributes.getAccess());
-}
-//--------------------------------------------------------------------------
-
-MergeLayerToTree& MergeLayerToTree::merge(SubtreeChange & _rLayerTree)
-{
- OSL_ENSURE(_rLayerTree.getNodeName() == m_rTree.getName(),"Layer merge: change does not match tree");
-
- this->applyToChildren(_rLayerTree);
- mergeAttributes(m_rTree,_rLayerTree.getAttributes());
-
- return *this;
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(ValueChange& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Layer merge: Found change to default - cleanup broken");
-
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- INode * const pTargetNode = m_rTree.getChild(sNodeName);
-
- OSL_ENSURE(pTargetNode,"Layer merge: Found NULL value - cleanup broken");
- OSL_ENSURE(!isFinal(pTargetNode->getAttributes()),"Layer merge: Found READONLY value - cleanup broken");
-
- if (ValueNode* pTargetValue = pTargetNode->asValueNode() )
- {
- _rChange.applyChangeNoRecover(*pTargetValue);
- mergeAttributes(*pTargetValue,_rChange.getAttributes());
- }
- else
- {
- OSL_ENSURE(false, "Layer merge : Node type mismatch: Value change applied to non-value node !");
- CFG_TRACE_ERROR("Layer merge : Discarding schema violation for value '%s'",OUSTRING2ASCII(sNodeName));
- //throw Whatever();
- }
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(AddNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- node::State eNodeState = node::isAdded;
-
- if (_rChange.isReplacing())
- {
- OSL_VERIFY( m_rTree.removeChild(sNodeName).get() );
- eNodeState = node::isReplaced;
- }
-
- OSL_ENSURE( !m_rTree.getChild(sNodeName),"Layer merge: Found conflicting data on insert - cleanup broken");
-
- rtl::Reference< data::TreeSegment > aAddedTree = _rChange.getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "Layer merge: Found empty data on insert - cleanup broken");
-
- // clean up the attributes of the added node
- std::auto_ptr<INode> aAddedData(data::convertTree(aAddedTree->fragment, true));
-
- AttributeSetter(eNodeState,false).applyToNode(*aAddedData);
-
- m_rTree.addChild(aAddedData);
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(RemoveNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- // should have such a node when removing
- OSL_VERIFY( m_rTree.removeChild(sNodeName).get() );
-}
-//--------------------------------------------------------------------------
-
-
-void MergeLayerToTree::handle(SubtreeChange& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Layer merge: Found change to default - cleanup broken");
-
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- INode * const pTargetNode = m_rTree.getChild(sNodeName);
-
- OSL_ENSURE(pTargetNode,"Layer merge: Found NULL subtree - cleanup broken");
- OSL_ENSURE(!isFinal(pTargetNode->getAttributes()),"Layer merge: Found READONLY subtree - cleanup broken");
-
- ISubtree * const pTargetTree = pTargetNode->asISubtree();
- OSL_ENSURE(pTargetTree,"Layer merge: Found non-tree for SubtreeChange - cleanup broken");
-
- // recurse
- MergeLayerToTree(*pTargetTree).merge(_rChange);
-}
-//--------------------------------------------------------------------------
-
-void AttributeSetter::setNodeAttributes(INode& _rNode)
-{
- node::Attributes const aOldAttributes = _rNode.getAttributes();
-
- _rNode.modifyState(m_state);
- if (m_bPromoteFinalized && isFinal(aOldAttributes))
- _rNode.modifyAccess(node::accessReadonly);
-}
-// -----------------------------------------------------------------------------
-
-void AttributeSetter::handle(ValueNode& _rValueNode)
-{
- setNodeAttributes(_rValueNode);
-}
-// -----------------------------------------------------------------------------
-
-void AttributeSetter::handle(ISubtree& _rSubtree)
-{
- setNodeAttributes(_rSubtree);
-
- this->applyToChildren(_rSubtree);
-}
-//--------------------------------------------------------------------------
-
-} // anonymous namespace
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/node.cxx b/configmgr/source/tree/node.cxx
deleted file mode 100644
index 2d5ac73ba051..000000000000
--- a/configmgr/source/tree/node.cxx
+++ /dev/null
@@ -1,535 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "node.hxx"
-#include "anydata.hxx"
-#include "treefragment.hxx"
-#include "attributes.hxx"
-#include "utility.hxx"
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Any.hxx>
-
-#ifndef INCLUDED_CSTDDEF
-#include <cstddef>
-#define INCLUDED_CSTDDEF
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
-
-rtl::OUString NodeInfo::getName() const
-{
- return rtl::OUString(this->name);
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes NodeInfo::getNodeInfoAttributes() const
-{
- configmgr::node::Attributes aResult;
-
- bool help = !!(flags & data::Flags::readonly);
- aResult.setAccess( help,!!(flags & data::Flags::finalized) );
-// aResult.setAccess( !!(flags & data::Flags::readonly),!!(flags & data::Flags::finalized) );
-
- aResult.setNullable(!!(flags & data::Flags::nullable));
- aResult.setLocalized(!!(flags & data::Flags::localized));
-
- configmgr::node::State state = (flags & data::Flags::defaulted) ? configmgr::node::isDefault :
- (flags & data::Flags::defaultable) ? configmgr::node::isMerged :
- configmgr::node::isReplaced;
- aResult.setState(state);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeInfo::isDefault() const
-{
- return !!(this->flags & data::Flags::defaulted);
-}
-//-----------------------------------------------------------------------------
-
-bool NodeInfo::isLocalized() const
-{
- return !!(this->flags & data::Flags::localized);
-}
-//-----------------------------------------------------------------------------
-
-void NodeInfo::markAsDefault(bool bDefault)
-{
- if (bDefault)
- {
- OSL_ENSURE(flags & data::Flags::defaultable,"Marking a non-defaultable node as default");
- this->flags |= data::Flags::defaulted;
- }
- else
- this->flags &= ~data::Flags::defaulted;
-}
-//-----------------------------------------------------------------------------
-
-bool GroupNode::hasDefaultsAvailable() const
-{
- if (this->info.isDefault())
- return true;
-
- if (node(this)->getTreeFragment()->hasDefaultsAvailable())
- return true;
-
-#if 0 // extended check for default state
- for (Node const * pChild = getFirstChild(); pChild != NULL; pChild = getNextChild(pChild))
- if (! pChild->isDefault() )
- return false;
-
- return true;
-#endif
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-Node * GroupNode::getFirstChild() const
-{
- OSL_ENSURE(numDescendants, "Groups MUST have at least one child");
- return const_cast< Node * >(node(this) + 1);
-}
-//-----------------------------------------------------------------------------
-
-static
-sal_uInt16 implGetNextChildOffset(GroupNode const * _pParent, Node const * _pChild)
-{
- OSL_PRECOND(_pChild, "getNextChild: previous child must not be NULL");
- OSL_PRECOND(_pChild->getParentNode() == node(_pParent), "getNextChild: not a child of this node");
-
-
- OSL_ENSURE( node(_pParent) < _pChild && _pChild <= node(_pParent) + _pParent->numDescendants,
- "getNextChild: child out of descendants range");
-
- // offset to child's next sibling
- sal_uInt16 next = 1;
- if ( _pChild->isGroup())
- {
- next = next + _pChild->group.numDescendants;
- }
-
- if (_pChild->info.parent + next > _pParent->numDescendants)
- {
- OSL_ENSURE(_pChild->info.parent + next == _pParent->numDescendants+1, "Next child candidate should match next sibling here");
- return 0;
- }
-
- OSL_POSTCOND( (_pChild+next)->getParentNode() == node(_pParent), "getNextChild: not a child of this node");
- return next;
-}
-//-----------------------------------------------------------------------------
-
-Node * GroupNode::getNextChild(Node * _pChild) const
-{
- if (sal_uInt16 next = implGetNextChildOffset(this, _pChild))
- return _pChild + next;
-
- else
- return NULL;
-}
-
-Node * GroupNode::getChild(rtl::OUString const & name) const {
- for (Node * child = getFirstChild(); child != 0;
- child = getNextChild(child))
- {
- if (child->isNamed(name)) {
- return child;
- }
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-// TODO: optimize this - keep a list of such structs ....
-struct SetNodeTemplateData
-{
- rtl_uString * name;
- rtl_uString * module;
-};
-//-----------------------------------------------------------------------------
-static inline
-SetNodeTemplateData * readTemplateData(sal_uInt8 * _aTemplateData)
-{
- return reinterpret_cast<SetNodeTemplateData *>( _aTemplateData );
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * SetNode::allocTemplateData(const rtl::OUString &rName,
- const rtl::OUString &rModule)
-{
- SetNodeTemplateData * pData = new SetNodeTemplateData();
-
- OSL_ENSURE(pData, "Creating template data: unexpected NULL data");
-
- pData->name = acquireString(rName);
- pData->module = acquireString(rModule);
-
- return reinterpret_cast<sal_uInt8 *>( pData );
-}
-
-sal_uInt8 * SetNode::copyTemplateData(sal_uInt8 * _aTemplateData)
-{
- SetNodeTemplateData const * pData = readTemplateData(_aTemplateData);
-
- OSL_ENSURE(pData, "Copying template data: unexpected NULL data");
-
- return allocTemplateData(rtl::OUString(pData->name), rtl::OUString(pData->module));
-}
-
-//-----------------------------------------------------------------------------
-
-void SetNode::releaseTemplateData(sal_uInt8 * _aTemplateData)
-{
- if (!_aTemplateData) return;
-
- SetNodeTemplateData const * pData = readTemplateData(_aTemplateData);
-
- OSL_ENSURE(pData, "Freeing template data: unexpected NULL data");
-
- rtl_uString_release(pData->name);
- rtl_uString_release(pData->module);
-
- delete pData;
-}
-
-//-----------------------------------------------------------------------------
-
-rtl::OUString SetNode::getElementTemplateName() const
-{
- SetNodeTemplateData const * pData = readTemplateData(this->elementType);
-
- OSL_ENSURE(pData, "ERROR: No template data found for set");
-
- return rtl::OUString(pData->name);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString SetNode::getElementTemplateModule() const
-{
- SetNodeTemplateData const * pData = readTemplateData(this->elementType);
-
- OSL_ENSURE(pData, "ERROR: No template data found for set");
-
- return rtl::OUString(pData->module);
-}
-//-----------------------------------------------------------------------------
-
-static inline
-TreeFragment * implGetFragmentFromList(TreeFragment * _aListEntry)
-{
- return reinterpret_cast<TreeFragment *>(_aListEntry);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * SetNode::getFirstElement() const
-{
- return implGetFragmentFromList(this->elements);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * SetNode::getNextElement(TreeFragment * _pElement) const
-{
- OSL_PRECOND(_pElement, "getNextElement: previous element must not be NULL");
- OSL_PRECOND(_pElement->header.parent == (Node *)this,
- "getNextElement: not an element of this node");
-
- return implGetFragmentFromList(_pElement->header.next);
-}
-
-TreeFragment * SetNode::getElement(rtl::OUString const & name) const {
- for (TreeFragment * element = getFirstElement(); element != 0;
- element = getNextElement(element))
- {
- if (element->isNamed(name)) {
- return element;
- }
- }
- return 0;
-}
-
-void SetNode::addElement(TreeFragment * newElement) {
- OSL_ASSERT(newElement != 0);
- newElement->header.next = elements;
- newElement->header.parent = node(this);
- elements = newElement;
-}
-
-TreeFragment * SetNode::removeElement(rtl::OUString const & name) {
- for (TreeFragment ** link = &elements; *link != 0;
- link = &(*link)->header.next)
- {
- if ((*link)->isNamed(name)) {
- TreeFragment * removed = *link;
- *link = removed->header.next;
- removed->header.next = 0;
- removed->header.parent = 0;
- return removed;
- }
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-bool ValueNode::isNull() const
-{
- data::Flags::Type availmask = (info.flags & data::Flags::defaulted) ?
- data::Flags::defaultAvailable :
- data::Flags::valueAvailable;
-
- return !(info.flags & availmask);
-}
-//-----------------------------------------------------------------------------
-
-bool ValueNode::hasUsableDefault() const
-{
- return (info.flags & data::Flags::defaultable) &&
- (info.flags & (data::Flags::defaultAvailable| data::Flags::nullable));
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueNode::getValueType() const
-{
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return getUnoType(aType);
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getValue() const
-{
- if (info.flags & data::Flags::defaulted)
- return getDefaultValue();
-
- else
- return getUserValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getUserValue() const
-{
- if (info.flags & data::Flags::valueAvailable)
- {
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return readData(aType,this->value);
- }
- else
- return com::sun::star::uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getDefaultValue() const
-{
- if (info.flags & data::Flags::defaultAvailable)
- {
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return readData(aType,this->defaultValue);
- }
- else
- return com::sun::star::uno::Any();
-}
-
-void ValueNode::setValue(com::sun::star::uno::Any const & newValue) {
- releaseValue();
- if (newValue.hasValue()) {
- sal_uInt8 type = adaptType(newValue);
- value = allocData(type, newValue);
- info.flags |= data::Flags::valueAvailable;
- }
- info.flags &= ~data::Flags::defaulted;
-}
-
-void ValueNode::setToDefault() {
- OSL_ASSERT(hasUsableDefault());
- releaseValue();
- info.flags |= data::Flags::defaulted;
-}
-
-void ValueNode::changeDefault(com::sun::star::uno::Any const & newDefault) {
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- if (info.flags & data::Flags::defaultAvailable) {
- OSL_ASSERT(type != data::Type::value_any);
- freeData(type, defaultValue);
- defaultValue.data = 0;
- info.flags &= ~data::Flags::defaultAvailable;
- }
- if (newDefault.hasValue()) {
- type = adaptType(newDefault);
- defaultValue = allocData(type, newDefault);
- info.flags |= data::Flags::defaultAvailable;
- }
-}
-
-void ValueNode::releaseValue() {
- if ((info.flags & data::Flags::valueAvailable) != 0) {
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- OSL_ASSERT(type != data::Type::value_any);
- freeData(type, value);
- value.data = 0;
- info.flags &= ~data::Flags::valueAvailable;
- }
-}
-
-sal_uInt8 ValueNode::adaptType(com::sun::star::uno::Any const & newValue) {
- sal_uInt8 newType = getTypeCode(newValue.getValueType());
- OSL_ASSERT(newType != data::Type::value_any);
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- if (type == data::Type::value_any) {
- type = static_cast< sal_uInt8 >(newType & data::Type::mask_valuetype);
- info.type = (info.type & ~data::Type::mask_valuetype) | type;
- }
- OSL_ASSERT(newType == type);
- return type;
-}
-
-//-----------------------------------------------------------------------------
-
-bool Node::isNamed(rtl::OUString const & _aName) const
-{
- rtl_uString *pCmpData = _aName.pData;
- rtl_uString *pNodeData = info.name;
-
- // Creating an OUString does rather expensive interlocking here.
- if (pCmpData == pNodeData)
- return true;
- if (pCmpData->length != pNodeData->length)
- return false;
- return !rtl_ustr_compare_WithLength( pCmpData->buffer,
- pCmpData->length,
- pNodeData->buffer,
- pNodeData->length);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Node::getName() const
-{
- return info.getName();
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes Node::getAttributes() const
-{
- if(this->isFragmentRoot())
- {
- return this->getTreeFragment()->getAttributes();
- }
- else
- {
- return info.getNodeInfoAttributes();
- }
-}
-//-----------------------------------------------------------------------------
-
-bool Node::isDefault() const
-{
- return info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool Node::isFragmentRoot() const
-{
- return !info.parent;
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-Node * Node::getParentNode()
-{
- return info.parent ? this - info.parent : NULL;
-}
-//-----------------------------------------------------------------------------
-
-Node const * Node::getParentNode() const
-{
- return info.parent ? this - info.parent : NULL;
-}
-#endif
-//-----------------------------------------------------------------------------
-static sal_uInt16 getFragmentIndex(Node const * pNode)
-{
- sal_uInt16 result = 0;
- while (sal_uInt16 step = pNode->info.parent)
- {
- result = result + step;
- pNode -= step;
- }
- return result;
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * Node::getTreeFragment()
-{
- void * pRoot = this - getFragmentIndex(this);
-
- void * pFrag = static_cast<char*>(pRoot) - offsetof(TreeFragment,nodes);
-
- return static_cast<TreeFragment *>(pFrag);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment const * Node::getTreeFragment() const
-{
- void const * pRoot = this - getFragmentIndex(this);
-
- void const * pFrag = static_cast<char const*>(pRoot) - offsetof(TreeFragment,nodes);
-
- return static_cast<TreeFragment const *>(pFrag);
-}
-
-Node * Node::getSubnode(rtl::OUString const & name) {
- if (isGroup()) {
- return group.getChild(name);
- } else if (isSet()) {
- TreeFragment * element = set.getElement(name);
- return element == 0 ? 0 : element->getRootNode();
- } else {
- OSL_ASSERT(false);
- return 0;
- }
-}
-
-//-----------------------------------------------------------------------------
- } // namespace sharable
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/nodeconverter.cxx b/configmgr/source/tree/nodeconverter.cxx
deleted file mode 100644
index ff6373236944..000000000000
--- a/configmgr/source/tree/nodeconverter.cxx
+++ /dev/null
@@ -1,210 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "builddata.hxx"
-#include "nodeconverter.hxx"
-#include "treenodefactory.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OTreeNodeConverter
-//==========================================================================
-OTreeNodeConverter::OTreeNodeConverter()
-: m_rFactory( getDefaultTreeNodeFactory() )
-{
-}
-
-std::auto_ptr<ISubtree> OTreeNodeConverter::createCorrespondingNode(SubtreeChange const& _rChange)
-{
- std::auto_ptr<ISubtree> aRet;
-
- //if ( isLocalizedValueSet(aSubtree) ) { ... } else - no special case yet
- if (_rChange.isSetNodeChange())
- {
- aRet = nodeFactory().createSetNode(_rChange.getNodeName(),
- _rChange.getElementTemplateName(),
- _rChange.getElementTemplateModule(),
- _rChange.getAttributes());
- }
- else
- {
- aRet = nodeFactory().createGroupNode(_rChange.getNodeName(),
- _rChange.getAttributes());
- }
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-std::auto_ptr<ValueNode> OTreeNodeConverter::createCorrespondingNode(ValueChange const& _rChange)
-{
- // DEFAULT-TODO
- OSL_ENSURE(_rChange.getValueType().getTypeClass() != uno::TypeClass_VOID, "Losing type information converting change to value");
-
- std::auto_ptr<ValueNode> aRet;
- if (_rChange.getNewValue().hasValue())
- aRet = nodeFactory().createValueNode(_rChange.getNodeName(), _rChange.getNewValue(), _rChange.getAttributes());
-
- else
- aRet = nodeFactory().createNullValueNode(_rChange.getNodeName(), _rChange.getValueType(), _rChange.getAttributes());
-
- OSL_ENSURE(aRet.get() && aRet->isValid(), "Could not create corresponding value node");
-
- return aRet;
-}
-
-//==========================================================================
-//= ONodeConverter
-//==========================================================================
-class ONodeConverter : public ChangeTreeModification
-{
- OTreeNodeConverter& m_rFactory;
- std::auto_ptr<INode> m_pNode;
-
-public:
- explicit
- ONodeConverter(OTreeNodeConverter& rFactory)
- : m_rFactory(rFactory)
- {
- }
-
- virtual void handle(ValueChange& aValueNode);
- virtual void handle(AddNode& aAddNode);
- virtual void handle(RemoveNode& aRemoveNode);
- virtual void handle(SubtreeChange& aSubtree);
-
- std::auto_ptr<INode> result() { return m_pNode; }
-
-};
-//==========================================================================
-//= OCreateSubtreeAction
-//==========================================================================
-//= creates a subtree out of a changes list
-//==========================================================================
-struct OCreateSubtreeAction : public ChangeTreeModification
-{
- ISubtree& m_rTree;
- OTreeNodeConverter& m_rNodeFactory;
-
-public:
- OCreateSubtreeAction(ISubtree& _rTree, OTreeNodeConverter& rFactory)
- :m_rTree(_rTree)
- ,m_rNodeFactory(rFactory) {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-};
-
-
-//--------------------------------------------------------------------------
-std::auto_ptr<ISubtree> OTreeNodeConverter::createCorrespondingTree(SubtreeChange& _rChange)
-{
- std::auto_ptr<ISubtree> pBaseTree = this->createCorrespondingNode(_rChange);
-
- OCreateSubtreeAction aNextLevel(*pBaseTree,*this);
- _rChange.forEachChange(aNextLevel);
-
- return pBaseTree;
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(ValueChange& aValueNode)
-{
- m_pNode = base_ptr(m_rFactory.createCorrespondingNode(aValueNode));
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(AddNode& aAddNode)
-{
- rtl::Reference< data::TreeSegment > seg(aAddNode.getNewTree());
- m_pNode = data::convertTree(seg.is() ? seg->fragment : 0, true);
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(RemoveNode& /*aRemoveNode*/)
-{
- m_pNode.reset();
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(SubtreeChange& aSubtree)
-{
- m_pNode = base_ptr(m_rFactory.createCorrespondingNode(aSubtree));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(ValueChange& _rChange)
-{
- // create a node by a ValueChange
- std::auto_ptr<ValueNode> pNode = m_rNodeFactory.createCorrespondingNode(_rChange);
-
- m_rTree.addChild(base_ptr(pNode));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(SubtreeChange& _rChange)
-{
- // create a node from a SubtreeChange (recursively)
- std::auto_ptr<ISubtree> pNode = m_rNodeFactory.createCorrespondingTree(_rChange);
-
- // add it to the tree
- m_rTree.addChild(base_ptr(pNode));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(RemoveNode& _rChange)
-{
- { (void)_rChange; }
- // we have nothing to do
- OSL_ENSURE(!m_rTree.getChild(_rChange.getNodeName()), "Removed node found in tree being built");
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(AddNode& _rChange)
-{
- // free the node and add it to the subtree
- rtl::Reference< data::TreeSegment > aNewNode = _rChange.getNewTree();
- m_rTree.addChild(data::convertTree(aNewNode.is() ? aNewNode->fragment : 0, true));
-}
-
-
-//--------------------------------------------------------------------------
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/nodevisitor.cxx b/configmgr/source/tree/nodevisitor.cxx
deleted file mode 100644
index 5d20ef860fc7..000000000000
--- a/configmgr/source/tree/nodevisitor.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include "osl/diagnose.h"
-
-#include "flags.hxx"
-#include "nodevisitor.hxx"
-#include "node.hxx"
-#include "treefragment.hxx"
-
-namespace configmgr { namespace data {
-
-NodeVisitor::~NodeVisitor() {}
-
-bool NodeVisitor::visitNode(sharable::Node * node) {
- switch (node->info.type & data::Type::mask_nodetype) {
- case data::Type::nodetype_value:
- return handle(&node->value);
- case data::Type::nodetype_group:
- return handle(&node->group);
- case data::Type::nodetype_set:
- return handle(&node->set);
- default:
- OSL_ASSERT(false);
- return false;
- }
-}
-
-bool NodeVisitor::visitChildren(sharable::GroupNode * node) {
- for (sharable::Node * child = node->getFirstChild(); child != 0;
- child = node->getNextChild(child))
- {
- if (visitNode(child)) {
- return true;
- }
- }
- return false;
-}
-
-bool NodeVisitor::handle(sharable::Node *) {
- return false;
-}
-
-bool NodeVisitor::handle(sharable::ValueNode * node) {
- return handle(sharable::node(node));
-}
-
-bool NodeVisitor::handle(sharable::GroupNode * node) {
- return handle(sharable::node(node));
-}
-
-bool NodeVisitor::handle(sharable::SetNode * node) {
- return handle(sharable::node(node));
-}
-
-SetVisitor::~SetVisitor() {}
-
-bool SetVisitor::visitTree(sharable::TreeFragment * tree) {
- return handle(tree);
-}
-
-bool SetVisitor::visitElements(sharable::SetNode * node) {
- for (sharable::TreeFragment * element = node->getFirstElement();
- element != 0; element = node->getNextElement(element))
- {
- if (handle(element)) {
- return true;
- }
- }
- return false;
-}
-
-bool SetVisitor::handle(sharable::TreeFragment * tree) {
- return visitNode(tree->getRootNode());
-}
-
-} }
diff --git a/configmgr/source/tree/subtree.hxx b/configmgr/source/tree/subtree.hxx
deleted file mode 100644
index 2ce25d33881b..000000000000
--- a/configmgr/source/tree/subtree.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SUBTREE_HXX
-#define CONFIGMGR_SUBTREE_HXX
-
-#include "valuenode.hxx"
-#include <rtl/ustring.hxx>
-
-#include <memory>
-#include <set>
-#include <vector>
-
-namespace configmgr
-{
- // List sorted by name for binary search
- class ChildListSet {
- std::vector< INode* > m_aChildList;
-
- ChildListSet(ChildListSet const&);
- ChildListSet& operator=(ChildListSet const& aSet);
- public:
- std::vector< INode* >::iterator begin() const { return const_cast<std::vector< INode* >*>(&m_aChildList)->begin(); }
- std::vector< INode* >::iterator end() const { return const_cast<std::vector< INode* >*>(&m_aChildList)->end(); }
- INode *erase(INode *pNode);
- std::vector< INode* >::iterator find(INode *pNode) const;
- std::pair<std::vector< INode* >::iterator, bool> insert(INode *aInsert);
-
- ChildListSet() : m_aChildList(0) {}
- ChildListSet(ChildListSet const&, treeop::DeepChildCopy);
- ~ChildListSet();
- };
-
-// Inner Node
- class Subtree : public ISubtree
- {
- ChildListSet m_aChildren;
- virtual INode* doGetChild(rtl::OUString const& name) const;
-
- public:
- Subtree(){}
- Subtree(const rtl::OUString& _rName,
- const node::Attributes& _rAttrs)
- :ISubtree(_rName, _rAttrs){};
-
- Subtree(const ISubtree& _rOther, treeop::NoChildCopy)
- : ISubtree(_rOther), m_aChildren(){};
-
- Subtree(const rtl::OUString& _rName,
- const rtl::OUString& _rTemplateName, const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttrs)
- :ISubtree(_rName, _rTemplateName, _rTemplateModule, _rAttrs){};
-
- Subtree(const Subtree& _rOther, treeop::DeepChildCopy _dc)
- : ISubtree(_rOther), m_aChildren(_rOther.m_aChildren,_dc){}
-
- virtual INode* addChild(std::auto_ptr<INode> node); // takes ownership
- virtual ::std::auto_ptr<INode> removeChild(rtl::OUString const& name);
-
- virtual std::auto_ptr<INode> clone() const;
-
-// Iteration support
- virtual void forEachChild(NodeAction& anAction) const;
- virtual void forEachChild(NodeModification& anAction);
- };
-
-
-
- // to search in ChildListSet a value
- class SearchNode : public INode
- {
- public:
- SearchNode(rtl::OUString const& aName);
- virtual ~SearchNode();
- virtual std::auto_ptr<INode> clone() const;
-
-// double dispatch support
- virtual void dispatch(NodeAction& /*anAction*/) const { }
- virtual void dispatch(NodeModification& /*anAction*/) { }
- };
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/tree/treeactions.cxx b/configmgr/source/tree/treeactions.cxx
deleted file mode 100644
index 0a040ff218ac..000000000000
--- a/configmgr/source/tree/treeactions.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treeactions.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OChangeActionCounter
-//==========================================================================
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(ValueChange const& /*aValueNode*/){ ++nValues; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(AddNode const& /*aAddNode*/){ ++nAdds; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(RemoveNode const& /*aRemoveNode*/){ ++nRemoves; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(SubtreeChange const& aSubtree)
-{
- applyToChildren(aSubtree);
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/treechangefactory.cxx b/configmgr/source/tree/treechangefactory.cxx
deleted file mode 100644
index 8a0840b57a90..000000000000
--- a/configmgr/source/tree/treechangefactory.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treechangefactory.hxx"
-#include "change.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-//= dummy helpe ============================================================
-bool isGenericSetElementType(rtl::OUString const& _aElementType)
-{
- return !! _aElementType.equals( getGenericSetElementType() );
-}
-
-bool isDummySetElementModule(rtl::OUString const& _aElementModule)
-{
- return !! _aElementModule.equals( getDummySetElementModule() );
-}
-
-rtl::OUString getGenericSetElementType()
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
-}
-
-rtl::OUString getDummySetElementModule()
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cfg:dummy-change"));
-}
-
-//= static default ============================================================
-OTreeChangeFactory& getDefaultTreeChangeFactory()
-{
- static OTreeChangeFactory aDefaultFactory;
- return aDefaultFactory;
-}
-
-//= SubtreeChanges ============================================================
-std::auto_ptr<SubtreeChange> OTreeChangeFactory::createDummyChange(
- rtl::OUString const& _aName, rtl::OUString const& _aElementTypeName)
-{
- std::auto_ptr<SubtreeChange> pResult;
-
- if (_aElementTypeName.getLength() == 0)
- {
- pResult.reset( new SubtreeChange(_aName, node::Attributes()) );
- }
- else
- {
- pResult.reset( new SubtreeChange(_aName,
- _aElementTypeName,
- getDummySetElementModule(),
- node::Attributes()) );
- }
- return pResult;
-}
-
-//-----------------------------------------------
-std::auto_ptr<SubtreeChange> OTreeChangeFactory::createSetNodeChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes _aAttrs,
- bool _bToDefault)
-{
- return std::auto_ptr<SubtreeChange>(new SubtreeChange(_aName,
- _aTemplateName,
- _aTemplateModule,
- _aAttrs,_bToDefault));
-}
-//-----------------------------------------------
-
-//= Set Changes ============================================================
-std::auto_ptr<AddNode> OTreeChangeFactory::createAddNodeChange(
- rtl::Reference< data::TreeSegment > const & _aNewTree,
- rtl::OUString const& _aName,
- bool _bToDefault)
-{
- return std::auto_ptr<AddNode>(new AddNode(_aNewTree,_aName,_bToDefault));
-}
-
-//-----------------------------------------------
-std::auto_ptr<RemoveNode> OTreeChangeFactory::createRemoveNodeChange(
- rtl::OUString const& _aName,
- bool _bToDefault)
-{
- return std::auto_ptr<RemoveNode>(new RemoveNode(_aName,_bToDefault));
-}
-
-//-----------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treefragment.cxx b/configmgr/source/tree/treefragment.cxx
deleted file mode 100644
index 352c8d078ca1..000000000000
--- a/configmgr/source/tree/treefragment.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treefragment.hxx"
-#include "utility.hxx"
-#include "attributes.hxx"
-#include <rtl/ustring.hxx>
-
-// memset
-#include <string.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
-rtl::OUString TreeFragment::getName() const
-{
- return rtl::OUString(this->header.name);
-}
-
-void TreeFragment::setName(rtl::OUString const & name) {
- rtl_uString * old = header.name;
- header.name = acquireString(name);
- rtl_uString_release(old);
-}
-
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::isNamed(rtl::OUString const & _aName) const
-{
- // TODO: optimize comparison
- return !!(this->getName() == _aName);
-}
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::hasDefaultsAvailable() const
-{
- return (this->header.state & data::State::flag_default_avail) || isDefault();
-}
-//-----------------------------------------------------------------------------
-
-
-bool TreeFragment::isDefault() const
-{
- return (this->header.state & data::State::mask_state) == data::State::defaulted;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::isNew() const
-{
- return (this->header.state & data::State::mask_state) == data::State::added;
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes TreeFragment::getAttributes() const
-{
- configmgr::node::Attributes aResult;
-
- switch (this->header.state & data::State::mask_state)
- {
- case data::State::merged: aResult.setState(configmgr::node::isMerged); break;
- case data::State::defaulted: aResult.setState(configmgr::node::isDefault); break;
- case data::State::replaced: aResult.setState(configmgr::node::isReplaced); break;
- case data::State::added: aResult.setState(configmgr::node::isAdded); break;
- default: OSL_ASSERT(false); break; // not reachable
- }
-
- aResult.setRemovability(!!(this->header.state & data::State::flag_removable),
- !!(this->header.state & data::State::flag_mandatory));
-
-
- OSL_ASSERT( header.count != 0 );
- NodeInfo const & aRootNodeInfo = this->nodes[0].info;
-
- aResult.setAccess( !!(this->header.state & data::State::flag_readonly),
- !!(aRootNodeInfo.flags & data::Flags::finalized) );
-
- aResult.setLocalized ( !!(aRootNodeInfo.flags & data::Flags::localized));
-
- return aResult;
-}
-
-TreeFragment *TreeFragment::allocate(sal_uInt32 nFragments)
-{
- sal_uInt32 nSize = sizeof(TreeFragment) + sizeof(Node) * (nFragments-1);
- sal_uInt8 *pMem = new sal_uInt8 [nSize];
- memset (pMem, 0, nSize);
- return reinterpret_cast<TreeFragment *>(pMem);
-}
-
-void TreeFragment::free_shallow(TreeFragment *pFragment )
-{
- delete[] (sal_uInt8 *) pFragment;
-}
-
-//-----------------------------------------------------------------------------
- } // namespace sharable
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treenodefactory.cxx b/configmgr/source/tree/treenodefactory.cxx
deleted file mode 100644
index 5af6cc0d5335..000000000000
--- a/configmgr/source/tree/treenodefactory.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treenodefactory.hxx"
-#include "valuenode.hxx"
-#include "subtree.hxx"
-#include "treechangefactory.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-
-//= static default ============================================================
-OTreeNodeFactory& getDefaultTreeNodeFactory()
-{
- static OTreeNodeFactory aDefaultFactory;
- return aDefaultFactory;
-}
-
-//= ValueNodes ============================================================
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aValue.hasValue(), "OTreeNodeFactory: Creating a value node having no type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aValue, _aAttrs) );
-}
-
-//-----------------------------------------------
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- uno::Any const& aDefault,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aValue.hasValue() || aDefault.hasValue(), "OTreeNodeFactory: Creating a value node having no type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aValue, aDefault, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createNullValueNode(
- rtl::OUString const& aName,
- uno::Type const& aType,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aType.getTypeClass() != uno::TypeClass_VOID, "OTreeNodeFactory: Creating a value node having VOID type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aType, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ISubtree> OTreeNodeFactory::createGroupNode(
- rtl::OUString const& aName,
- node::Attributes _aAttrs)
-{
- return std::auto_ptr<ISubtree>( new Subtree(aName, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ISubtree> OTreeNodeFactory::createSetNode(
- rtl::OUString const& aName,
- rtl::OUString const& _rTemplateName,
- rtl::OUString const& _rTemplateModule,
- node::Attributes _aAttrs)
-{
- return std::auto_ptr<ISubtree>( new Subtree(aName, _rTemplateName, _rTemplateModule, _aAttrs) );
-}
-
-//-----------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treesegment.cxx b/configmgr/source/tree/treesegment.cxx
deleted file mode 100644
index 99403a03e628..000000000000
--- a/configmgr/source/tree/treesegment.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include <memory>
-
-#include "osl/diagnose.h"
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "builddata.hxx"
-#include "treesegment.hxx"
-
-namespace configmgr { namespace data {
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- std::auto_ptr< INode > tree, rtl::OUString const & type)
-{
- rtl::Reference< TreeSegment > r;
- if (tree.get() != 0) {
- std::auto_ptr< sharable::TreeFragment > p(
- buildElementTree(*tree, type, false));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- rtl::OUString const & name, std::auto_ptr< INode > tree)
-{
- rtl::Reference< TreeSegment > r;
- if (tree.get() != 0) {
- std::auto_ptr< sharable::TreeFragment > p(
- buildTree(name, *tree, false));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- sharable::TreeFragment * tree)
-{
- rtl::Reference< TreeSegment > r;
- if (tree != 0) {
- std::auto_ptr< sharable::TreeFragment > p(data::buildTree(tree));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-TreeSegment::TreeSegment(sharable::TreeFragment * tree): fragment(tree) {
- OSL_ASSERT(tree != 0);
-}
-
-TreeSegment::~TreeSegment() {
- destroyTree(fragment);
-}
-
-} }
diff --git a/configmgr/source/tree/updatehelper.cxx b/configmgr/source/tree/updatehelper.cxx
deleted file mode 100644
index f70de6be5a19..000000000000
--- a/configmgr/source/tree/updatehelper.cxx
+++ /dev/null
@@ -1,622 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "updatehelper.hxx"
-#include "change.hxx"
-#include "nodeconverter.hxx"
-#include "treeactions.hxx"
-#include "treechangefactory.hxx"
-#include "treenodefactory.hxx"
-
-// -----------------------------------------------------------------------------
-#include "node.hxx"
-#include "treefragment.hxx"
-#include "builddata.hxx"
-#include "nodevisitor.hxx"
-// -----------------------------------------------------------------------------
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-//==========================================================================
-//= AdjustUpdate
-//==========================================================================
-//= This class tests changes on an existing tree and drops them if they
-//= are not need anymore or alters add nodes in node changes and vice versa
-//==========================================================================
-class AdjustUpdate : ChangeTreeModification
-{
- SubtreeChange& m_rChangeList; // list which containes changes merged with the existing nodes
- sharable::Node * m_refNode; // reference node needed for merging
- OTreeNodeConverter m_aNodeConverter;
-public:
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aUpdateTree,
- sharable::Node * targetNode)
- {
- return AdjustUpdate(_rResultTree, targetNode).impl_adjust(_aUpdateTree);
- }
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aUpdateTree,
- sharable::Node * targetNode,
- OTreeNodeFactory& _rNodeFactory)
- {
- return AdjustUpdate(_rResultTree, targetNode, _rNodeFactory).impl_adjust(_aUpdateTree);
- }
-private:
- AdjustUpdate(SubtreeChange& rList, sharable::Node * node)
- :m_rChangeList(rList)
- ,m_refNode(node)
- ,m_aNodeConverter()
- {}
-
- AdjustUpdate(SubtreeChange& rList, sharable::Node * node, OTreeNodeFactory& _rNodeFactory)
- :m_rChangeList(rList)
- ,m_refNode(node)
- ,m_aNodeConverter(_rNodeFactory)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- bool impl_adjust(SubtreeChange& _aUpdateTree);
-private:
- // ensuring the correct state
- bool checkNode() const;
-};
-
-// --------------------------------- ApplyUpdate ---------------------------------
-
-class ApplyUpdate : public ChangeTreeModification
-{
- sharable::Node * m_aCurrentNode;
-public:
- ApplyUpdate(sharable::Node * _aNode)
- : m_aCurrentNode(_aNode)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-};
-//--------------------------------------------------------------------------
-class ApplyValueChange
-{
- static
- void adjust(uno::Any& aActual, uno::Any const& aTarget);
-
-public:
- static
- void apply(ValueChange& _rValueChange, sharable::ValueNode * valueNode);
-};
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-// apply a already matching set of changes to the target tree
- void applyUpdateToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode)
- {
- ApplyUpdate aUpdater(_aRootNode);
- _anUpdateTree.forEachChange(aUpdater);
- }
-//--------------------------------------------------------------------------
-// apply a set of changes to the target tree
- void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode)
- {
- // POST: pSubtree = pSubtree + aChangeList
- SubtreeChange aActualChanges(_anUpdateTree, treeop::NoChildCopy());
-
- if ( AdjustUpdate::adjust(aActualChanges,_anUpdateTree, _aRootNode) )
- {
- applyUpdateToTree(aActualChanges, _aRootNode);
- }
- _anUpdateTree.swap(aActualChanges);
-
- }
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-static inline
-rtl::OUString getNodeName(INode const & _aNode)
-{
- return _aNode.getName();
-}
-//--------------------------------------------------------------------------
-
-static inline
-rtl::OUString getChangeNodeName(Change const & _aChange)
-{
- return _aChange.getNodeName();
-}
-//--------------------------------------------------------------------------
-
-bool AdjustUpdate::impl_adjust(SubtreeChange& _aUpdateTree)
-{
- // first check the changes
- this->applyToChildren(_aUpdateTree);
-
- // now check whether there are real modifications
- OChangeActionCounter aChangeCounter;
- aChangeCounter.handle(m_rChangeList);
- CFG_TRACE_INFO_NI("cache manager: counted changes : additions: %i , removes: %i, value changes: %i", aChangeCounter.nAdds, aChangeCounter.nRemoves, aChangeCounter.nValues);
-
- return !! aChangeCounter.hasChanges();
-}
-// -----------------------------------------------------------------------------
-
-inline bool AdjustUpdate::checkNode() const
-{
- // Change a Value
- OSL_ENSURE(m_refNode != 0, "AdjustUpdate: no data");
-
- return m_refNode != 0;
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(ValueChange& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // We have a node so we can keep the Change and the values do not differ
- if (childNode != 0)
- {
- bool bIsValue = childNode->isValue();
- OSL_ENSURE(bIsValue, "AdjustUpdate : node must be a value node!");
-
- if (bIsValue && _rChange.isChange())
- {
- std::auto_ptr<Change> pChange( new ValueChange(_rChange) );
- m_rChangeList.addChange(pChange);
- }
- }
- else
- {
- std::auto_ptr<ValueNode> pNode = m_aNodeConverter.createCorrespondingNode(_rChange);
-
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Adding a new value to a non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(base_ptr(pNode),sTypeName);
- // add the tree to the change list
- std::auto_ptr<Change> pChange( new AddNode( aNewTree,_rChange.getNodeName(), _rChange.isToDefault()) );
- m_rChangeList.addChange(pChange);
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(SubtreeChange& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // if there is a node we continue
- if (childNode != 0)
- {
- bool bIsSubtree = childNode->isGroup() || childNode->isSet();
- OSL_ENSURE(bIsSubtree, "AdjustUpdate : node must be a inner node!");
-
- if (bIsSubtree)
- {
- // generate a new change
- std::auto_ptr<SubtreeChange> pChange( new SubtreeChange(_rChange, treeop::NoChildCopy()) );
-
- // recurse
- if ( adjust(*pChange,_rChange,childNode,m_aNodeConverter.nodeFactory()) )
- m_rChangeList.addChange(base_ptr(pChange));
- }
- else
- OSL_ENSURE(false, "Inconsistent data: Subtree Change is merged into non-subtree node.");
- }
- // otherwise we have to create the node
- else
- {
- std::auto_ptr<ISubtree> pNode = m_aNodeConverter.createCorrespondingTree(_rChange);
- OSL_ASSERT(pNode.get() != NULL);
-
- // set the level
- pNode->setLevels(treeop::ALL_LEVELS,treeop::ALL_LEVELS);
-
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Adding a new value to a non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(base_ptr(pNode), sTypeName);
-
- // add the tree to the change list
- std::auto_ptr<Change> pChange( new AddNode(aNewTree,_rChange.getNodeName(), _rChange.isToDefault()) );
- m_rChangeList.addChange( pChange );
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(RemoveNode& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // only if there is a node, we will keep the change
- if (childNode != 0)
- {
- // generate a new change
- std::auto_ptr<Change> pChange( new RemoveNode(_rChange.getNodeName(),_rChange.isToDefault()) );
- m_rChangeList.addChange(pChange);
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(AddNode& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- rtl::Reference< data::TreeSegment > aNewNode = _rChange.getNewTree();
- std::auto_ptr<AddNode> pChange( new AddNode(aNewNode,_rChange.getNodeName(),_rChange.isToDefault()) );
- if (childNode != 0)
- {
- pChange->setReplacing();
- }
- m_rChangeList.addChange(base_ptr(pChange));
- }
-}
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-inline
-void ApplyValueChange::adjust(uno::Any& aActual, uno::Any const& aTarget)
-{
- // If set - it should already match
- OSL_ASSERT(!aActual.hasValue() || aTarget == aActual);
- aActual = aTarget;
-}
-
-//--------------------------------------------------------------------------
-// _rValueChange.applyTo(_aValueNode)
-void ApplyValueChange::apply(ValueChange& _rValueChange, sharable::ValueNode * valueNode)
-{
- switch (_rValueChange.getMode())
- {
- case ValueChange::wasDefault:
- OSL_ASSERT(valueNode->info.isDefault());
-
- case ValueChange::changeValue:
- adjust( _rValueChange.m_aOldValue, valueNode->getValue());
- valueNode->setValue(_rValueChange.getNewValue());
- break;
-
- case ValueChange::setToDefault:
- adjust(_rValueChange.m_aOldValue, valueNode->getValue());
- adjust(_rValueChange.m_aValue, valueNode->getDefaultValue());
- valueNode->setToDefault();
- break;
-
- case ValueChange::changeDefault:
- adjust(_rValueChange.m_aOldValue, valueNode->getDefaultValue());
- valueNode->changeDefault(_rValueChange.getNewValue());
- break;
-
- default:
- OSL_ENSURE(0, "Unknown mode found for ValueChange");
- break;
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(ValueChange& _rChange)
-{
- // Change a Value
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply ValueChange without node");
-
- sharable::Node * childNode = m_aCurrentNode->getSubnode(getChangeNodeName(_rChange));
- OSL_ENSURE(childNode != 0, "Cannot apply Change: No node to change");
-
- sharable::ValueNode * aValueAddr = childNode->valueData();
- OSL_ENSURE(aValueAddr != NULL,"Cannot apply ValueChange: Node is not a value");
-
- if (aValueAddr != NULL)
- ApplyValueChange::apply(_rChange,aValueAddr);
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(SubtreeChange& _rChange)
-{
- // handle traversion
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply SubtreeChange without node");
-
- sharable::Node * childNode = m_aCurrentNode->getSubnode(getChangeNodeName(_rChange));
- OSL_ENSURE(childNode != 0, "Cannot apply Change: No node to change");
-
- OSL_ENSURE( childNode->isGroup() || childNode->isSet(),
- "Cannot Apply SubtreeChange: Node is not an inner node");
-
- if (childNode != 0)
- {
- childNode->info.markAsDefault( _rChange.isToDefault() );
-
- sharable::Node * aOldNode = m_aCurrentNode;
- m_aCurrentNode = childNode;
-
- _rChange.forEachChange(*this);
-
- m_aCurrentNode = aOldNode;
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(AddNode& _rChange)
-{
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply AddNode without node");
-
- sharable::SetNode * aSetNodeAddr = sharable::SetNode::from(m_aCurrentNode);
- OSL_ENSURE(aSetNodeAddr != NULL,"Cannot apply AddNode: Node is not a set node");
-
- // Add a new element
- if (aSetNodeAddr != NULL)
- {
- if (_rChange.isReplacing())
- {
- sharable::TreeFragment * old = aSetNodeAddr->removeElement(getChangeNodeName(_rChange));
- OSL_ASSERT(old != 0);
- _rChange.takeReplacedTree(data::TreeSegment::create(old));
- }
-
- sharable::TreeFragment * aNewAddress = data::buildTree(_rChange.getNewTree()->fragment);
- OSL_ENSURE(aNewAddress != NULL, "ApplyUpdate: AddNode: could not create new element");
-
- aSetNodeAddr->addElement(aNewAddress);
-
- _rChange.setInsertedAddress( aNewAddress );
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(RemoveNode& _rChange)
-{
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply RemoveNode without node");
-
- sharable::SetNode * aSetNodeAddr = sharable::SetNode::from(m_aCurrentNode);
- OSL_ENSURE(aSetNodeAddr != NULL,"Cannot apply RemoveNode: Node is not a set node");
-
- // Remove an element
- if (aSetNodeAddr != NULL)
- {
- sharable::TreeFragment * old = aSetNodeAddr->removeElement(getChangeNodeName(_rChange));
- OSL_ASSERT(old != 0);
- _rChange.takeRemovedTree(data::TreeSegment::create(old));
- }
-}
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- struct ForwardTreeDifferenceBuilder : NodeAction
- {
- protected:
- SubtreeChange& m_rChangeList;
- sharable::Node * m_cacheNode;
-
- public:
- ForwardTreeDifferenceBuilder(SubtreeChange& rList, sharable::Node * cacheNode)
- : m_rChangeList(rList)
- , m_cacheNode(cacheNode)
- {
- }
-
- virtual void handle(ValueNode const& _aNewNode)
- {
- sharable::Node * childNode = m_cacheNode->getSubnode(getNodeName(_aNewNode));
- if (childNode != 0)
- {
- sharable::ValueNode * valueNode = childNode->valueData();
-
- OSL_ENSURE(valueNode != 0, "TreeDifferenceBuilder: node must be a value node!");
-
- // if the values differ add a new change
- if (_aNewNode.getValue() != valueNode->getValue())
- {
- bool bNewDefault = _aNewNode.isDefault();
- bool bOldDefault = valueNode->info.isDefault();
-
- ValueChange::Mode eMode;
- if (bNewDefault)
- if (bOldDefault)
- eMode = ValueChange::changeDefault;
- else
- eMode = ValueChange::setToDefault;
- else
- if (bOldDefault)
- eMode = ValueChange::wasDefault;
- else
- eMode = ValueChange::changeValue;
-
- std::auto_ptr<Change> pChange(
- new ValueChange(_aNewNode.getName(), _aNewNode.getAttributes(), eMode,
- _aNewNode.getValue(), valueNode->getValue()) );
-
- m_rChangeList.addChange(pChange);
- }
- }
- }
- virtual void handle(ISubtree const& _aNewNode)
- {
- sharable::Node * childNode = m_cacheNode->getSubnode(getNodeName(_aNewNode));
-
- if (childNode != 0)
- {
- OSL_ENSURE( childNode->isGroup() || childNode->isSet(),
- "ForwardTreeDifferenceBuilder: Node must be an inner node");
-
- // generate a new change
- std::auto_ptr<SubtreeChange> pNewChange( new SubtreeChange(_aNewNode) );
-
- // .. and recurse
- ForwardTreeDifferenceBuilder aNextLevel(*pNewChange, childNode);
- aNextLevel.applyToChildren(_aNewNode);
-
- // now count if there are any changes
- OChangeActionCounter aCounter;
- aCounter.applyToChange(*pNewChange);
-
- if (aCounter.hasChanges())
- m_rChangeList.addChange(base_ptr(pNewChange));
- }
- else if (m_cacheNode != 0 && m_cacheNode->isSet())
- {
- // Subtree not in Cache, add in TreeChangeList
- // SubtreeChange* pChange = new SubtreeChange(_rSubtree);
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Found newly added node in non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- std::auto_ptr<INode> pSubtree( _aNewNode.clone() );
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(pSubtree,sTypeName);
-
- std::auto_ptr<Change> pAdd(new AddNode(aNewTree, _aNewNode.getName(), _aNewNode.isDefault()));
-
- m_rChangeList.addChange(pAdd);
- }
- else
- OSL_ENSURE(false, "Found newly added node in group");
-
- }
- };
-// -----------------------------------------------------------------------------
-
-class BackwardTreeDifferenceBuilder: public data::SetVisitor {
-public:
- BackwardTreeDifferenceBuilder(SubtreeChange & list, ISubtree const * node):
- m_changeList(list), m_newNode(node) {}
-
- void applyToChildren(sharable::Node * cacheNode) {
- OSL_ASSERT(cacheNode != 0);
- if (cacheNode->isGroup()) {
- OSL_ASSERT(!m_changeList.isSetNodeChange());
- visitChildren(&cacheNode->group);
- } else if (cacheNode->isSet()) {
- OSL_ASSERT(m_changeList.isSetNodeChange());
- visitElements(&cacheNode->set);
- } else {
- OSL_ASSERT(false);
- }
- }
-
-private:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::Node * node) {
- OSL_ASSERT(!node->isValue());
- INode const * newChild = m_newNode->getChild(node->getName());
- ISubtree const * newTree = newChild == 0 ? 0 : newChild->asISubtree();
- if (newTree != 0) {
- // Traverse down to next change:
- Change * change = m_changeList.getChange(node->getName());
- std::auto_ptr< Change > newChange;
- SubtreeChange * groupChange = 0;
- if (change == 0) {
- groupChange = new SubtreeChange(*newTree);
- newChange.reset(groupChange);
- } else {
- groupChange = dynamic_cast< SubtreeChange * >(change);
- OSL_ASSERT(groupChange != 0);
- }
- if (groupChange != 0) {
- BackwardTreeDifferenceBuilder(*groupChange, newTree).
- applyToChildren(node);
- if (newChange.get() != 0) {
- // Now count if there are any real changes:
- OChangeActionCounter counter;
- counter.applyToChange(*newChange);
- if (counter.hasChanges()) {
- m_changeList.addChange(newChange);
- }
- }
- }
- }
- return false;
- }
-
- virtual bool handle(sharable::ValueNode *) {
- return false;
- }
-
- virtual bool handle(sharable::TreeFragment * tree) {
- INode const * newElement = m_newNode->getChild(tree->getName());
- if (newElement == 0) {
- // Remove node:
- std::auto_ptr< Change > remove(
- new RemoveNode(tree->getName(), tree->isNew()));
- m_changeList.addChange(remove);
- return false;
- } else {
- // Handle the root node:
- return SetVisitor::handle(tree);
- }
- }
-
- SubtreeChange & m_changeList;
- ISubtree const * m_newNode;
-};
-
-//--------------------------------------------------------------------------
-
-// apply a set of changes to the target tree, return true, if there are changes found
- bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, sharable::Node * existingData, ISubtree const & _aNewData)
- {
- OSL_ENSURE(existingData != 0, "Trying to create diffrence for empty data");
- // create the differences
- ForwardTreeDifferenceBuilder aForwardTreeDifference(_rResultingUpdateTree, existingData);
- aForwardTreeDifference.applyToChildren(_aNewData);
-
- BackwardTreeDifferenceBuilder aBackwardTreeDifference(_rResultingUpdateTree, & _aNewData);
- aBackwardTreeDifference.applyToChildren(existingData);
-
- return true;
- }
-//--------------------------------------------------------------------------
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/treecache/cacheaccess.cxx b/configmgr/source/treecache/cacheaccess.cxx
deleted file mode 100644
index f2b100575d4f..000000000000
--- a/configmgr/source/treecache/cacheaccess.cxx
+++ /dev/null
@@ -1,352 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cacheaccess.hxx"
-#include "tracer.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
-
-CacheClientAccess::CacheClientAccess(ConfigChangeBroadcastHelper * _pBroadcastHelper)
-: m_pBroadcastHelper( _pBroadcastHelper )
-{
-}
-// -------------------------------------------------------------------------
-
-CacheClientAccess::~CacheClientAccess()
-{
- OSL_ENSURE(!m_pBroadcastHelper, "Forgot to dispose broadcast helper");
-}
-// -------------------------------------------------------------------------
-
-ConfigChangeBroadcastHelper * CacheClientAccess::releaseBroadcaster()
-{
- ConfigChangeBroadcastHelper * pRet = m_pBroadcastHelper;
- m_pBroadcastHelper = NULL;
- return pRet;
-}
-
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::hasModule(const configuration::AbsolutePath& _aLocation)
-{
- return this->m_aData.hasModule(_aLocation.getModuleName());
-}
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::hasModuleDefaults(configuration::AbsolutePath const& _aLocation)
-{
- return this->m_aData.hasModuleDefaults(_aLocation.getModuleName());
-}
-// -------------------------------------------------------------------------
-void CacheClientAccess::attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule)
-{
- this->m_aData.attachModule(_aLocation, _aModule);
-}
-// -------------------------------------------------------------------------
-
-sharable::Node * CacheClientAccess::acquireNode(configuration::AbsolutePath const& rLocation )
-{
- CFG_TRACE_INFO("CacheClientAccess: Requesting data for path '%s'", OUSTRING2ASCII(rLocation.toString()) );
-
- sharable::Node * aResult = this->m_aData.acquireNode(rLocation);
-
- if (aResult != NULL)
- {
- CFG_TRACE_INFO_NI("- Data is available - returning Subtree");
- }
- else
- CFG_TRACE_INFO_NI("- Data is not available - returning NULL");
-
- return aResult;
-}
-// -------------------------------------------------------------------------
-
-oslInterlockedCount CacheClientAccess::releaseNode( configuration::AbsolutePath const& rLocation )
-{
- CFG_TRACE_INFO("Tree Info: Releasing subtree data for path '%s'", OUSTRING2ASCII(rLocation.toString()) );
-
- oslInterlockedCount nRet = this->m_aData.releaseModule(rLocation.getModuleName(),false);
-
- return nRet;
-}
-// -----------------------------------------------------------------------------
-
-void CacheClientAccess::applyUpdate(backend::UpdateInstance & _aUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheClientAccess: Merging changes into subtree '%s'", OUSTRING2ASCII(_aUpdate.root().toString()) );
-
- this->m_aData.applyUpdate(_aUpdate );
-}
-
-// -----------------------------------------------------------------------------
-sharable::Node * CacheClientAccess::findInnerNode( configuration::AbsolutePath const& aComponentName )
-{
- sharable::Node * node = m_aData.getNode(aComponentName);
- return node == 0 || node->isValue() ? 0 : node;
-}
-
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::insertDefaults( backend::NodeInstance const & _aDefaultData ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("Tree Info: Adding default data for path '%s'", OUSTRING2ASCII(_aDefaultData.root().toString()) );
-
- return this->m_aData.insertDefaults(_aDefaultData);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-CacheLoadingAccess::CacheLoadingAccess()
-: m_aDeadModules()
-{
-}
-// -------------------------------------------------------------------------
-
-CacheLoadingAccess::~CacheLoadingAccess()
-{
-}
-
-// -------------------------------------------------------------------------
-
-/// gets a tree reference for the given path if exists
-sharable::TreeFragment * CacheLoadingAccess::getTreeAddress(rtl::OUString const & _aModule)
-{
- return this->m_aData.getTreeAddress(_aModule);
-}
-// -------------------------------------------------------------------------
-void CacheLoadingAccess::createModule(rtl::OUString const & _aModule)
-{
- this->m_aData.createModule(_aModule);
-}
-// -------------------------------------------------------------------------
-bool CacheLoadingAccess::hasModule(rtl::OUString const & _aModule)
-{
- return this->m_aData.hasModule(_aModule);
-}
-// -------------------------------------------------------------------------
-
-bool CacheLoadingAccess::acquireModule(rtl::OUString const & _aModule)
-{
- CFG_TRACE_INFO("Tree Info: Requesting data for module '%s'", OUSTRING2ASCII(_aModule));
-
- if (this->m_aData.acquireModule(_aModule))
- {
- m_aDeadModules.erase( _aModule );
- CFG_TRACE_INFO_NI("- Data is available - returning Subtree");
- return true;
- }
- else
- {
- CFG_TRACE_INFO_NI("- Data is not available - returning NULL");
- return false;
- }
-}
-// -------------------------------------------------------------------------
-
-oslInterlockedCount CacheLoadingAccess::releaseModule( rtl::OUString const & _aModule )
-{
- CFG_TRACE_INFO("Tree Info: Releasing data for module '%s'", OUSTRING2ASCII(_aModule) );
-
- oslInterlockedCount nRet = this->m_aData.releaseModule(_aModule,true); // keep
- if (nRet == 0)
- {
- m_aDeadModules[ _aModule ] = TimeStamp::getCurrentTime();
- CFG_TRACE_INFO_NI("- Last reference released - marking data for cleanup");
- }
-
- return nRet;
-}
-// -----------------------------------------------------------------------------
-
-bool CacheLoadingAccess::isEmpty()
-{
- ExtendedCacheData::ModuleList& rModules = this->m_aData.accessModuleList();
-
- bool bRet = rModules.empty();
-
- if (bRet) // while we are at it - clean up
- m_aDeadModules.clear();
-
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheLoadingAccess::addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bIncludesDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheLoadingAccess: Adding component data for module '%s' : %s",
- OUSTRING2ASCII(_aComponentInstance.component()),
- _bIncludesDefaults ? "Data includes defaults." : "Data does not include defaults." );
-
- sharable::TreeFragment * aResult = this->m_aData.addComponentData(_aComponentInstance, _bIncludesDefaults);
- if (aResult != NULL)
- {
- m_aDeadModules.erase( _aComponentInstance.component() );
- CFG_TRACE_INFO_NI("- Data added successfully - returning Subtree");
- }
- else
- CFG_TRACE_INFO_NI("- Data not added - returning NULL");
-
- return aResult;
-}
-// -------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void CacheLoadingAccess::addChangesToPending( backend::ConstUpdateInstance const& _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- // NICE: m_pPending[_rLocation] += pSubtreeChange;
- CFG_TRACE_INFO("CacheLoadingAccess: Adding pending changes for subtree '%s'", OUSTRING2ASCII(_anUpdate.root().toString()) );
-
- this->m_aData.addPending(_anUpdate);
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> CacheLoadingAccess::releasePendingChanges(rtl::OUString const& _aComponentName)
-{
- CFG_TRACE_INFO("Tree Info: extract pending changes from subtree '%s'", OUSTRING2ASCII(_aComponentName) );
- return this->m_aData.releasePending(_aComponentName);
-}
-
-// -----------------------------------------------------------------------------
-bool CacheLoadingAccess::findPendingChangedModules( std::vector< rtl::OUString > & _rPendingList )
-{
- this->m_aData.findPendingModules(_rPendingList);
- return !_rPendingList.empty();
-}
-
-// -------------------------------------------------------------------------
-
-TimeStamp CacheLoadingAccess::collectDisposeList(std::vector< rtl::Reference<CacheLine> > & _rList, TimeStamp const & _aLimitTime, TimeInterval const & _aDelay)
-{
- TimeStamp aRetTime = TimeStamp::never();
-
- CFG_TRACE_INFO("Tree Info: Collecting disposable module trees for cleanup" );
-
- ExtendedCacheData::ModuleList& rActiveModules = this->m_aData.accessModuleList();
-
- std::map< rtl::OUString, TimeStamp >::iterator it = m_aDeadModules.begin();
-
- while (it != m_aDeadModules.end())
- {
- std::map< rtl::OUString, TimeStamp >::iterator current = it;
- // increment here, as we may later erase(current)
- ++it;
-
-#if (OSL_DEBUG_LEVEL > 0) || defined _DBG_UTIL || defined CFG_TRACE_ENABLE
- rtl::OUString sCurrentName( current->first );
-#endif
- TimeStamp aExpireTime = current->second + _aDelay;
- if (aExpireTime <= _aLimitTime)
- {
- ExtendedCacheData::ModuleList::iterator itModule = rActiveModules.find( current->first );
-
- if (itModule != rActiveModules.end())
- {
- rtl::Reference<CacheLine> xModule = itModule->second;
-
- bool bHandled = false;
-
- if (!xModule.is())
- {
- CFG_TRACE_ERROR_NI("- Unexpected: Module '%s' is NULL in active module list", OUSTRING2ASCII(sCurrentName) );
- bHandled = true;
- }
- else if (xModule->clientReferences() != 0)// at least in temporary use
- {
- OSL_ENSURE( false, "Referenced entry in dead module list");
-
- CFG_TRACE_WARNING_NI("- Module '%s' in (temporary ?) use - rescheduling", OUSTRING2ASCII(sCurrentName) );
- bHandled = false; // still remove from the lists
- }
- else if (m_aData.hasPending(current->first))
- {
- CFG_TRACE_WARNING_NI("- Module '%s' has pending changes - rescheduling disposal", OUSTRING2ASCII(sCurrentName) );
- bHandled = false;
- }
- else // now this really can be disposed
- {
- CFG_TRACE_INFO_NI("- Removing module '%s' for disposal", OUSTRING2ASCII(sCurrentName) );
-
- // It really is ok to dispose this entry
- _rList.push_back(xModule);
-
- bHandled = true;
- }
-
-
- if (bHandled)
- {
- // really remove
- rActiveModules.erase(itModule);
- m_aDeadModules.erase(current);
- }
- else
- {
- // reschedule
- TimeStamp aRetryTime = _aLimitTime + _aDelay;
- OSL_ASSERT(aRetryTime > _aLimitTime);
-
- current->second = _aLimitTime; // ?
- if (aRetryTime < aRetTime)
- aRetTime = aRetryTime;
- }
- }
- else
- {
- // obsolete dispose list entry - discard
- OSL_ENSURE( false, "Obsolete entry in dead module list");
-
- CFG_TRACE_WARNING_NI("- Module '%s' not found any more - obsolete entry in dead module list", OUSTRING2ASCII(sCurrentName) );
-
- m_aDeadModules.erase(current);
- }
- }
- else // consider for restart time
- {
- CFG_TRACE_INFO_NI("- Module '%s' has not expired yet - rescheduling", OUSTRING2ASCII(sCurrentName) );
-
- if (aExpireTime < aRetTime)
- aRetTime = aExpireTime;
- }
- }
-
- OSL_ASSERT(aRetTime > _aLimitTime);
- return aRetTime;
-}
-// -------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cacheaccess.hxx b/configmgr/source/treecache/cacheaccess.hxx
deleted file mode 100644
index b73eaa87f2b6..000000000000
--- a/configmgr/source/treecache/cacheaccess.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEACCESS_HXX
-#define CONFIGMGR_CACHEACCESS_HXX
-
-#include "cachedata.hxx"
-#include "timestamp.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <osl/mutex.hxx>
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
- class ConfigChangeBroadcastHelper;
- namespace backend
- {
- class CacheController;
- }
-//-----------------------------------------------------------------------------
-
- class CacheClientAccess: private boost::noncopyable, public salhelper::SimpleReferenceObject
- {
- private:
- CacheData m_aData;
-
- ConfigChangeBroadcastHelper* m_pBroadcastHelper;
- public:
- explicit
- CacheClientAccess(ConfigChangeBroadcastHelper* _pBroadcastHelper);
-
- ~CacheClientAccess();
-
- /// gets a helper to broadcast changes for
- ConfigChangeBroadcastHelper * getBroadcaster() const
- { return m_pBroadcastHelper; }
-
- /// removes an existing broadcast helper
- ConfigChangeBroadcastHelper * releaseBroadcaster();
-
- // attach a module with a given name
- void attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(const configuration::AbsolutePath& _aLocation);
- /// checks if the given module exists and has defaults available
- bool hasModuleDefaults(configuration::AbsolutePath const & _aLocation);
-
- /// retrieve the subtree at _aPath (maybe if it has the requested defaults) and clientAcquire() it
- sharable::Node * acquireNode(configuration::AbsolutePath const& _aPath);
-
- /** add or merge the given subtree at the given location,
- return <TRUE/> if the tree has defaults then
- */
- bool insertDefaults( backend::NodeInstance const & _aDefaultData ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseNode( configuration::AbsolutePath const& _aPath );
-
- /// retrieve the given subtree without changing its ref count
- sharable::Node * findInnerNode(configuration::AbsolutePath const& _aPath );
-
- /// merge the given change list into this tree - reflects old data to _aUpdate
- void applyUpdate(backend::UpdateInstance & _aUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-
- class CacheLoadingAccess: private boost::noncopyable, public salhelper::SimpleReferenceObject
- {
- public:
- friend class backend::CacheController;
- private:
- friend class CacheDisposeScheduler;
-
- ExtendedCacheData m_aData;
- std::map< rtl::OUString, TimeStamp > m_aDeadModules; /// list of nodes which are registered for throwing away
- public:
- explicit
- CacheLoadingAccess();
- ~CacheLoadingAccess();
-
- /// gets a tree address for the given module if it exists
- sharable::TreeFragment * getTreeAddress(rtl::OUString const & _aModule);
-
- /// return TRUE if there is no data (left) in this object's cache data
- bool isEmpty();
-
- // create a module with a given name
- void createModule(rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(rtl::OUString const & _aLocation);
- /// retrieve the subtree at aComponentName and clientAcquire() it, true if succeeded
- bool acquireModule(rtl::OUString const & _aModule);
-
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseModule( rtl::OUString const & _aModule );
-
- /// collect the modules that can be disposed now (i.e. released after _rLimitReleaseTime)
- TimeStamp collectDisposeList(std::vector< rtl::Reference<CacheLine> > & _rList,
- TimeStamp const & _aLimitTime,
- TimeInterval const & _aDelay);
-
- // stuff that is particular for CacheLoadingAccess
- /** add the given subtree at the given location,
- return the tree that is then pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bIncludesDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// merge the given change list into the pending change list of this tree
- void addChangesToPending( backend::ConstUpdateInstance const& _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException));
- /// retrieve accumulated pending changes
- std::auto_ptr<SubtreeChange> releasePendingChanges(rtl::OUString const& _aModule);
-
- /// find the modules having pending changes
- bool findPendingChangedModules( std::vector< rtl::OUString > & _rPendingList );
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachecontroller.cxx b/configmgr/source/treecache/cachecontroller.cxx
deleted file mode 100644
index d67885e5f321..000000000000
--- a/configmgr/source/treecache/cachecontroller.cxx
+++ /dev/null
@@ -1,716 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachecontroller.hxx"
-#include "disposetimer.hxx"
-#include "cachewritescheduler.hxx"
-#include "builddata.hxx"
-#include "localizedtreeactions.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
- namespace backend
- {
-
-static const rtl::OUString kCacheDisposeDelay(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheDisposeDelay"));
-static const rtl::OUString kCacheDisposeInterval(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheDisposeInterval"));
-static const rtl::OUString kCacheWriteInterval(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheWriteInterval"));
-// -------------------------------------------------------------------------
-
-OTreeDisposeScheduler* CacheController::createDisposer(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext)
-{
- ContextReader aReader(_xContext);
- sal_uInt32 c_nDefaultDelay = 0;
- rtl::OUString sDefaultDelay;
- aReader.getBestContext()->getValueByName(kCacheDisposeDelay) >>= sDefaultDelay;
- c_nDefaultDelay = sDefaultDelay.toInt32()==0?900:sDefaultDelay.toInt32() ;
-
- sal_uInt32 c_nDefaultInterval = 0;
- rtl::OUString sDefaultInterval;
- aReader.getBestContext()->getValueByName(kCacheDisposeInterval) >>= sDefaultInterval;
- c_nDefaultInterval = sDefaultInterval.toInt32()==0?60:sDefaultInterval.toInt32();
-
- TimeInterval aDelay(c_nDefaultDelay);
- TimeInterval aInterval(c_nDefaultInterval);
-
- return new OTreeDisposeScheduler(*this, aDelay, aInterval);
-}
-
-// -----------------------------------------------------------------------------
-
-OCacheWriteScheduler* CacheController::createCacheWriter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext)
-{
- ContextReader aReader(_xContext);
- sal_uInt32 c_nDefaultInterval=0;
- rtl::OUString sDefaultInterval;
- aReader.getBestContext()->getValueByName(kCacheWriteInterval) >>= sDefaultInterval;
- c_nDefaultInterval = sDefaultInterval.toInt32()==0?2:sDefaultInterval.toInt32();
-
- TimeInterval aInterval(c_nDefaultInterval);
- return new OCacheWriteScheduler(*this, aInterval);
-}
-// ----------------------------------------------------------------------------
-
-rtl::Reference<CacheLoadingAccess> CacheController::getCacheAlways(RequestOptions const & _aOptions)
-{
- rtl::Reference<CacheLoadingAccess> aResult = m_aCacheMap.get(_aOptions);
- if (!aResult.is())
- {
- rtl::Reference<CacheLoadingAccess> aNewCache( new CacheLoadingAccess() );
- aResult = m_aCacheMap.insert(_aOptions,aNewCache);
- }
- return aResult;
-}
-
-// -------------------------------------------------------------------------
-
-// disposing
-// -------------------------------------------------------------------------
-void CacheController::disposeAll(bool _bFlushRemainingUpdates)
-{
- CFG_TRACE_INFO("CacheController: Disposing all data" );
- CacheMap::Map aReleaseList;
-
- if (m_pDisposer)
- {
- m_pDisposer->stopAndClearTasks();
- m_aCacheMap.swap(aReleaseList); // move data out of m_aCacheMap and empty m_aCacheMap
- }
-
- if (_bFlushRemainingUpdates)
- {
- for (CacheMap::Map::iterator it = aReleaseList.begin(); it != aReleaseList.end(); ++it)
- saveAllPendingChanges(it->second,it->first);
- }
- // free all the trees
- aReleaseList.clear();
-}
-
-// -------------------------------------------------------------------------
-void CacheController::dispose() SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- UnoApiLock aLock;
-
- CFG_TRACE_INFO("CacheController: dispose()" );
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::dispose(), disable lazy write cache.");
- m_bDisposing = true; // we are in dispose, handling of errors must be something different.
-
- // writing of pending updates
- this->flushCacheWriter();
-
- // cleaning the cache
- this->disposeAll(true);
-}
-
-// -------------------------------------------------------------------------
-CacheController::CacheController(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- const uno::Reference<uno::XComponentContext>& xContext)
-: m_aNotifier()
-, m_xBackend(_xBackend)
-, m_aCacheMap()
-, m_aTemplates()
-, m_pDisposer()
-, m_pCacheWriter()
-, m_bDisposing(false)
-{
- m_pDisposer = this->createDisposer(xContext);
- m_pCacheWriter = this->createCacheWriter(xContext);
-}
-
-// -------------------------------------------------------------------------
-CacheController::~CacheController()
-{
- OSL_ENSURE(m_bDisposing == true, "CacheController::dispose() wasn't called, something went wrong.");
-
- delete m_pDisposer;
- delete m_pCacheWriter;
-}
-
-// -------------------------------------------------------------------------
-void CacheController::closeModules(std::vector< rtl::Reference<CacheLine> > & _aList, RequestOptions const & _aOptions)
-{
- //Remove listeners from Backend as module no longer in cache
- for (sal_uInt32 i =0; i < _aList.size(); ++i)
- {
- rtl::OUString aModuleName = _aList[i]->getModuleName();
- ComponentRequest aRequest(aModuleName, _aOptions);
- m_xBackend->removeRequestListener(this, aRequest);
- }
-}
-// -------------------------------------------------------------------------
-#if 0
-static
-std::auto_ptr<ISubtree> reduceSubtreeForLocale(std::auto_ptr<ISubtree> _pSubtree, RequestOptions const & _aOptions)
-{
- OSL_ENSURE(!_pSubtree.get() || !isLocalizedValueSet(*_pSubtree), "Unexpected node. Expecting a subtree, Found a single localized value.");
-
- std::auto_ptr<ISubtree> aRet;
-
- std::auto_ptr<INode> aReduced = reduceExpandedForLocale(_pSubtree, _aOptions.getLocale());
-
- if (aReduced.get())
- {
- if (ISubtree* pReduced =aReduced->asISubtree())
- {
- aRet.reset(pReduced);
- aReduced.release();
- }
- else
- {
- OSL_ENSURE(false, "Tree unexpectedly reduced to non-tree");
- }
- }
- else
- OSL_ENSURE(!_pSubtree.get(), "Tree unexpectedly reduced to nothing");
-
- return aRet;
-}
-#endif
-
-// -------------------------------------------------------------------------
-sharable::TreeFragment * CacheController::loadComponent(ComponentRequest const & _aRequest)
-{
- CFG_TRACE_INFO("CacheController: loading component '%s'", OUSTRING2ASCII(_aRequest.getComponentName()));
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::loadComponent()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "component: %s", RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- rtl::Reference<CacheLoadingAccess> aCache = this->getCacheAlways(_aRequest.getOptions());
-
- OSL_ENSURE(aCache.is(), "Could not create CacheAccess");
-
- sharable::TreeFragment * aTemplateResultAdddress;
-
- OSL_ENSURE(!_aRequest.isForcingReload(),"CacheController: No support for forced requests");
- if (aCache->hasModule(_aRequest.getComponentName()))
- {
- CFG_TRACE_INFO_NI("CacheController: found node in cache");
- if (_aRequest.getOptions().isRefreshEnabled())
- {
- refreshComponent(_aRequest);
- }
- aCache->acquireModule(_aRequest.getComponentName());
- }
- else
- {
- ResultHolder< ComponentInstance > aData = this->loadDirectly(_aRequest,true);
-
- CFG_TRACE_INFO_NI("CacheController: adding loaded data to the cache");
-
- aCache->createModule(_aRequest.getComponentName());
-
- aCache->addComponentData(aData.instance(), true);
- if (aData.instance().templateData().get()!=NULL)
- aTemplateResultAdddress = addTemplates(aData.mutableInstance().componentTemplateData() );
-
- // notify the new data to all clients
- m_aNotifier.notifyCreated(_aRequest);
- }
-
- return aCache->getTreeAddress(_aRequest.getComponentName());
-}
-// -------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > CacheController::getComponentData(ComponentRequest const & _aRequest,
- bool _bAddListenter ) SAL_THROW((com::sun::star::uno::Exception))
-{
- // TODO: Insert check here, if the data is in the cache already - and then clone
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getComponentData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "component: %s", RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- ResultHolder< ComponentInstance > aRet = this->loadDirectly(_aRequest, _bAddListenter);
-
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > CacheController::getDefaultData(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- // TODO: Insert check here, if the data is in the cache already - and then clone
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getDefaultData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "path: %s", RTL_LOGFILE_OU2A(_aRequest.getPath().toString()) );
-
- ResultHolder< NodeInstance > aRet = this->loadDefaultsDirectly(_aRequest);
-
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-configuration::AbsolutePath CacheController::encodeTemplateLocation(const rtl::OUString& _rName, const rtl::OUString &_rModule) const
-{
- namespace Path = configuration::Path;
-
-// static const
-// Component aTemplateRoot = wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- Path::Component aTemplateModule = Path::wrapSimpleName(_rModule);
- Path::Component aTemplateName = Path::wrapSimpleName(_rName);
-
- Path::Rep aResult(aTemplateName);
- aResult.prepend(aTemplateModule);
-// aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-// -------------------------------------------------------------------------
-#if 0
-static
-configuration::AbsolutePath templateLoadLocation(const configuration::AbsolutePath &_rTemplateLocation)
-{
- namespace Path = configuration::Path;
-
- static const
- Path::Component aTemplateRoot = Path::wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- Path::Rep aResult(_rTemplateLocation.rep());
- aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-#endif
-// -------------------------------------------------------------------------
-std::auto_ptr<ISubtree> CacheController::loadTemplateData(TemplateRequest const & _aTemplateRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- std::auto_ptr<ISubtree> aMultiTemplates;
- ResultHolder< TemplateInstance > aTemplateInstance = m_xBackend->getTemplateData(_aTemplateRequest);
- if (aTemplateInstance.is())
- {
- OSL_ASSERT(aTemplateInstance->name().getLength() == 0);
- if (ISubtree * pMulti = aTemplateInstance->data()->asISubtree())
- {
- aTemplateInstance.releaseAndClear();
- aMultiTemplates.reset(pMulti);
- }
- else
- OSL_ENSURE(false,"Requested multiple templates, got non-subtree node");
- }
- else
- OSL_ENSURE(false,"Requested configuration template does not exist");
-
- if (aMultiTemplates.get() == NULL)
- {
- CFG_TRACE_ERROR_NI("CacheController: could not load the templates");
- throw uno::Exception(::rtl::OUString::createFromAscii("The template description could not be loaded. The template does not exist."), NULL);
- }
-
- return aMultiTemplates;
-}
-// -------------------------------------------------------------------------
-sharable::TreeFragment * CacheController::addTemplates ( backend::ComponentDataStruct const & _aComponentInstance )
-{
- OSL_PRECOND(_aComponentInstance.data.get(), "addTemplates: Data must not be NULL");
- rtl::OUString aModuleName = _aComponentInstance.name;
- m_aTemplates.createModule(aModuleName);
- configuration::AbsolutePath aTemplateLocation = configuration::AbsolutePath::makeModulePath(_aComponentInstance.name);
- sharable::TreeFragment * aTemplateAddr = NULL;
-
- if (!m_aTemplates.hasNode(aTemplateLocation ))
- {
- CFG_TRACE_INFO_NI("CacheController: cache miss for that template - loading from backend");
- aTemplateAddr = m_aTemplates.addTemplates(_aComponentInstance );
- }
- OSL_ASSERT (aTemplateAddr != NULL);
- return aTemplateAddr;
- }
-// -------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheController::loadTemplate(TemplateRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
-
- OSL_ENSURE(_aRequest.getTemplateName().getLength() != 0, "CacheController::loadTemplate : invalid template name !");
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::loadTemplate()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) ,
- _aRequest.isComponentRequest() ?
- "*" : RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- rtl::OUString aModuleName = aTemplateLocation.getModuleName();
-
- configuration::AbsolutePath aTemplateParent (aTemplateLocation.getParentPath());
-
- //Load-if-not-there (componentwise)
- if (!m_aTemplates.hasNode(aTemplateParent))
- {
- OSL_ENSURE(aTemplateLocation.getDepth() > 1, "CacheController::ensureTemplate : invalid template location !");
- TemplateRequest aTemplateRequest = TemplateRequest::forComponent(_aRequest.getComponentName());
-
- std::auto_ptr<ISubtree> aMultiTemplates = loadTemplateData(aTemplateRequest);
- //add-if-not-loaded
- addTemplates(backend::ComponentDataStruct(aMultiTemplates, aModuleName));
-
- }
- sharable::TreeFragment * aTemplateAddr = m_aTemplates.getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- throw uno::Exception(::rtl::OUString::createFromAscii("Unknown template. Type description could not be found in the given module."), NULL);
-
- return m_aTemplates.getTreeAddress(aTemplateLocation.getModuleName());
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< TemplateInstance > CacheController::getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getTemplateData()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) ,
- _aRequest.isComponentRequest() ?
- "*" : RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- loadTemplate(_aRequest);
- //configuration::AbsolutePath aTemplateLocation = ensureTemplate(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- sharable::TreeFragment * aTemplateAddr = m_aTemplates.getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- throw uno::Exception(::rtl::OUString::createFromAscii("Unknown template. Type description could not be found in the given module."), NULL);
-
- std::auto_ptr<INode> aResultTree = data::convertTree(aTemplateAddr, true);
-
- TemplateInstance aResult(aResultTree,_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- return ResultHolder< TemplateInstance >(aResult);
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::saveAndNotify(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::saveAndNotify()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "location: %s", RTL_LOGFILE_OU2A(_anUpdate.getUpdateRoot().toString()) );
- try
- {
- // ---------- preworking on the changes ----------
- // caller must own a read lock on this cache line
- CFG_TRACE_INFO("CacheController: saving an update for '%s'",OUSTRING2ASCII(_anUpdate.getUpdateRoot().toString()));
-
- rtl::Reference<CacheLoadingAccess> aCache = m_aCacheMap.get(_anUpdate.getOptions());
-
- OSL_ENSURE(aCache.is(), "No cache data to update in saveAndNotify");
-
- if (!aCache.is()) throw lang::DisposedException(rtl::OUString::createFromAscii("Tree to be updated was already disposed"), NULL);
-
- aCache->addChangesToPending(_anUpdate.getUpdate());
-
- if ( _anUpdate.isSyncRequired()|| m_bDisposing ) // cannot do it asynchronously
- {
- CFG_TRACE_INFO_NI("Running synchronous write");
- savePendingChanges( aCache, getComponentRequest(_anUpdate) );
- }
-
- else
- {
- CFG_TRACE_INFO_NI("Posting asynchronous write");
- m_pCacheWriter->scheduleWrite( getComponentRequest(_anUpdate) );
- }
-
- CFG_TRACE_INFO_NI("Notifying the changes");
- // notify the changes to all clients
- m_aNotifier.notifyChanged(_anUpdate);
- }
- catch(configuration::Exception& ex)
- {
- CFG_TRACE_ERROR_NI("Got unexpected exception: %s", ex.what());
- configapi::ExceptionMapper e(ex);
- e.unhandled();
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::flushPendingUpdates()SAL_THROW((com::sun::star::uno::Exception))
-{
- CacheMap::Map aFlushList = m_aCacheMap.copy();
-
- for (CacheMap::Map::iterator it = aFlushList.begin(); it != aFlushList.end(); ++it)
- saveAllPendingChanges(it->second,it->first);
-}
-
-void CacheController::flushCacheWriter()SAL_THROW(())
-{
- //OSL_ASSERT(m_bDisposing);
-
- if (m_pCacheWriter)
- {
- CFG_TRACE_INFO("CacheController: flushing all pending updates");
-
- m_pCacheWriter->stopAndWriteCache();
- }
-}
-// -----------------------------------------------------------------------------
-
-bool CacheController::normalizeResult(std::auto_ptr<ISubtree> & _aResult, RequestOptions const & _aOptions)
-{
-
- if (_aResult.get()==NULL) return false;
-
- if (_aOptions.isForAllLocales()) return true;
-
- std::auto_ptr<INode> aReduced = reduceExpandedForLocale(_aResult, _aOptions.getLocale());
-
- std::auto_ptr<ISubtree> aReducedTree;
- if (aReduced.get())
- {
- if (ISubtree* pReducedTree =aReduced->asISubtree())
- {
- aReduced.release();
- aReducedTree.reset(pReducedTree);
- }
- else
- {
- OSL_ENSURE(false, "Tree unexpectedly reduced to non-tree");
- }
- }
- else
- OSL_ENSURE(false, "Tree unexpectedly reduced to nothing");
-
-
- _aResult = aReducedTree;
- bool retCode = _aResult.get()!=NULL ? true : false;
- return retCode;
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > CacheController::loadDirectly(ComponentRequest const & _aRequest, bool _bAddListenter) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: loading data for component '%s' from the backend", OUSTRING2ASCII(_aRequest.getComponentName()));
-
- configuration::AbsolutePath aRequestPath = configuration::AbsolutePath::makeModulePath(_aRequest.getComponentName());
-
- NodeRequest aNodeRequest(aRequestPath, _aRequest.getOptions());
-
- ResultHolder< ComponentInstance > aResult = m_xBackend->getNodeData(_aRequest, this, _bAddListenter?this:NULL);
-
- OSL_PRECOND(aResult.mutableInstance().mutableData().get(), "loadDirectly: Data must not be NULL");
-
- CFG_TRACE_INFO_NI("- loading data completed - normalizing result");
-
- if (!normalizeResult( aResult.mutableInstance().mutableData(),_aRequest.getOptions()))
- {
- CFG_TRACE_ERROR_NI(" - cannot normalized result: failing");
-
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("Requested data at '"));
- sMsg += aRequestPath.toString();
- sMsg += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'is not available: "));
-
- throw com::sun::star::container::NoSuchElementException(sMsg,NULL);
- }
-
- CFG_TRACE_INFO_NI(" - returning normalized defaults");
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > CacheController::loadDefaultsDirectly(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: loading defaults for '%s' from the backend", OUSTRING2ASCII(_aRequest.getPath().toString()));
-
- ResultHolder< NodeInstance > aResult = m_xBackend->getDefaultData(_aRequest);
-
- CFG_TRACE_INFO_NI("- loading defaultscompleted - normalizing result");
-
- normalizeResult(aResult.mutableInstance().mutableData(),_aRequest.getOptions());
-
- CFG_TRACE_INFO_NI(" - returning normalized defaults");
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::saveDirectly(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception))
-{
- m_xBackend->updateNodeData(_anUpdate);
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::savePendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, ComponentRequest const & _aComponent) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: saving updates for tree: '%s'", OUSTRING2ASCII(_aComponent.getComponentName()));
-
- try
- {
- CFG_TRACE_INFO2("CacheController: saving updates for tree: '%s'", OUSTRING2ASCII(_aComponent.getComponentName()));
-
- std::auto_ptr<SubtreeChange> aChangeData = _aCache->releasePendingChanges(_aComponent.getComponentName());
-
- if (aChangeData.get())
- {
- CFG_TRACE_INFO_NI("- found changes - sending to backend");
-
- configuration::AbsolutePath aRootPath = configuration::AbsolutePath::makeModulePath(_aComponent.getComponentName());
-
- backend::UpdateRequest anUpdateSpec(aChangeData.get(),aRootPath,_aComponent.getOptions());
-
- // anUpdateSpec.setRequestId(pInfo->getRequestId(_aRootPath));
-
- this->saveDirectly(anUpdateSpec);
-
- CFG_TRACE_INFO_NI("- saving changes completed successfully");
- }
- else
- CFG_TRACE_WARNING_NI("- no changes found - cannot save");
- }
- catch(uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR_NI("CacheController: saving tree '%s' failed: %s",
- OUSTRING2ASCII(_aComponent.getComponentName()),
- OUSTRING2ASCII(e.Message) );
-
- refreshComponent(_aComponent);
- CFG_TRACE_INFO_NI("- component data invalidated");
-
- throw;
- }
-}
-// -----------------------------------------------------------------------------
-
-bool CacheController::saveAllPendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, RequestOptions const & _aOptions)
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheController: Saving all pending changes for cache line");
- OSL_ASSERT(_aCache.is());
-
- std::vector< rtl::OUString > aPendingModules;
- _aCache->findPendingChangedModules(aPendingModules);
-
- CFG_TRACE_INFO_NI("Found %d changed modules",int(aPendingModules.size()));
-
- bool bSuccess = true;
- for (std::vector< rtl::OUString >::iterator it = aPendingModules.begin();
- it != aPendingModules.end();
- ++it )
- {
- try
- {
- this->savePendingChanges(_aCache, ComponentRequest(*it,_aOptions) );
- }
- catch (uno::Exception & )
- {
- CFG_TRACE_ERROR_NI("CacheController: Exception while saving one module - ignoring");
- bSuccess = false;
- }
- }
- CFG_TRACE_INFO_NI("Done saving pending changes for cache line");
-
- return bSuccess;
-}
-// -----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-void CacheController::freeComponent(ComponentRequest const & _aRequest) SAL_THROW(())
-{
- CFG_TRACE_INFO("CacheController: releasing module '%s' for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aRequest.getComponentName()),
- OUSTRING2ASCII(_aRequest.getOptions().getEntity()),
- OUSTRING2ASCII(_aRequest.getOptions().getLocale()) );
-
- rtl::Reference<CacheLoadingAccess> aCache = m_aCacheMap.get(_aRequest.getOptions());
-
- OSL_ENSURE(aCache.is(), "Releasing a nonexisting module");
-
- if (aCache.is())
- {
- if (aCache->releaseModule(_aRequest.getComponentName()) == 0)
- {
- // start the cleanup
- m_pDisposer->scheduleCleanup(_aRequest.getOptions());
- }
- }
-}
-// -----------------------------------------------------------------------------
-void CacheController::dataChanged(const ComponentRequest& _aRequest) SAL_THROW(())
-{
- refreshComponent(_aRequest);
-}
-// -----------------------------------------------------------------------------
-void CacheController::refreshAllComponents() SAL_THROW((com::sun::star::uno::Exception))
-{
- CacheMap::Map aRefreshList = m_aCacheMap.copy();
-
- for (CacheMap::Map::iterator i = aRefreshList.begin();
- i != aRefreshList.end(); ++i)
- {
- if (!i->second->isEmpty())
- {
- ExtendedCacheData aCacheData = i->second->m_aData;
- RequestOptions aOption = i->first;
- CacheData::ModuleList aModuleList = aCacheData.accessModuleList();
- for (CacheData::ModuleList::iterator itr = aModuleList.begin();
- itr != aModuleList.end(); ++itr)
- {
- //Check the cacheline has atleast one client reference
-
-
- if (itr->second->clientReferences() > 0)
- {
- ComponentRequest aRequest(itr->first,i->first);
- refreshComponent(aRequest);
- } else
- {
- // FIXME: otherwise dispose now
- // XXX: (lo) refresh all, preventing cache corruption.
- // An unused component should be purged from the cache
- // instead of being refreshed
- ComponentRequest aRequest(itr->first,i->first);
- refreshComponent(aRequest);
- }
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------
- } // namespace
-
-// -------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treecache/cachecontroller.hxx b/configmgr/source/treecache/cachecontroller.hxx
deleted file mode 100644
index bd3b669a1276..000000000000
--- a/configmgr/source/treecache/cachecontroller.hxx
+++ /dev/null
@@ -1,338 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_CACHECONTROLLER_HXX
-#define CONFIGMGR_BACKEND_CACHECONTROLLER_HXX
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "utility.hxx"
-#include "mergeddataprovider.hxx"
-#include "cacheaccess.hxx"
-#include "cachemulticaster.hxx"
-#include "requestoptions.hxx"
-#include "autoreferencemap.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- class OTreeDisposeScheduler;
- class OCacheWriteScheduler;
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-
- /** manages a shared data cache for configuration data
- trying to ensure consistency with a backend
- and provides access to the data for clients
- */
- class CacheController:
- public salhelper::SimpleReferenceObject,
- public ITemplateDataProvider, public INodeDataListener
- {
- public:
- /** ctor
- */
- explicit
- CacheController(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- // disposing the cache before destroying
- void dispose() SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /** locates data of a component in the cache.
-
- <p> If the data isn't in the cache it is loaded from the backend. </p>
-
- @param _aRequest
- identifies the component to be loaded.
-
- @returns
- data that can be used to locate the loaded data in the cache.
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * loadComponent(ComponentRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** releases data of a component from the cache.
-
- <p> Should be called when a client is done with a component.
- Each calls to <method>loadComponent</method> should
- be balanced by exactly one call to <method>freeComponent</method>.
- </p>
-
- @param _aRequest
- identifies a component previously loaded via <method>loadComponent</method>.
-
- @returns
- data that can be used to locate the loaded data in the cache.
- */
- void freeComponent(ComponentRequest const & _aRequest)
- SAL_THROW(());
-
- /** refreshes data of an existing component from the backend
-
- <p> If the data is in the cache already, it is refreshed from the
- backend and the change are notified to all registered listeners.
- </p>
- <p> If the data isn't in the cache nothing is done and
- a NULL location is returned.
- </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @param _aRequest
- identifies the component to be refreshed.
-
- @returns
- data that can be used to locate the refreshed data in the cache.
-
- <p>If there is no data to refresh a NULL location is returned.</p>
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * refreshComponent(ComponentRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
- /** refreshes data of all existing components from the backend
-
- <p> If the data is in the cache already, it is refreshed from the
- backend and the change are notified to all registered listeners.
- </p>
- <p> If the data isn't in the cache nothing is done and
- a NULL location is returned.
- </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void refreshAllComponents()
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** flushes data of all pending updates from cache to the backend(s)
- @throws com::sun::star::uno::Exception
- if flushing the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void flushPendingUpdates() SAL_THROW((com::sun::star::uno::Exception));
-
- /** locates a template in the cache.
-
- <p> If the data isn't in the cache it is loaded from the backend. </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @param _aRequest
- identifies the template to be loaded.
-
- @returns
- data that can be used to locate the template data in the cache.
-
- @throws com::sun::star::uno::Exception
- if loading the template data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * loadTemplate(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** saves changes to the backend and notifies them to registered listeners.
-
- <p> Must be called after the changes have been applied to the cache
- and before any subsequent changes to the same component.
- </p>
-
- <p> Notifications are guaranteed to be delivered
- before any subsequent changes to the same component are possible.
- </p>
-
- <p> Note: the caller <strong>must</strong> hold a read lock (but no write lock)
- on the cache line affected during the call.</p>
-
- @param _anUpdate
- identifies the node that changed and describes the changes.
-
- @throws com::sun::star::uno::Exception
- if saving the changes to the backend fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void saveAndNotify(UpdateRequest const & _anUpdate)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** @returns
- an object that can used to broadcast changes done through this object.
- <p> The object returned is guaranteed to live as long
- as this object lives.
- </p>
- */
- CacheChangeMulticaster & getNotifier() SAL_THROW(())
- { return m_aNotifier; }
-
- /** loads merged data for a (complete) tree and returns it as return value.
-
- @param _aRequest
- identifies the component to be loaded
-
- @param __bAddListenter
- identifies is listener is to be registered to backend
-
- @returns
- A valid component instance for the given component.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
-
- */
- ResultHolder< ComponentInstance > getComponentData(ComponentRequest const & _aRequest,
- bool _bAddListenter)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** loads default data for a (partial) tree and returns it as return value
-
- @param _aRequest
- identifies the node to be loaded
-
- @returns
- A valid node instance for the default state of the given node.
-
- <p>May be NULL, if the node exists but has no default equivalent.</p>
-
- @throws com::sun::star::uno::Exception
- if the default cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- ResultHolder< NodeInstance > getDefaultData(NodeRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** loads a given template and returns it as return value
-
- @param _aRequest
- identifies the template to be loaded
-
- @returns
- A valid instance of the given template.
-
- <p> Currently a request with empty template name
- will retrieve a group node holding all templates
- of a component.
- </p>
-
- @throws com::sun::star::uno::Exception
- if the template cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< TemplateInstance > getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
- //INodeDataListener Implementation
- /** Triggered when component data is changed
-
- @param _aRequest
- identifies the data that changed
- */
- virtual void dataChanged(const ComponentRequest& _aRequest) SAL_THROW(());
- protected:
- // ref counted, that's why no public dtor
- ~CacheController();
- // implementation
- private:
- configuration::AbsolutePath encodeTemplateLocation(rtl::OUString const & _rName, rtl::OUString const & _rModule) const;
-
- configuration::AbsolutePath ensureTemplate(rtl::OUString const& _rName, rtl::OUString const& _rModule) SAL_THROW((com::sun::star::uno::Exception));
-
- // adjust a node result for locale, ...
- bool normalizeResult(std::auto_ptr<ISubtree> & _aResult, RequestOptions const & _aOptions);
-
- // reads data from the backend directly
- ResultHolder< ComponentInstance > loadDirectly(ComponentRequest const & _aRequest, bool _bAddListenter )
- SAL_THROW((com::sun::star::uno::Exception));
- // reads default data from the backend directly
- ResultHolder< NodeInstance > loadDefaultsDirectly(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception));
- // writes an update to the backend directly
- void saveDirectly(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception));
-
- // writes updates for a component to the backend directly
- void savePendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, ComponentRequest const & _aComponent)
- SAL_THROW((com::sun::star::uno::Exception));
- // saves all pending changes from a cache access to the backend
- bool saveAllPendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, RequestOptions const & _aOptions)
- SAL_THROW((com::sun::star::uno::RuntimeException));
- // load templates componentwise from backend
- std::auto_ptr<ISubtree> loadTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
-
- void flushCacheWriter() SAL_THROW(());
- // add templates componentwise to cache
- sharable::TreeFragment * addTemplates ( backend::ComponentDataStruct const & _aComponentInstance );
- rtl::Reference<CacheLoadingAccess> getCacheAlways(RequestOptions const & _aOptions);
-
- OTreeDisposeScheduler * createDisposer(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
- OCacheWriteScheduler * createCacheWriter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
-
-
-
- // disposing
- void disposeAll(bool _bFlushRemainingUpdates);
-
- void closeModules(std::vector< rtl::Reference<CacheLine> > & _aList, RequestOptions const & _aOptions);
- private:
- typedef AutoReferenceMap<RequestOptions,CacheLoadingAccess,lessRequestOptions> CacheMap;
-
- CacheChangeMulticaster m_aNotifier;
- rtl::Reference< backend::IMergedDataProvider > m_xBackend;
- CacheMap m_aCacheMap;
- TemplateCacheData m_aTemplates;
-
- OTreeDisposeScheduler* m_pDisposer;
- OCacheWriteScheduler * m_pCacheWriter;
-
- bool m_bDisposing; // disables async writing and automatic refresh
-
- friend class configmgr::OTreeDisposeScheduler;
- friend class configmgr::OCacheWriteScheduler;
- friend class OInvalidateTreeThread;
-
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachedata.cxx b/configmgr/source/treecache/cachedata.cxx
deleted file mode 100644
index 200781cbab04..000000000000
--- a/configmgr/source/treecache/cachedata.cxx
+++ /dev/null
@@ -1,495 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachedata.hxx"
-#include "node.hxx"
-#include "updatehelper.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-#include "configpath.hxx"
-
-namespace configmgr
-{
- // ---------------------------- Client Acquire helper ----------------------------
-
- struct CacheLineClientRef
- {
- rtl::Reference<CacheLine> xModule;
-
- CacheLineClientRef(rtl::Reference<CacheLine> const& _xModule)
- : xModule(_xModule)
- {
- if (xModule.is())
- xModule->clientAcquire();
- }
-
- ~CacheLineClientRef() // release the client reference unless it was 'kept'
- {
- if (xModule.is())
- xModule->clientRelease();
- }
-
- void rebind(rtl::Reference<CacheLine> const& _xModule)
- {
- if (_xModule.is())
- _xModule->clientAcquire();
- if (xModule.is())
- xModule->clientRelease();
- xModule = _xModule;
- }
-
- /// release the contained module so that the client reference will be kept active
- void keep()
- {
- xModule.clear();
- OSL_ASSERT(!xModule.is());
- }
-
- /// return the contained module so that the client reference will be kept active
- rtl::Reference<CacheLine> keepModule()
- {
- rtl::Reference<CacheLine> xRet = xModule;
- this->keep();
- return xRet;
- }
- private:
- CacheLineClientRef(CacheLineClientRef const& );
- CacheLineClientRef& operator=(CacheLineClientRef const& );
-
- };
-
-// -----------------------------------------------------------------------------
- static inline rtl::OUString implExtractModuleName(configuration::AbsolutePath const& aConfigPath)
- {
- return aConfigPath.getModuleName();
- }
-
-// -----------------------------------------------------------------------------
-
- CacheData::CacheData()
- {
- }
-// -----------------------------------------------------------------------------
-
- CacheData::~CacheData()
- {
- CFG_TRACE_INFO("Discarding CacheData (Still holding %d module trees)", int (m_aModules.size()) );
- }
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<CacheLine> CacheData::internalGetModule(rtl::OUString const & _aModuleName ) const
- {
- OSL_ASSERT(_aModuleName.getLength() != 0);
-
- ModuleList::const_iterator it = m_aModules.find(_aModuleName);
-
- return it!=m_aModules.end() ? it->second : rtl::Reference<CacheLine>();
- }
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<CacheLine> CacheData::internalGetModule(const configuration::AbsolutePath& _aPath) const
- {
- return internalGetModule( implExtractModuleName(_aPath) );
- }
-// -----------------------------------------------------------------------------
-
- inline
- void CacheData::internalAddModule(rtl::OUString const & _aName, const rtl::Reference<CacheLine> & _aModule)
- {
- //OSL_PRECOND(m_aModules.find(_aName) == m_aModules.end(), "ERROR: Module already present in CacheData");
-
- m_aModules[_aName] = _aModule;
-
- CFG_TRACE_INFO("CacheData Data: Added new module tree for module %s", OUSTRING2ASCII(_aName) );
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheData::internalAttachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = doCreateAttachedModule(_aLocation,_aName);
-
- internalAddModule( _aName, aNewModule );
-
- return aNewModule;
- }
-
-// -------------------------------------------------------------------------
-
- void CacheData::attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule)
- {
- this->internalAttachModule(_aLocation,_aModule);
- }
-// -------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- return CacheLine::createAttached( _aName, _aLocation );
- }
-// -----------------------------------------------------------------------------
-
- /// gets a data segment reference for the given path if exists
- sharable::TreeFragment * CacheData::getTreeAddress(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() ? aModule->getTreeAddress() : NULL;
- }
-// -------------------------------------------------------------------------
-
- bool CacheData::hasModule(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() && !aModule->isEmpty();
- }
-// -------------------------------------------------------------------------
-
- bool CacheData::hasModuleDefaults(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() && !aModule->hasDefaults();
- }
-// -------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheData::internalGetPartialTree(const configuration::AbsolutePath& aComponentName ) const
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(aComponentName);
-
- if ( !xModule.is() )
- return NULL;
-
- sharable::TreeFragment * pSubtree = xModule->getPartialTree(aComponentName);
-
- OSL_ENSURE( pSubtree == NULL || xModule->clientReferences() != 0 ,
- "WARNING: returning subtree from module without clients\n" );
-#ifdef CFG_ENABLE_TRACING
- if( pSubtree != NULL && xModule->clientReferences() == 0)
- {
- CFG_TRACE_WARNING("CacheData data: returning subtree %s from module without clients", OUSTRING2ASCII( aComponentName.toString() ) );
- }
-#endif // CFG_ENABLE_TRACING
-
- return pSubtree;
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::internalGetNode(const configuration::AbsolutePath& aComponentName ) const
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(aComponentName);
-
- if ( !xModule.is() )
- return 0;
-
- if ( xModule->isEmpty() )
- return 0;
-
- sharable::Node * pNode = xModule->getNode(aComponentName);
-
- OSL_ENSURE( pNode == NULL || xModule->clientReferences() != 0,
- "WARNING: returning node from module without clients\n" );
- #ifdef CFG_ENABLE_TRACING
- if( pNode != NULL && xModule->clientReferences() == 0)
- {
- CFG_TRACE_WARNING("CacheData data: returning node %s from module without clients", OUSTRING2ASCII( aComponentName.toString() ) );
- }
-#endif // CFG_ENABLE_TRACING
-
- return pNode;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- bool CacheData::acquireModule(rtl::OUString const & _aModule)
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(_aModule);
-
- if (xModule.is())
- {
- CacheLineClientRef aClientRef(xModule);
- aClientRef.keep();
- }
-
- return xModule.is();
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::acquireNode(configuration::AbsolutePath const& _aPath)
- {
- CacheLineClientRef aClientRef(internalGetModule(_aPath));
-
- sharable::Node * aNodeAddr = internalGetNode(_aPath);
-
- if (sharable::Node const * pNode = aNodeAddr)
- {
- if (pNode->isValue())
- aNodeAddr = 0; // invalid: cannot acquire single value
- }
- else
- OSL_ASSERT( aNodeAddr == NULL );
-
- if (aNodeAddr != NULL)
- aClientRef.keep();
-
- return aNodeAddr;
- }
-// -----------------------------------------------------------------------------
-
- bool CacheData::insertDefaults( backend::NodeInstance const & _aDefaultInstance) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aDefaultInstance.data().get(), "insertDefaults: Data must not be NULL");
- OSL_PRECOND(_aDefaultInstance.root().getDepth() == 1, "insertDefaults: Default tree being added must be for module");
-
- // we should already have the module in cache !
- rtl::Reference<CacheLine> xModule = internalGetModule(_aDefaultInstance.root());
-
- OSL_ENSURE( xModule.is(), "CacheData::insertDefaults: No module to insert the defaults to - where did the data segment come from ?");
-
- if (!xModule.is()) return false;
-
- // make sure to keep the module alive
- CacheLineClientRef( xModule ).keep();
-
- sharable::TreeFragment * aResultTree = xModule->insertDefaults(_aDefaultInstance);
-
- return aResultTree != NULL;
- }
-// -----------------------------------------------------------------------------
-
- void CacheData::applyUpdate( backend::UpdateInstance & _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- // request the subtree, atleast one level must exist!
- sharable::Node * aNodeAddr = internalGetNode(_anUpdate.root());
-
- if (aNodeAddr != NULL)
- {
- applyUpdateToTree(*_anUpdate.data(),aNodeAddr);
- }
- else
- {
- OSL_ENSURE(false, "CacheData::applyUpdate called for non-existing tree");
- rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("CacheData: update to non-existing node: "));
-
- aStr += _anUpdate.root().toString();
-
- throw uno::RuntimeException(aStr,0);
- }
- }
-// -----------------------------------------------------------------------------
- oslInterlockedCount CacheData::releaseModule( rtl::OUString const & _aModule, bool _bKeepDeadModule )
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(_aModule);
-
- const oslInterlockedCount c_nErrorCount = -1;
-
- OSL_ENSURE( xModule.is(), "ERROR: Releasing non-existent subtree");
- if ( !xModule.is()) return c_nErrorCount;
-
- OSL_ENSURE( xModule->clientReferences() > 0, "ERROR: Releasing non-referenced subtree");
-
- oslInterlockedCount nResult = xModule->clientRelease();
-
- if (nResult == 0 && !_bKeepDeadModule)
- {
- m_aModules.erase( _aModule );
- }
- return nResult;
- }
-
-// -----------------------------------------------------------------------------
- sharable::TreeFragment * CacheData::getTemplateTree(configuration::AbsolutePath const& aTemplateName ) const
- {
- return internalGetPartialTree(aTemplateName);
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::getNode(const configuration::AbsolutePath& _rPath)
- {
- return internalGetNode(_rPath);
- }
-// -----------------------------------------------------------------------------
- bool CacheData::hasNode(const configuration::AbsolutePath& _rPath) const
- {
- return internalGetNode(_rPath) != NULL;
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * TemplateCacheData::addTemplates( backend::ComponentDataStruct const & _aComponentInstance) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data.get(), "addTemplates: Data must not be NULL");
- // we should already have the module in cache !
- rtl::OUString aModuleName ( _aComponentInstance.name);
- rtl::Reference<CacheLine> xModule = internalGetModule(aModuleName);
-
- OSL_ENSURE( xModule.is(), "ExtendedCacheData::addTemplates: No module to add the templates to - where did the data segment come from ?");
-
- if (!xModule.is()) return NULL;
-
- // make sure to keep the module alive
- CacheLineClientRef( xModule ).keep();
-
- static const rtl::OUString aDummyTemplateName(RTL_CONSTASCII_USTRINGPARAM("cfg:Template"));
- static const rtl::OUString aDummyTemplateModule(RTL_CONSTASCII_USTRINGPARAM("cfg:Templates"));
- _aComponentInstance.data->makeSetNode(aDummyTemplateName,aDummyTemplateModule);
-
- sharable::TreeFragment * aResult = xModule->setComponentData(_aComponentInstance, true);
-
- OSL_ASSERT(aResult != NULL);
-
- return aResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> TemplateCacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = CacheLine::createAttached(_aName, _aLocation);
-
- return aNewModule.get();
- }
-// -----------------------------------------------------------------------------
-
- void TemplateCacheData::createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = CacheLine::createNew(_aModule);
-
- internalAddModule( _aModule, aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<ExtendedCacheLine> ExtendedCacheData::implExtended(const rtl::Reference<CacheLine>& _aSimpleRef) const
- {
- CacheLine * pBasic = _aSimpleRef.get();
- ExtendedCacheLine * pExtended = static_cast<ExtendedCacheLine *>(pBasic);
- return rtl::Reference<ExtendedCacheLine>(pExtended);
- }
-
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> ExtendedCacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<ExtendedCacheLine> aNewModule =
- ExtendedCacheLine::createAttached(_aName, _aLocation);
-
- return rtl::Reference<CacheLine>( aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<ExtendedCacheLine> aNewModule = ExtendedCacheLine::createNew(_aModule);
-
- internalAddModule( _aModule, aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * ExtendedCacheData::addComponentData(backend::ComponentInstance const & _aComponentInstance,
- bool _bWithDefaults) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data().get(), "addComponentData: Data must not be NULL");
- // we should already have the module in cache !
- //rtl::Reference<CacheLine> xModule = internalGetModule(_aNodeInstance.root().location());
- rtl::Reference<CacheLine> xModule = internalGetModule(_aComponentInstance.component() );
-
- OSL_ENSURE( xModule.is(), "ExtendedCacheData::addComponentData: No module to add the subtree to - where did the data segment come from ?");
-
- if (!xModule.is()) return NULL;
-
- CacheLineClientRef aClientRef( xModule );
-
- sharable::TreeFragment * aResult = xModule->setComponentData(_aComponentInstance.componentNodeData(), _bWithDefaults);
-
- OSL_ASSERT(aResult != NULL);
-
- if (aResult != NULL) aClientRef.keep();
-
- return aResult;
- }
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- // do we already have the module in cache ?
- rtl::Reference<CacheLine> xModule = internalGetModule(_anUpdate.root());
-
- if (xModule.is())
- {
- implExtended(xModule)->addPending(_anUpdate);
- }
- else
- {
- OSL_ENSURE(false, "We can only change Nodes if we already know something about it. So this must be a big bug.");
- }
- }
-// -----------------------------------------------------------------------------
-
- std::auto_ptr<SubtreeChange> ExtendedCacheData::releasePending(rtl::OUString const& _aModule)
- {
- rtl::Reference<ExtendedCacheLine> xModule = implExtended(internalGetModule(_aModule));
-
- if (xModule.is())
- {
- if (xModule->hasPending())
- return xModule->releasePending();
- else
- return std::auto_ptr<SubtreeChange>();
- }
- else
- {
- OSL_ENSURE(false, "We can only get Nodes if we already know something about it.");
- }
- return std::auto_ptr<SubtreeChange>();
- }
-// -----------------------------------------------------------------------------
-
- bool ExtendedCacheData::hasPending(rtl::OUString const & _aModule)
- {
- rtl::Reference<ExtendedCacheLine> xModule = implExtended(internalGetModule(_aModule));
-
- return xModule.is() && xModule->hasPending();
- }
-
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::findPendingModules( std::vector< rtl::OUString > & _rPendingList )
- {
- ModuleList& rModules = CacheData::accessModuleList();
- for (ModuleList::iterator it = rModules.begin();
- it != rModules.end();
- ++it)
- {
- OSL_ASSERT( it->second.is() );
- if ( implExtended(it->second)->hasPending() )
- _rPendingList.push_back( it->first );
- }
- }
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cachedata.hxx b/configmgr/source/treecache/cachedata.hxx
deleted file mode 100644
index 0e4db8ddb3a2..000000000000
--- a/configmgr/source/treecache/cachedata.hxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEDATA_HXX
-#define CONFIGMGR_CACHEDATA_HXX
-
-#include "cacheline.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
- namespace backend
- {
- struct NodeInstance;
- struct TemplateInstance;
- struct UpdateInstance;
- struct ConstUpdateInstance;
- }
-
-////////////////////////////////////////////////////////////////////////////////
- /** A collection of CacheLines
- */
-
- class CacheData
- {
- public:
- CacheData();
- virtual ~CacheData();
-
- // attach a module with a given name
- void attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(rtl::OUString const & _aModule) const;
- /// checks if the given module exists and has defaults available
- bool hasModuleDefaults(rtl::OUString const & _aModule) const;
-
- /// gets a tree address for the given module if it exists
- sharable::TreeFragment * getTreeAddress(rtl::OUString const & _aModule) const;
-
- /// checks whether a certain node exists in the tree
- bool hasNode(configuration::AbsolutePath const & _aLocation) const;
-
- /// retrieve the given node without changing its ref count
- sharable::Node * getNode(configuration::AbsolutePath const & _rPath);
- /// retrieve the given template tree without changing its ref count
- sharable::TreeFragment * getTemplateTree( configuration::AbsolutePath const & aTemplateName ) const;
-
- /// retrieve the subtree at _aPath and clientAcquire() it
- sharable::Node * acquireNode(configuration::AbsolutePath const & _aPath );
- /// retrieve the subtree at _aPath and clientAcquire() it, return true on success
- bool acquireModule( rtl::OUString const & _aModule );
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseModule( rtl::OUString const & _aModule, bool _bKeepDeadModule = false );
-
- bool insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// merge the given changes into this tree - reflects old values to _anUpdate
- void applyUpdate( backend::UpdateInstance & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // low-level interface for cache management
- typedef std::map<rtl::OUString, rtl::Reference<CacheLine> > ModuleList;
- ModuleList& accessModuleList() { return m_aModules; }
-
- protected:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sharable::TreeFragment * internalGetPartialTree(configuration::AbsolutePath const & _aPath ) const;
- sharable::Node * internalGetNode(const configuration::AbsolutePath& _rPath) const;
-
- rtl::Reference<CacheLine> internalAttachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
- void internalAddModule(rtl::OUString const & _aName, rtl::Reference<CacheLine> const & _aModule);
-
- rtl::Reference<CacheLine> internalGetModule(rtl::OUString const & _aName) const;
- rtl::Reference<CacheLine> internalGetModule(const configuration::AbsolutePath& _aLocation) const;
-
- private:
- ModuleList m_aModules;
- };
-////////////////////////////////////////////////////////////////////////////////
- /** A collection of CacheLines for templates
- */
-
- class TemplateCacheData : public CacheData
- {
- public:
- TemplateCacheData() : CacheData()
- {
- }
-
- /** add the given template tree at the given location,
- return the tree that is now pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addTemplates( backend::ComponentDataStruct const & _aComponentInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // create a new module with the given name
- void createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
- private:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
- };
-//-----------------------------------------------------------------------------
- /** A collection of CacheLines
- */
-
- class ExtendedCacheData : public CacheData
- {
- public:
- ExtendedCacheData() : CacheData()
- {
- }
-
- /** add the given subtree at the given location,
- return the tree that is now pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// find the modules having pending changes
- bool hasPending(rtl::OUString const & _aModule);
- /// find the modules having pending changes
- void findPendingModules( std::vector< rtl::OUString > & _rPendingList );
-
- /// add or merge the given subtreechange at the given location
- void addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- /// remove and return pending changes for the given component
- std::auto_ptr<SubtreeChange> releasePending(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // create a new module with the given name
- void createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
- private:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- rtl::Reference<ExtendedCacheLine> implExtended(rtl::Reference<CacheLine> const & _aSimpleRef) const;
- };
-//-----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachefactory.cxx b/configmgr/source/treecache/cachefactory.cxx
deleted file mode 100644
index 54264ca0704f..000000000000
--- a/configmgr/source/treecache/cachefactory.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachefactory.hxx"
-#include "treemanager.hxx"
-#include "cachecontroller.hxx"
-#include "backendfactory.hxx"
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
-
- static
- rtl::Reference<TreeManager> buildCacheManager(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
- {
- rtl::Reference< TreeManager > xCache;
-
- if (_xBackend.is())
- {
- rtl::Reference< backend::CacheController > xLoader
- = new backend::CacheController(_xBackend.get(), _xContext);
-
- xCache.set( new TreeManager(xLoader.get()) );
- }
-
- return xCache;
- }
-// -------------------------------------------------------------------------
-
- rtl::Reference<TreeManager>
- CacheFactory::createCacheManager(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
- {
- rtl::Reference< backend::IMergedDataProvider > xBackend = backend::BackendFactory::instance(_xContext).createBackend();
-
- return buildCacheManager(xBackend, _xContext);
- }
-
-// -------------------------------------------------------------------------
-
- CacheFactory & CacheFactory::instance()
- {
- static CacheFactory aStaticFactory;
- return aStaticFactory;
- }
-
-//-----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treecache/cacheline.cxx b/configmgr/source/treecache/cacheline.cxx
deleted file mode 100644
index 530e29298bb4..000000000000
--- a/configmgr/source/treecache/cacheline.cxx
+++ /dev/null
@@ -1,353 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cacheline.hxx"
-#include "builddata.hxx"
-#include "treechangefactory.hxx"
-#include "mergechange.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- static inline rtl::OUString implExtractModuleName(configuration::AbsolutePath const& _aConfigPath)
- {
- return _aConfigPath.getModuleName();
- }
-
-
-// -----------------------------------------------------------------------------
-// class CacheLine
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-
- CacheLine::CacheLine(rtl::OUString const & _aModuleName)
- : m_base(NULL)
- , m_name(_aModuleName)
- , m_nDataRefs(0)
- {
- }
-// -----------------------------------------------------------------------------
-
- CacheLine::CacheLine(rtl::OUString const & _aModuleName, sharable::TreeFragment * _pSegment)
- : m_base(_pSegment)
- , m_name(_aModuleName)
- , m_nDataRefs(0)
- {
- }
-
-// -----------------------------------------------------------------------------
-
- void CacheLine::setBase(sharable::TreeFragment * _base)
- {
- OSL_PRECOND(m_base == NULL, "CacheLine: Data base address was already set");
- OSL_PRECOND( _base != NULL, "CacheLine: Cannot set NULL base address");
- m_base = _base;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheLine::createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
- if (_aSegment == NULL)
- {
- OSL_ENSURE(false, "Cannot attach a cache line to a NULL segment");
- return NULL;
- }
-
- rtl::Reference<CacheLine> xResult = new CacheLine(_aModuleName,_aSegment);
-
- return xResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheLine::createNew( rtl::OUString const & _aModuleName
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
-
- rtl::Reference<CacheLine> xResult = new CacheLine(_aModuleName);
-
- return xResult;
- }
-// -------------------------------------------------------------------------
-
- rtl::OUString CacheLine::getModuleName() const
- {
- return m_name;
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::getPartialTree(configuration::AbsolutePath const& aConfigName) const
- {
- sharable::Node * parent = internalGetNode(aConfigName.getParentPath());
-
- if (parent != 0 && parent->isSet())
- return parent->set.getElement(aConfigName.getLocalName().getName());
- else
- return NULL;
- }
-// -----------------------------------------------------------------------------
-
- bool CacheLine::hasDefaults() const
- {
- return m_base != 0 && m_base->hasDefaultsAvailable();
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheLine::internalGetNode(configuration::AbsolutePath const& aConfigName) const
- {
- OSL_ASSERT(m_base != 0);
- sharable::Node * node = m_base->getRootNode();
- OSL_ASSERT(node != 0);
- std::vector< configuration::Path::Component >::const_reverse_iterator i(
- aConfigName.begin());
- OSL_ASSERT(
- i != aConfigName.end() && node->getName() == i->getInternalName());
- while (node != 0 && ++i != aConfigName.end()) {
- node = node->getSubnode(i->getName());
- }
- return node;
- }
-// -----------------------------------------------------------------------------
-
- sharable::Node * CacheLine::getNode(configuration::AbsolutePath const& aConfigName) const
- {
- return internalGetNode(aConfigName);
- }
-// -------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::setComponentData( backend::ComponentDataStruct const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data.get(), "CacheLine::insertDefaults: inserting NULL defaults !");
- OSL_PRECOND(_aComponentInstance.name == this->getModuleName(),"Data location does not match module");
-
- OSL_PRECOND(base() == NULL, "Data is already loaded");
-
- if (base() == NULL) // no data yet
- {
- this->setBase( data::buildTree(_aComponentInstance.data->getName(), *_aComponentInstance.data, _bWithDefaults) );
- }
-
- return this->base();
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aDefaultInstance.data().get(), "CacheLine::insertDefaults: inserting NULL defaults !");
- OSL_PRECOND(_aDefaultInstance.root().getDepth() == 1, "Should have complete component to fill tree with defaults");
- OSL_PRECOND(_aDefaultInstance.root().getModuleName() == this->getModuleName(),"Data location does not match module");
-
- OSL_PRECOND(m_base != NULL, "Data must already be loaded to insert defaults");
-
- if (m_base != NULL)
- {
- data::mergeDefaults(m_base,*_aDefaultInstance.data());
- }
-
- return m_base;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- ExtendedCacheLine::ExtendedCacheLine(rtl::OUString const & _aModuleName)
- : CacheLine(_aModuleName)
- , m_pPending()
- {
- }
-
-// -----------------------------------------------------------------------------
-
- ExtendedCacheLine::ExtendedCacheLine(rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment)
- : CacheLine(_aModuleName,_aSegment)
- , m_pPending()
- {
- }
-
-// -----------------------------------------------------------------------------
-
- rtl::Reference<ExtendedCacheLine> ExtendedCacheLine::createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
- if (_aSegment == NULL)
- {
- OSL_ENSURE(false, "Cannot attach a cache line to a NULL segment");
- return NULL;
- }
-
- rtl::Reference<ExtendedCacheLine> xResult = new ExtendedCacheLine(_aModuleName,_aSegment);
-
- return xResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<ExtendedCacheLine> ExtendedCacheLine::createNew( rtl::OUString const & _aModuleName
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
-
- rtl::Reference<ExtendedCacheLine> xResult = new ExtendedCacheLine(_aModuleName);
-
- return xResult;
- }
-// -------------------------------------------------------------------------
-
- void ExtendedCacheLine::addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- configuration::AbsolutePath aRootLocation = _anUpdate.root();
-
- OSL_PRECOND(!aRootLocation.isRoot(),"Pending change cannot be located at root");
- OSL_PRECOND(aRootLocation.getModuleName() == this->getModuleName(),"Pending change location does not match module");
-
- OSL_PRECOND(_anUpdate.data() != NULL,"Adding NULL 'pending' change");
- OSL_PRECOND(_anUpdate.data()->getNodeName() == aRootLocation.getLocalName().getName(),
- "Path to pending change does not match change name");
-
- using std::auto_ptr;
-
- // first make the _pSubtreeChange a full tree starting at the module root
- auto_ptr<SubtreeChange> pRootChange;
- SubtreeChange *pExistingEntry = NULL;
-
- std::vector<configuration::Path::Component>::const_reverse_iterator last = aRootLocation.end();
-
- OSL_ASSERT(last != aRootLocation.begin());
- --last;
-
- for (std::vector<configuration::Path::Component>::const_reverse_iterator it = aRootLocation.begin();
- it != last;
- ++it)
- {
- OSL_ASSERT( it != aRootLocation.end());
- OSL_ASSERT( it+1 != aRootLocation.end());
- // We need to create a new SubtreeChange
- rtl::OUString const aChangeName = it->getName();
- rtl::OUString const aElementTypeName = (it+1)->getTypeName();
-
- auto_ptr<SubtreeChange> pNewChange =
- OTreeChangeFactory::createDummyChange(aChangeName, aElementTypeName);
-
- if (pExistingEntry == NULL)
- {
- OSL_ASSERT(pRootChange.get() == NULL);
-
- pRootChange = pNewChange;
- pExistingEntry = pRootChange.get();
- }
- else
- {
- OSL_ASSERT(pRootChange.get() != NULL);
-
- pExistingEntry->addChange(base_ptr(pNewChange));
-
- Change* pChange = pExistingEntry->getChange(aChangeName);
- pExistingEntry = static_cast<SubtreeChange*>(pChange);
-
- OSL_ENSURE(dynamic_cast< SubtreeChange * >(pChange) != 0, "ERROR: Cannot recover change just added");
- }
- }
-
- auto_ptr<SubtreeChange> pAddedChange( new SubtreeChange(*_anUpdate.data(), treeop::DeepChildCopy()) );
-
- if (aRootLocation.getDepth() > 1)
- {
- OSL_ASSERT(pRootChange.get() != NULL && pExistingEntry != NULL);
-
- // the _pSubtreeChange did not start at root, so add its clone to the built dummies
- pExistingEntry->addChange(base_ptr(pAddedChange));
- }
- else
- {
- OSL_ASSERT(pRootChange.get() == NULL && pExistingEntry == NULL);
-
- // the _pSubtreeChange starts at root, so just reset pRootChange
- pRootChange = pAddedChange;
- }
- OSL_ASSERT(pRootChange.get() != NULL);
-
- if (m_pPending.get() == NULL)
- {
- // no merge is need, because the existing pending changes are empty
- m_pPending = pRootChange;
- }
- else
- {
- try
- {
- // We need to merge the new rebased changes into the m_pPending
- combineUpdates(*pRootChange,*m_pPending);
- }
- catch (configuration::Exception& e)
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Update cache for module: Could not add pending changes at"));
-
- sMessage += aRootLocation.toString();
-
- sMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(". Internal Exception:")) + e.message();
-
- throw uno::RuntimeException(sMessage,0);
- }
- }
-
- OSL_POSTCOND(m_pPending.get() != NULL, "Could not insert new pending changes");
- }
-// -----------------------------------------------------------------------------
-
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cacheline.hxx b/configmgr/source/treecache/cacheline.hxx
deleted file mode 100644
index 8cb2b5524ac7..000000000000
--- a/configmgr/source/treecache/cacheline.hxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHELINE_HXX
-#define CONFIGMGR_CACHELINE_HXX
-
-#include "configpath.hxx"
-#include "requesttypes.hxx"
-#include "utility.hxx"
-#include "treefragment.hxx"
-#include <osl/interlck.h>
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
- /** This object represents a cache line for a single configuration tree
- */
- class CacheLine: public salhelper::SimpleReferenceObject
- {
- public:
- // create a new CacheLine for the given component name
- static rtl::Reference<CacheLine>
- createNew( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- static rtl::Reference<CacheLine>
- createAttached( rtl::OUString const & _aModuleName, sharable::TreeFragment * _aLocation );
-
- bool hasDefaults() const;
-
- bool isEmpty() const { return m_base == NULL; }
- sharable::TreeFragment * getTreeAddress() const { return m_base; }
- sharable::TreeFragment * getPartialTree(configuration::AbsolutePath const & _aTemplatePath ) const;
- sharable::Node * getNode(configuration::AbsolutePath const & _aPath) const;
-
- sharable::TreeFragment * setComponentData( backend::ComponentDataStruct const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sharable::TreeFragment * insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // get the module name for this component
- rtl::OUString getModuleName() const;
-
- /// add a client for this module's data
- oslInterlockedCount clientReferences() const { return m_nDataRefs; }
- /// add a client for this modules data
- oslInterlockedCount clientAcquire() { return osl_incrementInterlockedCount(&m_nDataRefs); }
- /// subtract a client for this modules data
- oslInterlockedCount clientRelease() { return osl_decrementInterlockedCount(&m_nDataRefs); }
-
- protected:
- // create a new CacheLine attached to the given memory location
- explicit
- CacheLine( rtl::OUString const & _aModuleName, sharable::TreeFragment * _pLocation );
-
- // create a new empty CacheLine for the given component name
- explicit
- CacheLine( rtl::OUString const & _aModuleName );
-
- sharable::Node * internalGetNode(configuration::AbsolutePath const & _rPath) const;
-
- sharable::TreeFragment * base() const { return m_base; }
- void setBase(sharable::TreeFragment * _base);
-
- private:
- sharable::TreeFragment * m_base;
- rtl::OUString m_name;
-
- oslInterlockedCount m_nDataRefs; /// the number of clients on this modules data
- };
-
-////////////////////////////////////////////////////////////////////////////////
- /** This object represents a cache line and associated data for a single configuration tree
- */
- class ExtendedCacheLine : public CacheLine
- {
- public:
- // create a new CacheLine for the given component name
- static rtl::Reference<ExtendedCacheLine>
- createNew( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- static rtl::Reference<ExtendedCacheLine>
- createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aLocation );
-
- // management of pending changes
- bool hasPending() const {return m_pPending.get() != NULL;}
-
- void addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- std::auto_ptr<SubtreeChange> releasePending() {return m_pPending;}
-
- private:
- // create a new empty CacheLine for the given component name
- explicit
- ExtendedCacheLine( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- explicit
- ExtendedCacheLine( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aLocation );
-
- private:
- std::auto_ptr<SubtreeChange> m_pPending;
- };
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachemulticaster.cxx b/configmgr/source/treecache/cachemulticaster.cxx
deleted file mode 100644
index d308491b6cf4..000000000000
--- a/configmgr/source/treecache/cachemulticaster.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachemulticaster.hxx"
-#include "treemanager.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-namespace
-{
-// manually implemented helpers, as rtl::References don't work well with std binders
-
-// ---------------------------------------------------------------------------
-
- // replacing std::bind2nd( std::mem_fun(&TreeManager::componentCreated), _aComponentName )
- struct NotifyCreated : std::unary_function<rtl::Reference<TreeManager>,void>
- {
- ComponentRequest const & m_arg;
-
- NotifyCreated(ComponentRequest const * _pComponent) SAL_THROW(())
- : m_arg(*_pComponent)
- {}
-
- void operator()(rtl::Reference<TreeManager> const & _xListener) const SAL_THROW(())
- { _xListener->componentCreated(m_arg); }
- };
-// ---------------------------------------------------------------------------
-
- // replacing std::bind2nd( std::mem_fun(&TreeManager::componentChanged), _aComponentName )
- struct NotifyChanged : std::unary_function<rtl::Reference<TreeManager>,void>
- {
- UpdateRequest const & m_arg;
-
- NotifyChanged(UpdateRequest const * _pUpdate) SAL_THROW(())
- : m_arg(*_pUpdate)
- {}
-
- void operator()(rtl::Reference<TreeManager> const & _xListener) const SAL_THROW(())
- { _xListener->componentChanged(m_arg); }
- };
-// ---------------------------------------------------------------------------
-} // anonymous namespace
-//----------------------------------------------------------------------------
-
-CacheChangeMulticaster::CacheChangeMulticaster()
-: m_aMutex()
-, m_aListeners()
-{
-}
-// ---------------------------------------------------------------------------
-
-CacheChangeMulticaster::~CacheChangeMulticaster()
-{
- OSL_ENSURE( m_aListeners.empty(), "Forgot to dispose multicaster" );
-}
-// ---------------------------------------------------------------------------
-
-inline std::list< rtl::Reference<TreeManager> > CacheChangeMulticaster::copyListenerList()
-{
- osl::MutexGuard aListGuard(m_aMutex);
- return m_aListeners;
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::notifyCreated(ComponentRequest const & _aComponent) SAL_THROW(())
-{
- std::list< rtl::Reference<TreeManager> > aNotifyListeners( this->copyListenerList() );
-
- std::for_each( aNotifyListeners.begin(), aNotifyListeners.end(), NotifyCreated(&_aComponent) );
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::notifyChanged(UpdateRequest const & _anUpdate) SAL_THROW(())
-{
- std::list< rtl::Reference<TreeManager> > aNotifyListeners( this->copyListenerList() );
-
- std::for_each( aNotifyListeners.begin(), aNotifyListeners.end(), NotifyChanged(&_anUpdate) );
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::addListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
-
- OSL_PRECOND(std::find(m_aListeners.begin(),m_aListeners.end(),_xListener) == m_aListeners.end(),
- "WARNING: Cache Change Listener was already registered - will be notified multiply.");
-
- OSL_PRECOND(_xListener.is(), "ERROR: trying to register a NULL listener");
-
- if (_xListener.is())
- m_aListeners.push_front(_xListener);
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::removeListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
- m_aListeners.remove(_xListener);
-}
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/treecache/cachemulticaster.hxx b/configmgr/source/treecache/cachemulticaster.hxx
deleted file mode 100644
index 56b6119f30a8..000000000000
--- a/configmgr/source/treecache/cachemulticaster.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_CACHEMULTICASTER_HXX
-#define CONFIGMGR_BACKEND_CACHEMULTICASTER_HXX
-
-#include "sal/config.h"
-
-#include <list>
-
-#include "osl/mutex.hxx"
-#include "rtl/ref.hxx"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
- class TreeManager;
-
- namespace backend
- {
- class ComponentRequest;
- class UpdateRequest;
-// ---------------------------------------------------------------------------
-
- /** Interface providing a multicasting service for changes to the cache
- managed by a <type>CacheController</type>
- */
- class CacheChangeMulticaster
- {
- public:
- CacheChangeMulticaster();
- virtual ~CacheChangeMulticaster();
-
- /** notify a new component to all registered listeners.
- <p> Must be called after the component has been created in the cache.</p>
- */
- void notifyCreated(ComponentRequest const & _aComponentName) SAL_THROW(());
-
- /** notify changed data to all registered listeners.
- <p> Must be called after the change has been applied to the cache
- and before any subsequent changes to the same component.</p>
- */
- void notifyChanged(UpdateRequest const & _anUpdate) SAL_THROW(());
-
- // notification support.
- /// register a listener for observing changes to the cached data
- void addListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(());
- /// unregister a listener previously registered
- void removeListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(());
- private:
- std::list< rtl::Reference<TreeManager> > copyListenerList();
-
- osl::Mutex m_aMutex;
- std::list< rtl::Reference<TreeManager> > m_aListeners;
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachewritescheduler.cxx b/configmgr/source/treecache/cachewritescheduler.cxx
deleted file mode 100644
index 03a2a768aa11..000000000000
--- a/configmgr/source/treecache/cachewritescheduler.cxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "cachewritescheduler.hxx"
-#include "cachecontroller.hxx"
-#include "tracer.hxx"
-
-
-namespace configmgr
-{
-// =========================================================================
-OCacheWriteScheduler::~OCacheWriteScheduler()
-{
- stopAndWriteCache();// last chance - violates precond
-}
-
-void OCacheWriteScheduler::stopAndWriteCache()
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- CFG_TRACE_INFO("Cancelling all cache writings, Stopping timer");
-
- if (m_xTimer.isValid())
- m_xTimer->dispose(); // just to be sure
-
- runWriter();
-
- m_aWriteList.clear();
-}
-
-// -------------------------------------------------------------------------
-void OCacheWriteScheduler::Timer::onShot()
-{
- UnoApiLock aLock;
-
- if (pParent)
- pParent->onTimerShot();
- else
- CFG_TRACE_WARNING("Timer shot for disposed cache writer");
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::onTimerShot()
-{
- //m_aTimer.stop();
-
- CFG_TRACE_INFO("Write Timer invoked - executing write task");
-
- try
- {
- runWriter();
- CFG_TRACE_INFO_NI("Write timer: writing ended");
- }
- catch (...)
- {
- CFG_TRACE_ERROR_NI("Write timer: writing failed with an unknown exception");
- OSL_ENSURE(false, "ERROR: Unknown Exception left a writer");
- }
-
- TimeStamp aNewTime = implGetScheduleTime(TimeStamp::getCurrentTime(), m_aWriteInterval);
-
- implStartBefore(aNewTime);
-}
-// -------------------------------------------------------------------------
-void OCacheWriteScheduler::runWriter()
-{
- // Write Cache
- OSL_ASSERT(UnoApiLock::isHeld());
- CFG_TRACE_INFO("Running write operations");
-
- CacheWriteList aPendingWrites;
- m_aWriteList.swap(aPendingWrites);
-
- CFG_TRACE_INFO_NI("Found %d sections to write", int(aPendingWrites.size()));
- for (CacheWriteList::iterator it = aPendingWrites.begin();
- it != aPendingWrites.end();
- ++it)
- {
- RequestOptions aTaskOption = *it;
- try
- {
- writeOneTreeFoundByOption(aTaskOption);
- }
- catch (uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR_NI("TreeCacheWriteScheduler: Attempt to write data failed - error is '%s' (currently ignored)",OUSTRING2ASCII(e.Message));
- }
- }
- // m_aWriteList.clear();
- CFG_TRACE_INFO_NI("DONE: Running write operations");
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::writeOneTreeFoundByOption(RequestOptions const& _aOptions) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("Writeing one cache tree for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-
- rtl::Reference<CacheLoadingAccess> aCache;
- aCache = m_rTreeManager.m_aCacheMap.get(_aOptions);
-
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("- Found matching data container - starting write task");
- if (!m_rTreeManager.saveAllPendingChanges(aCache,_aOptions))
- {
- m_aWriteList.insert(_aOptions);
-
- CFG_TRACE_INFO_NI("- Write task incomplete -reregistering");
- }
- // we got a pending list with pointers from TreeInfo.
- }
- else
- {
- CFG_TRACE_WARNING_NI("- Data container (TreeInfo) to write not found: Ignoring task");
- }
-
- CFG_TRACE_INFO_NI("Removing written cache tree (for user '%s' with locale '%s')",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-}
-
-// -----------------------------------------------------------------------------
-bool OCacheWriteScheduler::clearTasks(RequestOptions const& _aOptions)
-{
- // sadly list::remove doesn't return an indication of what it did
- bool bFound = m_aWriteList.erase(_aOptions) !=0;
- if (bFound)
- {
- CFG_TRACE_INFO("Write Scheduler: Dropped cache tree (for user '%s' with locale '%s') from task list",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
- }
-
- return bFound;
-}
-
-// -----------------------------------------------------------------------------
-// should be called guarded only
-void OCacheWriteScheduler::implStartBefore(TimeStamp const& _aTime)
-{
- CFG_TRACE_INFO("Triggering write timer");
- // check if we were cleared
- if (!m_aWriteList.empty())
- {
- if (!m_xTimer->isTicking())
- {
- m_xTimer->setAbsoluteTime(_aTime.getTimeValue());
-
- if (!m_xTimer->isTicking())
- m_xTimer->start();
-
- OSL_ASSERT( m_xTimer->isTicking() );
- }
- CFG_TRACE_INFO_NI("- Write timer running - next execution in %d seconds", int (m_xTimer->getRemainingTime().Seconds) );
- CFG_TRACE_INFO_NI("- %d write tasks are pending", int(m_aWriteList.size()) );
- }
- else
- {
- m_xTimer->stop();
- CFG_TRACE_INFO_NI("- Stopped timer - no more open write tasks");
- }
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::scheduleWrite(backend::ComponentRequest _aComponent) SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE(_aComponent.getOptions().hasLocale(), "ERROR: OTreeDisposeScheduler: cannot handle complete user scheduling");
-
- CFG_TRACE_INFO("Scheduling cache write for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aComponent.getOptions().getEntity()),
- OUSTRING2ASCII(_aComponent.getOptions().getLocale()));
-
- // lasy writing
- m_aWriteList.insert(_aComponent.getOptions());
-
- TimeStamp aNewTime = implGetScheduleTime(TimeStamp::getCurrentTime(), m_aWriteInterval);
- implStartBefore(aNewTime);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/treecache/cachewritescheduler.hxx b/configmgr/source/treecache/cachewritescheduler.hxx
deleted file mode 100644
index 84f1935307f3..000000000000
--- a/configmgr/source/treecache/cachewritescheduler.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEWRITESCHEDULER_HXX
-#define CONFIGMGR_CACHEWRITESCHEDULER_HXX
-
-#include "datalock.hxx"
-#include "requestoptions.hxx"
-#include "timestamp.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#include <vos/timer.hxx>
-#ifndef _VOS_REF_HXX_
-#include <vos/ref.hxx>
-
-#endif
-#include <osl/mutex.hxx>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- class RequestOptions;
- namespace backend { class ComponentRequest; class CacheController; }
-
- // Write down the Cache, much less complex than caching Nodes
- // (better control)
- class OCacheWriteScheduler
- {
- typedef std::set< RequestOptions, lessRequestOptions > CacheWriteList; // fire and forget!
-
- class Timer : public vos::OTimer
- {
- public:
- OCacheWriteScheduler* pParent;
-
- Timer(OCacheWriteScheduler& _rParent) : pParent(&_rParent) {};
-
- // vos::OTimer
- virtual void SAL_CALL onShot();
-
- // stop the scheduling
- void dispose() {
- stop();
- pParent = NULL;
- }
-
- };
- friend void Timer::onShot();
- private:
- vos::ORef<Timer> m_xTimer;
- backend::CacheController &m_rTreeManager;
- CacheWriteList m_aWriteList;
- TimeInterval m_aWriteInterval;
-
- public:
- //-------- Construction and destruction -----------------------------------
- explicit
- OCacheWriteScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aWriteInterval)
- : m_rTreeManager(_rTreeManager)
- , m_aWriteInterval(_aWriteInterval)
- {
- m_xTimer = new Timer(*this);
- }
- ~OCacheWriteScheduler();
-
- //-------- Delay and Interval ---------------------------------------------
- /// retrieves the recurrance interval used for cleanup
- TimeInterval const& getWriteInterval() const
- {
- UnoApiLock aLock;
- return m_aWriteInterval;
- }
-
- static TimeStamp implGetScheduleTime(TimeStamp const& aBaseTime, TimeInterval const& aDelay)
- {
- return aBaseTime + aDelay;
- }
- //-------- Control of execution ------------------------------------------
- void scheduleWrite(backend::ComponentRequest _aComponent) SAL_THROW((com::sun::star::uno::Exception));
-
- /// stop pending activities for one set of options (do not discard them)
- bool clearTasks(RequestOptions const& _xOptions);
-
- /// stop and discard pending activities
- void stopAndWriteCache();
- private:
- // vos::OTimer
- void onTimerShot();
-
- void runWriter();
- void implStartBefore(TimeStamp const& _aTime);
- void writeOneTreeFoundByOption(RequestOptions const& _aOption) SAL_THROW((com::sun::star::uno::Exception));
- };
-} // namespace configmgr
-
-#endif // CONFIGMGR_DISPOSETIMER_HXX
-
diff --git a/configmgr/source/treecache/disposetimer.cxx b/configmgr/source/treecache/disposetimer.cxx
deleted file mode 100644
index e01700ccfe22..000000000000
--- a/configmgr/source/treecache/disposetimer.cxx
+++ /dev/null
@@ -1,302 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "datalock.hxx"
-#include "disposetimer.hxx"
-#include "cachecontroller.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-namespace configmgr
-{
-//==========================================================================
-//=
-//==========================================================================
-
-
-void OTreeDisposeScheduler::scheduleCleanup(RequestOptions const& _aOptions)
-{
- OSL_ENSURE(_aOptions.hasLocale(), "ERROR: OTreeDisposeScheduler: cannot handle complete user scheduling");
-
- CFG_TRACE_INFO("Scheduling data cleanup for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-
- CFG_TRACE_INFO_NI("- Cleanup will be started in about %d seconds", int(m_aCleanupDelay.getTimeValue().Seconds));
-
- TimeStamp aNewTime = implGetCleanupTime(TimeStamp::getCurrentTime(), m_aCleanupDelay);
- OSL_ASSERT(!aNewTime.isNever());
-
- TimeStamp aScheduleTime = implAddTask(_aOptions, aNewTime);
-
- OSL_ASSERT(aScheduleTime <= aNewTime);
- OSL_ASSERT(!aScheduleTime.isNever());
-
- implStartBefore(aNewTime);
-}
-// -------------------------------------------------------------------------
-
-static
-inline
-bool equivalentOptions(RequestOptions const& lhs, RequestOptions const& rhs)
-{
- lessRequestOptions lessThan;
- return ! (lessThan(lhs,rhs) || lessThan(rhs,lhs));
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::stopAndClearTasks()
-{
- CFG_TRACE_INFO("Cancelling all data cleanup tasks, Stopping Cleanup timer");
- CFG_TRACE_INFO_NI("- %d cleanup tasks were pending", int(m_aAgenda.size()) );
-
- if (m_xTimer.isValid())
- m_xTimer->dispose(); // just to be sure
-
- m_aAgenda.clear();
-}
-// -------------------------------------------------------------------------
-
-std::pair<bool,RequestOptions> OTreeDisposeScheduler::getTask(TimeStamp const& _aActualTime, TimeStamp& _rNextTime)
-{
- OSL_ASSERT( _rNextTime.isNever() ); // internal contract, we set this only in the positive case
-
- std::pair<bool,RequestOptions> aTask( false, RequestOptions() );
-
- if (!m_aAgenda.empty())
- {
- Agenda::iterator const it = m_aAgenda.begin();
-
- if (it->first <= _aActualTime)
- {
- aTask = std::make_pair(true,it->second);
- m_aAgenda.erase(it);
- }
- }
-
- if (!m_aAgenda.empty())
- {
- Agenda::iterator const it = m_aAgenda.begin();
-
- _rNextTime = it->first;
- }
-
- return aTask;
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::Timer::onShot()
-{
- UnoApiLock aLock;
- if (pParent)
- pParent->onTimerShot();
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::onTimerShot()
-{
- CFG_TRACE_INFO("Cleanup Timer invoked - executing dispose task");
-
- TimeStamp aActualTime = TimeStamp::getCurrentTime();
- TimeStamp aNextTime = implGetCleanupTime(aActualTime, getCleanupInterval());
-
- try
- {
- TimeStamp aNextDisposeTime = runDisposer(aActualTime);
-
- if (aNextTime < aNextDisposeTime)
- aNextTime = aNextDisposeTime;
- }
-
- catch (uno::Exception& )
- {
- OSL_ENSURE(false, "ERROR: UNO Exception left a disposer");
- }
- catch (configuration::Exception& )
- {
- OSL_ENSURE(false, "ERROR: configuration::Exception left a disposer");
- }
- catch (...)
- {
- OSL_ENSURE(false, "ERROR: Unknown Exception left a disposer");
- }
-
- OSL_ASSERT(UnoApiLock::isHeld());
- implStartBefore(aNextTime);
-}
-// -------------------------------------------------------------------------
-
-// this really should be a member of the TreeManager (see TreeManager::disposeOne etc.)
-TimeStamp OTreeDisposeScheduler::runDisposer(TimeStamp const& _aActualTime)
-{
- TimeStamp aNextTime = TimeStamp::never();
- OSL_ASSERT(aNextTime.isNever());
-
- OSL_ASSERT(UnoApiLock::isHeld());
-
- std::pair<bool,RequestOptions> aTask = this->getTask( _aActualTime, aNextTime );
- if (aTask.first)
- {
- RequestOptions & rTaskOptions = aTask.second;
-
- CFG_TRACE_INFO("Found cleanup task for user %s and locale %s",
- OUSTRING2ASCII(rTaskOptions.getEntity()),
- OUSTRING2ASCII(rTaskOptions.getLocale()));
-
- rtl::Reference<CacheLoadingAccess> aCache = m_rTreeManager.m_aCacheMap.get(rTaskOptions);
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("- Found matching data container (TreeInfo) - collecting data");
-
- std::vector< rtl::Reference<CacheLine> > aDisposeList;
-
- TimeStamp aNextTaskTime = aCache->collectDisposeList(aDisposeList, _aActualTime, m_aCleanupDelay);
-
- CFG_TRACE_INFO_NI("- Found %d module trees to dispose", int(aDisposeList.size()) );
-
- if (!aNextTaskTime.isNever())
- {
- OSL_ENSURE( !aCache->isEmpty(), "ERROR: Empty TreeInfo returning finite dispose time");
-
- // repost with new time
- OSL_ASSERT(UnoApiLock::isHeld());
-
- CFG_TRACE_INFO_NI("- Rescheduling current option set" );
-
- aNextTime = this->implAddTask(rTaskOptions,aNextTaskTime);
- }
-
- else if (aCache->isEmpty())// may have been the last one - check that
- {
- // currently it is not possible to release options which are
- // because it is not save to delete the info if another thread is running in
- // a read request
- }
- else
- CFG_TRACE_INFO_NI("- Currently no more cleanup tasks for this options set" );
-
- if (!aDisposeList.empty())
- {
- CFG_TRACE_INFO_NI("- Closing %d modules", int(aDisposeList.size()) );
- m_rTreeManager.closeModules(aDisposeList,rTaskOptions);
- }
- else
- CFG_TRACE_INFO_NI("- No modules trees to dispose");
- }
- else
- CFG_TRACE_INFO_NI("- No matching data container (TreeInfo) found - task is obsolete");
- }
- else
- CFG_TRACE_INFO("No eligible task found - may reschedule");
-
- return aNextTime;
-}
-// -------------------------------------------------------------------------
-
-static inline
-TimeStamp getExpirationTime( vos::OTimer const& aTimer )
-{
- OSL_ENSURE(aTimer.isTicking(), "Timer is already expired !");
-
- // note: order ensures that result time may be earlier, but not later
- TimeStamp const now ( TimeStamp::getCurrentTime() );
- TimeInterval const left( aTimer.getRemainingTime() );
- TimeStamp const expires = now + left;
-
- return expires;
-}
-
-// -------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-static
-void checkTimerStarted( vos::OTimer const& aTimer, TimeStamp const& _aLimit)
-{
- const TimeInterval tolerance( vos::TTimeValue(1) ); // milliseconds
- if (aTimer.isTicking())
- {
- TimeStamp const expires = getExpirationTime(aTimer);
- TimeStamp const limit = _aLimit + tolerance;
-
- OSL_ENSURE(expires <= limit, "Timer does not expire within expected time (tolerance 1 ms) !");
- // OSL_ENSURE(expires <= _aLimit, "Timer does not expire within expected time !");
- OSL_ENSURE(aTimer.isTicking(), "Timer just started already expired ?!");
- }
- else
- {
- OSL_ENSURE(false, "Timer just started is not ticking ?!");
- }
-}
-#endif
-
-// -------------------------------------------------------------------------
-// should be called guarded only
-void OTreeDisposeScheduler::implStartBefore(TimeStamp const& _aTime)
-{
- // check if we were cleared
- if (!m_aAgenda.empty() && !_aTime.isNever())
- {
- if (!m_xTimer->isTicking() || _aTime < getExpirationTime(*m_xTimer))
- {
- m_xTimer->setAbsoluteTime(_aTime.getTimeValue());
-
- if (!m_xTimer->isTicking()) m_xTimer->start();
-
- OSL_DEBUG_ONLY( checkTimerStarted(*m_xTimer,_aTime) );
- }
- CFG_TRACE_INFO_NI("- Cleanup timer running - next execution in %d seconds", int (m_xTimer->getRemainingTime().Seconds) );
- CFG_TRACE_INFO_NI("- %d cleanup tasks are pending", int(m_aAgenda.size()) );
- }
- else
- {
- m_xTimer->stop();
- CFG_TRACE_INFO_NI("- Stopped timer - no more open cleanup tasks");
- }
-}
-// -------------------------------------------------------------------------
-
-TimeStamp OTreeDisposeScheduler::implAddTask(RequestOptions const& _aOptions, TimeStamp const& _aTime)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
-
- // try to insert after euivalent entries (but STL may ignore the hint)
- Agenda::iterator where = m_aAgenda.upper_bound(_aTime);
-
- m_aAgenda.insert(where, Agenda::value_type(_aTime,_aOptions));
-
- OSL_ASSERT(!m_aAgenda.empty());
-
- return m_aAgenda.begin()->first;
-}
-// -------------------------------------------------------------------------
-
-} // namespace
diff --git a/configmgr/source/treecache/disposetimer.hxx b/configmgr/source/treecache/disposetimer.hxx
deleted file mode 100644
index abfc8ef52d84..000000000000
--- a/configmgr/source/treecache/disposetimer.hxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DISPOSETIMER_HXX
-#define CONFIGMGR_DISPOSETIMER_HXX
-
-#include "timestamp.hxx"
-#include "requestoptions.hxx"
-#include <osl/mutex.hxx>
-#include <vos/timer.hxx>
-#include <vos/ref.hxx>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-#ifndef INCLUDED_UTILITY
-#include <utility>
-#define INCLUDED_UTILITY
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace uno = ::com::sun::star::uno;
-namespace lang = ::com::sun::star::lang;
-
-namespace configmgr
-{
- namespace backend { class CacheController; }
-////////////////////////////////////////////////////////////////////////////////
-/* OTreeDisposeScheduler:
- does something special????
-*/
-
- class OTreeDisposeScheduler
- {
- typedef std::multimap< TimeStamp, RequestOptions, ltTimeStamp > Agenda;
-
- class Timer : public vos::OTimer
- {
- public:
- OTreeDisposeScheduler* pParent;
-
- Timer(OTreeDisposeScheduler& _rParent) : pParent(&_rParent) {};
-
- // vos::OTimer
- virtual void SAL_CALL onShot();
-
- // stop the scheduling
- void dispose() {stop(); pParent = NULL;}
- };
- friend void Timer::onShot();
-
- private:
- Agenda m_aAgenda;
- vos::ORef<Timer> m_xTimer;
- backend::CacheController& m_rTreeManager;
-
- TimeInterval m_aCleanupDelay;
- TimeInterval m_aCleanupInterval;
- public:
- //-------- Construction and destruction -----------------------------------
- explicit
- OTreeDisposeScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aCleanupDelay)
- : m_rTreeManager(_rTreeManager)
- , m_aCleanupDelay(_aCleanupDelay)
- , m_aCleanupInterval(_aCleanupDelay)
- {
- m_xTimer = new Timer(*this);
- }
-
- explicit
- OTreeDisposeScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aCleanupDelay, TimeInterval const& _aCleanupInterval)
- : m_rTreeManager(_rTreeManager)
- , m_aCleanupDelay(_aCleanupDelay)
- , m_aCleanupInterval(_aCleanupInterval)
- {
- m_xTimer = new Timer(*this);
- }
-
- ~OTreeDisposeScheduler() { stopAndClearTasks(); }
-
- //-------- Delay and Interval ---------------------------------------------
- /// sets the initial delay to be used for cleanup in the future, does not affect an already started process
- void setCleanupDelay(TimeInterval const& _aCleanupDelay)
- {
- m_aCleanupDelay = _aCleanupDelay;
- }
-
- /// sets the initial delay and recurrance interval to be used for cleanup in the future, does not affect an already started process
- void setCleanupDelay(TimeInterval const& _aCleanupDelay, TimeInterval const& _aCleanupInterval)
- {
- m_aCleanupDelay = _aCleanupDelay;
- m_aCleanupInterval = _aCleanupInterval;
- }
-
- /// sets the recurrance interval to be used for cleanup in the future, does not affect an already started process
- void setCleanupInterval(TimeInterval const& _aCleanupInterval)
- {
- m_aCleanupInterval = _aCleanupInterval;
- }
-
- /// retrieves the initial delay used for cleanup
- TimeInterval const& getCleanupDelay() const
- {
- return m_aCleanupDelay;
- }
-
- /// retrieves the recurrance interval used for cleanup
- TimeInterval const& getCleanupInterval() const
- {
- return m_aCleanupInterval;
- }
-
- //-------- Control of execution ------------------------------------------
- /// ensure this will execute cleanup duties for _xOptions (no later than after getCleanupDelay() has elapsed)
- void scheduleCleanup(RequestOptions const & _aOptions);
-
- /// stop and discard pending activities
- void stopAndClearTasks();
-
- private:
- // vos::OTimer
- void onTimerShot();
-
- std::pair<bool,RequestOptions> getTask(TimeStamp const& _aActualTime, TimeStamp& _aNextTime);
-
- /// ensure this will execute cleanup duties for _xOptions (no later than after getCleanupDelay() has elapsed)
- // TimeStamp fillDisposeList(CacheLoadingAccess & _aCache, DisposeList& _rList, TimeStamp const& aLimitTime)
-
- TimeStamp runDisposer(TimeStamp const& _aActualTime);
- private:
- TimeStamp implAddTask(RequestOptions const& _xOptions, TimeStamp const& _aTime);
- void implStartBefore(TimeStamp const& _aTime);
-
- static TimeStamp implGetCleanupTime(TimeStamp const& aPostingTime, TimeInterval const& aDelay)
- { return aPostingTime + aDelay; }
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-} // namespace configmgr
-
-#endif // CONFIGMGR_DISPOSETIMER_HXX
-
diff --git a/configmgr/source/treecache/invalidatetree.cxx b/configmgr/source/treecache/invalidatetree.cxx
deleted file mode 100644
index cfd5510e4712..000000000000
--- a/configmgr/source/treecache/invalidatetree.cxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "cachecontroller.hxx"
-#include "change.hxx"
-#include "valuenode.hxx"
-#include "updatehelper.hxx"
-#include "treeactions.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
-
- namespace container = com::sun::star::container;
-// -----------------------------------------------------------------------------
-// ------------------------------- invalidateTree -------------------------------
-// -----------------------------------------------------------------------------
-
-namespace backend
-{
-// -----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> createDiffs(sharable::Node * cachedNode,
- ISubtree const * _pLoadedSubtree,
- configuration::AbsolutePath const& _aAbsoluteSubtreePath)
-{
- OSL_PRECOND(cachedNode != 0, "Need an existing node to create a diff");
- OSL_PRECOND(_pLoadedSubtree != 0, "Need a result node to create a diff");
- // Create a TreeChangeList with the right name, parentname and ConfigurationProperties
- std::auto_ptr<SubtreeChange> aNewChange(new SubtreeChange(_aAbsoluteSubtreePath.getLocalName().getName(),
- node::Attributes()) );
-
- if (!createUpdateFromDifference(*aNewChange, cachedNode, *_pLoadedSubtree))
- aNewChange.reset();
-
- return aNewChange;
-}
-// -----------------------------------------------------------------------------
-#if 0
-std::auto_ptr<ISubtree> TreeManager::loadNodeFromSession( configuration::AbsolutePath const& _aAbsoluteSubtreePath,
- const vos::ORef < OOptions >& _xOptions,
- sal_Int16 _nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
-{
- TreeInfo* pInfo = this->requestTreeInfo(_xOptions,true /*create TreeInfo*/);
-
- CFG_TRACE_INFO_NI("cache manager: cache miss. going to load the node");
- rtl::Reference< OTreeLoader > xLoader = pInfo->getNewLoaderWithoutPending(_aAbsoluteSubtreePath, _nMinLevels, _xOptions, m_xBackend.get());
-
- OSL_ENSURE(xLoader.is(), "Did not receive a loader for retrieving the node");
- CFG_TRACE_INFO_NI("cache manager: cache miss. going to load the node");
- if (!xLoader.is())
- throw container::NoSuchElementException((::rtl::OUString::createFromAscii("Error while retrieving the node")), NULL);
-
- // now block for reading
- std::auto_ptr<ISubtree> pResponse;
- try
- {
- pResponse = xLoader->waitToResponse();
- }
- catch (uno::Exception& e)
- {
- pInfo->releaseLoader(xLoader);
- throw;
- }
-
- pInfo->releaseLoader(xLoader);
-
- return pResponse;
-}
-#endif
-// -----------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheController::refreshComponent(ComponentRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- if (m_bDisposing) return NULL;
-
- rtl::Reference<CacheLoadingAccess> aCache = this->getCacheAlways(_aRequest.getOptions());
-
- if (!aCache.is()) return NULL;
-
- // load the Node direct from the session, without using the cache
- ComponentRequest aForcedRequest(_aRequest);
- aForcedRequest.forceReload();
-
- ResultHolder< ComponentInstance > aLoadedInstance = this->getComponentData(aForcedRequest,false);
- configuration::AbsolutePath aRequestPath = configuration::AbsolutePath::makeModulePath(_aRequest.getComponentName());
- NodeInstance aNodeInstance(aLoadedInstance.mutableInstance().mutableData(),aRequestPath) ;
- ResultHolder< NodeInstance > aLoadedNodeInstance(aNodeInstance) ;
-
- sharable::TreeFragment * aResult = NULL;
- if (aLoadedNodeInstance.is())
- {
- rtl::OUString aModuleName = aLoadedNodeInstance->root().getModuleName();
-
- bool bAcquired = aCache->acquireModule(aModuleName);
- aResult = (sharable::TreeFragment *)( aCache->getTreeAddress(aModuleName) );
-
- if (bAcquired)
- try
- {
- std::auto_ptr<SubtreeChange> aTreeChanges;
- sharable::Node * aRootAddress;
-
- {
- sharable::Node * rootNode = aResult == 0 ? 0 : aResult->getRootNode();
-
- aTreeChanges = createDiffs(rootNode, aLoadedNodeInstance->data().get(), aLoadedNodeInstance->root());
- aRootAddress = rootNode;
- }
-
- if (aTreeChanges.get() != NULL)
- {
- // change all Values... found in the Subtree in the CacheTree
- applyUpdateWithAdjustmentToTree(*aTreeChanges, aRootAddress);
-
- UpdateRequest anUpdateReq( aTreeChanges.get(),
- aLoadedNodeInstance->root(),
- _aRequest.getOptions()
- );
-
- m_aNotifier.notifyChanged(anUpdateReq);
- }
- aCache->releaseModule(aModuleName);
- }
- catch (...)
- {
- aCache->releaseModule(aModuleName);
- throw;
- }
- }
- return aResult;
-}
-
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
diff --git a/configmgr/source/treecache/makefile.mk b/configmgr/source/treecache/makefile.mk
deleted file mode 100644
index 718ee5ca4e00..000000000000
--- a/configmgr/source/treecache/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=treecache
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/timestamp.obj \
- $(SLO)$/disposetimer.obj \
- $(SLO)$/cachewritescheduler.obj \
- $(SLO)$/invalidatetree.obj \
- $(SLO)$/cachefactory.obj \
- $(SLO)$/cacheaccess.obj \
- $(SLO)$/cachedata.obj \
- $(SLO)$/cacheline.obj \
- $(SLO)$/cachemulticaster.obj \
- $(SLO)$/cachecontroller.obj \
- $(SLO)$/treemanager.obj \
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/treecache/timestamp.cxx b/configmgr/source/treecache/timestamp.cxx
deleted file mode 100644
index c201d321a918..000000000000
--- a/configmgr/source/treecache/timestamp.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "timestamp.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- const sal_uInt32 maxTimeValueSeconds = 0xFF000000ul; // catches accidetally added values as well
- const sal_uInt32 maxTimeValueNanos = 999999999ul;
- const sal_uInt32 minTimeValueSeconds = 0ul;
- const sal_uInt32 minTimeValueNanos = 0ul;
-// -------------------------------------------------------------------------
- TimeStamp TimeStamp::never()
- {
- const ::TimeValue maxTimeValue = { maxTimeValueSeconds, maxTimeValueNanos };
-
- return TimeStamp( maxTimeValue );
- }
-// -------------------------------------------------------------------------
- TimeStamp TimeStamp::getCurrentTime()
- {
- TimeStamp aResult;
- if (! ::osl_getSystemTime( &aResult.m_aTime ) )
- return never();
- return aResult;
- }
-// -------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/timestamp.hxx b/configmgr/source/treecache/timestamp.hxx
deleted file mode 100644
index 82bf33a2773f..000000000000
--- a/configmgr/source/treecache/timestamp.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TIMESTAMP_HXX
-#define CONFIGMGR_TIMESTAMP_HXX
-
-#include <vos/timer.hxx>
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
-
- class TimeInterval
- {
- vos::TTimeValue m_aTime;
- public:
- TimeInterval() : m_aTime()
- {}
-
- explicit
- TimeInterval(sal_uInt32 nSeconds) : m_aTime(nSeconds,0)
- {}
-
- explicit
- TimeInterval(const TimeValue& rTimeValue) : m_aTime(rTimeValue)
- {}
-
- sal_Bool isEmpty() const { return m_aTime.isEmpty(); }
-
- vos::TTimeValue const& getTimeValue() const { return m_aTime; }
- };
-////////////////////////////////////////////////////////////////////////////////
-
- class TimeStamp
- {
- vos::TTimeValue m_aTime;
- public:
- TimeStamp() : m_aTime()
- {}
-
- explicit
- TimeStamp(TimeValue const& rTimeValue) : m_aTime(rTimeValue)
- {}
-
- TimeStamp& operator += (TimeInterval const& aInterval)
- { m_aTime.addTime(aInterval.getTimeValue()); return *this; }
-
- vos::TTimeValue const& getTimeValue() const { return m_aTime; }
-
- sal_Bool isNever() const;
-
- static TimeStamp getCurrentTime();
- static TimeStamp never(); // is later than (>) any other TimeStamp
- };
-
- inline
- TimeStamp operator +(TimeStamp const& aTime, TimeInterval const& aInterval)
- {
- TimeStamp aResult(aTime);
- aResult += aInterval;
- return aResult;
- }
- inline
- TimeStamp operator +(TimeInterval const& aInterval, TimeStamp const& aTime)
- {
- TimeStamp aResult(aTime);
- aResult += aInterval;
- return aResult;
- }
-////////////////////////////////////////////////////////////////////////////////
- inline sal_Bool operator ==(TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() == rhs.getTimeValue(); }
- inline sal_Bool operator < (TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() < rhs.getTimeValue(); }
- inline sal_Bool operator > (TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() > rhs.getTimeValue(); }
-
- inline sal_Bool operator !=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(lhs == rhs); }
- inline sal_Bool operator <=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(rhs < lhs); }
- inline sal_Bool operator >=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(lhs < rhs); }
-
- inline sal_Bool TimeStamp::isNever() const
- {
- return never() <= *this;
- }
-////////////////////////////////////////////////////////////////////////////////
-
- struct ltTimeStamp //: std::binary_function<TimeStamp,TimeStamp,bool>
- {
- bool operator()(TimeStamp const& lhs, TimeStamp const& rhs) const
- { return !!(lhs < rhs); }
- };
-
-////////////////////////////////////////////////////////////////////////////////
-} // namespace configmgr
-
-#endif // CONFIGMGR_TIMESTAMP_HXX
-
diff --git a/configmgr/source/treecache/treemanager.cxx b/configmgr/source/treecache/treemanager.cxx
deleted file mode 100644
index 7a2dc848afa4..000000000000
--- a/configmgr/source/treecache/treemanager.cxx
+++ /dev/null
@@ -1,512 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treemanager.hxx"
-#include "mergeddataprovider.hxx"
-#include "cacheaccess.hxx"
-#include "cachecontroller.hxx"
-#include "cachemulticaster.hxx"
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
- namespace lang= ::com::sun::star::lang;
-
- namespace Path = configuration::Path;
-// =========================================================================
-//#if OSL_DEBUG_LEVEL > 0
-#if 0 // currently not used in debug build!
-static void test_complete(memory::HeapManager & _rDummy)
-{ new TreeManager(NULL,_rDummy); }
-#endif
-// =========================================================================
-
-#define MAKEUSTRING( char_array ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( char_array ) )
-// =========================================================================
-
-static inline
-configuration::AbsolutePath extractModulePath(configuration::AbsolutePath const & _aPath)
-{
- if (_aPath.getDepth() <= 1) return _aPath;
-
- rtl::OUString aModule = _aPath.getModuleName();
-
- return configuration::AbsolutePath::makeModulePath(aModule);
-}
-// =========================================================================
-
-// disposing
-// -------------------------------------------------------------------------
-void TreeManager::disposeAll()
-{
- CFG_TRACE_INFO("TreeManager: Disposing all data" );
- CacheList::Map aReleaseList;
-
- m_aCacheList.swap(aReleaseList); // move data out of m_aCacheList
-
- // free all the trees - not exception safe !! (i.e. disposeBroadcastHelper() must not throw)
- for (CacheList::Map::iterator i = aReleaseList.begin(); i != aReleaseList.end(); ++i)
- {
- if (ConfigChangeBroadcastHelper * pHelper = i->second->releaseBroadcaster())
- disposeBroadcastHelper(pHelper);
- i->second.clear();
- }
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::dispose()
-{
- CFG_TRACE_INFO("TreeManager: dispoing the treemanager" );
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::TreeManager", "jb99855", "configmgr: TreeManager::dispose().");
-
- rtl::Reference< backend::CacheController > xBackendCache = maybeGetBackendCache();
-
- if (xBackendCache.is()) xBackendCache->getNotifier().removeListener(this);
-
- // cleaning the cache
- disposeAll();
-
- disposeBackendCache();
-}
-
-// -------------------------------------------------------------------------
-ConfigChangeBroadcastHelper* TreeManager::getBroadcastHelper(RequestOptions const& _aOptions, bool bCreate)
-{
- rtl::Reference<CacheClientAccess> aCache = bCreate ? this->getCacheAlways(_aOptions)
- : m_aCacheList.get(_aOptions);
-
- return aCache.is() ? aCache->getBroadcaster() : NULL;
-}
-
-
-// -------------------------------------------------------------------------
-TreeManager::TreeManager(rtl::Reference< backend::CacheController > const & _xBackend)
-: m_xCacheController(_xBackend)
-, m_aCacheList()
-, m_aTemplates(new CacheData())
-, m_bEnableAsync(true)
-{
- OSL_PRECOND(_xBackend.is(),"Trying to create a TreeManager without a backend");
-
- if (m_xCacheController.is()) m_xCacheController->getNotifier().addListener(this);
-}
-
-// -------------------------------------------------------------------------
-TreeManager::~TreeManager()
-{
-}
-
-// -------------------------------------------------------------------------
-rtl::Reference< backend::CacheController > TreeManager::maybeGetBackendCache() SAL_THROW(())
-{
- osl::MutexGuard aGuard(m_aCacheControllerMutex);
- rtl::Reference< backend::CacheController > xResult(m_xCacheController);
- return xResult;
-}
-
-// -------------------------------------------------------------------------
-rtl::Reference< backend::CacheController > TreeManager::getCacheLoader() SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- osl::MutexGuard aGuard(m_aCacheControllerMutex);
- if (!m_xCacheController.is())
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("TreeManager: No backend available - tree manager was already disposed.");
- throw com::sun::star::lang::DisposedException(sMsg,NULL);
- }
- rtl::Reference< backend::CacheController > xResult(m_xCacheController);
- return xResult;
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::disposeBackendCache() SAL_THROW(())
-{
- osl::ClearableMutexGuard aGuard(m_aCacheControllerMutex);
- if (m_xCacheController.is())
- {
- rtl::Reference< backend::CacheController > xBackendCache(m_xCacheController);
- m_xCacheController.clear();
- aGuard.clear();
- xBackendCache->dispose();
- }
-}
-
-// -------------------------------------------------------------------------
-
-rtl::Reference<CacheClientAccess> TreeManager::getCacheAlways(RequestOptions const & _aOptions)
-{
- rtl::Reference<CacheClientAccess> aResult = m_aCacheList.get(_aOptions);
- if (!aResult.is())
- {
- rtl::Reference<CacheClientAccess> aNewCache( new CacheClientAccess(new ConfigChangeBroadcastHelper()) );
- aResult = m_aCacheList.insert(_aOptions,aNewCache);
- }
- return aResult;
-}
-
-// -------------------------------------------------------------------------
-
-sharable::Node * TreeManager::requestSubtree(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("TreeManager: request for subtree '%s'", OUSTRING2ASCII(aSubtreePath.toString()));
-
- rtl::Reference<CacheClientAccess> aCache = getCacheAlways(_aOptions);
- OSL_ENSURE(aCache.is(),"TreeManager: Cannot create cache access for loading node");
-
- if (!aCache->hasModule(aSubtreePath))
- {
- CFG_TRACE_INFO_NI("TreeManager: cache miss. going to load the node");
- backend::ComponentRequest aQuery( aSubtreePath.getModuleName(), _aOptions );
-
- sharable::TreeFragment * aLoadedLocation = getCacheLoader()->loadComponent(aQuery);
- if (aLoadedLocation == NULL)
- {
- CFG_TRACE_WARNING_NI("TreeManager: requested component not found");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Requested component not found"), NULL);
- }
-
- CFG_TRACE_INFO_NI("TreeManager: attaching loaded cache segment ");
- aCache->attachModule(aLoadedLocation,aSubtreePath.getModuleName());
- }
- else
- {
- CFG_TRACE_INFO_NI("TreeManager: found node in cache");
- if (_aOptions.isRefreshEnabled())
- {
- backend::ComponentRequest aRequest( aSubtreePath.getModuleName(), _aOptions );
- getCacheLoader()->refreshComponent(aRequest);
- }
- }
-
- return aCache->acquireNode(aSubtreePath);
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::fetchSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& ) SAL_THROW(())
-{
- (void) aSubtreePath; // avoid warning about unused parameter
- CFG_TRACE_WARNING("TreeManager: Prefetching not implemented. (Request to prefetch component %s.", OUSTRING2ASCII(aSubtreePath.toString()));
-}
-
-// -------------------------------------------------------------------------
-sal_Bool TreeManager::fetchDefaultData( configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("tree manager: checking the cache for defaults");
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aOptions);
-
- if (!aCache.is())
- {
- OSL_ENSURE(aCache.is(),"TreeManager: Cache access to fetch defaults for does not exist ! Where does the node access come from ?");
- return false;
- }
-
- if (aCache->hasModuleDefaults(aSubtreePath))
- {
- CFG_TRACE_INFO_NI("TreeManager: found default data in cache");
- return true;
- }
-
- configuration::AbsolutePath aRequestPath = extractModulePath(aSubtreePath);
-
- backend::NodeRequest aRequest(aRequestPath,_aOptions);
-
- backend::ResultHolder< backend::NodeInstance > aDefaults = getCacheLoader()->getDefaultData( aRequest );
-
- if (!aDefaults.is())
- {
- CFG_TRACE_INFO_NI("TreeManager: merging loaded defaults into cache");
- return aCache->insertDefaults(aDefaults.instance());
- }
- else
- {
- CFG_TRACE_WARNING_NI("TreeManager: cannot load defaults: no data available or not supported");
- return false;
- }
-}
-
-// -------------------------------------------------------------------------
-std::auto_ptr<ISubtree> TreeManager::requestDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
-{
- // to do: check cache for existing default data (?!)
- CFG_TRACE_INFO_NI("TreeManager: loading default data directly");
-
- backend::NodeRequest aRequest(aSubtreePath,_aOptions);
-
- backend::ResultHolder< backend::NodeInstance > aDefaults = getCacheLoader()->getDefaultData( aRequest );
-
- return aDefaults.extractDataAndClear();
-}
-
-// -------------------------------------------------------------------------
-configuration::AbsolutePath TreeManager::encodeTemplateLocation(const rtl::OUString& _rLogicalTemplateName, const rtl::OUString &_rModule)
-{
-// static const
-// configuration::Path::Component aTemplateRoot = configuration::Path::wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- configuration::Path::Component aTemplateModule = configuration::Path::wrapSimpleName(_rModule);
- configuration::Path::Component aTemplateName = configuration::Path::wrapSimpleName(_rLogicalTemplateName);
-
- Path::Rep aResult(aTemplateName);
- aResult.prepend(aTemplateModule);
-// aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-
-// -------------------------------------------------------------------------
-sharable::TreeFragment * TreeManager::requestTemplate(rtl::OUString const& _rName,
- rtl::OUString const& _rModule) SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE(_rName.getLength() != 0, "TreeManager::requestTemplate : invalid template name !");
-
- CFG_TRACE_INFO("TreeManager: going to get a template named %s", OUSTRING2ASCII(_rName));
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_rName, _rModule);
- rtl::OUString aCacheModule = aTemplateLocation.getModuleName();
-
- if (!getTemplates().hasNode(aTemplateLocation))
- {
- CFG_TRACE_INFO_NI("TreeManager: cache miss. going to load the template");
- backend::TemplateRequest aQuery( _rName, _rModule );
-
- sharable::TreeFragment * aLoadedLocation = getCacheLoader()->loadTemplate(aQuery);
- if (aLoadedLocation == NULL)
- {
- CFG_TRACE_ERROR_NI("TreeManager: requested template module not found");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Requested template module not found"), NULL);
- }
-
- CFG_TRACE_INFO_NI("TreeManager: attaching to loaded template module");
-
- getTemplates().attachModule(aLoadedLocation,aCacheModule);
-
- // create a client ref count on the template module
- getTemplates().acquireNode(aTemplateLocation);
- }
- else
- {
- CFG_TRACE_INFO_NI("TreeManager: template module found in cache");
- }
-
- sharable::TreeFragment * aTemplateAddr = getTemplates().getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- {
- CFG_TRACE_ERROR_NI("TreeManager: template not found in module");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Unknown template. Type description could not be found in the given module."), NULL);
- }
- return aTemplateAddr;
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::saveAndNotifyUpdate(TreeChangeList const& aChangeTree) SAL_THROW((com::sun::star::uno::Exception))
-{
- {
- CFG_TRACE_INFO("TreeManager: committing an Update to the cache controller");
- RequestOptions aOptions = aChangeTree.getOptions();;
- //Modify RequestOptions - suppress async commit, if disabled
- if(!m_bEnableAsync)
- aOptions.enableAsync(false);
-
- backend::UpdateRequest anUpdate(
- & aChangeTree.root,
- aChangeTree.getRootNodePath(),
- aOptions);
-
- getCacheLoader()->saveAndNotify(anUpdate);
- CFG_TRACE_INFO_NI("TreeManager: committing done");
- }
-}
-
-// -----------------------------------------------------------------------------
-void TreeManager::updateTree(TreeChangeList& _aChanges) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("TreeManager: updating the cache from a changes list");
-
- backend::UpdateInstance anUpdate(&_aChanges.root,_aChanges.getRootNodePath());
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aChanges.getOptions());
-
- if (!aCache.is())
- {
- CFG_TRACE_ERROR_NI("TreeManager: Cache access to update into does not exist !");
- OSL_ENSURE(aCache.is(),"TreeManager: Cache access to update into does not exist ! Where does the update access come from ?");
- throw lang::DisposedException(rtl::OUString::createFromAscii("Tree to be updated was already disposed"), NULL);
- }
-
- // merge the changes into the tree
- aCache->applyUpdate(anUpdate);
-
- CFG_TRACE_INFO_NI("TreeManager: cache update done");
-}
-
-// -----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-void TreeManager::releaseSubtree( configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions ) SAL_THROW(())
-{
- CFG_TRACE_INFO("TreeManager: releasing subtree '%s' for entity '%s' with locale '%s'", OUSTRING2ASCII(aSubtreePath.toString()), OUSTRING2ASCII(_aOptions.getEntity()), OUSTRING2ASCII(_aOptions.getLocale()) );
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aOptions);
-
- OSL_ENSURE(aCache.is(),"TreeManager: No local data to release");
-
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("TreeManager: decrementing refcount for subtree '%s'", OUSTRING2ASCII(aSubtreePath.toString()) );
- if (aCache->releaseNode(aSubtreePath) == 0)
- {
- backend::ComponentRequest aComponentDesc(aSubtreePath.getModuleName(),_aOptions);
- rtl::Reference< backend::CacheController > xBackendCache = maybeGetBackendCache();
- if (xBackendCache.is()) xBackendCache->freeComponent(aComponentDesc);
- }
- }
-}
-// ----------------------------------------------------------------------------
-void TreeManager::refreshAll() SAL_THROW((com::sun::star::uno::Exception))
-{
- //Find what components are in cache and that have client references and reload
- //such components.
- rtl::Reference< backend::CacheController > aCacheRef = maybeGetBackendCache();
- if (aCacheRef.is()) aCacheRef->refreshAllComponents();
-}
-// ----------------------------------------------------------------------------
-void TreeManager::flushAll()SAL_THROW(())
-{
- rtl::Reference< backend::CacheController > aCacheRef = maybeGetBackendCache();
- if (aCacheRef.is()) aCacheRef->flushPendingUpdates();
-}
-//-----------------------------------------------------------------------------
-void TreeManager::enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(())
-{
- m_bEnableAsync = bEnableAsync;
-}
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::addListener(configuration::AbsolutePath const& aName, RequestOptions const & _aOptions, rtl::Reference<INodeListener> const& pHandler)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,true))
- {
- pHelper->addListener(aName, pHandler);
- }
- else
- OSL_ASSERT(false);
- }
-
- void TreeManager::removeListener(RequestOptions const & _aOptions, rtl::Reference<INodeListener> const& pHandler)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,false))
- {
- pHelper->removeListener( pHandler);
- }
- }
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::fireChanges(TreeChangeList const& rList_, sal_Bool bError_)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(rList_.getOptions(),false))
- {
- pHelper->broadcast(rList_, bError_, this);
- }
- }
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper)
- {
- if (pHelper)
- {
- pHelper->dispose(this);
- delete pHelper;
- }
- }
-
-// ----------------------------------------------------------------------------
-void TreeManager::nodeUpdated(TreeChangeList& _rChanges)
-{
- CFG_TRACE_INFO("TreeManager: nodeUpdated");
- try
- {
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_rChanges.getOptions());
-
- if (aCache.is())
- {
- // first approve the changes and merge them with the current tree
- configuration::AbsolutePath aSubtreeName = _rChanges.getRootNodePath();
-
- sharable::Node * aCacheTree = aCache->findInnerNode(aSubtreeName);
- //OSL_ENSURE(aCacheTree != NULL, "TreeManager::nodeUpdated : node not found in cache!");
-
- if (aCacheTree != NULL)
- this->fireChanges(_rChanges,false);
- }
- }
- catch (uno::RuntimeException&)
- {
- CFG_TRACE_ERROR_NI("TreeManager::nodeUpdated : could not notify !");
- }
- CFG_TRACE_INFO_NI("TreeManager: nodeUpdated done");
-}
-
-// ----------------------------------------------------------------------------
-
-void TreeManager::componentCreated(backend::ComponentRequest const & ) SAL_THROW(())
-{
- CFG_TRACE_INFO("TreeManager: component was created");
-}
-// ----------------------------------------------------------------------------
-
-void TreeManager::componentChanged(backend::UpdateRequest const & _anUpdate) SAL_THROW(())
-{
- TreeChangeList aChanges(_anUpdate.getOptions(),
- _anUpdate.getUpdateRoot(),
- *_anUpdate.getUpdateData(),
- treeop::DeepChildCopy() );
-
- this->nodeUpdated(aChanges);
-}
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treemgr/collectchanges.cxx b/configmgr/source/treemgr/collectchanges.cxx
deleted file mode 100644
index 831a166aa6ef..000000000000
--- a/configmgr/source/treemgr/collectchanges.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <string.h>
-#include "collectchanges.hxx"
-
-#include "nodechangeinfo.hxx"
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// conversion helper function
-//-----------------------------------------------------------------------------
-bool convertNodeChange(NodeChangeData& aData_, ValueChange const& aChange_)
-{
- switch(aChange_.getMode())
- {
- case ValueChange::wasDefault:
- case ValueChange::changeValue:
- aData_.type = NodeChangeData::eSetValue;
- break;
-
- case ValueChange::setToDefault:
- aData_.type = NodeChangeData::eSetDefault;
- break;
-
- case ValueChange::changeDefault:
- aData_.type = NodeChangeData::eNoChange; // ??
- break;
-
- default:
- OSL_ENSURE(false,"Unknown change type found");
- return false;
- }
-
- aData_.unoData.newValue = aChange_.getNewValue();
- aData_.unoData.oldValue = aChange_.getOldValue();
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool convertNodeChange(NodeChangeData& aData_, AddNode const& aChange_)
-{
- aData_.type = aChange_.isReplacing()
- ? NodeChangeData::eReplaceElement
- : NodeChangeData::eInsertElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool convertNodeChange(NodeChangeData& aData_, RemoveNode const& /*aChange_*/)
-{
- aData_.type = NodeChangeData::eRemoveElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// CollectChanges visitor class
-//-----------------------------------------------------------------------------
-
-CollectChanges::CollectChanges( NodeChangesInformation& rTargetList_,
- Tree& rStartTree_, unsigned int nStartNode_,
- rtl::Reference<Template> aElementTemplate_,
- unsigned int nMaxDepth)
-: m_rTargetList(rTargetList_)
-, m_aAccessor()
-, m_aContextTypeName()
-, m_pBaseTree(&rStartTree_)
-, m_nBaseNode(nStartNode_)
-, m_nDepthLeft( nMaxDepth )
-{
- if (aElementTemplate_.is())
- m_aContextTypeName = aElementTemplate_->getName();
-}
-
-//-----------------------------------------------------------------------------
-CollectChanges::CollectChanges( CollectChanges const& rBase, Path::Component const& rChildName, rtl::OUString const& aSubTypeName_)
-: m_rTargetList(rBase.m_rTargetList)
-, m_aAccessor(rBase.m_aAccessor.compose(rChildName))
-, m_aContextTypeName(aSubTypeName_)
-, m_pBaseTree(rBase.m_pBaseTree)
-, m_nBaseNode(rBase.m_nBaseNode)
-, m_nDepthLeft(childDepth(rBase.m_nDepthLeft))
-{
- OSL_ASSERT(rBase.m_nDepthLeft > 0);
-}
-
-//-----------------------------------------------------------------------------
-inline
-Path::Component CollectChanges::implGetNodeName(Change const& aChange_) const
-{
- rtl::OUString aSimpleNodeName( aChange_.getNodeName() );
-
- if (m_aContextTypeName.getLength() == 0)
- {
- OSL_ENSURE(isSimpleName(aSimpleNodeName),"Unexpected: Found non-simple name without a type");
- return Path::wrapSafeName(aSimpleNodeName);
- }
- else
- return Path::makeCompositeName(aSimpleNodeName, m_aContextTypeName);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(ValueChange const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, false ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(AddNode const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, true ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(RemoveNode const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, true ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(SubtreeChange const& aChanges_)
-{
- if (m_nDepthLeft > 0)
- {
- rtl::OUString aSubTypeName( aChanges_.getElementTemplateName() );
-
- CollectChanges aSubcollector( *this, implGetNodeName(aChanges_), aSubTypeName );
-
- aSubcollector.applyToChildren(aChanges_);
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::implAdd(NodeChangeInformation const& aChangeInfo_)
-{
- m_rTargetList.push_back(aChangeInfo_);
-}
-
-//-----------------------------------------------------------------------------
-bool CollectChanges::implSetLocation(NodeChangeLocation& rLocation_, Change const& aOriginal_, bool bSet_) const
-{
- NodeID aBaseID(m_pBaseTree,m_nBaseNode);
- if (aBaseID.isEmpty())
- return false;
-
- rLocation_.setBase( aBaseID );
-
- if (bSet_ && m_aAccessor.isEmpty()) // It is a set change affecting the base ...
- rLocation_.setAffected( aBaseID );
-
- Path::Component aChangeName = implGetNodeName( aOriginal_ );
- rLocation_.setAccessor( m_aAccessor.compose( aChangeName ) );
-
- return true;
-}
-
-// ChangeTreeAction implementations
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(ValueChange const& aValueNode_)
-{
- collectFrom(aValueNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(AddNode const& aAddNode_)
-{
- collectFrom(aAddNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(RemoveNode const& aRemoveNode_)
-{
- collectFrom(aRemoveNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(SubtreeChange const& aSubtree_)
-{
- collectFrom( aSubtree_ );
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/collectchanges.hxx b/configmgr/source/treemgr/collectchanges.hxx
deleted file mode 100644
index 1c7b3171c69f..000000000000
--- a/configmgr/source/treemgr/collectchanges.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_COLLECTCHANGES_HXX_
-#define CONFIGMGR_COLLECTCHANGES_HXX_
-
-// low.level (cache model) changes (needed for change tree action class)
-#include "change.hxx"
-
-// pathes for accessors
-#include "configpath.hxx"
-
-// need c_TreeDepthAll
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class NodeChangeData;
- class NodeChangeLocation;
- class NodeChangeInformation;
- class NodeChangesInformation;
-//-----------------------------------------------------------------------------
-
- /// Change model translation: Create a NodeChangeData from a ValueChange object
- bool convertNodeChange(NodeChangeData& aData_, ValueChange const& aChange_);
- /// Change model translation: Create a NodeChangeData from an AddNode change object
- bool convertNodeChange(NodeChangeData& aData_, AddNode const& aChange_);
- /// Change model translation: Create a NodeChangeData from a RemoveNode change object
- bool convertNodeChange(NodeChangeData& aData_, RemoveNode const& aChange_);
-
- /** Change Tree Visitor that appends all changes in the changes tree
- to a NodeChanges list, optionally restricted to a given depth
- */
- class CollectChanges : private ChangeTreeAction
- {
- NodeChangesInformation& m_rTargetList;
- RelativePath m_aAccessor;
- rtl::OUString m_aContextTypeName;
- Tree* m_pBaseTree;
- unsigned int m_nBaseNode;
- unsigned int m_nDepthLeft;
-
- public:
- /// Constructs a Visitor object, sets the output target list and context
- CollectChanges( NodeChangesInformation& rTargetList_,
- Tree& rStartTree_, unsigned int nStartNode_,
- rtl::Reference<Template> aElementTemplate_,
- unsigned int nMaxDepth = c_TreeDepthAll);
-
- /// Adds a (translated) ValueChange to the target list
- void collectFrom(ValueChange const& aChange_);
-
- /// Adds a (translated) AddNode to the target list
- void collectFrom(AddNode const& aChange_);
-
- /// Adds a (translated) RemoveNode to the target list
- void collectFrom(RemoveNode const& aChange_);
-
- /// Appends (translated) Changes from the subtree to the target list, possibly with a depth limit
- void collectFrom(SubtreeChange const& aChange_);
-
- /// Appends the given Change and its descendants to the target list, possibly with a depth limit
- void collectFrom(Change const& aChange_)
- {
- this->applyToChange( aChange_ );
- }
-
- /// Appends the descendants of the given Change to the target list, possibly with a depth limit
- void collectFromChildren(SubtreeChange const& aParent_)
- {
- this->applyToChildren( aParent_ );
- }
-
- protected:
- /// Constructs a Visitor object for a child of another one's context
- CollectChanges( CollectChanges const& rBase, Path::Component const& rChildName, rtl::OUString const& aSubTypeName );
-
- private:
- // ChangeTreeAction implementations
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree);
-
- bool implSetLocation(NodeChangeLocation& rLocation_, Change const& aOriginal_, bool bSet_) const;
- void implAdd(NodeChangeInformation const& aChangeInfo_);
- Path::Component implGetNodeName(Change const& _aChange_) const;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_COLLECTCHANGES_HXX_
diff --git a/configmgr/source/treemgr/configdefaultprovider.cxx b/configmgr/source/treemgr/configdefaultprovider.cxx
deleted file mode 100644
index 7e77fab8f516..000000000000
--- a/configmgr/source/treemgr/configdefaultprovider.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configdefaultprovider.hxx"
-#include "defaultproviderproxy.hxx"
-#include "noderef.hxx"
-#include "valuenode.hxx"
-#include "tree.hxx"
-#include "options.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class DefaultProvider
-//-----------------------------------------------------------------------------
-
-// standard c/d-tors to make compiler barrier
-DefaultProvider DefaultProvider::createEmpty()
-{
- return DefaultProvider(NULL);
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider DefaultProvider::create(rtl::Reference< Tree > const& _aRootTree, RequestOptions const& _aOptions,
- rtl::Reference< TreeManager > const & _xDefaultProvider,
- IDefaultableTreeManager* _pDefaultableTree)
-{
- OSL_PRECOND( !isEmpty(_aRootTree.get()), "ERROR: Cannot create DefaultProvider for NULL tree");
-
- rtl::Reference< DefaultProviderProxy > xNewProxy;
-
- if (!isEmpty(_aRootTree.get()))
- {
- xNewProxy = new DefaultProviderProxy(_xDefaultProvider,_pDefaultableTree,
- _aRootTree->getRootPath(), _aOptions );
- }
-
- return DefaultProvider( xNewProxy );
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::DefaultProvider(DefaultProvider const& _aOther)
-: m_aProxy(_aOther.m_aProxy)
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider& DefaultProvider::operator=(DefaultProvider const& _aOther)
-{
- m_aProxy = _aOther.m_aProxy;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::~DefaultProvider()
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::DefaultProvider(rtl::Reference< DefaultProviderProxy > const& _xProviderProxy)
-: m_aProxy(_xProviderProxy)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// tries to load a default instance of the specified node
-std::auto_ptr<ISubtree> DefaultProvider::getDefaultTree(
- rtl::Reference< Tree > const& _aTree, NodeRef const& _aNode
- ) const SAL_THROW((com::sun::star::uno::Exception))
-{
- std::auto_ptr<ISubtree> aRet;
-
- node::Attributes aAttributes = _aTree->getAttributes(_aNode);
-
-// if (aAttributes.bDefaulted)
-// clone the ISubtree (no interface for that) :-(
-
- if (m_aProxy.is() && aAttributes.existsInDefault())
- aRet = m_aProxy->getDefaultTree(_aTree->getAbsolutePath(_aNode));
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-static bool shouldFetchDefaultData(rtl::Reference< Tree > const& _aTreeRef, bool & _rbHasDefaults)
-{
- bool bShouldFetch = false;
-
- node::Attributes aAttributes = _aTreeRef->getAttributes(_aTreeRef->getRootNode());
-
- if (aAttributes.isDefault())
- _rbHasDefaults = true;
-
- // in replaced/added parts, defaults are considered non-existing
- else if (!aAttributes.isReplacedForUser())
- _rbHasDefaults = false;
-
- else
- bShouldFetch = true;
-
- return bShouldFetch;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-bool DefaultProvider::fetchDefaultData(rtl::Reference< Tree > const& _aTreeRef) const SAL_THROW((com::sun::star::uno::Exception))
-{
- bool bHasDefaults = false;
-
- if (shouldFetchDefaultData(_aTreeRef,bHasDefaults) && m_aProxy.is() )
- bHasDefaults = m_aProxy->fetchDefaultData();
-
- return bHasDefaults;
-}
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configexcept.cxx b/configmgr/source/treemgr/configexcept.cxx
deleted file mode 100644
index 6f0499a77814..000000000000
--- a/configmgr/source/treemgr/configexcept.cxx
+++ /dev/null
@@ -1,181 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configexcept.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- Exception::Exception(char const* sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
- {
- }
- //---------------------------------------------------------------------
- Exception::Exception(rtl::OString const& sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString Exception::message() const
- {
-
- return rtl::OStringToOUString( m_sAsciiMessage, RTL_TEXTENCODING_ASCII_US );
- }
- //---------------------------------------------------------------------
- char const* Exception::what() const
- {
- return m_sAsciiMessage.getLength() ? m_sAsciiMessage.getStr() : "FAILURE in CONFIGURATION: No description available";
- }
- //---------------------------------------------------------------------
-
- static const char c_sInvalidNamePre[] = "CONFIGURATION: Invalid path or name: ";
- static const char c_sInvalidName[] = "CONFIGURATION: <Invalid path or name>";
-//-----------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
-
- InvalidName::InvalidName(rtl::OUString const& sName, char const* sAsciiDescription)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sInvalidName)) += sAsciiDescription )
- , m_sName( sName.concat(rtl::OUString::createFromAscii(sAsciiDescription)) )
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString InvalidName::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(c_sInvalidNamePre)).concat( m_sName );
- }
-//-----------------------------------------------------------------------------
-
- static const char c_sViolation[] = "CONFIGURATION: Update Violates Constraint: ";
- //---------------------------------------------------------------------
-
- ConstraintViolation::ConstraintViolation(char const* sConstraint)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sViolation)) += sConstraint)
- {
- }
-
-//-----------------------------------------------------------------------------
-
- static const char c_sTypeMismatch[] = "CONFIGURATION: Data Types do not match: ";
- //---------------------------------------------------------------------
- rtl::OUString TypeMismatch::describe(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType)
- {
- rtl::OUString sRet = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Found Type: '"));
- sRet += sFoundType;
- if (sExpectedType.getLength() != 0)
- {
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' - Expected Type: '"));
- sRet += sExpectedType;
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- }
- else
- {
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' is not valid in this context"));
- }
- return sRet;
- }
- //---------------------------------------------------------------------
-
- //---------------------------------------------------------------------
-
- TypeMismatch::TypeMismatch(rtl::OUString const& sType1, rtl::OUString const& sType2)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sTypeMismatch)) )
- , m_sTypes( describe(sType1,sType2) )
- {
- }
- //---------------------------------------------------------------------
- TypeMismatch::TypeMismatch(rtl::OUString const& sType1, rtl::OUString const& sType2, char const* sAsciiDescription)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sTypeMismatch)) += sAsciiDescription)
- , m_sTypes( describe(sType1,sType2).concat(rtl::OUString::createFromAscii(sAsciiDescription)) )
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString TypeMismatch::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(c_sTypeMismatch)).concat( m_sTypes );
- }
-//-----------------------------------------------------------------------------
- }
-
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- ExceptionMapper::ExceptionMapper(configuration::Exception& e)
- : m_eOriginal(e)
- , m_xContext()
- , m_sMessage(e.message())
- {
- }
- //---------------------------------------------------------------------
-
- ExceptionMapper::~ExceptionMapper()
- {
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::setContext(uno::XInterface* pContext)
- {
- m_xContext = pContext;
- }
- //---------------------------------------------------------------------
-
- rtl::OUString ExceptionMapper::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE in CONFIGMGR: ")).concat( m_sMessage );
- }
- //---------------------------------------------------------------------
-
- uno::Reference<uno::XInterface> ExceptionMapper::context() const
- {
- return m_xContext;
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::illegalArgument(sal_Int16 nArgument) throw(lang::IllegalArgumentException)
- {
- throw lang::IllegalArgumentException(message(),context(),nArgument);
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::unhandled() throw(uno::RuntimeException)
- {
- throw uno::RuntimeException(message(),context());
- }
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/configgroup.cxx b/configmgr/source/treemgr/configgroup.cxx
deleted file mode 100644
index f3b810665368..000000000000
--- a/configmgr/source/treemgr/configgroup.cxx
+++ /dev/null
@@ -1,404 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configgroup.hxx"
-#include "configset.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "tree.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "typeconverter.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// class GroupUpdateHelper
-//-----------------------------------------------------------------------------
-
-GroupUpdateHelper::GroupUpdateHelper(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode)
-: m_aTree(aParentTree)
-, m_aNode(aGroupNode)
-{
- implValidateTree(m_aTree);
- implValidateNode(m_aTree,m_aNode);
-
- if (! view::ViewTreeAccess(m_aTree.get()).isGroupNode(m_aNode) )
- throw Exception("INTERNAL ERROR: Group Member Update: node is not a group");
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateTree(rtl::Reference< Tree > const& aTree) const
-{
- if (isEmpty(aTree.get()))
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL tree");
-
- // check for proper nesting
- for(rtl::Reference<Tree> aTestTree = aTree;
- aTestTree != m_aTree; // search this as ancestor tree
- aTestTree = aTestTree->getContextTree() )
- {
- if (!aTestTree.is()) // no more trees to look for
- throw Exception("INTERNAL ERROR: Group Member Update: improper tree relationship");
- }
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) const
-{
- if (!aNode.isValid())
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL node");
-
- if (!aTree->isValidNode(aNode.getOffset()))
- throw Exception("INTERNAL ERROR: Group Member Update: node does not match tree");
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateNode(rtl::Reference< Tree > const& aTree, ValueRef const& aNode) const
-{
- if (!aNode.isValid())
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL node");
-
- if (!aTree->isValidValueNode(aNode))
- throw Exception("INTERNAL ERROR: Group Member Update: changed node does not match tree");
-
- if (aTree->getAttributes(aNode).isReadonly())
- throw ConstraintViolation( "Group Member Update: Node is read-only !" );
-
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::validateNode(ValueRef const& aNode) const
-{
- implValidateNode(m_aTree,aNode);
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::validateNode(NodeRef const& aNode) const
-{
- implValidateNode(m_aTree,aNode);
-}
-//-----------------------------------------------------------------------------
-
-/** a helper that gets the UNO <type scope='com::sun::star::uno'>Type</type>
- for a UNO <type scope='com::sun::star::uno'>Any</type>.
-*/
-static inline com::sun::star::uno::Type getUnoAnyType()
-{
- com::sun::star::uno::Any const * const selectAny = 0;
- return ::getCppuType(selectAny);
-}
-//-----------------------------------------------------------------------------
-
-bool isPossibleValueType(com::sun::star::uno::Type const& aValueType)
-{
- switch(aValueType.getTypeClass())
- {
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_DOUBLE:
- case uno::TypeClass_STRING:
- return true;
-
- case uno::TypeClass_SEQUENCE:
- switch(getSequenceElementType(aValueType).getTypeClass())
- {
- case uno::TypeClass_BYTE: // scalar binary
-
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_DOUBLE:
- case uno::TypeClass_STRING:
- return true;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > const * const forBinaryList = 0;
- return !!(aValueType == ::getCppuType(forBinaryList));
- }
-
- default:
- return false;
- }
-
- default:
- return false;
- }
-}
-
-//-----------------------------------------------------------------------------
-bool convertCompatibleValue(com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xTypeConverter, uno::Any& rConverted, com::sun::star::uno::Any const& rNewValue, com::sun::star::uno::Type const& rTargetType)
-{
- OSL_ASSERT( isPossibleValueType(rTargetType) );
-
- if (rTargetType == rNewValue.getValueType())
- {
- rConverted = rNewValue;
- return true;
- }
-
- if (xTypeConverter.is())
- try
- {
- rConverted = xTypeConverter->convertTo(rNewValue,rTargetType);
-
- OSL_ASSERT( rConverted.getValueType() == rTargetType );
- }
- catch(uno::RuntimeException&) { throw; }
- catch(css::lang::IllegalArgumentException&)
- {
- // try to do more conversion here ?!
- return false;
- }
- catch(css::script::CannotConvertException&)
- {
- // try to do more conversion here ?!
- return false;
- }
- catch(uno::Exception&)
- {
- OSL_ENSURE(sal_False, "ValueUpdater::convertValue : generic exception ... thought we caught all allowed exceptions !");
- // try to do more conversion here ?!
- return false;
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupUpdater
-//-----------------------------------------------------------------------------
-
-GroupUpdater::GroupUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter)
-: m_aHelper(aParentTree,aGroupNode)
-, m_xTypeConverter(xConverter)
-{
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any GroupUpdater::implValidateValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode, com::sun::star::uno::Any const& aValue) const
-{
- com::sun::star::uno::Type aValueType = aValue.getValueType();
- com::sun::star::uno::Type aTargetType = aTree->getUnoType(aNode);
-
- OSL_ENSURE( aTargetType.getTypeClass() == uno::TypeClass_ANY || isPossibleValueType(aTargetType),
- "Invalid value type found on existing property" );
-
- OSL_ASSERT( aValueType.getTypeClass() != uno::TypeClass_ANY);
-
- com::sun::star::uno::Any aRet;
-
- if (!aValue.hasValue())
- {
- if (!aTree->getAttributes(aNode).isNullable())
- {
- rtl::OString sError("Group Member Update: Node (");
- sError += OUSTRING2ASCII(aNode.m_sNodeName);
- sError += ") is not nullable !";
- throw ConstraintViolation( sError );
- }
- OSL_ASSERT( !aRet.hasValue() );
- }
-
- else if (aValueType == aTargetType)
- {
- aRet = aValue;
- }
-
- else if (aTargetType == getUnoAnyType())
- {
- if ( ! isPossibleValueType(aValueType) )
- throw TypeMismatch(aValueType.getTypeName(), aTargetType.getTypeName(), " - new property value has no legal configuration data type");
-
- // OK - any type
- aRet = aValue;
- }
-
- else
- {
- if (!convertCompatibleValue(m_xTypeConverter, aRet, aValue,aTargetType))
- throw TypeMismatch(aValueType.getTypeName(), aTargetType.getTypeName(), " cannot set incompatible value");
- }
-
-
- OSL_ASSERT( !aRet.hasValue() || isPossibleValueType(aRet.getValueType()) );
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupUpdater::validateSetValue(ValueRef const& aValueNode, com::sun::star::uno::Any const& newValue )
-{
- m_aHelper.validateNode(aValueNode);
-
- com::sun::star::uno::Any aNewValue = implValidateValue(m_aHelper.tree(), aValueNode, newValue);
-
- // now build the specific change
- std::auto_ptr<ValueChangeImpl> pChange( new ValueReplaceImpl(aNewValue) );
-
- NodeRef aParent = m_aHelper.tree()->getParent(aValueNode);
- pChange->setTarget(
- view::ViewTreeAccess(m_aHelper.tree().get()).toGroupNode(aParent),
- aValueNode.m_sNodeName
- );
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// helper class NodeDefaulter
-//-----------------------------------------------------------------------------
-
-namespace
-{
- struct NodeDefaulter : NodeVisitor
- {
- GroupDefaulter& updater;
- NodeChanges result;
-
- explicit
- NodeDefaulter(GroupDefaulter& _rUpdater) : updater(_rUpdater), result() {}
-
- /// do the operation on <var>aNode</var>. needs to be implemented by concrete visitor classes
- Result handle(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// do the operation on <var>aValue</var>. needs to be implemented by concrete visitor classes
- Result handle(rtl::Reference< Tree > const& aTree, ValueRef const& aValue);
-
- inline void addResult(NodeChange const& aChange)
- {
- if (aChange.maybeChange())
- this->result.add(aChange);
- }
- };
-
- NodeVisitor::Result NodeDefaulter::handle(rtl::Reference< Tree > const& , NodeRef const& aNode)
- {
- addResult( updater.validateSetToDefaultState(aNode) );
- return CONTINUE;
- }
-
- NodeVisitor::Result NodeDefaulter::handle(rtl::Reference< Tree > const& , ValueRef const& aValue)
- {
- addResult( updater.validateSetToDefaultValue(aValue) );
- return CONTINUE;
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupDefaulter
-//-----------------------------------------------------------------------------
-
-GroupDefaulter::GroupDefaulter(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aProvider)
-: m_aHelper(_aParentTree,_aGroupNode)
-, m_aDefaultProvider(_aProvider)
-, m_bHasDoneSet(false)
-{
-}
-//-----------------------------------------------------------------------------
-bool GroupDefaulter::isDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode)
-{
- return _aParentTree->areValueDefaultsAvailable(_aGroupNode);
-}
-//-----------------------------------------------------------------------------
-bool GroupDefaulter::ensureDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aDataSource)
-{
- return isDataAvailable(_aParentTree, _aGroupNode) ||
- _aDataSource.fetchDefaultData( _aParentTree );
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupDefaulter::validateSetToDefaultValue(ValueRef const& aValueNode)
-{
- m_aHelper.validateNode(aValueNode);
-
- if (!m_aHelper.tree()->hasNodeDefault(aValueNode))
- throw Exception("INTERNAL ERROR: Group Member Update: Node has no default value" );
-
- // now build the specific change
- std::auto_ptr<ValueChangeImpl> pChange( new ValueResetImpl() );
-
- NodeRef aParent = m_aHelper.tree()->getParent(aValueNode);
- pChange->setTarget(
- view::ViewTreeAccess(m_aHelper.tree().get()).toGroupNode(aParent),
- aValueNode.m_sNodeName
- );
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupDefaulter::validateSetToDefaultState(NodeRef const& aNode)
-{
- m_aHelper.validateNode(aNode);
-
- NodeChange aResult;
-
- // only works for set nodes - groups are left alone
- if ( view::ViewTreeAccess(m_aHelper.tree().get()).isSetNode(aNode) )
- {
- aResult = SetDefaulter( m_aHelper.tree(), aNode, m_aDefaultProvider ).validateSetToDefaultState();
- }
-
- m_bHasDoneSet = aResult.maybeChange();
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-NodeChanges GroupDefaulter::validateSetAllToDefault()
-{
- NodeDefaulter aDefaulter(*this);
-
- m_aHelper.tree()->dispatchToChildren(m_aHelper.node(),aDefaulter);
-
- return aDefaulter.result;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configpath.cxx b/configmgr/source/treemgr/configpath.cxx
deleted file mode 100644
index 586188f0763a..000000000000
--- a/configmgr/source/treemgr/configpath.cxx
+++ /dev/null
@@ -1,998 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configpath.hxx"
-#include "configexcept.hxx"
-#include <rtl/ustrbuf.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-#ifndef CFG_PATH_STRICT
-//#define CFG_PATH_STRICT 1
-#endif
-
-#define dprint(a,b,c)
-
-namespace configmgr
-{
- namespace configuration
- {
-
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Name validation
-//-----------------------------------------------------------------------------
-namespace
-{
- //-------------------------------------------------------------------------
- inline
- bool isValidNameStart(sal_Unicode ch) SAL_THROW(())
- {
- return (sal_Unicode('A') <= ch && ch <= sal_Unicode('Z')) ||
- (sal_Unicode('a') <= ch && ch <= sal_Unicode('z')) ||
- sal_Unicode('_') == ch;
- }
- inline
- bool isValidNameCont(sal_Unicode ch) SAL_THROW(())
- {
- return ( (sal_Unicode('0') <= ch && ch <= sal_Unicode('9'))
- || (sal_Unicode('.') == ch) // eg for module names
- || (sal_Unicode('-') == ch) // eg for locale names
- || (sal_Unicode(':') == ch) // support special namespaced names
- );
- }
-
- //-------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-bool isSimpleName(rtl::OUString const& sName) SAL_THROW(())
-{
- sal_Unicode const* const pStr = sName.getStr();
- sal_Unicode const* const pEnd = pStr + sName.getLength();
-
- if ( (pStr == pEnd) || !isValidNameStart(*pStr) )
- return false;
-
- for (sal_Unicode const* pValidate = pStr+1; pValidate != pEnd; ++pValidate)
- {
- if (!isValidNameStart(*pValidate) && !isValidNameCont(*pValidate))
- return false;
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateNodeName(rtl::OUString const& sName)
-{
- if (!isSimpleName(sName))
- throw InvalidName(sName, "is not a valid name for a configuration node");
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateElementName(rtl::OUString const& sName)
-{
- if (sName.getLength() == 0)
- throw InvalidName(sName, "is not a valid name for a configuration item (empty names are not permitted)");
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-namespace // path helpers I
-{
-//-----------------------------------------------------------------------------
- const sal_Unicode c_cDelimiter = '/';
-
- const sal_Unicode c_lBracket = '[', c_rBracket = ']';
-
- const sal_Unicode c_cAnytype = '*';
-//-----------------------------------------------------------------------------
-
- // Textually an Absolute path starts with a slash
- static
- inline
- bool detectAbsolutePath(sal_Unicode const* _pPath) SAL_THROW(())
- {
- OSL_ASSERT( _pPath != NULL );
- return *_pPath == c_cDelimiter;
- }
-//-----------------------------------------------------------------------------
-
- static
- inline
- rtl::OUString makeWildcardType() SAL_THROW(())
- {
- return rtl::OUString(&c_cAnytype,1);
- }
-//-----------------------------------------------------------------------------
-
- // even handles empty strings (if NUL-terminated)
- static
- inline
- bool isWildcardType(sal_Unicode const* _sType) SAL_THROW(())
- {
- OSL_ASSERT( _sType != NULL );
- return _sType[0] == c_cAnytype &&
- _sType[1] == 0;
- }
-//-----------------------------------------------------------------------------
-
- static
- inline
- bool isEmptyString(sal_Unicode const* _sType) SAL_THROW(())
- {
- OSL_ASSERT( _sType != NULL );
- return _sType[0] == 0;
- }
-//-----------------------------------------------------------------------------
- static
- inline
- sal_Unicode lastChar(rtl::OUString const& _sString) SAL_THROW(())
- {
- sal_Int32 const nLen = _sString.getLength();
-
- OSL_PRECOND( nLen > 0, "Non-empty string expected");
-
- return _sString[nLen-1];
- }
-//-----------------------------------------------------------------------------
-
- rtl::OUString implMakeCompositeName(rtl::OUString const& _sBaseName, rtl::OUString const& _sPredicate) SAL_THROW((InvalidName));
- void implSplitCompositeName(rtl::OUString const& _aCompositeName, rtl::OUString& _rBaseName, rtl::OUString& _rPredicate) SAL_THROW(());
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-namespace Path
-{
-//-----------------------------------------------------------------------------
-// class configuration::Path::Component
-//-----------------------------------------------------------------------------
-
-inline // though public, this method is not available outside this translation unit
-Component::Component(rtl::OUString const& _sName) SAL_THROW(())
-: m_aName(_sName)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool Component::isSimpleName() const SAL_THROW(())
-{
- return m_aName.getLength() != 0 && lastChar(m_aName) != c_rBracket;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Component::getName() const SAL_THROW(())
-{
- if (isSimpleName()) return m_aName;
-
- rtl::OUString sName, sType;
- implSplitCompositeName(m_aName,sType,sName);
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Component::getTypeName() const SAL_THROW(())
-{
- if (isSimpleName()) return rtl::OUString();
-
- rtl::OUString sName, sType;
- implSplitCompositeName(m_aName,sType,sName);
-
- return sType;
-}
-//-----------------------------------------------------------------------------
-
-Component makeEmptyComponent() SAL_THROW(())
-{
- return Component( rtl::OUString() );
-}
-//-----------------------------------------------------------------------------
-
-Component wrapSimpleName(rtl::OUString const& _sName)
-{
- OSL_ENSURE( isSimpleName(_sName), "Simple name expected creating path component");
- if (!isSimpleName(_sName))
- throw InvalidName(_sName, "is not a simple name. Cannot convert to path component");
-
- return Component( _sName );
-}
-//-----------------------------------------------------------------------------
-
-Component makeCompositeName(rtl::OUString const& _sElementName, rtl::OUString const& _sTypeName)
-{
- return Component( implMakeCompositeName(_sTypeName,_sElementName) );
-}
-//-----------------------------------------------------------------------------
-
-
-bool matches(Component const& lhs,Component const& rhs) SAL_THROW(())
-{
- // this extra preflight check might be left out (is it good for performance ?)
- if (lhs.getInternalName() == rhs.getInternalName())
- return true;
-
- if (lhs.getName() != rhs.getName())
- return false;
-
- // simple names are considered equivalent to wildcard namess
- if (lhs.isSimpleName() || rhs.isSimpleName())
- return true;
-
- rtl::OUString aTypeLHS = lhs.getTypeName();
- rtl::OUString aTypeRHS = rhs.getTypeName();
-
- // this would need an extra test without our preflight check
- OSL_ASSERT(aTypeLHS != aTypeRHS); // would have been dicovered by first check
-
- if ( isWildcardType(aTypeLHS) || isWildcardType(aTypeRHS) )
- return true;
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// weak comparison of components
-//-----------------------------------------------------------------------------
-bool before(Component const& lhs, Component const& rhs) SAL_THROW(())
-{ return lhs.getName() < rhs.getName(); }
-
-//-----------------------------------------------------------------------------
-bool equiv(Component const& lhs, Component const& rhs) SAL_THROW(())
-{ return lhs.getName() == rhs.getName(); }
-
-//-----------------------------------------------------------------------------
-size_t hashCode(Component const& comp) SAL_THROW(())
-{ return comp.getName().hashCode(); }
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class configuration::Path::Rep
-//-----------------------------------------------------------------------------
-void Rep::check_not_empty() const
-{
- if (m_aComponents.empty())
- {
- OSL_ENSURE(!m_aComponents.empty(),"Trying to access components of an empty path");
- throw Exception("Trying to access components of an empty path");
- }
-}
-//-----------------------------------------------------------------------------
-
-void Rep::prepend(Rep const& _aOther) SAL_THROW(())
-{
- // to prepend the other path append its components
- m_aComponents.insert( m_aComponents.end(),
- _aOther.m_aComponents.begin(),
- _aOther.m_aComponents.end());
-
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Rep::toString(bool _bAbsolute) const SAL_THROW(())
-{
- std::vector<Component>::const_reverse_iterator cur = begin();
- std::vector<Component>::const_reverse_iterator const stop = end();
-
- rtl::OUStringBuffer sRet;
-
- if (!_bAbsolute && cur != stop)
- sRet = cur++->toPathString();
-
- for ( ;cur != stop; ++cur)
- sRet.append( c_cDelimiter ).append( cur->toPathString() );
-
- return sRet.makeStringAndClear();
-}
-//-----------------------------------------------------------------------------
-
-size_t Rep::hashCode() const SAL_THROW(())
-{
- const unsigned long mangle_factor = 11; // 1011 (2)
- unsigned long nHash = 0;
- for (std::vector<Component>::const_reverse_iterator it = begin(), stop = end(); it != stop; ++it)
- {
- nHash = mangle_factor*nHash + Path::hashCode(*it);
- }
- return nHash;
-}
-//-----------------------------------------------------------------------------
-
-bool before(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return std::lexicographical_compare(lhs.begin(),lhs.end(),rhs.begin(),rhs.end(), Before());
-}
-//-----------------------------------------------------------------------------
-
-bool equiv(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return (lhs.countComponents() == rhs.countComponents()) &&
- std::equal(lhs.begin(),lhs.end(),rhs.begin(),Equiv());
-}
-//-----------------------------------------------------------------------------
-
-bool matches(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return (lhs.countComponents() == rhs.countComponents()) &&
- std::equal(lhs.begin(),lhs.end(),rhs.begin(),Matches());
-}
-//-----------------------------------------------------------------------------
-
-bool isAbsolutePath(rtl::OUString const& _sPath) SAL_THROW(())
-{
- return detectAbsolutePath(_sPath);
-}
-//-----------------------------------------------------------------------------
-
-bool hasMatchingPrefix(Rep const& _aPath, Rep const& _aPrefix) SAL_THROW(())
-{
- return (_aPath.countComponents() >= _aPrefix.countComponents()) &&
- std::equal( _aPrefix.begin(), _aPrefix.end(), _aPath.begin(), Matches());
-}
-//-----------------------------------------------------------------------------
-
-Rep stripMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix) // SAL_THROW((InvalidName))
-{
- Rep aResult(_aPath);
-
- for (std::vector<Component>::const_reverse_iterator it = _aPrefix.begin(); it != _aPrefix.end(); ++it)
- {
- if (aResult.isEmpty() || !matches(*it,aResult.getFirstName()))
- throw InvalidName(aResult.getFirstName().toPathString(), "does not match the expected location.");
-
- aResult.dropFirstName();
- }
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-} // namespace Path
-//-----------------------------------------------------------------------------
-
-namespace
-{
-//-----------------------------------------------------------------------------
- const sal_Unicode c_quot = '\"';
- const sal_Unicode c_apos = '\'';
- const sal_Unicode c_amp = '&';
-
- const sal_Unicode c_end_escape = ';';
-
- const sal_Unicode c_normal_quot = c_apos;
- //-------------------------------------------
- static sal_Char const c_amp_name[] = "&amp;";
- static sal_Char const c_apos_name[] = "&apos;";
- static sal_Char const c_quot_name[] = "&quot;";
-
- const sal_Int32 c_nMinEscapeLen = sizeof c_amp_name - 1;
- const sal_Int32 c_nMaxEscapeLen = sizeof c_quot_name - 1;
-//-------------------------------------------------------------------------
- /// distinguishes which kind of path is held in a path object
- enum PathType { eRELATIVE = 1, eABSOLUTE = 2 };
-
-//-----------------------------------------------------------------------------
- // missing or mis leading in SAL/rtl: pStr1[nLength] must NOT be evaluated
- static
- sal_Int32 cfg_ustr_ascii_compare_WithLength( const sal_Unicode* pStr1,
- sal_Int32 nStr1Len,
- const sal_Char* pStr2 )
- {
- while( nStr1Len )
- {
- sal_Int32 nRet = static_cast<sal_Int32>(*pStr1)-
- static_cast<sal_Int32>(static_cast<unsigned char>(*pStr2));
-
- if (nRet != 0 || *pStr2 == 0) return nRet;
-
- ++pStr1;
- ++pStr2;
- --nStr1Len;
- }
-
- return -static_cast<sal_Int32>(static_cast<unsigned char>(*pStr2));
- }
-//-----------------------------------------------------------------------------
-
-
- /** find the char being escaped by the escape sequence in the given string range
- @return
- the char being escaped or zero, if the range is no known escape
- */
- sal_Unicode implParseEscape(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND( pBegin < pEnd, "Nonempty string range expected" );
- OSL_PRECOND( pBegin[0] == c_amp, "String range is not a possible escape: missing start marker" );
- OSL_PRECOND( pEnd[-1] == c_end_escape, "String range is not a possible escape: missing end marker" );
-
- sal_Int32 const nLen = pEnd - pBegin;
-
- sal_Unicode chResult;
-
- if ( c_nMinEscapeLen > nLen || nLen > c_nMaxEscapeLen) // quick check, if there is no possible match
- chResult = 0;
- // the standard escapes
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_amp_name)) chResult = c_amp;
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_apos_name)) chResult = c_apos;
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_quot_name)) chResult = c_quot;
- // extra escapes for XML compatibility
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,"&lt;")) chResult = sal_Unicode('<');
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,"&gt;")) chResult = sal_Unicode('>');
- else chResult = 0;
-
- return chResult;
- }
-
-//-----------------------------------------------------------------------------
-
- /** find the escape sequence to use for the given char
- @return
- an escape sequence, or NULL, if the char should not be escaped
- */
- inline
- sal_Char const* implGetEscape(sal_Unicode ch ) SAL_THROW(())
- {
- switch (ch)
- {
- case c_amp: return c_amp_name;
- case c_apos: return c_apos_name;
- case c_quot: return c_quot_name;
-
- default: return NULL;
- }
- }
-
-//-----------------------------------------------------------------------------
-
- /** find the start of the path component ending before pEnd in the string starting at pBegin
- @return
- a pointer to the last character before pEnd that is not a name delimiter
- */
- sal_Unicode const * implFindNameStart(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin <= pEnd, "Invalid string range");
-
- sal_Int32 const nLen = pEnd-pBegin;
- sal_Int32 const nPos = rtl_ustr_lastIndexOfChar_WithLength(pBegin, nLen, c_cDelimiter) + 1;
-
- OSL_ASSERT(0 <= nPos && nPos <= nLen);
-
- return pBegin + nPos;
- }
-//-----------------------------------------------------------------------------
-
- /** find the start of the bracketed & quoted predicate ending before pEnd in the string starting at pBegin
- @return
- <ul><li>a pointer to the opening bracket matching the closing bracket at pEnd[-1], if found</li>
- <li><var>pEnd</var>, if no bracketed string was found</li>
- <li>NULL, if there was a closing bracket, but the beginning could not be discovered</li></ul>
- */
- sal_Unicode const * implFindPredicateStart(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin < pEnd, "Nonempty string range required");
-
- if (pEnd == pBegin || pEnd[-1] != c_rBracket) return pEnd;
-
- if (--pEnd == pBegin)
- {
- OSL_ENSURE(false, "Invalid path component: single ']'");
- return NULL; // string was only "]"
- }
-
- sal_Unicode chQuote = *--pEnd;
-
- if (chQuote != c_quot && chQuote != c_apos)
- {
- // should we support empty brackets ?
- if (chQuote == c_lBracket)
- {
- OSL_ENSURE(false, "Empty predicate brackets found");
- return NULL; // for now we don't
-
- }
-
- // should we support brackets with non-quoted strings ?
- chQuote = c_lBracket; // for now we do
- }
-
- sal_Int32 nStart = rtl_ustr_lastIndexOfChar_WithLength(pBegin, pEnd-pBegin, chQuote);
-
- if (chQuote != c_lBracket) // needed to support non-quoted strings
- --nStart;
-
- if (nStart < 0)
- {
- OSL_ENSURE(false, "Could not find opening quote or bracket for bracketed predicate");
- return NULL;
- }
-
- if (pBegin[nStart] != c_lBracket)
- {
- OSL_ENSURE(false, "Illegal quote character in string");
- return NULL; // for now we don't
- }
-
- return pBegin + nStart;
- }
-//-----------------------------------------------------------------------------
-
- /// find the position of the given char in the range given.
- inline
- sal_Int32 indexOfCharInRange(sal_Unicode const * pBegin, sal_Unicode const * pEnd, sal_Unicode ch) SAL_THROW(())
- {
- return rtl_ustr_indexOfChar_WithLength(pBegin, pEnd-pBegin, ch);
- }
-//-----------------------------------------------------------------------------
-
- /// find the position of the given char in the range given.
- inline
- bool containsChar(sal_Unicode const * pString, sal_Unicode ch) SAL_THROW(())
- {
- return rtl_ustr_indexOfChar(pString, ch) >= 0;
- }
-//-----------------------------------------------------------------------------
-
- /** validate and normalize a bracketed & quoted predicate from content the string range [pBegin,pEnd)
- @param pRequiredEscapes
- contains a list of characters that must be preescaped or are otherwise invalid
- if NULL is passed, the source range is presumed to contain no escaped data
- otherwise the ampersand (&) and all characters in the list are required to be escaped
- @return
- the normalized, bracketed and quoted predicate
- @throw
- InvalidName, if the predicate data is not valid
- */
- rtl::OUString implMakeNormalizedPredicate(sal_Unicode const * pBeginContent, sal_Unicode const * pEndContent, sal_Unicode const* pRequiredEscapes) SAL_THROW((InvalidName))
- {
- OSL_PRECOND(pBeginContent <= pEndContent, "Invalid string range");
- if (pBeginContent == pEndContent)
- return rtl::OUString();
-
- rtl::OUStringBuffer aNormalized(pEndContent-pBeginContent + 4); // reserve approximate size initially
-
- // prefix: opening bracket and quote
- aNormalized.append(c_lBracket).append(c_normal_quot);
-
- // content: copy over each char and handle escaping
- for(sal_Unicode const * pCur = pBeginContent; pCur != pEndContent; ++pCur)
- {
- sal_Unicode ch = *pCur;
-
- // maybe parse contained escaping
- if (pRequiredEscapes)
- {
- if (ch == c_amp)
- {
- // find an escape end marker (after pCur). Result is pCur, if the end marker is not there
- sal_Unicode const * pEndEscape = pCur + 1 + indexOfCharInRange(pCur+1,pEndContent,c_end_escape);
- sal_Unicode ch2 = pCur != pEndEscape ? implParseEscape(pCur,pEndEscape+1) : 0;
-
- if (ch2 != 0) // found and read a valid escape sequence
- {
- ch = ch2;
- pCur = pEndEscape;
- OSL_ASSERT(*pCur == c_end_escape);
- }
- else
- {
- OSL_ENSURE(false, "Character '&' must be escaped in this context");
- #if 0
- throw InvalidName(rtl::OUString(pBeginContent,pEndContent-pBeginContent),
- "is not a valid element name string. "
- "Character '&' must be escaped in this context");
- #endif
- }
- }
- else if ( containsChar(pRequiredEscapes, ch) )
- {
- throw InvalidName(rtl::OUString(pBeginContent,pEndContent-pBeginContent),
- "is not a valid element name string. "
- "Some characters must be escaped in this context");
- }
- }
-
- // now append (escape if normal)
- if (sal_Char const * pEscape = implGetEscape(ch))
- aNormalized.appendAscii( pEscape );
-
- else
- aNormalized.append( ch );
- }
-
- // suffix: closing quote and bracket
- aNormalized.append(c_normal_quot).append(c_rBracket);
-
- return aNormalized.makeStringAndClear();
- }
-//-----------------------------------------------------------------------------
-
- /** extract and unescape the normalized predicate content in the string range [pBegin,pEnd)
- @return
- the denormalized predicate content
- */
- rtl::OUString implReadPredicate(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin <= pEnd, "Invalid string range");
-
- rtl::OUStringBuffer aContent(pEnd-pBegin); // reserve approximate size initially
-
- sal_Unicode const * pReadPos = pBegin;
-
- // content: copy data, handling escapes
- for(sal_Unicode const * pCur = pReadPos; pCur != pEnd; ++pCur)
- {
- if (*pCur != c_amp) continue; // no escape here
-
- // handle an escape
- // find an escape end marker (after pCur). Result is pCur, if the end marker is not there
- sal_Unicode const * pEndEscape = pCur + 1 + indexOfCharInRange(pCur+1,pEnd,c_end_escape);
-
- OSL_ENSURE(pEndEscape != pCur, "Found dangling ampersand in normalized data");
-
- sal_Unicode ch = implParseEscape(pCur,pEndEscape+1);
-
- OSL_ENSURE(ch != 0, "Found unreckognized escape in normalized data");
-
- if (ch != 0) // found and read a valid escape sequence
- {
- // do copy of preceding data
- aContent.append(pReadPos, pCur-pReadPos).append(ch);
- pCur = pReadPos = pEndEscape;
-
- ++pReadPos;
-
- OSL_ASSERT(*pCur == c_end_escape);
- }
- // otherwise just treat the ampersand as a mormal character
- }
-
- // do copy of remaining data
- if (pReadPos != pEnd)
- aContent.append(pReadPos, pEnd-pReadPos);
-
- return aContent.makeStringAndClear();
- }
-//-----------------------------------------------------------------------------
-
- /** validate and normalize the bracketed & quoted predicate in the string range [pBegin,pEnd)
- @return
- the normalized predicate
- @throw
- InvalidName, if the predicate is not valid
- */
- rtl::OUString implNormalizePredicate(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW((InvalidName))
- {
- sal_Unicode sStopCharBuf[2];
- sal_Unicode const * pStopChars;
-
- OSL_PRECOND(pBegin < pEnd, "Nonempty string range expected");
- OSL_PRECOND(pEnd-pBegin >= 2, "Bracketed string range expected");
- OSL_PRECOND(pBegin[0] == c_lBracket,"Bracketed string range expected");
- OSL_PRECOND(pEnd[-1] == c_rBracket, "Bracketed string range expected");
-
- ++pBegin; --pEnd; // skip brackets
-
- sal_Unicode const chUsedQuot = *pBegin;
- if (chUsedQuot == c_apos || chUsedQuot == c_quot)
- {
- OSL_PRECOND(pBegin < pEnd && pEnd-pBegin >= 2, "Bracketed quoted string range expected");
- OSL_PRECOND(pEnd[-1] == chUsedQuot, "Non-matching quotes in bracketed quoted string");
-
- if (pEnd-pBegin <= 1 || pEnd[-1] != chUsedQuot)
- throw InvalidName( rtl::OUString(pBegin, pEnd-pBegin), "is not a valid element predicate: quotes do not match");
-
- ++pBegin; --pEnd; // skip quotes
-
- sStopCharBuf[0] = chUsedQuot;
- sStopCharBuf[1] = 0;
-
- pStopChars = sStopCharBuf;
- }
-
- // non-quoted strings are not really valid, but we tolerate them
- else
- {
- OSL_ENSURE(false, "Warning: Invalid path - non-quoted data in bracketed predicate");
-
- static sal_Unicode const sGeneralStoppers[] = { c_quot, c_apos, c_rBracket, c_lBracket, 0 };
-
- pStopChars = sGeneralStoppers;
- }
-
- if (pBegin == pEnd)
- throw InvalidName(rtl::OUString(pBegin-1,2),"Empty element name in predicate");
-
- return implMakeNormalizedPredicate(pBegin, pEnd, pStopChars);
- }
-//-----------------------------------------------------------------------------
- /// parse a path into a sequence of components
- Path::Rep implParsePath(rtl::OUString const& _aPathString, PathType eType) SAL_THROW((InvalidName))
- {
- Path::Rep aResult;
-
- dprint (stderr, "implParsePath '%s' ",
- rtl::OUStringToOString(_aPathString, RTL_TEXTENCODING_UTF8).getStr());
-
- sal_Unicode const * pBegin = _aPathString.getStr();
- sal_Unicode const * pEnd = pBegin + _aPathString.getLength();
-
- if (eType == eABSOLUTE)
- {
- if ( detectAbsolutePath(_aPathString) )
- ++pBegin; // skip the leading slash
-
-#ifdef CFG_PATH_STRICT
- else
- OSL_ENSURE(false, "Warning: trying to parse relative path as absolute");
-#endif
- }
- else
- OSL_ENSURE(!detectAbsolutePath(_aPathString), "ERROR: trying to parse absolute path as relative one");
-
- if (detectAbsolutePath(pBegin))
- throw InvalidName(_aPathString, "is not a valid path. Illegal empty first component");
-
- else if (pBegin != pEnd && pEnd[-1] == '/')
- {
-#ifdef CFG_PATH_STRICT
- OSL_ENSURE(false, "Illegal configuration path. Terminating '/' found.");
-#endif
- --pEnd;
- }
-
- while (pEnd != pBegin)
- {
- // check for predicate
- sal_Unicode const * pQuoteStart = implFindPredicateStart(pBegin, pEnd);
- if (pQuoteStart == NULL)
- throw InvalidName(_aPathString, "is not a valid path. Invalid name or predicate syntax");
-
- sal_Unicode const * pNameStart = implFindNameStart(pBegin, pQuoteStart);
-
- rtl::OUString aElementName(pNameStart, pQuoteStart-pNameStart);
-
- if (!isSimpleName(aElementName))
- {
- // this is OK only for few cases WITH predicate
- if (pQuoteStart == pEnd)
- throw InvalidName(_aPathString, "is not a valid path. Invalid name");
-
- if (isEmptyString(aElementName))
- aElementName = makeWildcardType();
-
- else if ( !isWildcardType(aElementName))
- throw InvalidName(_aPathString, "is not a valid path. Invalid type tag for predicate");
- }
- if (pQuoteStart != pEnd)
- {
- dprint (stderr, "add 'normalize predicate'", "");
- rtl::OUString aPred = implNormalizePredicate(pQuoteStart,pEnd);
- aElementName += aPred;
- dprint (stderr, " [result pred '%s']",
- rtl::OUStringToOString(aPred, RTL_TEXTENCODING_UTF8).getStr());
- }
-
- aResult.prepend( Path::Component(aElementName) );
-
- pEnd = pNameStart;
- if (pNameStart != pBegin) --pEnd;
- }
- dprint (stderr, "\n", "");
- return aResult;
- }
-//-----------------------------------------------------------------------------
-
- /// build a composite path component from a base name (type) and a (somewhat optional) predicate
- rtl::OUString implMakeCompositeName(rtl::OUString const& _sBaseName, rtl::OUString const& _sPredicate) SAL_THROW((InvalidName))
- {
- rtl::OUString sComposite(_sBaseName);
-
- if (isEmptyString(_sBaseName))
- sComposite = makeWildcardType();
-
- else if (!isWildcardType(_sBaseName) && !isSimpleName(_sBaseName))
- throw InvalidName(_sBaseName, "The base-name (type) part of a composite node name must be a simple word");
-
- dprint (stderr, "implMakeNormalizePred '%s' ",
- rtl::OUStringToOString(_sPredicate, RTL_TEXTENCODING_UTF8).getStr());
-
- sal_Unicode const * pPredStart = _sPredicate.getStr();
- sal_Unicode const * pPredEnd = pPredStart + _sPredicate.getLength();
-
- if (pPredStart != pPredEnd)
- sComposite += implMakeNormalizedPredicate(pPredStart, pPredEnd, NULL);
-
- dprint (stderr, " [result pred '%s']\n",
- rtl::OUStringToOString(sComposite, RTL_TEXTENCODING_UTF8).getStr());
-
- return sComposite;
- }
-//-----------------------------------------------------------------------------
-
- /// split a composite path component into a base name (type) and a predicate (if present)
- void implSplitCompositeName(rtl::OUString const& _aCompositeName, rtl::OUString& _rBaseName, rtl::OUString& _rPredicate) SAL_THROW(())
- {
- sal_Int32 nPos = _aCompositeName.indexOf(c_lBracket);
-
- if (nPos >= 0)
- {
- OSL_ENSURE( nPos > 0, "Invalid name: Only predicate, no base type");
-
- _rBaseName = _aCompositeName.copy(0,nPos);
-
- sal_Unicode const * pBeginPred = _aCompositeName.getStr() + nPos;
- sal_Unicode const * pEndPred = _aCompositeName.getStr() + _aCompositeName.getLength();
-
- OSL_ASSERT(pBeginPred[0] == c_lBracket);
- OSL_ENSURE(pBeginPred[1] == c_normal_quot, "Missing or unexpected quote mark");
- OSL_ENSURE(pEndPred[-1] == c_rBracket, "Invalid name: Predicate brackets not closed");
- OSL_ENSURE(pEndPred[-2] == c_normal_quot, "Missing or unexpected quote mark");
-
- // skip brackets and quotes - then read data
- _rPredicate = implReadPredicate(pBeginPred+2, pEndPred-2);
- }
- else
- {
- OSL_ENSURE( _aCompositeName.indexOf(c_rBracket) < 0, "Invalid name: Predicate brackets not opened");
- _rBaseName = _aCompositeName;
- _rPredicate = rtl::OUString();
- }
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class RelativePath
-//-----------------------------------------------------------------------------
-
-// Currently unused method to check/ensure validity
-void RelativePath::init() SAL_THROW(())
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath RelativePath::parse(rtl::OUString const& aString)
-{
- return RelativePath( implParsePath(aString, eRELATIVE) );
-}
-//-----------------------------------------------------------------------------
-
-RelativePath::RelativePath(Path::Component const& aName) SAL_THROW(())
-: m_aRep(aName)
-{
- if (aName.isEmpty()) m_aRep.clearComponents();
-}
-//-----------------------------------------------------------------------------
-
-RelativePath RelativePath::compose(RelativePath const& aPath) const SAL_THROW(())
-{
- Path::Rep aResult = aPath.rep();
- aResult.prepend( this->m_aRep );
- return RelativePath( aResult );
-}
-//-----------------------------------------------------------------------------
-rtl::OUString RelativePath::toString() const SAL_THROW(())
-{
- return m_aRep.toString(false);
-}
-
-//-----------------------------------------------------------------------------
-// class AbsolutePath
-//-----------------------------------------------------------------------------
-
-// Currently unused method to check/ensure validity
-void AbsolutePath::init() SAL_THROW(())
-{
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::parse(rtl::OUString const& aString)
-{
- return AbsolutePath( implParsePath(aString, eABSOLUTE) );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::root() SAL_THROW(())
-{
- return AbsolutePath( Path::Rep() );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::detachedRoot() SAL_THROW(())
-{
- Path::Rep aRep( Path::makeEmptyComponent() ); // use 1 empty component here, to start detached names
- return AbsolutePath( aRep );
-}
-//-----------------------------------------------------------------------------
-
-static inline Path::Component implMakeSafeModuleName(rtl::OUString const& _sModuleName) SAL_THROW(())
-{
- OSL_ENSURE( isSimpleName(_sModuleName), "A module name must be a simple name");
-
- // if (isSimpleName(_sModuleName)) sModuleName = escape_name( _sModuleName );
-
- return Path::Component(_sModuleName);
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::makeModulePath(rtl::OUString const& _sModuleName) SAL_THROW(())
-{
- return AbsolutePath( Path::Rep( implMakeSafeModuleName(_sModuleName) ) );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::compose(RelativePath const& aPath) const SAL_THROW(())
-{
- Path::Rep aResult = aPath.rep();
- aResult.prepend( this->m_aRep );
- return AbsolutePath( aResult );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::getParentPath() const
-{
- // or: m_aRep.check_not_empty();
- OSL_ENSURE(!isRoot(), "ERROR: Requesting the parent of a root path");
- if (isRoot()) return *this;
-
- OSL_ENSURE(!isDetached(), "ERROR: Requesting the parent of a detached path");
-
- return AbsolutePath( Path::Rep(begin(),end()-1) );
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-
-bool AbsolutePath::isDetached() const SAL_THROW(())
-{
- return !m_aRep.isEmpty() && begin()->isEmpty();
-}
-#endif
-//-----------------------------------------------------------------------------
-
-rtl::OUString AbsolutePath::toString() const SAL_THROW(())
-{
- return m_aRep.toString(true);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configset.cxx b/configmgr/source/treemgr/configset.cxx
deleted file mode 100644
index e9887aba5827..000000000000
--- a/configmgr/source/treemgr/configset.cxx
+++ /dev/null
@@ -1,574 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h> // needed for Solaris 8
-#include "configset.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "tree.hxx"
-#include "treefragment.hxx"
-#include "template.hxx"
-#include "templateimpl.hxx"
-#include "configgroup.hxx"
-#include "valuenode.hxx"
-#include "valuenodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class SetElementFactory
-//-----------------------------------------------------------------------------
-
-SetElementFactory::SetElementFactory(TemplateProvider const& aProvider)
-: m_aProvider(aProvider)
-{
- OSL_ENSURE(aProvider.m_aImpl.is(), "WARNING: Template Instance Factory created without template provider - cannot instantiate elements");
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory::SetElementFactory(SetElementFactory const& aOther)
-: m_aProvider(aOther.m_aProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory& SetElementFactory::operator=(SetElementFactory const& aOther)
-{
- m_aProvider = aOther.m_aProvider;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory::~SetElementFactory()
-{
-}
-
-//-----------------------------------------------------------------------------
-rtl::Reference< ElementTree > SetElementFactory::instantiateTemplate(rtl::Reference<Template> const& aTemplate)
-{
- OSL_ENSURE(m_aProvider.m_aImpl.is(), "ERROR: Template Instance Factory has no template provider - cannot instantiate element");
- OSL_ENSURE(aTemplate.is(), "ERROR: Template is NULL - cannot instantiate element");
-
- rtl::Reference< data::TreeSegment > aInstanceTree( m_aProvider.m_aImpl->instantiate(aTemplate) );
- OSL_ENSURE(aInstanceTree.is(), "ERROR: Cannot create Element Instance: Provider could not instantiate template");
-
- //set removable state
- aInstanceTree->fragment->header.state |= data::State::flag_removable;
-
- return new ElementTree( aInstanceTree, aTemplate, m_aProvider );
-}
-//-----------------------------------------------------------------------------
-rtl::Reference< ElementTree > SetElementFactory::instantiateOnDefault(rtl::Reference< data::TreeSegment > const& _aElementData, rtl::Reference<Template> const& aDummyTemplate)
-{
-// OSL_ENSURE(m_aProvider.m_aImpl(), "ERROR: Template Instance Factory has no template provider - cannot instantiate element");
- OSL_ENSURE(_aElementData.is(), "ERROR: Tree is NULL - cannot instantiate element");
- OSL_ENSURE(aDummyTemplate.is(), "ERROR: Template is NULL - cannot instantiate element");
-
- return new ElementTree( _aElementData, aDummyTemplate, m_aProvider );
-}
-//-----------------------------------------------------------------------------
-
-TemplateProvider SetElementFactory::findTemplateProvider(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_ENSURE(!isEmpty(aTree.get()), "ERROR: Getting Element Factory requires a valid tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: Getting Element Factory requires a valid node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: Tree/Node mismatch");
- if (aNode.isValid() )
- {
- view::ViewTreeAccess aView(aTree.get());
-
- OSL_ENSURE (aView.isSetNode(aNode), "WARNING: Getting Element Factory requires a SET node");
- if (aView.isSetNode(aNode))
- return aView.getTemplateProvider(aView.toSetNode(aNode));
- }
- return TemplateProvider();
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class TreeSetUpdater and ValueSetUpdater
-//-----------------------------------------------------------------------------
-
-static node::Attributes getNewElementAttributes(bool bInserting)
-{
- node::Attributes aResult;
- aResult.setState( node::isReplaced );
- //Check if you are inserting new dynamic property
- if(bInserting)
- {
- aResult.markRemovable();
- }
- return aResult;
-}
-
-// Value Element Factory methods
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ElementTree> ValueSetUpdater::makeValueElement(rtl::OUString const& aName, com::sun::star::uno::Any const& aValue, bool bInserting)
-{
-
- const node::Attributes aNewValueAttributes = getNewElementAttributes(bInserting); // TODO: get real value
-
- com::sun::star::uno::Type aType = m_aTemplate->getInstanceType();
-
- rtl::OUString aTypeName = m_aTemplate->getName();
-
- std::auto_ptr<INode> pNode;
- if (aValue.hasValue())
- pNode.reset( new ValueNode(aTypeName, aValue, aNewValueAttributes) );
- else
- pNode.reset( new ValueNode(aTypeName, aType, aNewValueAttributes) );
-
- rtl::Reference< data::TreeSegment > aValueTree = data::TreeSegment::create(aName, pNode);
-
- return new ElementTree(aValueTree, m_aTemplate, TemplateProvider() );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ElementTree> ValueSetUpdater::makeValueElement(rtl::OUString const& aName, rtl::Reference< Tree > const& , com::sun::star::uno::Any const& aValue, bool bInserting)
-{
- // for now ignoring the node.
- // TODO: merge attributes etc. from that node's value
- return makeValueElement(aName, aValue,bInserting);
-}
-//-----------------------------------------------------------------------------
-
-
-TreeSetUpdater::TreeSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, rtl::Reference< Template > const& aTemplate)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aTemplate(aTemplate)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-ValueSetUpdater::ValueSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- rtl::Reference< Template > const& aTemplate, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aTemplate(aTemplate)
-, m_xTypeConverter(xConverter)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-SetDefaulter::SetDefaulter(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- DefaultProvider const& aDefaultProvider)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aDefaultProvider(aDefaultProvider)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-/// validates that a actual set and an updater's construction parameters match
-static void doValidateSet(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode)
-{
- if (isEmpty(aParentTree.get()))
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL tree");
-
- if (!aSetNode.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL node");
-
- if (!aParentTree->isValidNode(aSetNode.getOffset()))
- throw Exception("INTERNAL ERROR: Set Update: node does not match tree");
-
- if (! view::ViewTreeAccess(aParentTree.get()).isSetNode(aSetNode))
- throw Exception("INTERNAL ERROR: Set Update: node is not a set");
-
- if (aParentTree->getAttributes(aSetNode).isReadonly())
- throw ConstraintViolation( "Set Update: Set is read-only !" );
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void TreeSetUpdater::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- if (!m_aTemplate.is())
- throw Exception("INTERNAL ERROR: No template available for tree set update");
-
- if (m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Tree set update invoked on a value-set");
-
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- if ( aParentView.getElementTemplate(aParentView.toSetNode(m_aSetNode)) != m_aTemplate)
- throw Exception("INTERNAL ERROR: Set Update: template mismatch");
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void ValueSetUpdater::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- com::sun::star::uno::Type aThisType = m_aTemplate->getInstanceType();
-
- switch ( aThisType.getTypeClass())
- {
- case uno::TypeClass_VOID: throw Exception("INTERNAL ERROR: Value set element type is void");
- case uno::TypeClass_INTERFACE: throw Exception("INTERNAL ERROR: Value update invoked on a complex set");
-
- case uno::TypeClass_STRUCT:
- case uno::TypeClass_EXCEPTION: throw Exception("INTERNAL ERROR: Unexpected/Invalid type for set elements");
-
- default: break;
- }
-
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- if ( aParentView.getElementTemplate(aParentView.toSetNode(m_aSetNode))->getInstanceType() != aThisType)
- throw Exception("INTERNAL ERROR: Set Update: element type mismatch");
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void SetDefaulter::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- if (!m_aDefaultProvider.isValid())
- throw Exception("INTERNAL ERROR: No default provider available for restoring set default state");
-}
-//-----------------------------------------------------------------------------
-
-static void doValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable)
-{
- if (!aElement.is())
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL element");
-
- if ( bReqRemovable)
- {
- rtl::Reference< Tree > aElementTree = aElement.get();
-
- if(!aElementTree->getAttributes(aElementTree->getRootNode()).isRemovable())
- throw ConstraintViolation( "New Set Update: Existing element cannot be removed (or replaced) !" );
- }
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the given element is valid in this context and returns its name
-Path::Component TreeSetUpdater::implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable)
-{
- doValidateElement(aElement,bReqRemovable);
- return aElement->getExtendedRootName();
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the given element is valid and can be replaced in this context and returns its name
-Path::Component ValueSetUpdater::implValidateElement(rtl::Reference< ElementTree > const& aElement, bool mReqRemovable)
-{
- doValidateElement(aElement,mReqRemovable);
-
-#if OSL_DEBUG_LEVEL > 0
- com::sun::star::uno::Type aNodeType = ElementHelper::getUnoType(aElement);
-
- OSL_ENSURE(aNodeType.getTypeClass() != uno::TypeClass_VOID, "INTERNAL ERROR: Set Element without associated type found");
- OSL_ENSURE(aNodeType.getTypeClass() != uno::TypeClass_INTERFACE,"INTERNAL ERROR: Set Element with complex type found");
-
- OSL_ENSURE(aNodeType == m_aTemplate->getInstanceType() ||
- uno::TypeClass_ANY == m_aTemplate->getInstanceType().getTypeClass(),
- "INTERNAL ERROR: Set Update: existing element does not match template type");
-#endif
-
- return aElement->getExtendedRootName();
-}
-//-----------------------------------------------------------------------------
-static void checkEligibleChild(rtl::Reference< ElementTree > const& aElementTree, rtl::Reference< Tree > const& aParentTree)
-{
- ElementTree const * const pElement = aElementTree.get(); OSL_ASSERT(pElement);
-
- if (pElement->getContextTree() != NULL)
- throw ConstraintViolation( "Set Update: cannot insert an element that already has a parent." );
-
- Tree const* pAncestor = aParentTree.get();
- while (pAncestor != NULL)
- {
- if (pElement == pAncestor)
- throw ConstraintViolation( "Set Update: Circular insertion - trying to insert an element into self or descendant" );
-
- pAncestor = pAncestor->getContextTree();
- OSL_ENSURE(pAncestor != aParentTree.get(), "ERROR: Circular tree found");
- }
-}
-
-//-----------------------------------------------------------------------------
-
-void TreeSetUpdater::implValidateTree(rtl::Reference< ElementTree > const& aElementTree)
-{
- if (!aElementTree.is())
- throw ConstraintViolation( "Set Update: cannot replace element of complex set with NULL node. Remove the element instead !" );
-
- checkEligibleChild(aElementTree,m_aParentTree);
-
- if (! aElementTree->isTemplateInstance())
- {
- throw TypeMismatch(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<Unnamed> (Template missing)")),
- m_aTemplate->getName(), " - new element without template in Set Update");
- }
-
- if (!aElementTree->isInstanceOf(m_aTemplate))
- {
- throw TypeMismatch( aElementTree->getTemplate()->getPathString(),
- m_aTemplate->getPathString(), " - new element without template in Set Update");
- }
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueSetUpdater::implValidateValue(com::sun::star::uno::Any const& aValue)
-{
- com::sun::star::uno::Type const aThisType = m_aTemplate->getInstanceType();
-
- OSL_ENSURE( aThisType.getTypeClass() == uno::TypeClass_ANY || isPossibleValueType(aThisType),
- "Invalid element type for value set" );
-
- com::sun::star::uno::Any aRet;
- if (aValue.hasValue())
- {
- com::sun::star::uno::Type const aValType = aValue.getValueType();
-
- if (aValType.getTypeClass() == uno::TypeClass_INTERFACE)
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - cannot replace value by complex tree in Set update");
-
- if (aValType == aThisType)
- {
- aRet = aValue;
- }
-
- else if ( uno::TypeClass_ANY == aThisType.getTypeClass() )
- {
- if ( ! isPossibleValueType(aValType) )
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - new element has no legal configuration data type");
-
- aRet = aValue;
- }
-
- else
- {
- if (!convertCompatibleValue(m_xTypeConverter, aRet, aValue, aThisType))
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - new element does not match template type in SetUpdate");
- }
-
- OSL_ASSERT( isPossibleValueType(aRet.getValueType()) );
- }
- else
- {
- // cannot do anything about null values here
- OSL_ASSERT(aValue.getValueTypeClass() == uno::TypeClass_VOID);
-
- }
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueSetUpdater::implValidateValue(rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue)
-{
- node::Attributes aAttributes = aElementTree->getAttributes(aElementTree->getRootNode());
- // Here we assume writable == removable/replaceable
- if (aAttributes.isReadonly())
- throw ConstraintViolation( "Set Update: Existing element is read-only !" );
-
- // Here we assume nullable != removable
- if (!aValue.hasValue())
- {
- if (!aAttributes.isNullable())
- throw ConstraintViolation( "Set Update: Value is not nullable !" );
- }
- return implValidateValue( aValue);
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateInsertElement (rtl::OUString const& aName, rtl::Reference< ElementTree > const& aNewElement)
-{
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- SetEntry anEntry = aParentView.findElement(aParentView.toSetNode(m_aSetNode),aName);
- if (anEntry.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Element to be inserted already exists");
-
- implValidateTree(aNewElement);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetInsertImpl(aNewElement->makeExtendedName(aName), aNewElement) );
-
- pChange->setTarget(aParentView.makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateInsertElement (rtl::OUString const& aName, com::sun::star::uno::Any const& aNewValue)
-{
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- SetEntry anEntry = aParentView.findElement(aParentView.toSetNode(m_aSetNode),aName);
- if (anEntry.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Element to be inserted already exists");
-
- com::sun::star::uno::Any aValidValue = implValidateValue(aNewValue);
-
- rtl::Reference<ElementTree> aNewElement = makeValueElement(aName, aValidValue,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetInsertImpl(aNewElement->makeExtendedName(aName), aNewElement) );
-
- pChange->setTarget(aParentView.makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateReplaceElement(rtl::Reference< ElementTree > const& aElement, rtl::Reference< ElementTree > const& aNewElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- implValidateTree(aNewElement);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetReplaceImpl(aName, aNewElement) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateReplaceElement(rtl::Reference< ElementTree > const& aElement, com::sun::star::uno::Any const& aNewValue)
-{
- Path::Component aName = implValidateElement(aElement,false);
-
- rtl::Reference< Tree > aElementNode = extractElementNode(aElement);
-
- com::sun::star::uno::Any aValidValue = implValidateValue(aElementNode, aNewValue);
-
- rtl::Reference< Tree > aElementTree = aElement.get();
-
- rtl::Reference<ElementTree> aNewElement;
- if(aElementTree->getAttributes(aElementTree->getRootNode()).isRemovable())
- {
- aNewElement = makeValueElement(aName.getName(), aElementNode, aValidValue,true);
- }
- else
- {
- aNewElement = makeValueElement(aName.getName(), aElementNode, aValidValue,false);
- }
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetReplaceImpl(aName, aNewElement) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateRemoveElement (rtl::Reference< ElementTree > const& aElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetRemoveImpl(aName) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateRemoveElement (rtl::Reference< ElementTree > const& aElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetRemoveImpl(aName) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-NodeChange SetDefaulter::validateSetToDefaultState()
-{
- std::auto_ptr< ISubtree > aDefault = m_aDefaultProvider.getDefaultTree(m_aParentTree,m_aSetNode);
-
- // now build the specific change
- std::auto_ptr<SetChangeImpl> pChange;
-
- if (aDefault.get())
- {
- TemplateProvider aProvider = SetElementFactory::findTemplateProvider(m_aParentTree,m_aSetNode);
-
- configmgr::configuration::SetElementFactory aTmp(aProvider);
- pChange.reset( new SetResetImpl(aTmp, aDefault) );
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
- }
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > ValueSetUpdater::extractElementNode (rtl::Reference< ElementTree > const& aElement)
-{
- return aElement.get();
-}
-//-----------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-com::sun::star::uno::Type ElementHelper::getUnoType(rtl::Reference< ElementTree > const& aElement)
-{
- OSL_PRECOND( aElement.is(), "ERROR: Configuration: ElementTree operation requires valid node" );
-
- rtl::Reference< Tree > aElementTree(aElement.get());
-
- NodeRef aNode = aElementTree->getRootNode();
- OSL_ASSERT( aNode.isValid() );
-
- view::ViewTreeAccess aElementView(aElementTree.get());
-
- if ( aElementView.isValueNode(aNode) )
- {
- return aElementView.getValueType(aElementView.toValueNode(aNode));
- }
- else
- {
- uno::Reference< uno::XInterface > const * const selectInterface=0;
- return ::getCppuType(selectInterface);
- }
-}
-#endif
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/defaultproviderproxy.cxx b/configmgr/source/treemgr/defaultproviderproxy.cxx
deleted file mode 100644
index e5f01f70f7b6..000000000000
--- a/configmgr/source/treemgr/defaultproviderproxy.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "defaultproviderproxy.hxx"
-#include "defaultprovider.hxx"
-#include "treemanager.hxx"
-#include "valuenode.hxx"
-#include "options.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-DefaultProviderProxy::DefaultProviderProxy(
- rtl::Reference< TreeManager > const & _xDefaultTreeProvider,
- IDefaultableTreeManager * _pDefaultTreeManager,
- AbsolutePath const& _aBaseLocation,
- RequestOptions const& _aOptions
- )
-: m_aBaseLocation(_aBaseLocation)
-, m_aOptions(_aOptions)
-, m_xDefaultTreeProvider(_xDefaultTreeProvider)
-, m_pDefaultTreeManager(_pDefaultTreeManager)
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProviderProxy::~DefaultProviderProxy()
-{
-}
-//-----------------------------------------------------------------------------
-
-/// tries to load a default instance of the specified node (which must be within the request range owned)
-std::auto_ptr<ISubtree> DefaultProviderProxy::getDefaultTree(
- AbsolutePath const& _aLocation
- ) const SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE( Path::hasPrefix(_aLocation,m_aBaseLocation),
- "ERROR: DefaultProviderProxy called for out-of-scope location" );
-
- std::auto_ptr<ISubtree> aRet;
-
- if (m_xDefaultTreeProvider.is())
- aRet = m_xDefaultTreeProvider->requestDefaultData(_aLocation, m_aOptions);
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-bool DefaultProviderProxy::fetchDefaultData() SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_PRECOND(m_pDefaultTreeManager, "No tree to fetch defaults into");
- if (!m_pDefaultTreeManager) return false;
-
- return !! m_pDefaultTreeManager->fetchDefaultData(m_aBaseLocation,m_aOptions);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/defaultproviderproxy.hxx b/configmgr/source/treemgr/defaultproviderproxy.hxx
deleted file mode 100644
index f386b5ff6ccc..000000000000
--- a/configmgr/source/treemgr/defaultproviderproxy.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
-#define CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
-
-#include "configpath.hxx"
-#include "utility.hxx"
-#include "requestoptions.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class ISubtree;
- class IDefaultableTreeManager;
- class OOptions;
- class TreeManager;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- /// provides access to the defaults for a given request
- class DefaultProviderProxy
- : public salhelper::SimpleReferenceObject
- {
- // the data defining a request
- AbsolutePath m_aBaseLocation;
- RequestOptions m_aOptions;
-
- // the object(s) that provide the defaults
- rtl::Reference< TreeManager > m_xDefaultTreeProvider;
- IDefaultableTreeManager * m_pDefaultTreeManager;
- public:
- explicit
- DefaultProviderProxy(
- rtl::Reference< TreeManager > const & _xDefaultTreeProvider,
- IDefaultableTreeManager * _pDefaultTreeManager,
- AbsolutePath const& _aBaseLocation,
- RequestOptions const& _aOptions
- );
-
- ~DefaultProviderProxy();
-
- /// tries to load a default instance of the specified node (which must be within the request range owned)
- std::auto_ptr<ISubtree> getDefaultTree(AbsolutePath const& _aLocation) const SAL_THROW((com::sun::star::uno::Exception));
-
- /// tries to load default data into the owned tree - call only outside of any locks
- bool fetchDefaultData() SAL_THROW((com::sun::star::uno::Exception));
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
diff --git a/configmgr/source/treemgr/deferredview.cxx b/configmgr/source/treemgr/deferredview.cxx
deleted file mode 100644
index a0449a25aac4..000000000000
--- a/configmgr/source/treemgr/deferredview.cxx
+++ /dev/null
@@ -1,443 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "deferredview.hxx"
-#include "viewfactory.hxx"
-#include "nodeimplobj.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-static inline configuration::DeferredGroupNodeImpl* deferredGroupNode(Node const& _aNode)
-{
- return static_cast<configuration::DeferredGroupNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredGroupNodeImpl* deferredGroupNode(GroupNode const& _aNode)
-{
- return static_cast<configuration::DeferredGroupNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredSetNodeImpl* deferredSetNode(Node const& _aNode)
-{
- return static_cast<configuration::DeferredSetNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredSetNodeImpl* deferredSetNode(SetNode const& _aNode)
-{
- return static_cast<configuration::DeferredSetNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline void deferredValueNode(Node const& _aNode)
-{
- { (void)_aNode; }
- OSL_ENSURE( _aNode.isValueNode(),"Unknown Node type in deferred view");
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
-}
-//-----------------------------------------------------------------------------
-
-static void deferredValueNodeChanged(Node const& _aNode)
-{
- { (void)_aNode; }
- OSL_ENSURE( _aNode.isValueNode(),"Unknown Node type in deferred view");
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
- OSL_ENSURE(!_aNode.isValueNode(),"Value node changes not supported in deferred view");
- throw configuration::Exception("Internal Error: Invalid operation applied to element");
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredViewStrategy::doHasChanges(Node const& _aNode) const
-{
- if (_aNode.isGroupNode())
- return deferredGroupNode(_aNode)->hasChanges();
-
- else if (_aNode.isSetNode())
- return deferredSetNode(_aNode)->hasChanges();
-
- else
- deferredValueNode(_aNode);
-
- return false;
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doMarkChanged(Node const& _aNode)
-{
- if (_aNode.isGroupNode())
- deferredGroupNode(_aNode)->markChanged();
-
- else if (_aNode.isSetNode())
- deferredSetNode(_aNode)->markChanged();
-
- else
- deferredValueNodeChanged(_aNode);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doCollectChanges(Node const& _aNode, configuration::NodeChanges& _rChanges) const
-{
- implCollectChangesIn(_aNode,_rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::implCollectChangesIn(Node const& _aNode, configuration::NodeChanges& _rChanges) const
-{
- if ( hasChanges(_aNode) )
- {
- if (_aNode.isSetNode())
- {
- deferredSetNode(_aNode)->collectElementChanges( _rChanges);
- }
- else if (_aNode.isGroupNode())
- {
- GroupNode aGroup(_aNode);
-
- deferredGroupNode(aGroup)->collectValueChanges( _rChanges, _aNode.tree(), _aNode.get_offset());
-
- for( Node aChild = aGroup.getFirstChild();
- aChild.is();
- aChild = aGroup.getNextChild(aChild)
- )
- {
- this->implCollectChangesIn( aChild, _rChanges );
- }
- }
- else
- OSL_ASSERT(!"Unreachable code");
- }
-}
-
-//-----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> DeferredViewStrategy::doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
-{
- std::auto_ptr<SubtreeChange> pRet;
- if (hasChanges(tree))
- {
- pRet = implPreCommitChanges(getRootNode(tree),_rRemovedElements);
- if (pRet.get() != NULL)
- {
- pRet->setNodeName(getSimpleRootName(tree));
- }
- }
- return pRet;
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implFailedCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implFinishCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implRevertCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-configuration::ValueChangeImpl* DeferredViewStrategy::doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& _aName, ValueChange const& rExternalChange)
-{
- rtl::Reference<configuration::ValueMemberNode::DeferredImpl> aChange = deferredGroupNode(_aGroupNode)->findValueChange(_aName);
-
- if (aChange.is())
- {
- if (configuration::ValueChangeImpl* pValueChange = aChange->adjustToChange(rExternalChange))
- {
- OSL_ENSURE(aChange->isChange(), "Got an adjusted change from a non-changing value");
-
- return pValueChange;
- }
- else // a non-change
- {
- OSL_ENSURE(!aChange->isChange(), "Got no adjusted change from a changing value") ;
- OSL_ENSURE(false, "Got a non-change from a (deferred) group") ;
- // then do as without deferred change
- }
- }
-
- return ViewStrategy::doAdjustToValueChange(_aGroupNode, _aName, rExternalChange);
-
-}
-
-//-----------------------------------------------------------------------------
-node::Attributes DeferredViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- return _aAttributes;
-}
-
-//-----------------------------------------------------------------------------
-configuration::ValueMemberNode DeferredViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- return deferredGroupNode(_aNode)->makeValueMember(_aName,_bForUpdate);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& _aNewEntry)
-{
- // move to this memory segment
- // should be direct (as any free-floating one)
-
- //implMakeElement(aNewEntry)
- configuration::ElementTreeData aNewElement = implMakeElement(_aNode, _aNewEntry );
-
- deferredSetNode(_aNode)->insertNewElement(aName, aNewElement);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName)
-{
- deferredSetNode(_aNode)->removeOldElement(aName);
-}
-
-//-----------------------------------------------------------------------------
-extern NodeFactory& getDeferredChangeFactory();
-
-NodeFactory& DeferredViewStrategy::doGetNodeFactory()
-{
- return getDeferredChangeFactory();
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createDeferredChangeStrategy()
-{
- return new DeferredViewStrategy();
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<SubtreeChange> DeferredViewStrategy::implPreCommitChanges(Node const& _aNode, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
-{
- std::auto_ptr<SubtreeChange> aRet;
-
- OSL_ASSERT (this->hasChanges( _aNode) );
-
- if (_aNode.isSetNode())
- {
- aRet = deferredSetNode(_aNode)->preCommitChanges(_rRemovedElements);
- }
- else if (_aNode.isGroupNode())
- {
- std::auto_ptr<SubtreeChange> aGroupChange(deferredGroupNode(_aNode)->preCommitValueChanges());
-
- OSL_ASSERT(aGroupChange.get());
- if (aGroupChange.get())
- implPreCommitSubChanges( GroupNode(_aNode), _rRemovedElements, *aGroupChange);
-
- aRet = aGroupChange;
- }
- else
- deferredValueNode(_aNode);
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFinishCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->finishCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->finishCommit(rSubtreeChange);
- implFinishSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot finish commit: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implRevertCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->revertCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->revertCommit(rSubtreeChange);
- implRevertSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot revert commit: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFailedCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->failedCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->failedCommit(rSubtreeChange);
- implFailedSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot handle commit failure: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implPreCommitSubChanges(GroupNode const & _aGroup, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements, SubtreeChange& _rParentChange)
-{
- for( Node aChild = _aGroup.getFirstChild(); aChild.is(); aChild = _aGroup.getNextChild(aChild) )
- {
- if (this->hasChanges(aChild))
- {
- std::auto_ptr<SubtreeChange> aSubChanges( this->implPreCommitChanges(aChild,_rRemovedElements) );
- std::auto_ptr<Change> aSubChangesBase( aSubChanges.release() );
- _rParentChange.addChange( aSubChangesBase );
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFinishSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implFinishCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implRevertSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implRevertCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFailedSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implFailedCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/deferredview.hxx b/configmgr/source/treemgr/deferredview.hxx
deleted file mode 100644
index 48911b847c6b..000000000000
--- a/configmgr/source/treemgr/deferredview.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFERREDVIEW_HXX_
-#define CONFIGMGR_DEFERREDVIEW_HXX_
-
-#include "viewstrategy.hxx"
-
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct data access
-//-----------------------------------------------------------------------------
-
- class DeferredViewStrategy : public ViewStrategy
- {
- public:
- explicit
- DeferredViewStrategy() {}
-
- // ViewStrategy implementation
- private:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
-
- // change handling
- virtual void doCollectChanges(Node const& _aNode, configuration::NodeChanges& rChanges) const;
-
- // commit protocol
- virtual std::auto_ptr<SubtreeChange> doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- virtual void doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges);
-
- // notification protocol
- virtual configuration::ValueChangeImpl* doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& aName, ValueChange const& rExternalChange);
- // virtual void doAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, SubtreeChange const& rExternalChanges, TreeDepth nDepth);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
- private:
- void implCollectChangesIn(Node const& _aNode, configuration::NodeChanges& rChanges) const;
- // commit protocol
- std::auto_ptr<SubtreeChange> implPreCommitChanges(Node const& _aNode, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- void implFailedCommit(Node const& _aNode, SubtreeChange& rChanges);
- void implFinishCommit(Node const& _aNode, SubtreeChange& rChanges);
- void implRevertCommit(Node const& _aNode, SubtreeChange& rChanges);
-
- void implPreCommitSubChanges(GroupNode const & _aGroup, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements, SubtreeChange& _rParentChange);
- void implFailedSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
- void implFinishSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
- void implRevertSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
-
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DEFERREDVIEW_HXX_
diff --git a/configmgr/source/treemgr/directview.cxx b/configmgr/source/treemgr/directview.cxx
deleted file mode 100644
index d1cb247cb7e6..000000000000
--- a/configmgr/source/treemgr/directview.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "directview.hxx"
-#include "viewfactory.hxx"
-#include "setnodeimpl.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::implMarkNondefault(SetNode const& _aSetNode)
-{
- sharable::SetNode * set = _aSetNode.getAccess();
-
- OSL_ASSERT(set != 0);
-
- sharable::SetNode* pNode = NULL;
- if (m_aTreeSegment.is())
- pNode = set;
-
- OSL_ASSERT(pNode);
-
- pNode->info.markAsDefault(false);
-}
-//-----------------------------------------------------------------------------
-
-bool DirectViewStrategy::doHasChanges(Node const& ) const
-{
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::doMarkChanged(Node const& )
-{
- // do nothing
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes DirectViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- node::Attributes aAttributes = _aAttributes;
-
- if (aAttributes.isReadonly())
- aAttributes.setAccess(node::accessFinal);
-
- return aAttributes;
-}
-//-----------------------------------------------------------------------------
-
-configuration::ValueMemberNode DirectViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- return ViewStrategy::doGetValueMember(_aNode,_aName,_bForUpdate);
-}
-//-----------------------------------------------------------------------------
-void DirectViewStrategy::doInsertElement(SetNode const& _aNode, rtl::OUString const& _aName, configuration::SetEntry const& _aNewEntry)
-{
- // move to this memory segment
- // should already be direct (as any free-floating one)
-
- //implMakeElement(aNewEntry)
- configuration::ElementTreeData aNewElement = implMakeElement(_aNode, _aNewEntry );
- // _aNewEntry.tree()->rebuild(this, _aNode.accessor());
-
- _aNode.get_impl()->insertElement(_aName, aNewElement);
-
- aNewElement->attachTo( _aNode.getAccess(), _aName );
-
- implMarkNondefault( _aNode );
-}
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::doRemoveElement(SetNode const& _aNode, rtl::OUString const& _aName)
-{
- configuration::ElementTreeData aOldElement = _aNode.get_impl()->removeElement(_aName);
-
- aOldElement->detachFrom( _aNode.getAccess(), _aName);
-
- implMarkNondefault( _aNode );
-}
-//-----------------------------------------------------------------------------
-
-extern NodeFactory& getDirectAccessFactory();
-
-NodeFactory& DirectViewStrategy::doGetNodeFactory()
-{
- return getDirectAccessFactory();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createDirectAccessStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment)
-{
- return new DirectViewStrategy(_aTreeSegment);
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/directview.hxx b/configmgr/source/treemgr/directview.hxx
deleted file mode 100644
index a2024f8149e3..000000000000
--- a/configmgr/source/treemgr/directview.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DIRECTVIEW_HXX_
-#define CONFIGMGR_DIRECTVIEW_HXX_
-
-#include "viewstrategy.hxx"
-#include "treesegment.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct data access
-//-----------------------------------------------------------------------------
-
- class DirectViewStrategy : public ViewStrategy
- {
- rtl::Reference< data::TreeSegment > m_aTreeSegment;
- public:
- explicit
- DirectViewStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment)
- : m_aTreeSegment(_aTreeSegment)
- {}
-
- protected:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
-
- private:
- void implMarkNondefault(SetNode const& _aNode);
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DIRECTVIEW_HXX_
diff --git a/configmgr/source/treemgr/groupnodeimpl.hxx b/configmgr/source/treemgr/groupnodeimpl.hxx
deleted file mode 100644
index 21cba28788f3..000000000000
--- a/configmgr/source/treemgr/groupnodeimpl.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
-#define CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-#include "valuemembernode.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class SubtreeChange;
- class ValueChange;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class ValueChangeImpl;
-//-----------------------------------------------------------------------------
-// a visitor
-//-----------------------------------------------------------------------------
- struct GroupMemberVisitor
- {
- enum Result { DONE, CONTINUE };
- virtual Result visit(ValueMemberNode const& aValue) = 0;
- protected:
- virtual ~GroupMemberVisitor() {}
- };
-
-
-// Specific type of nodes
-//-----------------------------------------------------------------------------
-
- class GroupNodeImpl : public NodeImpl
- {
- mutable sharable::Node *m_pCache;
- public:
- explicit GroupNodeImpl(sharable::GroupNode * _pNodeRef);
-
- sharable::GroupNode * getDataAccess() const;
-
- bool areValueDefaultsAvailable() const;
-
- sharable::ValueNode * getOriginalValueNode(rtl::OUString const& aName) const;
-
- ValueMemberNode makeValueMember(sharable::ValueNode * node);
- };
-
-//-----------------------------------------------------------------------------
-
- // domain-specific 'dynamic_cast' replacements
- GroupNodeImpl& AsGroupNode(NodeImpl& rNode);
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/makefile.mk b/configmgr/source/treemgr/makefile.mk
deleted file mode 100644
index 0fe253b77b9b..000000000000
--- a/configmgr/source/treemgr/makefile.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=treemgr
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/collectchanges.obj \
- $(SLO)$/configdefaultprovider.obj \
- $(SLO)$/configexcept.obj \
- $(SLO)$/configgroup.obj \
- $(SLO)$/configpath.obj \
- $(SLO)$/configset.obj \
- $(SLO)$/defaultproviderproxy.obj \
- $(SLO)$/valuemembernode.obj \
- $(SLO)$/nodechange.obj \
- $(SLO)$/nodechangeimpl.obj \
- $(SLO)$/nodechangeinfo.obj \
- $(SLO)$/nodefactory.obj \
- $(SLO)$/nodeimpl.obj \
- $(SLO)$/nodeimplobj.obj \
- $(SLO)$/noderef.obj \
- $(SLO)$/roottree.obj \
- $(SLO)$/setnodeimpl.obj \
- $(SLO)$/template.obj \
- $(SLO)$/templateimpl.obj \
- $(SLO)$/treeimpl.obj \
- $(SLO)$/viewaccess.obj \
- $(SLO)$/viewstrategy.obj \
- $(SLO)$/viewnode.obj \
- $(SLO)$/deferredview.obj \
- $(SLO)$/directview.obj \
- $(SLO)$/readonlyview.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/treemgr/nodechange.cxx b/configmgr/source/treemgr/nodechange.cxx
deleted file mode 100644
index 0d1f88d203b5..000000000000
--- a/configmgr/source/treemgr/nodechange.cxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-
-#include "noderef.hxx"
-#include "tree.hxx"
-
-#include <algorithm>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// NodeChange handle class
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-inline void NodeChange::init()
-{
- if (m_pImpl) m_pImpl->acquire();
-}
-inline void NodeChange::deinit()
-{
- if (m_pImpl) m_pImpl->release();
-}
-
-//-----------------------------------------------------------------------------
-NodeChange::NodeChange()
-: m_pImpl(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::NodeChange(NodeChangeImpl* pImpl)
-: m_pImpl(pImpl)
-{
- init();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::NodeChange(NodeChange const& rOther)
-: m_pImpl(rOther.m_pImpl)
-{
- init();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange& NodeChange::operator=(NodeChange const& rOther)
-{
- NodeChange(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChange::swap(NodeChange& rOther)
-{
- std::swap(m_pImpl,rOther.m_pImpl);
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::~NodeChange()
-{
- deinit();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::maybeChange() const
-{
- return m_pImpl && m_pImpl->isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::isChange() const
-{
- return m_pImpl && m_pImpl->isChange(false);
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt32 NodeChange::getChangeInfos(NodeChangesInformation& _rInfos) const
-{
- sal_uInt32 nCount = 0;
- if (m_pImpl)
- {
- sal_uInt32 nChanges = m_pImpl->getChangeDataCount();
-
- for (sal_uInt32 ix = 0; ix < nChanges; ++ix)
- {
- NodeChangeInformation aSingleInfo;
- aSingleInfo.change.type = NodeChangeData::eNoChange;
-
- m_pImpl->fillChangeInfo(aSingleInfo,ix);
-
- if ( !aSingleInfo.isEmptyChange() )
- {
- _rInfos.push_back(aSingleInfo);
- ++nCount;
- }
- }
- }
-
- return nCount;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::getChangeLocation(NodeChangeLocation& rLoc) const
-{
- return m_pImpl && m_pImpl->fillChangeLocation(rLoc);
-}
-
-//-----------------------------------------------------------------------------
-
-// retrieve the tree where the change is actually taking place
-rtl::Reference< Tree > NodeChange::getAffectedTree() const
-{
- if (this->maybeChange())
- return m_pImpl->getTargetTree().get();
- else
- return NULL;
-}
-//-----------------------------------------------------------------------------
-
-// retrieve the tree where the change is actually taking place
-NodeRef NodeChange::getAffectedNode() const
-{
- if (this->maybeChange())
- {
- rtl::Reference<Tree> aTree = m_pImpl->getTargetTree();
- unsigned int nOffset = m_pImpl->getTargetNode();
-
- OSL_ASSERT(aTree.is() && aTree->isValidNode(nOffset));
-
- if (aTree.is() && nOffset)
- return aTree->getNode(nOffset);
- }
- return NodeRef();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange& NodeChange::test()
-{
- if (m_pImpl) m_pImpl->test();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange const& NodeChange::test() const
-{
- if (m_pImpl) m_pImpl->test();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange& NodeChange::apply()
-{
- if (m_pImpl) m_pImpl->apply();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange const& NodeChange::apply() const
-{
- if (m_pImpl) m_pImpl->apply();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-// NodeChanges collection
-//-----------------------------------------------------------------------------
-
-NodeChanges::NodeChanges()
-: m_aChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChanges::isEmpty() const
-{
- return m_aChanges.empty();
-}
-//-----------------------------------------------------------------------------
-
-/// predicate for compact
-
-static bool isEmptyChange(NodeChange const& aChange)
-{
- return !aChange.maybeChange();
-}
-//-----------------------------------------------------------------------------
-
-
-NodeChanges& NodeChanges::compact()
-{
- m_aChanges.erase( std::remove_if(begin(),end(),isEmptyChange), end() );
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChanges::implTest() const
-{
- for(std::vector<NodeChange>::const_iterator it = begin(), stop = end(); it != stop; ++it)
- {
- it ->test();
- }
-}
-//-----------------------------------------------------------------------------
-/** insert a change into this collection
-*/
-void NodeChanges::add(NodeChange const& aChange)
-{
- m_aChanges.push_back(aChange);
-}
-
-//-----------------------------------------------------------------------------
-
-/** removes a change to <var>aNode</var> from this collection (if there is one)
-void NodeChanges::reset(Node const& aNode)
-{
-}
-*/
-
-sal_uInt32 NodeChanges::getChangesInfos(NodeChangesInformation& _rInfos) const
-{
- if (isEmpty()) return 0;
-
- _rInfos.reserve(_rInfos.size() + this->getCount());
-
- sal_Int32 nResult = 0;
- for (std::vector<NodeChange>::const_iterator it = begin(); it != end(); ++it)
- {
- nResult += it->getChangeInfos(_rInfos);
- }
-
- return nResult;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/nodechangeimpl.cxx b/configmgr/source/treemgr/nodechangeimpl.cxx
deleted file mode 100644
index 004f60976b58..000000000000
--- a/configmgr/source/treemgr/nodechangeimpl.cxx
+++ /dev/null
@@ -1,785 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-#include "nodeimpl.hxx"
-#include "tree.hxx"
-#include "configset.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// All Changes:NodeChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-// life cycle states for a NodeChangeImpl
-enum { eTestedChange = 0x01, eAppliedChange = 0x02, eNoCheck = 0x07 };
-//-----------------------------------------------------------------------------
-
-NodeChangeImpl::NodeChangeImpl(bool bNoCheck)
-: m_aAffectedTree()
-, m_nAffectedNode(0)
-, m_nState(0)
-{
- if (bNoCheck) m_nState = eNoCheck;
-}
-//-----------------------------------------------------------------------------
-
-view::ViewTreeAccess NodeChangeImpl::getTargetView()
-{
- OSL_ENSURE( m_aAffectedTree.is(), "ERROR: Configuration Change: Target Tree Access has not been set up" );
-
- return view::ViewTreeAccess(m_aAffectedTree.get());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Tree> NodeChangeImpl::getTargetTree() const
-{
- rtl::Reference<Tree> aRet = m_aAffectedTree;
- OSL_ENSURE( aRet.is(), "ERROR: Configuration Change: Target Tree has not been set up" );
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int NodeChangeImpl::getTargetNode() const
-{
- unsigned int nRet = m_nAffectedNode;
- OSL_ENSURE( nRet != 0, "ERROR: Configuration Change: Target Node has not been set up" );
- OSL_ENSURE( m_aAffectedTree.is() && m_aAffectedTree->isValidNode(nRet),
- "ERROR: Configuration Change: Changing Node does not match tree" );
-
- return nRet;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::setTarget(view::Node _aAffectedNode)
-{
- this->setTarget(_aAffectedNode.tree(), _aAffectedNode.get_offset());
-
-}
-void NodeChangeImpl::setTarget(rtl::Reference<Tree> const& _aAffectedTree, unsigned int _nAffectedNode)
-{
- OSL_ENSURE(m_nState == 0 || (!m_aAffectedTree.is() && m_nState == eNoCheck), "WARNING: Configuration: Retargeting change that already was tested or applied");
-
- OSL_ENSURE( _aAffectedTree.is(), "ERROR: Configuration Change: NULL Target Tree is not allowed" );
- OSL_ENSURE( _nAffectedNode, "ERROR: Configuration Change: NULL Target Node is not allowed" );
- OSL_ENSURE( _aAffectedTree->isValidNode(_nAffectedNode), "ERROR: Configuration Change: Target Node does not match Tree" );
-
- if (m_nState != eNoCheck) m_nState = 0; // previous checks are invalidated
-
- m_aAffectedTree = _aAffectedTree;
- m_nAffectedNode = _nAffectedNode;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::isChange(bool bAllowUntested) const
-{
- OSL_ENSURE(bAllowUntested || (m_nState & eTestedChange), "WARNING: Configuration: Change was not tested - isChange is meaningless");
-
- if (m_nState == eNoCheck)
- return true;
-
- if (!(m_nState & eTestedChange))
- return bAllowUntested;
-
- return doIsChange();
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt32 NodeChangeImpl::getChangeDataCount() const
-{
- OSL_PRECOND(m_nState & eTestedChange, "WARNING: Configuration: Change was not tested - change data count may be incorrect");
-
- return doGetChangeCount();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeData(NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- OSL_PRECOND(_ix < doGetChangeCount(), "ERROR: Configuration: Change index out of range");
- OSL_PRECOND(m_nState & eTestedChange, "WARNING: Configuration: Change was not tested - fillChange is partially meaningless");
-
- return doFillChange(rChange, _ix) || rChange.isDataChange(); // force true if the data is signaling change
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeLocation(NodeChangeLocation& rChange, sal_uInt32 _ix) const
-{
- if (!m_aAffectedTree.is()) return false;
-
- rChange.setBase( NodeID(this->getTargetTree().get(), this->getTargetNode()) );
-
- rChange.setAccessor( this->doGetChangingNodePath(_ix) );
-
- rChange.setAffected( NodeID(this->getTargetTree().get(), this->getTargetNode()) );
-
- rChange.setChangingSubnode( this->doIsChangingSubnode() );
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeInfo(NodeChangeInformation& rChange, sal_uInt32 _ix) const
-{
- return fillChangeLocation(rChange.location, _ix) & fillChangeData(rChange.change, _ix);
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::test()
-{
- if (!(m_nState & eTestedChange))
- {
- doTest(implGetTarget());
- m_nState |= eTestedChange;
- }
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::apply()
-{
- if (!(m_nState & eAppliedChange))
- {
- implApply();
-
- OSL_ENSURE(m_nState & eAppliedChange, "ERROR: Configuration: Change could not be applied");
- OSL_ENSURE(m_nState & eTestedChange, "ERROR: Configuration: Change was not tested while applied");
- }
- else
- OSL_ENSURE(m_nState & eTestedChange, "ERROR: Configuration: Change marked applied but not tested");
-}
-//-----------------------------------------------------------------------------
-
-// default count is 1
-sal_uInt32 NodeChangeImpl::doGetChangeCount() const
-{
- return 1;
-}
-//-----------------------------------------------------------------------------
-
-/// apply this change to the given node - start state is nState (which is then updated)
-void NodeChangeImpl::implApply()
-{
- OSL_ASSERT( !(m_nState & eAppliedChange)); // Caller must check
-
- view::Node aTarget = implGetTarget();
-
- if (!(m_nState & eTestedChange)) // Test checks the old value if there is realy a change
- { // for eventlisteners to say "the old value is kept"
- doTest(aTarget);
- m_nState |= eTestedChange;
- }
-
- doApply(aTarget);
- m_nState |= eAppliedChange;
-}
-//-----------------------------------------------------------------------------
-
-view::Node NodeChangeImpl::implGetTarget()
-{
- OSL_ENSURE(m_aAffectedTree.is(), "ERROR: Configuration Change: no target tree set");
-
- OSL_ENSURE(m_aAffectedTree->isValidNode(m_nAffectedNode), "ERROR: Configuration Change: target node not in target tree");
-
- view::Node aTarget = getTargetView().makeNode(m_nAffectedNode);
- OSL_ENSURE(aTarget.is(), "ERROR: Configuration: No target for change");
- return aTarget;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueChangeImpl = common base
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl()
-: m_aNewValue()
-, m_aOldValue()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl(com::sun::star::uno::Any const& aNewValue)
-: m_aNewValue(aNewValue)
-, m_aOldValue()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-: NodeChangeImpl(true)
-, m_aNewValue(aNewValue)
-, m_aOldValue(aOldValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::~ValueChangeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::setTarget(view::GroupNode const& _aParentNode, rtl::OUString const& sNodeName)
-{
- OSL_ENSURE(sNodeName.getLength() != 0, "ValueChangeTarget is being set without a name");
-
- NodeChangeImpl::setTarget(_aParentNode.node());
- m_aName = sNodeName;
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::setTarget(rtl::Reference<Tree> const& aAffectedTree, unsigned int nParentNode, rtl::OUString const& sNodeName)
-{
- OSL_ENSURE(sNodeName.getLength() != 0, "ValueChangeTarget is being set without a name");
-
- NodeChangeImpl::setTarget(aAffectedTree,nParentNode);
- m_aName = sNodeName;
-}
-//-----------------------------------------------------------------------------
-
-RelativePath ValueChangeImpl::doGetChangingNodePath(sal_uInt32 ) const
-{
- return RelativePath( Path::wrapSimpleName(m_aName) );
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doIsChangingSubnode() const
-{
- return m_aName.getLength() != 0;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doIsChange() const
-{
- return !!(getNewValue() != getOldValue());
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.unoData.newValue = getNewValue();
- rChange.unoData.oldValue = getOldValue();
- return rChange.unoData.isDataChange();
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::doTest( view::Node const& rTarget)
-{
- view::ViewTreeAccess aTargetView = getTargetView();
-
- OSL_ENSURE(rTarget.isGroupNode(), "ERROR: Configuration: Target type mismatch: expected a group node holding the value");
-
- ValueMemberNode aValueTarget = aTargetView.getValue( view::GroupNode(rTarget), m_aName );
-
- OSL_ENSURE(aValueTarget.isValid(), "ERROR: Configuration: Target missing: could not find the changing value");
-
- preCheckValue(aValueTarget, m_aOldValue, m_aNewValue);
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::doApply( view::Node const& rTarget)
-{
- view::ViewTreeAccess aTargetView = getTargetView();
-
- OSL_ENSURE(rTarget.isGroupNode(), "ERROR: Configuration: Target type mismatch: expected a group node holding the value");
-
- ValueMemberUpdate aValueTarget = aTargetView.getValueForUpdate( view::GroupNode(rTarget), m_aName );
-
- OSL_ENSURE(aValueTarget.isValid(), "ERROR: Configuration: Target missing: could not find the changing value");
-
- doApplyChange(aValueTarget);
- configmgr::configuration::ValueMemberNode aNode(aValueTarget.getNode());
- postCheckValue(aNode, m_aNewValue); // Sideeffect: m_aNewValue will be changed
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& )
-{
- com::sun::star::uno::Any aPrevValue = rNode.getValue();
- OSL_ENSURE(!rOld.hasValue() || rOld == aPrevValue, "ERROR: Configuration: Stored old value of target does not match the actual value");
- rOld = aPrevValue;
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::postCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rNew)
-{
- com::sun::star::uno::Any aResultValue = rNode.getValue();
- OSL_ENSURE(!rNew.hasValue() || rNew == aResultValue, "ERROR: Configuration: New value of target does not match the predicted result");
- rNew = aResultValue;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueReplaceImpl = set local value
-//-----------------------------------------------------------------------------
-
-ValueReplaceImpl::ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue)
-:ValueChangeImpl(aNewValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueReplaceImpl::ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-:ValueChangeImpl(aNewValue, aOldValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueReplaceImpl::doApplyChange( ValueMemberUpdate& rNode)
-{
- rNode.setValue(getNewValue());
-}
-//-----------------------------------------------------------------------------
-
-bool ValueReplaceImpl::doFillChange( NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- rChange.type = NodeChangeData::eSetValue;
- return ValueChangeImpl::doFillChange(rChange, _ix);
-}
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueResetImpl = set to default
-//-----------------------------------------------------------------------------
-
-ValueResetImpl::ValueResetImpl()
-:ValueChangeImpl()
-, m_bTargetIsDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueResetImpl::ValueResetImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-:ValueChangeImpl(aNewValue, aOldValue)
-, m_bTargetIsDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueResetImpl::doApplyChange( ValueMemberUpdate& rNode)
-{
- rNode.setDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool ValueResetImpl::doIsChange() const
-{
- return !m_bTargetIsDefault;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueResetImpl::doFillChange( NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- rChange.type = NodeChangeData::eSetDefault;
- ValueChangeImpl::doFillChange(rChange,_ix);
- return !m_bTargetIsDefault && !rChange.isEmptyChange(); // do it defensively here - default (= 'new') may be unknown still
-}
-//-----------------------------------------------------------------------------
-
-void ValueResetImpl::preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew)
-{
- ValueChangeImpl::preCheckValue(rNode,rOld,rNew);
-
- com::sun::star::uno::Any aDefaultValue = rNode.getDefaultValue();
- OSL_ENSURE(!rNew.hasValue() || rNew == aDefaultValue, "ERROR: Configuration: Stored new value of target does not match the actual default value");
- rNew = aDefaultValue;
- m_bTargetIsDefault = rNode.isDefault();
-}
-
-//-----------------------------------------------------------------------------
-// All Set Changes: SetChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-SetChangeImpl::SetChangeImpl(bool bNoCheck)
-: NodeChangeImpl(bNoCheck)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SetChangeImpl::doIsChangingSubnode() const
-{
- return false;
-}
-
-//-----------------------------------------------------------------------------
-// Resetting a set to its default state
-//-----------------------------------------------------------------------------
-
-SetResetImpl::SetResetImpl(
- SetElementFactory& _rElementFactory,
- std::auto_ptr<ISubtree> _pDefaultData,
- bool _bNoCheck
-)
-: SetChangeImpl(_bNoCheck)
-, m_aDefaultData(_pDefaultData)
-, m_rElementFactory(_rElementFactory)
-, m_aTreeChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetResetImpl::~SetResetImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath SetResetImpl::doGetChangingNodePath(sal_uInt32 _ix) const
-{
- OSL_ENSURE( _ix < m_aTreeChanges.size() || _ix == scCommonBase, "Illegal Change index" );
- OSL_ASSERT( static_cast<size_t>(scCommonBase) > m_aTreeChanges.size() );
-
- if ( _ix < m_aTreeChanges.size() )
- return RelativePath( m_aTreeChanges[_ix].m_aElementName);
-
- else
- return RelativePath();
-}
-//-----------------------------------------------------------------------------
-
-static NodeChangeData::Type getChangeType(ElementTreeChange const& aChange)
-{
- sal_Bool bHasNew = aChange.m_aAddedElement.is();
- sal_Bool bHasOld = aChange.m_aRemovedElement.is();
-
- NodeChangeData::Type aResult;
- if (bHasNew)
- aResult = bHasOld ? NodeChangeData::eReplaceElement : NodeChangeData::eInsertElement;
- else
- aResult = bHasOld ? NodeChangeData::eRemoveElement : NodeChangeData::eSetDefault;
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-bool SetResetImpl::doIsChange() const
-{
- return !m_aTreeChanges.empty() || m_aDefaultData.get();
-}
-//-----------------------------------------------------------------------------
-
-bool SetResetImpl::doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- OSL_ENSURE( _ix < m_aTreeChanges.size() || _ix == scCommonBase, "Illegal Change index" );
- if (_ix >= m_aTreeChanges.size())
- {
- rChange.type = NodeChangeData::eResetSetDefault;
- return m_aDefaultData.get() != NULL;
- }
- ElementTreeChange const& aChange = m_aTreeChanges[_ix];
-
- rChange.type = getChangeType(aChange);
-
- rChange.element.newValue = aChange.m_aAddedElement;
- rChange.element.oldValue = aChange.m_aRemovedElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-void SetResetImpl::doTest( view::Node const& rTarget)
-{
- if ( m_aDefaultData.get() )
- {
- view::ViewTreeAccess accessor = this->getTargetView();
-
- view::SetNode aTargetSet(rTarget);
-
- std::auto_ptr<SubtreeChange> pChanges = accessor.differenceToDefaultState(aTargetSet, *m_aDefaultData);
-
- if (pChanges.get())
- {
- for (SubtreeChange::MutatingChildIterator it = pChanges->begin_changes(),
- stop = pChanges->end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aName(it->getNodeName());
-
- SetEntry anExistingEntry = accessor.findElement(aTargetSet,aName);
-
- rtl::Reference<ElementTree> aOldTree = anExistingEntry.tree();
- rtl::Reference<ElementTree> aNewTree;
-
- if (AddNode * addNode = dynamic_cast< AddNode * >(&*it))
- {
- rtl::Reference< data::TreeSegment > pAddedNode = addNode->getNewTree();
-
- OSL_ENSURE(pAddedNode.is(), "Processing an addNode to default - no node to add");
-
- aNewTree = m_rElementFactory.instantiateOnDefault(pAddedNode,accessor.getElementTemplate(aTargetSet)).get();
- }
-
-
- Path::Component aFullName =
- aNewTree.is() ? aNewTree->getExtendedRootName() :
- aOldTree.is() ? aOldTree->getExtendedRootName() :
- Path::makeCompositeName(aName,accessor.getElementTemplate(aTargetSet)->getName());
-
- OSL_ENSURE(aOldTree.is() || aNewTree.is(), "No data for change to default");
-
- m_aTreeChanges.push_back(ElementTreeChange(aFullName,aNewTree,aOldTree));
- }
- }
-
- m_aDefaultData.reset();
- }
-}
-//-----------------------------------------------------------------------------
-
-void SetResetImpl::doApply( view::Node const& rTarget)
-{
- view::ViewTreeAccess accessor = this->getTargetView();
-
- view::SetNode aTargetSet(rTarget);
-
- for (std::vector< ElementTreeChange >::iterator it = m_aTreeChanges.begin(); it != m_aTreeChanges.end(); ++it)
- {
- rtl::OUString aElementName = it->m_aElementName.getName();
-
- if (it->m_aRemovedElement.is())
- accessor.removeElement(aTargetSet, aElementName);
-
- if (it->m_aAddedElement.is())
- {
- SetEntry aNewEntry( it->m_aAddedElement.get() );
- accessor.insertElement(aTargetSet, aElementName, aNewEntry);
- }
-
- OSL_ENSURE(getChangeType(*it) != NodeChangeData::eSetDefault,
- "Cannot apply change without data");
- }
-}
-
-//-----------------------------------------------------------------------------
-// All Set Changes affecting a single element: SetElementChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl::SetElementChangeImpl(Path::Component const& aName, bool bNoCheck)
-: SetChangeImpl(bNoCheck)
-, m_aName(aName)
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath SetElementChangeImpl::doGetChangingNodePath(sal_uInt32 ) const
-{
- return RelativePath(getFullElementName());
-}
-//-----------------------------------------------------------------------------
-
-void SetElementChangeImpl::doTest( view::Node const& rTarget)
-{
- doTestElement(view::SetNode(rTarget), getElementName() );
-}
-//-----------------------------------------------------------------------------
-
-void SetElementChangeImpl::doApply( view::Node const& rTarget)
-{
- doApplyToElement(view::SetNode(rTarget), getElementName() );
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetInsertTreeImpl
-//-----------------------------------------------------------------------------
-
-SetInsertImpl::SetInsertImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, bool bNoCheck)
-: SetElementChangeImpl(aName,bNoCheck)
-, m_aNewTree(aNewTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SetInsertImpl::doIsChange() const
-{
- return !!m_aNewTree.is();
-}
-//-----------------------------------------------------------------------------
-
-bool SetInsertImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eInsertElement;
- if (m_aNewTree.is())
- rChange.element.newValue = m_aNewTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetInsertImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(!anEntry.isValid(), "ERROR: Configuration: Adding a node that already exists");
-}
-//-----------------------------------------------------------------------------
-
-void SetInsertImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- if (m_aNewTree.is())
- {
- SetEntry aNewEntry( m_aNewTree.get() );
- getTargetView().insertElement( _aNode, aName, aNewEntry);
- }
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetReplaceTreeImpl
-//-----------------------------------------------------------------------------
-
-SetReplaceImpl::SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree)
-: SetElementChangeImpl(aName)
-, m_aNewTree(aNewTree)
-, m_aOldTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetReplaceImpl::SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, rtl::Reference<ElementTree> const& aOldTree)
-: SetElementChangeImpl(aName,true)
-, m_aNewTree(aNewTree)
-, m_aOldTree(aOldTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// checks, if this represents an actual change
-bool SetReplaceImpl::doIsChange() const
-{
- return !(m_aOldTree == m_aNewTree);
-}
-//-----------------------------------------------------------------------------
-
-/// fills in pre- and post-change values, returns wether they differ
-bool SetReplaceImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eReplaceElement;
- if (m_aNewTree.is())
- rChange.element.newValue = m_aNewTree;
-
- if (m_aOldTree.is())
- rChange.element.oldValue = m_aOldTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetReplaceImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- OSL_ASSERT(!m_aOldTree.is()); // already tested ?
-
- // remove the old node
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(anEntry.isValid(), "ERROR: Configuration: Replacing a node that doesn't exist");
-
- m_aOldTree = anEntry.tree();
-}
-//-----------------------------------------------------------------------------
-
-void SetReplaceImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- if (m_aOldTree != m_aNewTree)
- {
- view::ViewTreeAccess aTargetView = this->getTargetView();
-
- OSL_ENSURE(m_aOldTree.is(), "ERROR: Configuration: Replacing a node that doesn't exist");
- aTargetView.removeElement(_aNode, aName);
-
- // add the new one
- OSL_ENSURE(m_aNewTree.is(), "ERROR: Configuration: Replacing a node with nothing");
- if (m_aNewTree.is())
- {
- SetEntry aNewEntry( m_aNewTree.get() );
- aTargetView.insertElement( _aNode, aName, aNewEntry);
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetRemoveTreeImpl
-//-----------------------------------------------------------------------------
-
-SetRemoveImpl::SetRemoveImpl(Path::Component const& aName)
-: SetElementChangeImpl(aName)
-, m_aOldTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetRemoveImpl::SetRemoveImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aOldTree)
-: SetElementChangeImpl(aName,true)
-, m_aOldTree(aOldTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// checks, if this represents an actual change
-bool SetRemoveImpl::doIsChange() const
-{
- return !!m_aOldTree.is();
-}
-//-----------------------------------------------------------------------------
-
-/// fills in pre- and post-change values, returns wether they differ
-bool SetRemoveImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eRemoveElement;
- if (m_aOldTree.is())
- rChange.element.oldValue = m_aOldTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetRemoveImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- OSL_ASSERT(!m_aOldTree.is()); // already tested ?
-
- // remove the old node
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(anEntry.isValid(), "ERROR: Configuration: Removing a node that doesn't exist");
-
- m_aOldTree = anEntry.tree();
-}
-//-----------------------------------------------------------------------------
-
-void SetRemoveImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- getTargetView().removeElement(_aNode, aName);
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodechangeimpl.hxx b/configmgr/source/treemgr/nodechangeimpl.hxx
deleted file mode 100644
index c7ebc6c7030c..000000000000
--- a/configmgr/source/treemgr/nodechangeimpl.hxx
+++ /dev/null
@@ -1,429 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGEIMPL_HXX_
-#define CONFIGMGR_CONFIGCHANGEIMPL_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "viewaccess.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- class ISubtree;
-
- namespace view { class ViewTreeAccess; struct Node; struct GroupNode; struct SetNode; }
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class ValueMemberNode;
- class ValueMemberUpdate;
-//-----------------------------------------------------------------------------
- class NodeChangeData;
- class NodeChangeLocation;
- class NodeChangeInformation;
-//-----------------------------------------------------------------------------
- struct ElementTreeChange
- {
- Path::Component m_aElementName;
- rtl::Reference<ElementTree> m_aAddedElement;
- rtl::Reference<ElementTree> m_aRemovedElement;
-
- ElementTreeChange(
- Path::Component const& _aElementName,
- rtl::Reference<ElementTree> const& _aAddedElement,
- rtl::Reference<ElementTree> const& _aRemovedElement
- )
- : m_aElementName(_aElementName)
- , m_aAddedElement(_aAddedElement)
- , m_aRemovedElement(_aRemovedElement)
- {}
-
- bool isChange() const
- {
- return !!(m_aAddedElement != m_aRemovedElement);
- }
- };
-//-----------------------------------------------------------------------------
-
-
- /// represents a node position in some tree
- class NodeChangeImpl
- : public salhelper::SimpleReferenceObject
- {
- public:
- explicit
- NodeChangeImpl(bool bNoCheck = false);
-
- public:
- // related/affected nodes and trees
- /// the tree within which the change occurs
- rtl::Reference<Tree> getTargetTree() const;
-
- /// the node that is affected by the change
- unsigned int getTargetNode() const;
-
- protected:
- /// setup the 'target' node that is to be affected or changed
- void setTarget(rtl::Reference<Tree> const& _aAffectedTree, unsigned int _nAffectedNode);
- void setTarget(view::Node _aAffectedNode);
-
- view::ViewTreeAccess getTargetView();
- public:
- // getting information
- /*static const sal_uInt32*/ enum { scCommonBase = ~0u };
-
- /// checks, if this represents an actual change - with or without requiring a preceding test
- bool isChange(bool bAllowUntested) const;
-
- /// return the number of distict changes in this object
- sal_uInt32 getChangeDataCount() const;
-
- /// fills in base change location, returns whether it is set
- bool fillChangeLocation(NodeChangeLocation& rChange, sal_uInt32 _ix = scCommonBase) const;
-
- /// fills in pre- and post-change values, returns whether they may differ
- bool fillChangeData(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// fills in change location and values, returns whether data may be changed
- bool fillChangeInfo(NodeChangeInformation& rChange, sal_uInt32 _ix) const;
-
- /// test whether this really is a change to the stored 'changing' node
- void test();
-
- /// apply this change to the stored 'changing' node
- void apply();
-
- private:
- /// virtual hooks for some of the public methods
- /// return the number of distict changes in this object
- sal_uInt32 doGetChangeCount() const;
-
- /// the path from base to 'changing' node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const = 0;
-
- /// is the change really affecting a child (or children) of the affected node (true for values)
- virtual bool doIsChangingSubnode() const = 0;
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const = 0;
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const = 0;
-
- /// dry-check whether this is a change
- virtual void doTest( view::Node const& rTarget) = 0;
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget) = 0;
-
- private:
- rtl::Reference<Tree> m_aAffectedTree;
- unsigned int m_nAffectedNode;
- sal_uInt16 m_nState;
-
- void implApply();
- view::Node implGetTarget();
- };
-//-----------------------------------------------------------------------------
-
- /// represents a node position in some tree
- class ValueChangeImpl
- : public NodeChangeImpl
- {
- rtl::OUString m_aName;
- com::sun::star::uno::Any m_aNewValue;
- com::sun::star::uno::Any m_aOldValue;
- public:
- explicit ValueChangeImpl();
- explicit ValueChangeImpl(com::sun::star::uno::Any const& aNewValue);
- explicit ValueChangeImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
- ~ValueChangeImpl();
-
- public:
- /// setup the 'target' node that is to be affected or changed
- void setTarget(view::GroupNode const& _aParentNode, rtl::OUString const& sNodeName);
- void setTarget(rtl::Reference<Tree> const& aAffectedTree, unsigned int nParentNode, rtl::OUString const& sNodeName);
-
- public:
- /// get the name of the value
- rtl::OUString getValueName() const { return m_aName; }
-
- /// get the pre-change value (if known)
- com::sun::star::uno::Any getOldValue() const { return m_aOldValue; }
- /// get the post-change value (if known)
- com::sun::star::uno::Any getNewValue() const { return m_aNewValue; }
-
- protected:
- using NodeChangeImpl::setTarget;
- // override information items
- /// the path from base to 'affected' node - here is the name of the changing node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// is the change really affecting a child of the affected node (true here)
- virtual bool doIsChangingSubnode() const;
-
- protected:
- // override change information items
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const = 0;
-
- protected:
- // override apply functionality
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
-
- protected:
- // new overrideables
- /// extract the pre-change value from the target context
- virtual void preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew);
- /// extract the post-change value from the target context
- virtual void postCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rNew);
- /// apply the new value to the target context
- virtual void doApplyChange(ValueMemberUpdate& rNode) = 0;
- };
-//-----------------------------------------------------------------------------
-
- /// represents setting a value node to a given value
- class ValueReplaceImpl
- : public ValueChangeImpl
- {
- public:
- explicit ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue);
- explicit ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
-
- protected:
- // implement: set the target to the new value
- virtual void doApplyChange( ValueMemberUpdate& rNode);
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
-// friend class SetReplaceValueImpl;
- };
-//-----------------------------------------------------------------------------
-
- /// represents resetting a value node to its default value
- class ValueResetImpl
- : public ValueChangeImpl
- {
- bool m_bTargetIsDefault;
- public:
- explicit ValueResetImpl();
- explicit ValueResetImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
-
- protected:
- // override: set the new value as well and check the default state
- virtual void preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew);
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
-
- // implement: set the target to default
- virtual void doApplyChange( ValueMemberUpdate& rNode);
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
- };
-//-----------------------------------------------------------------------------
-
-
- /// represents a change to a set (as a container)
- class SetChangeImpl
- : public NodeChangeImpl
- {
- public:
- explicit SetChangeImpl(bool bNoCheck = false);
-
- using NodeChangeImpl::setTarget;
-
- protected:
- /// virtual hooks for some of the public methods
- /// is the change really affecting a child of the affected node (false here)
- virtual bool doIsChangingSubnode() const;
- };
-//-----------------------------------------------------------------------------
- class SetElementFactory;
-
- /// represents setting to its default state a set (as a container)
- class SetResetImpl
- : public SetChangeImpl
- {
- std::auto_ptr<ISubtree> m_aDefaultData;
- SetElementFactory& m_rElementFactory;
- std::vector< ElementTreeChange > m_aTreeChanges;
- public:
- explicit SetResetImpl(
- SetElementFactory& _rElementFactory,
- std::auto_ptr<ISubtree> _pDefaultData,
- bool _bNoCheck = false);
-
- ~SetResetImpl();
-
- protected:
- /// virtual hooks for some of the public methods
- /// retrieve the count of elements affected
- sal_uInt32 doGetChangeCount() const;
-
- /// the path from base to 'affected' node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
-
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a change to an element of a set (as a container)
- class SetElementChangeImpl
- : public SetChangeImpl
- {
- Path::Component m_aName;
- public:
- explicit SetElementChangeImpl(Path::Component const& aName, bool bNoCheck = false);
-
- /// the name of the element being changed
- Path::Component getFullElementName() const { return m_aName; }
-
- /// the name of the element being changed
- rtl::OUString getElementName() const { return m_aName.getName(); }
-
- protected:
- /// virtual hooks for some of the public methods
- /// the path from base to 'affected' node - use element name
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
-
- private:
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName) = 0;
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName) = 0;
- };
-//-----------------------------------------------------------------------------
-
- /// represents an insertion into a set of trees
- class SetInsertImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aNewTree;
- public:
- explicit SetInsertImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, bool bNoCheck = false);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a substitution within a set of trees
- class SetReplaceImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aNewTree;
- rtl::Reference<ElementTree> m_aOldTree;
- public:
- explicit SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree);
- explicit SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, rtl::Reference<ElementTree> const& aOldTree);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a removal from of a set of trees
- class SetRemoveImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aOldTree;
- public:
- explicit SetRemoveImpl(Path::Component const& aName);
- explicit SetRemoveImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aOldTree);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGCHANGEIMPL_HXX_
diff --git a/configmgr/source/treemgr/nodechangeinfo.cxx b/configmgr/source/treemgr/nodechangeinfo.cxx
deleted file mode 100644
index db86fa6fe4b8..000000000000
--- a/configmgr/source/treemgr/nodechangeinfo.cxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechangeinfo.hxx"
-
-#include "noderef.hxx"
-#include "tree.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-NodeChangeData::NodeChangeData()
-: type(eNoChange)
-, unoData()
-, element()
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData::NodeChangeData(NodeChangeData const& aOther)
-: type(aOther.type)
-, unoData(aOther.unoData)
-, element(aOther.element)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData& NodeChangeData::operator=(NodeChangeData const& aOther)
-{
- type = aOther.type;
- unoData = aOther.unoData;
- element = aOther.element;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData::~NodeChangeData()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeData::isDataChange() const
-{
- if (isSetChange() && element.isDataChange())
- return true;
-
- return unoData.isDataChange();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeData::getNewElementTree() const
-{
- return element.newValue.get();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeData::getOldElementTree() const
-{
- return element.oldValue.get();
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeData::getNewElementNodeID() const
-{
- rtl::Reference<ElementTree> newElement = this->element.newValue;
- if ( newElement.is() && newElement->nodeCount() > 0)
- {
- return NodeID( newElement.get(), Tree::ROOT );
- }
- else
- return NodeID(0,0);
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeData::getOldElementNodeID() const
-{
- rtl::Reference<ElementTree> oldElement = this->element.oldValue;
- if ( oldElement.is() && oldElement->nodeCount() > 0)
- {
- return NodeID( oldElement.get(), Tree::ROOT );
- }
- else
- return NodeID(0,0);
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeLocation::NodeChangeLocation()
-: m_path()
-, m_base(0,0)
-, m_affected(0,0)
-, m_bSubNodeChanging(false)
-{
-}
-//-----------------------------------------------------------------------------
-bool NodeChangeLocation::isValidLocation() const
-{
- return m_base.isValidNode() &&
- (m_affected.isEmpty()
- ? ! m_bSubNodeChanging
- : ( m_affected.isValidNode() &&
- (! m_bSubNodeChanging ||
- (!m_path.isEmpty() &&
- SubNodeID(m_affected,m_path.getLocalName().getName()).isValidNode()
- ) ) ) );
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-bool NodeChangeLocation::isValidData() const
-{
- return m_base.isValidNode() &&
- (m_affected.isEmpty()
- ? ! m_bSubNodeChanging
- : ( m_affected.isValidNode() &&
- (! m_bSubNodeChanging || !m_path.isEmpty() )
- ) );
-}
-#endif
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setAccessor(RelativePath const& aAccessor)
-{
- m_path = aAccessor;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setBase(NodeID const& aBaseNode)
-{
- m_base = aBaseNode;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setAffected(NodeID const& aTargetNode)
-{
- m_affected = aTargetNode;
-
- if (m_base.isEmpty())
- setBase(aTargetNode);
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setChangingSubnode( bool bSubnode )
-{
- OSL_ENSURE(!m_affected.isEmpty() || !bSubnode, "Change without target cannot affect subnode");
-
- m_bSubNodeChanging = bSubnode;
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeLocation::getBaseTree() const
-{
- OSL_ENSURE(m_base.isValidNode(), "Invalid base location set in NodeChangeLocation");
- return m_base.getTree();
-}
-//-----------------------------------------------------------------------------
-
-NodeRef NodeChangeLocation::getBaseNode() const
-{
- OSL_ENSURE(m_base.isValidNode(), "Invalid base location set in NodeChangeLocation");
- return m_base.getNode();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeLocation::getAffectedTreeRef() const
-{
- NodeID aAffected = this->getAffectedNodeID();
- return aAffected.getTree();
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeLocation::getAffectedNodeID() const
-{
- OSL_ENSURE(m_affected.isEmpty() || m_affected.isValidNode(), "Invalid target location set in NodeChangeLocation");
- return m_affected;
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID NodeChangeLocation::getChangingValueID() const
-{
- if (!m_bSubNodeChanging) return SubNodeID::createEmpty();
-
- OSL_ENSURE(!m_affected.isEmpty() && m_affected.isValidNode(), "Invalid target location set in NodeChangeLocation with subnode");
- OSL_ENSURE(!m_path.isEmpty(), "No target accessor set in NodeChangeLocation with subnode");
-
- SubNodeID aResult( m_affected, m_path.getLocalName().getName() );
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/nodefactory.cxx b/configmgr/source/treemgr/nodefactory.cxx
deleted file mode 100644
index 37a0cd5ab61b..000000000000
--- a/configmgr/source/treemgr/nodefactory.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodefactory.hxx"
-#include "nodeimplobj.hxx"
-#include "configpath.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-namespace view
-{
-
-// Creating Specific types of nodes
-//-----------------------------------------------------------------------------
-namespace
-{
-//---------------------------------------------------------------------
- struct BasicNodeFactory : NodeFactory
- {
- rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node);
- rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node);
- rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate);
- };
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeValueNode(sharable::ValueNode * node)
- {
- return new configuration::ValueElementNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeGroupNode(sharable::GroupNode * node)
- {
- return new configuration::GroupNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate)
- {
- return new configuration::SetNodeImpl(node, pTemplate);
- }
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-
- struct DeferredNodeFactory : NodeFactory
- {
- rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node);
- rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node);
- rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate);
- };
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeValueNode(sharable::ValueNode * node)
- {
- // OSL_ENSURE(false, "Wrong factory for value elements - should be immutable (=read-only)");
- return new configuration::ValueElementNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeGroupNode(sharable::GroupNode * node)
- {
- return new configuration::DeferredGroupNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate)
- {
- return new configuration::DeferredSetNodeImpl(node, pTemplate);
- }
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-} // anonymous
-//-----------------------------------------------------------------------------
-
-// Different standard (static) factories
-//---------------------------------------------------------------------
-
- /// provides a factory for immediately commiting node implementations
- NodeFactory& getDirectAccessFactory()
- {
- static BasicNodeFactory aFactory;
- return aFactory;
- }
- /// provides a factory for read-only node implementations
- NodeFactory& getReadAccessFactory()
- {
- static BasicNodeFactory aFactory;
- return aFactory;
- }
- /// provides a factory for nodes that cache changes temporarily
- NodeFactory& getDeferredChangeFactory()
- {
- static DeferredNodeFactory aFactory;
- return aFactory;
- }
-
-//---------------------------------------------------------------------
-} // view
-
-//-----------------------------------------------------------------------------
-} // configmgr
-
diff --git a/configmgr/source/treemgr/nodefactory.hxx b/configmgr/source/treemgr/nodefactory.hxx
deleted file mode 100644
index 3d6ec135c427..000000000000
--- a/configmgr/source/treemgr/nodefactory.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEFACTORY_HXX_
-#define CONFIGMGR_CONFIGNODEFACTORY_HXX_
-
-#include <rtl/ref.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
- class NodeImpl;
- class Template;
- }
- namespace sharable {
- struct GroupNode;
- struct SetNode;
- struct ValueNode;
- }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
-
-// Creating Specific types of nodes
-//-----------------------------------------------------------------------------
-
- struct NodeFactory
- {
- virtual rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node) = 0;
- virtual rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node) = 0;
- virtual rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate) = 0;
- };
- }
-//-----------------------------------------------------------------------------
-
-}
-
-#endif // CONFIGMGR_CONFIGNODEFACTORY_HXX_
diff --git a/configmgr/source/treemgr/nodeimpl.cxx b/configmgr/source/treemgr/nodeimpl.cxx
deleted file mode 100644
index e03915a664cc..000000000000
--- a/configmgr/source/treemgr/nodeimpl.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "nodevisitor.hxx"
-#include "tree.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-#include "change.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-// Specific types of nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupNodeImpl
-//-----------------------------------------------------------------------------
-
-sharable::GroupNode * GroupNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isGroup());
- return &node->group;
-}
-//-----------------------------------------------------------------------------
-
-GroupNodeImpl::GroupNodeImpl(sharable::GroupNode * _pNodeRef)
- : NodeImpl(reinterpret_cast<sharable::Node *>(_pNodeRef))
- , m_pCache( NULL )
-{
-}
-//-----------------------------------------------------------------------------
-
-bool GroupNodeImpl::areValueDefaultsAvailable() const
-{
- return getDataAccess()->hasDefaultsAvailable();
-}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode GroupNodeImpl::makeValueMember(sharable::ValueNode * node)
-{
- return ValueMemberNode(node);
-}
-//-----------------------------------------------------------------------------
-
-sharable::ValueNode * GroupNodeImpl::getOriginalValueNode(rtl::OUString const& _aName) const
-{
- OSL_ENSURE( _aName.getLength() != 0, "Cannot get nameless child value");
-
- sharable::GroupNode * group = getDataAccess();
-
- if (m_pCache)
- {
- if (m_pCache->isNamed(_aName))
- return m_pCache->valueData();
-
- m_pCache = group->getNextChild(m_pCache);
-
- if (m_pCache && m_pCache->isNamed(_aName))
- return m_pCache->valueData();
- m_pCache = NULL;
- }
-
- sharable::Node * child = group->getChild(_aName);
- m_pCache = child;
-
- // to do: investigate cache lifecycle more deeply.
-
- return child == 0 ? 0 : child->valueData();
-}
-
-//-----------------------------------------------------------------------------
-// class ValueElementNodeImpl
-//-----------------------------------------------------------------------------
-
-sharable::ValueNode * ValueElementNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isValue());
- return &node->value;
-}
-//-----------------------------------------------------------------------------
-
-ValueElementNodeImpl::ValueElementNodeImpl(sharable::ValueNode * const& _aNodeRef)
- : NodeImpl(reinterpret_cast<sharable::Node *>(_aNodeRef))
-{
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueElementNodeImpl::getValue() const
-{
- return getDataAccess()->getValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueElementNodeImpl::getValueType() const
-{
- return getDataAccess()->getValueType();
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodeimpl.hxx b/configmgr/source/treemgr/nodeimpl.hxx
deleted file mode 100644
index 025171e25223..000000000000
--- a/configmgr/source/treemgr/nodeimpl.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
-#define CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
-
-#include "attributes.hxx"
-#include "node.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view { class ViewStrategy; }
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- //-----------------------------------------------------------------------------
- class Tree;
- class NodeChange;
- class NodeChanges;
- class NodeChangesInformation;
-
-//-----------------------------------------------------------------------------
-// Specific types of nodes
-//-----------------------------------------------------------------------------
-
- class NodeImpl;
- struct INodeHandler;
-
- // Almost an interface, but derives from concrete OReference
- class NodeImpl : public salhelper::SimpleReferenceObject
- {
- friend class view::ViewStrategy;
- sharable::Node * m_pNodeRef;
- public:
- NodeImpl(sharable::Node * _pNodeRef)
- : m_pNodeRef(_pNodeRef) {}
-
- public:
- /// provide access to the data of the underlying node
- sharable::Node * getOriginalNodeAccess() const
- { return m_pNodeRef; }
- };
-
-//-----------------------------------------------------------------------------
- class ValueElementNodeImpl;
- class GroupNodeImpl;
- class SetNodeImpl;
-//-----------------------------------------------------------------------------
-
- struct INodeHandler
- {
- virtual void handle( ValueElementNodeImpl& rNode) = 0;
- virtual void handle( GroupNodeImpl& rNode) = 0;
- virtual void handle( SetNodeImpl& rNode) = 0;
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/nodeimplobj.cxx b/configmgr/source/treemgr/nodeimplobj.cxx
deleted file mode 100644
index 2d10b42507ad..000000000000
--- a/configmgr/source/treemgr/nodeimplobj.cxx
+++ /dev/null
@@ -1,1162 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodeimplobj.hxx"
-
-
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "nodechangeimpl.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// Value Nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class DeferredValueElementNodeImpl
-//-----------------------------------------------------------------------------
-
-// Group Nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class DeferredGroupNodeImpl
-//-----------------------------------------------------------------------------
-
-DeferredGroupNodeImpl::DeferredGroupNodeImpl(sharable::GroupNode * const& _aNodeRef)
-: GroupNodeImpl(_aNodeRef)
-, m_aChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-DeferredGroupNodeImpl::~DeferredGroupNodeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode DeferredGroupNodeImpl::makeValueMember(rtl::OUString const& _aName, bool _bForUpdate)
-{
- MemberChanges::iterator it = m_aChanges.find(_aName);
-
- if (it != m_aChanges.end())
- {
- if (!it->second.is())
- OSL_ENSURE(_aName.getLength() == 0, "ERROR: Found empty change reference");
-
- else if (_bForUpdate || it->second->isChange()) // found one
- return ValueMemberNode(it->second);
-
- else // leftover non-change
- m_aChanges.erase(it);
-
- // if not found continue with default
- }
-
- sharable::ValueNode * original = getOriginalValueNode(_aName);
-
- if (_bForUpdate) // create a new change
- {
- if (original != 0)
- {
- rtl::Reference<ValueMemberNode::DeferredImpl> aNewChange(new ValueMemberNode::DeferredImpl(original));
- m_aChanges[_aName] = aNewChange;
-
- return ValueMemberNode(aNewChange);
- }
- }
-
- return GroupNodeImpl::makeValueMember(original);
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredGroupNodeImpl::hasChanges() const
-{
- for (MemberChanges::const_iterator it = m_aChanges.begin(); it != m_aChanges.end(); ++it)
- {
- if (!it->second.is())
- {
- // empty element is present -> marked as changed
- OSL_ASSERT(it->first.getLength() == 0);
- return true;
- }
-
- if (it->second->isChange())
- return true;
- }
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::collectValueChanges(NodeChanges& rChanges, Tree* pParentTree, unsigned int nNode) const
-{
- for (MemberChanges::const_iterator it = m_aChanges.begin(); it != m_aChanges.end(); ++it)
- {
- if (it->second.is())
- {
- OSL_ASSERT(it->first.getLength() != 0);
- if (ValueChangeImpl* pValueChange = it->second->collectChange())
- {
- pValueChange->setTarget(pParentTree,nNode,it->first);
-
- rChanges.add( NodeChange(pValueChange) );
- }
- else // leftover non-change
- OSL_ENSURE(!it->second->isChange(), "Got no change from a changing value") ;
- }
- else
- OSL_ASSERT(it->first.getLength() == 0);
- }
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ValueMemberNode::DeferredImpl> DeferredGroupNodeImpl::findValueChange(rtl::OUString const& aName)
-{
- rtl::Reference<ValueMemberNode::DeferredImpl> aResult;
-
- MemberChanges::iterator it = m_aChanges.find(aName);
-
- if (it != m_aChanges.end())
- {
- if (it->second.is() )
- {
- if (it->second->isChange())
- {
- aResult = it->second;
- }
-
- else // leftover non-change -> drop
- {
- m_aChanges.erase(it);
- }
- }
- else
- OSL_ENSURE(aName.getLength() == 0, "ERROR: Found empty change reference");
- }
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<SubtreeChange> DeferredGroupNodeImpl::preCommitValueChanges()
-{
- std::auto_ptr<SubtreeChange> aRet;
-
- if (!m_aChanges.empty())
- {
- sharable::Node * originalData = this->getOriginalNodeAccess();
- aRet.reset( new SubtreeChange( originalData->getName(),
- originalData->getAttributes() ) );
-
- for (MemberChanges::iterator pos = m_aChanges.begin(); pos != m_aChanges.end(); )
- {
- MemberChanges::iterator it = pos++; // this is used to allow erasing below
-
- if (!it->second.is())
- {
- OSL_ASSERT(it->first.getLength() == 0);
- }
- else if (it->second->isChange())
- {
- std::auto_ptr<ValueChange> aValueChange = it->second->preCommitChange();
- if (aValueChange.get())
- {
- std::auto_ptr<Change> aBaseChange(aValueChange.release());
- aRet->addChange( aBaseChange );
- }
- else
- OSL_ENSURE(false, "Got no change from a changed member");
- }
- else // found left-over non-change
- m_aChanges.erase(it);
- }
- if (m_aChanges.empty()) aRet.reset();
- }
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::finishCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) throw Exception("Unexpected type of element change");
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Found empty change object for Member value change");
-
- if (aStoredChange.is())
- {
- aStoredChange->finishCommit(*valueChange);
- OSL_ENSURE(!aStoredChange->isChange(),"ValueChange is not moot after finishCommit");
- }
-
- m_aChanges.erase( itStoredChange ); // remove finished change
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
-
- }
-
- OSL_DEBUG_ONLY( m_aChanges.erase( rtl::OUString() ) ); // remove change marker (if present)
- OSL_ENSURE(m_aChanges.empty(), "Found unprocessed changes to values in group");
-
- m_aChanges.clear(); // remove all pending stuff and marker
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::revertCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) continue;
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Cannot restore change: found empty change object for Member value change");
-
- if (aStoredChange.is())
- {
- aStoredChange->revertCommit(*valueChange);
- OSL_ENSURE(!aStoredChange->isChange(),"ValueChange is not moot after reverting - will be discarded nevertheless");
- }
- m_aChanges.erase( itStoredChange ); // remove change if it is moot
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::failedCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) continue;
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Cannot recover from failed change: found empty change object for Member value change");
-
- if (aStoredChange.is())
- aStoredChange->failedCommit(*valueChange);
- {
- if (!aStoredChange->isChange())
- m_aChanges.erase( itStoredChange ); // remove change if it is moot
- }
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
- }
-
- OSL_DEBUG_ONLY( m_aChanges.erase( rtl::OUString() ) ); // remove change marker (if present)
- OSL_ENSURE(m_aChanges.empty(), "RevertCommit: Found unprocessed changes to values in group");
-
- m_aChanges.clear(); // discard all pending stuff and marker
-}
-//-----------------------------------------------------------------------------
-
-
-void DeferredGroupNodeImpl::markChanged()
-{
- // special mark: a NULL rtl::Reference<ValueMemberNode::DeferredImpl> at empty name
- m_aChanges.insert( MemberChanges::value_type() );
-}
-//-----------------------------------------------------------------------------
-
-// Set nodes
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-// class DeferredTreeSetNodeImpl
-//-----------------------------------------------------------------------------
-
-DeferredSetNodeImpl::DeferredSetNodeImpl(sharable::SetNode * const& _aNodeRef, Template* pTemplate)
-: SetNodeImpl(_aNodeRef,pTemplate)
-, m_aChangedData()
-, m_bChanged(false)
-, m_bDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredSetNodeImpl::doIsEmpty() const
-{
- if (m_aChangedData.isEmpty())
- return SetNodeImpl::doIsEmpty();
-
- // look for added elements
- {for(ElementSet::ConstIterator it = m_aChangedData.begin(), stop = m_aChangedData.end();
- it != stop;
- ++it)
- {
- if (it->isValid()) return false;
- }}
-
-
- // look for elements in the base set that are not 'deleted' (the changes are all deletions here)
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (!m_aChangedData.hasElement(it->first)) return false;
- }}
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-ElementTree* DeferredSetNodeImpl::doFindElement(rtl::OUString const& aName)
-{
- ElementTreeData* pElement = m_aChangedData.getElement(aName);
- if (!pElement)
- pElement = SetNodeImpl::getStoredElement(aName);
-
- return pElement ? pElement->get() : 0;
-}
-//-----------------------------------------------------------------------------
-
-SetNodeVisitor::Result DeferredSetNodeImpl::doDispatchToElements(SetNodeVisitor& aVisitor)
-{
- SetNodeVisitor::Result eRet = SetNodeVisitor::CONTINUE;
- // look for elements in the base set that are not hidden by changes
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- eRet = aVisitor.visit(SetEntry(it->second.get()));
- }
- }}
-
- // look for added elements
- {for(ElementSet::ConstIterator it = m_aChangedData.begin(), stop = m_aChangedData.end();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- if (it->isValid())
- {
- eRet = aVisitor.visit(SetEntry(it->get()));
- }
- }}
- return eRet;
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredSetNodeImpl::hasChanges() const
-{
- return m_bChanged || !m_aChangedData.isEmpty();
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::collectElementChanges(NodeChanges& rChanges) const
-{
- // collect added and deleted nodes
- {for(ElementSet::Data::const_iterator it = m_aChangedData.beginNative(), stop = m_aChangedData.endNative();
- it != stop;
- ++it)
- {
- ElementTreeData const* pOriginal = SetNodeImpl::getStoredElement(it->first);
-
- if (it->second.isValid()) // added one
- {
- if (pOriginal)
- {
- rChanges.add(NodeChange(implCreateReplace(it->first,it->second,*pOriginal)));
- }
- else
- {
- rChanges.add(NodeChange(implCreateInsert(it->first,it->second)));
- }
- }
- else
- {
- if (pOriginal)
- {
- rChanges.add(NodeChange(implCreateRemove(it->first,*pOriginal)));
- }
-
- //else nothing to do
- }
- }}
-
- // collect preexisting nodes
- // if (!containsValues()) // value elements ar immutable !
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- view::ViewTreeAccess aElementView(it->second.get());
-
- if (aElementView.hasChanges())
- aElementView.collectChanges(rChanges);
- }
- }}
-
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::markChanged()
-{
- m_bChanged = true;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::doTransferElements(ElementSet& rReplacement)
-{
- // transfer preexisting nodes (unless replaced/deleted)
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
-
- rReplacement.insertElement(it->first,it->second);
- }
- }}
-
- // commit added and deleted nodes
- {
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- if (it->second.isValid())
- rReplacement.insertElement(it->first,it->second);
-
- ++it;
- m_aChangedData.removeElement(it->first);
- }
- }
-
- m_bChanged = false;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::rebuildElement(rtl::OUString const& _aName, ElementTreeData const& _aElement)
-{
- Tree* pContext = this->getParentTree();
- OSL_ENSURE(pContext, "Context tree must be set before rebuilding");
-
- rtl::Reference<view::ViewStrategy> xContextBehavior = pContext->getViewBehavior();
-
- sharable::TreeFragment * elementAccessor = this->getDataAccess()->getElement(_aName);
- OSL_ENSURE(elementAccessor != 0, "Element Tree not found in data");
-
- OSL_ENSURE(_aElement.isValid(), "Element not found in view");
- _aElement->rebuild(xContextBehavior, elementAccessor);
-}
-
-//-----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> DeferredSetNodeImpl::preCommitChanges(std::vector< rtl::Reference<ElementTree> >& _rRemovedElements)
-{
- sharable::Node * originalData = this->getOriginalNodeAccess();
- // now first get the name of this node
- rtl::OUString sSetName = originalData->getName();
-
- // and make a SubtreeChange
- std::auto_ptr<SubtreeChange> pSetChange( new SubtreeChange(sSetName,
- getElementTemplate()->getName(),
- getElementTemplate()->getModule(),
- originalData->getAttributes() ) );
-
- // commit preexisting nodes
- {
- for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- OSL_ENSURE( !m_bDefault || it->second.inDefault, "m_bDefault is inconsistent");
-
- view::ViewTreeAccess aElementView(it->second.get());
- std::auto_ptr<SubtreeChange> pNewChange = aElementView.preCommitChanges(_rRemovedElements);
- if (pNewChange.get() != 0)
- {
- //OSL_ENSURE( !containsValues(), "Unexpected change generated by value set element");
- std::auto_ptr<Change> pNewChangeBase( pNewChange.release() );
- pSetChange->addChange(pNewChangeBase);
- }
- }
- }
- }
-
- // commit added and deleted nodes
- {
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- rtl::OUString aName = it->first;
- ElementTreeData aNewElement = it->second;
-
- ElementTreeData* pOriginal = SetNodeImpl::getStoredElement(aName);
-
- if (aNewElement.isValid())
- {
- rtl::Reference< data::TreeSegment > aAddedTree = aNewElement->releaseOwnedTree();
- if (!aAddedTree.is())
- {
- throw Exception("INTERNAL ERROR: Could not find data for the added ElementTree");
- }
-
- OSL_ENSURE( !m_bDefault || aNewElement.inDefault, "m_bDefault is inconsistent");
-
- AddNode* pAddNode = new AddNode(aAddedTree, aName, aNewElement.inDefault );
-
- std::auto_ptr<Change> pNewChange( pAddNode );
-
- if (pOriginal)
- pAddNode->setReplacing();
-
- pSetChange->addChange(pNewChange);
- }
- else
- {
- if (pOriginal)
- {
- OSL_ENSURE( !m_bDefault || aNewElement.inDefault, "m_bDefault is inconsistent");
-
- std::auto_ptr<Change> pNewChange( new RemoveNode(aName,aNewElement.inDefault) );
-
- pSetChange->addChange(pNewChange);
- }
- //else nothing to do
- }
-
- // collect removed or replaced element
- if (pOriginal)
- _rRemovedElements.push_back( pOriginal->tree );
-
- ++it;
- }
- }
- return pSetChange;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::finishCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- ElementTreeData aOriginal;
- if (pOriginal)
- {
- aOriginal = *pOriginal;
- OSL_ASSERT(aOriginal.isValid());
- }
- else
- OSL_ASSERT(!aOriginal.isValid());
-
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > aRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (bool) aRemovedTree.is() );
-
- if (aOriginal.isValid())
- SetNodeImpl::replaceElement(aElementName,*pNewElement);
-
- else
- SetNodeImpl::insertElement(aElementName,*pNewElement);
-
- this->rebuildElement(aElementName,*pNewElement);
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(aOriginal.isValid());
- if (aOriginal.isValid())
- SetNodeImpl::removeElement(aElementName);
- }
- // handle a added or deleted node
- if (aOriginal.isValid())
- {
- OSL_ENSURE(aRemovedTree.is(), "Cannot take over the removed node");
-
- aOriginal->takeTreeAndRebuild(aRemovedTree);
- }
- m_aChangedData.removeElement(aElementName);
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected type of element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).finishCommit(*subtreeChange);
- }
- }
- m_bChanged = false;
-
- OSL_ENSURE(m_aChangedData.isEmpty(), "ERROR: Uncommitted changes left in set node");
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::revertCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > pRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- pRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (0!=pRemovedTree.is()) );
-
- OSL_ENSURE(!addNode->wasInserted(), "Cannot retract new node: Change was integrated");
-
- rtl::Reference< data::TreeSegment > aAddedTree = addNode->getNewTree();
- OSL_ENSURE(aAddedTree.is(), "Cannot restore new node: Change lost ownership");
-
- // restore the tree
- (*pNewElement)->takeTreeBack(aAddedTree);
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- pRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(pOriginal);
- OSL_ASSERT((0 != pOriginal) == (0!=pRemovedTree.is()) );
- }
- OSL_ENSURE(pRemovedTree.is(), "Possible problems reverting removed node: Change took ownership");
- // try handle a added or deleted node
- if (pOriginal)
- {
- OSL_ASSERT(pOriginal->isValid());
- (*pOriginal)->takeTreeAndRebuild(pRemovedTree);
- OSL_DEBUG_ONLY(pRemovedTree.clear());
- }
- OSL_ENSURE(!pRemovedTree.is(), "Could not revert removed node: Nowhere to put ownership");
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected set element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).revertCommit(*subtreeChange);
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::failedCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- ElementTreeData aOriginal;
- if (pOriginal)
- {
- aOriginal = *pOriginal;
- OSL_ASSERT(aOriginal.isValid());
- }
- else
- OSL_ASSERT(!aOriginal.isValid());
-
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > aRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (bool) aRemovedTree.is() );
-
- if (addNode->wasInserted())
- { // it has been integrated into the master tree
- OSL_ENSURE(getDataAccess()->getElement(aElementName) == addNode->getInsertedTree(),
- "Internal Error: Inserted tree address does not match actual data");
-
- // so add it
- if (aOriginal.isValid())
- SetNodeImpl::replaceElement(aElementName,*pNewElement);
-
- else
- SetNodeImpl::insertElement(aElementName,*pNewElement);
-
- this->rebuildElement(aElementName,*pNewElement);
- }
- else // Change not done; need to restore new node (element will be released into the wild then)
- {
- rtl::Reference< data::TreeSegment > aAddedTree = addNode->getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "Unexpected: added node is gone, but where ? May cause invalid references");
- (*pNewElement)->takeTreeBack(aAddedTree);
- detach(*pNewElement);
- }
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(aOriginal.isValid());
- if (aRemovedTree.is() && getDataAccess()->getElement(aElementName) == 0)
- {
- // really removed - then remove the originel
- if (aOriginal.isValid())
- SetNodeImpl::removeElement(aElementName);
- }
- }
-
- // handle a added or deleted node
- if (aOriginal.isValid() && aRemovedTree.is())
- {
- aOriginal->takeTreeAndRebuild(aRemovedTree);
- //aOriginal->getAccess().makeDirect();
- OSL_DEBUG_ONLY(aRemovedTree.clear());
- }
- OSL_ENSURE(!aRemovedTree.is(), "Could not revert removed node: Nowhere to put ownership");
-
- m_aChangedData.removeElement(aElementName);
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected set element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).recoverFailedCommit(*subtreeChange);
- }
- }
- m_bChanged = false;
- m_bDefault = false;
-
- OSL_ENSURE(m_aChangedData.isEmpty(), "ERROR: Uncommitted changes left in set node");
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::insertNewElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- // put the new element into the changed set
- ElementTreeData* pAddedElement = m_aChangedData.getElement(aName);
- if (pAddedElement)
- {
- OSL_ENSURE(!pAddedElement->isValid(),"WARNING: Element being inserted was already there - replacing");
- detach(m_aChangedData.replaceElement(aName,aNewElement));
- }
- else
- {
- m_aChangedData.insertElement(aName, aNewElement);
- }
- m_bChanged = true;
- m_bDefault = false;
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::removeOldElement(rtl::OUString const& aName)
-{
- // put an empty (dummy) element into the changed set
- ElementTreeData* pAddedElement = m_aChangedData.getElement(aName);
- if (pAddedElement)
- {
- OSL_ENSURE(pAddedElement->isValid(),"WARNING: Element being removed was already removed");
- detach(m_aChangedData.replaceElement(aName, ElementTreeData()));
- m_bChanged = true;
- m_bDefault = false;
- }
- else
- {
- m_aChangedData.insertElement(aName, ElementTreeData());
- }
-
- // now check the original one
- ElementTreeData* pOldElement = getStoredElement(aName);
- if (pOldElement)
- {
- OSL_ASSERT(pOldElement->isValid());
- detach(*pOldElement);
- m_bChanged = true;
- m_bDefault = false;
- }
- else // just clear things out
- {
- m_aChangedData.removeElement(aName);
- }
-
- OSL_ENSURE(pOldElement || pAddedElement,"WARNING: Element being removed was not found in set");
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange)
-{
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- if (ElementTreeData* pElement = getStoredElement(aName))
- {
- OSL_ASSERT(pElement->isValid());
-
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&aChange))
- {
- // recurse to element tree - but do not notify those changes (?)
- Tree * elementTree = pElement->get();
-
- NodeChangesInformation aIgnoredChanges;
- view::getViewBehavior(elementTree)->adjustToChanges(aIgnoredChanges, view::getRootNode(elementTree), *subtreeChange);
- }
- else
- {
- OSL_ENSURE(dynamic_cast<ValueChange const * >(&aChange) != 0, "Unexpected kind of change to value set element" );
- //OSL_ENSURE( containsValues(), "Unexpected kind of change: Value change applied to tree set element" );
- }
-
- }
- else
- {
- // could be changed to do an insert instead (?)
- OSL_ENSURE( false, "Changed Element didn't exist before it was removed/replaced" );
- }
-
- if (pLocalElement->isValid())
- {
- // we have a complete replacement for the changed node
- ElementTreeData aLocalElement = *pLocalElement;
-
- // also signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else
- {
- // already removed locally - should be notified by different route (if applicable)
- return NULL;
- }
- }
- else
- {
- return SetNodeImpl::doAdjustChangedElement( rLocalChanges,aName,aChange);
- }
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const& aNewElement)
-{
- m_bDefault = false;
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- // We have another element replacing ours - what do we do ?
- if (hasStoredElement(aName))
- {
- OSL_ENSURE( aAddNodeChange.isReplacing(), "Added Element already exists - replacing" );
-
- this->replaceElement(aName,aNewElement);
- }
- else
- {
- OSL_ENSURE( !aAddNodeChange.isReplacing(), "Replaced Element doesn't exist - simply adding" );
- this->insertElement(aName,aNewElement);
- }
-
-
- if (pLocalElement->isValid()) // ours remains a valid replacement
- {
- ElementTreeData aLocalElement = *pLocalElement;
-
- // just signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else // had been removed locally
- {
- // signal what happened
- return implCreateInsert(aName,aNewElement);
- }
- }
- else
- {
- return SetNodeImpl::implAdjustToAddedElement(aName,aNewElement,aAddNodeChange.isReplacing());
- }
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& /*aRemoveNodeChange*/)
-{
- m_bDefault = false;
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- if (hasStoredElement(aName))
- {
- // take away the original
- this->removeElement(aName);
- }
-
- if (pLocalElement->isValid()) // remains a valid replacement
- {
- ElementTreeData aLocalElement = *pLocalElement;
-
- // signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else // already was removed locally
- {
- return 0;
- }
- }
- else
- {
- return SetNodeImpl::implAdjustToRemovedElement(aName);
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree)
-{
- if (!m_bDefault)
- {
- implDifferenceToDefaultState(_rChangeToDefault,_rDefaultTree);
-
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- rtl::OUString aName = it->first;
- ElementTreeData aElement = it->second;
-
- Change* pChange = _rChangeToDefault.getChange( aName );
- OSL_ENSURE(pChange == NULL || dynamic_cast< AddNode * >(pChange) != 0 || dynamic_cast< RemoveNode * >(pChange) != 0,
- "Unexpected change type found in difference to default tree");
-
- if (pChange == NULL)
- {
- std::auto_ptr<INode> aDefaultNode = _rDefaultTree.removeChild(aName);
- OSL_ENSURE( aDefaultNode.get(), "Error: unused Default tree not found after SetNodeImpl::implDifferenceToDefaultState");
-
- rtl::OUString aElementTypeName = _rDefaultTree.getElementTemplateName();
- OSL_ENSURE( _rDefaultTree.isSetNode(), "Error: missing set template information in default data");
-
- rtl::Reference< data::TreeSegment > aDefaultTree = data::TreeSegment::create(aDefaultNode,aElementTypeName);
- OSL_ENSURE(aDefaultTree.is(), "Error: unused Default tree not accessible after SetNodeImpl::implDifferenceToDefaultState");
-
- AddNode* pAddIt = new AddNode(aDefaultTree, aName, true );
-
- std::auto_ptr<Change> pNewChange( pAddIt );
-
- if (aElement.isValid())
- {
- OSL_ENSURE(!aElement.inDefault, "Default element replaced by default");
- pAddIt->setReplacing();
- }
-
- _rChangeToDefault.addChange(pNewChange);
-
- }
- else if (AddNode * addNode = dynamic_cast< AddNode * >(pChange))
- {
- // adjust the AddNode - remove the original expected node
- addNode->clearReplacedTree();
-
- if (aElement.isValid())
- {
- if (aElement.inDefault)
- {
- // change already done locally
- _rChangeToDefault.removeChange(aName);
- }
- else // adjust here
- addNode->setReplacing();
- }
-
- else
- OSL_ENSURE(!addNode->isReplacing(),"Could not unmark the 'replacing' state of an AddNode");
- }
- else if (RemoveNode * removeNode = dynamic_cast< RemoveNode * >(pChange))
- {
- if (aElement.isValid())
- {
- OSL_ENSURE(!aElement.inDefault, "Default element replaced by default");
- // adjust the RemoveNode - remove the original expected node
- removeNode->clearRemovedTree();
- }
- else
- {
- // change already done locally
- _rChangeToDefault.removeChange(aName);
- }
- // TODO: mark local removal as to-default
- }
- }
- }
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodeimplobj.hxx b/configmgr/source/treemgr/nodeimplobj.hxx
deleted file mode 100644
index e498c52feeac..000000000000
--- a/configmgr/source/treemgr/nodeimplobj.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_NODEIMPLOBJECTS_HXX_
-#define CONFIGMGR_NODEIMPLOBJECTS_HXX_
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "node.hxx"
-#include "nodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-// Specific types of nodes for direct or read only access
-//-----------------------------------------------------------------------------
-
-// Value Nodes
-//-----------------------------------------------------------------------------
-
- class ValueMemberNode::DeferredImpl : public salhelper::SimpleReferenceObject
- {
- sharable::ValueNode * m_valueNode;
-
- com::sun::star::uno::Any m_aNewValue;
- bool m_bToDefault;
- bool m_bChange;
- public:
- explicit DeferredImpl(sharable::ValueNode * valueNode);
-
- /// does this wrap a change
- bool isChange() const { return m_bChange; }
-
- /// retrieve the underlying (original) node
- sharable::ValueNode * getOriginalNode() const
- { return m_valueNode; }
-
- /// Does this node change to default
- bool isToDefault() const { return m_bToDefault; }
-
- /// retrieve the current value of this node
- com::sun::star::uno::Any getNewValue() const { return m_aNewValue; }
-
- /// Set this node to a new value
- void setValue(com::sun::star::uno::Any const& aNewValue, sharable::ValueNode * originalNode);
-
- /// Set this node to assume its default value
- void setValueToDefault(sharable::ValueNode * originalNode);
-
- public:
- // commit protocol
- std::auto_ptr<ValueChange> preCommitChange();
- void finishCommit(ValueChange& rChange);
- void revertCommit(ValueChange& rChange);
- void failedCommit(ValueChange& rChange);
-
- ValueChangeImpl* collectChange();
- ValueChangeImpl* adjustToChange(ValueChange const& rExternalChange);
-
- // notification protocol
- void adjustToChange(NodeChangesInformation& rLocalChange, ValueChange const& rExternalChange, Tree& rParentTree, unsigned int nParentPos, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-
-// Group Nodes
-//-----------------------------------------------------------------------------
-
- class DeferredGroupNodeImpl : public GroupNodeImpl
- {
- public:
- explicit
- DeferredGroupNodeImpl(sharable::GroupNode * const& _aNodeRef);
- explicit
- DeferredGroupNodeImpl(sharable::GroupNode * const& _aNewAddress, GroupNodeImpl& rOriginal);
-
- ~DeferredGroupNodeImpl();
-
- public:
- // commit protocol
- std::auto_ptr<SubtreeChange> preCommitValueChanges();
- void finishCommit(SubtreeChange& rChange);
- void revertCommit(SubtreeChange& rChange);
- void failedCommit(SubtreeChange& rChange);
-
- void collectValueChanges(NodeChanges& rChanges, Tree* pParent, unsigned int nNode) const;
-
- public:
- // data access
- bool hasChanges() const;
- void markChanged();
-
- rtl::Reference<ValueMemberNode::DeferredImpl> findValueChange(rtl::OUString const& aName);
-
- using GroupNodeImpl::makeValueMember;
- ValueMemberNode makeValueMember(rtl::OUString const& _aName, bool _bForUpdate);
-
- private:
- typedef std::map< rtl::OUString, rtl::Reference<ValueMemberNode::DeferredImpl> > MemberChanges;
-
- MemberChanges m_aChanges;
- };
-//-----------------------------------------------------------------------------
-
-// Set nodes
-//-----------------------------------------------------------------------------
-
- class DeferredSetNodeImpl : public SetNodeImpl
- {
- public:
- explicit
- DeferredSetNodeImpl(sharable::SetNode * const& _aNodeRef, Template* pTemplate);
-
- public:
- bool hasChanges() const;
- void markChanged();
- void collectElementChanges(NodeChanges& rChanges) const;
-
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(std::vector< rtl::Reference<ElementTree> >& _rRemovedElements);
- void failedCommit(SubtreeChange& rChanges);
- void finishCommit(SubtreeChange& rChanges);
- void revertCommit(SubtreeChange& rChanges);
-
- void insertNewElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- void removeOldElement(rtl::OUString const& aName);
- // Base Overrideables
- private:
- // NodeImpl implementation
- virtual bool doIsEmpty() const;
- virtual ElementTree* doFindElement(rtl::OUString const& aName) ;
- virtual SetNodeVisitor::Result doDispatchToElements(SetNodeVisitor& aVisitor);
-
- virtual void doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree);
-
- virtual SetElementChangeImpl* doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement);
- virtual SetElementChangeImpl* doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& aRemoveNodeChange);
-
- virtual SetElementChangeImpl* doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange);
-
- virtual void doTransferElements(ElementSet& rReplacement);
-
- // Implementation
- private:
- void rebuildElement(rtl::OUString const& aName, ElementTreeData const& _aElement);
-
- private:
- ElementSet m_aChangedData;
- bool m_bChanged;
- bool m_bDefault;
- };
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_NODEIMPLOBJECTS_HXX_
diff --git a/configmgr/source/treemgr/noderef.cxx b/configmgr/source/treemgr/noderef.cxx
deleted file mode 100644
index 8abab202979c..000000000000
--- a/configmgr/source/treemgr/noderef.cxx
+++ /dev/null
@@ -1,917 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "anynoderef.hxx"
-#include "valueref.hxx"
-#include "noderef.hxx"
-#include "tree.hxx"
-#include "viewaccess.hxx"
-#include "configpath.hxx"
-#include "nodechange.hxx"
-#include "configexcept.hxx"
-#include "configset.hxx"
-#include "tracer.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm> // for swap
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional> // for less
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// local helpers
-//-----------------------------------------------------------------------------
-
-namespace
-{
-//-----------------------------------------------------------------------------
- struct CollectValueIDs : GroupMemberVisitor
- {
- CollectValueIDs(NodeID const& aParentID, std::vector<SubNodeID>& rValueList)
- : m_aParentID(aParentID)
- , m_rValueList(rValueList)
- {
- }
-
- Result visit(ValueMemberNode const& anEntry);
-
- NodeID m_aParentID;
- std::vector<SubNodeID>& m_rValueList;
- };
-
- GroupMemberVisitor::Result CollectValueIDs::visit(ValueMemberNode const& aValue)
- {
- OSL_ASSERT(aValue.isValid());
-
- rtl::OUString aValueName = aValue.getNodeName();
-
- m_rValueList.push_back(SubNodeID( m_aParentID, aValueName));
-
- return CONTINUE;
- }
-//-----------------------------------------------------------------------------
-}
-
-//-----------------------------------------------------------------------------
-// class NodeRef
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef()
-: m_nPos(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef(unsigned int nPos, unsigned int nDepth)
-: m_nPos(nPos)
-, m_nDepth(nDepth)
-{}
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef(NodeRef const& rOther)
-: m_nPos(rOther.m_nPos)
-, m_nDepth(rOther.m_nDepth)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeRef& NodeRef::operator=(NodeRef const& rOther)
-{
- NodeRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeRef::swap(NodeRef& rOther)
-{
- std::swap(m_nPos, rOther.m_nPos);
- std::swap(m_nDepth, rOther.m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-NodeRef::~NodeRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class ValueRef
-//-----------------------------------------------------------------------------
-
-bool ValueRef::checkValidState() const
-{
- if (m_nParentPos == 0) return false;
-
- // old node semantics for now
- if ( m_sNodeName.getLength() == 0 ) return false;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef()
-: m_sNodeName()
-, m_nParentPos(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef(rtl::OUString const& aName, unsigned int nParentPos)
-: m_sNodeName(aName)
-, m_nParentPos(nParentPos)
-{
- OSL_ENSURE( nParentPos == 0 || checkValidState(), "Constructing invalid ValueRef");
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef(ValueRef const& rOther)
-: m_sNodeName(rOther.m_sNodeName)
-, m_nParentPos(rOther.m_nParentPos)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueRef& ValueRef::operator=(ValueRef const& rOther)
-{
- ValueRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void ValueRef::swap(ValueRef& rOther)
-{
- std::swap(m_sNodeName, rOther.m_sNodeName);
- std::swap(m_nParentPos, rOther.m_nParentPos);
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::~ValueRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class AnyNodeRef
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool AnyNodeRef::checkValidState() const
-{
- if (m_nUsedPos == 0) return false;
-
- if ( m_sNodeName.getLength() != 0 ) // it's a local value
- {
- // not used as runtime check as it should not be dangerous
- OSL_ENSURE(m_nDepth ==0, "AnyNodeRef that wraps a ValueRef should have no depth"); // value has no depth
- }
-
- return true;
-}
-#endif
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef()
-: m_sNodeName()
-, m_nUsedPos(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(unsigned int nPos, unsigned int nDepth)
-: m_sNodeName()
-, m_nUsedPos(nPos)
-, m_nDepth(nDepth)
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(rtl::OUString const& aName, unsigned int nParentPos)
-: m_sNodeName(aName)
-, m_nUsedPos(nParentPos)
-, m_nDepth(0)
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(AnyNodeRef const& rOther)
-: m_sNodeName(rOther.m_sNodeName)
-, m_nUsedPos(rOther.m_nUsedPos)
-, m_nDepth(rOther.m_nDepth)
-{
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(NodeRef const& aNodeRef)
-: m_sNodeName()
-, m_nUsedPos( aNodeRef.m_nPos )
-, m_nDepth( aNodeRef.m_nDepth )
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(ValueRef const& aValueRef)
-: m_sNodeName( aValueRef.m_sNodeName )
-, m_nUsedPos( aValueRef.m_nParentPos )
-, m_nDepth( 0 )
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef& AnyNodeRef::operator=(AnyNodeRef const& rOther)
-{
- AnyNodeRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void AnyNodeRef::swap(AnyNodeRef& rOther)
-{
- std::swap(m_sNodeName, rOther.m_sNodeName);
- std::swap(m_nUsedPos, rOther.m_nUsedPos);
- std::swap(m_nDepth, rOther.m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::~AnyNodeRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-
-bool AnyNodeRef::isNode() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid()) return false;
-
- return m_sNodeName.getLength() == 0;
-}
-//-----------------------------------------------------------------------------
-
-NodeRef AnyNodeRef::toNode() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid() || !isNode()) return NodeRef();
-
- return NodeRef(m_nUsedPos,m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-ValueRef AnyNodeRef::toValue() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid() || isNode()) return ValueRef();
-
- return ValueRef(m_sNodeName, m_nUsedPos);
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// hashing any pointer
-//-----------------------------------------------------------------------------
-static // for now
-// should move this to a more public place sometime
-// need this, as STLPORT does not hash sal_(u)Int64 (at least on MSVC)
-inline
-size_t hash64(sal_uInt64 n)
-{
- // simple solution (but the same that STLPORT uses for unsigned long long (if enabled))
- return static_cast<size_t>(n);
-}
-//-----------------------------------------------------------------------------
-
-static // for now
-// should move this to a more public place sometime
-inline
-size_t hashAnyPointer(void* p)
-{
- // most portable quick solution IMHO (we need this cast for UNO tunnels anyway)
- sal_uInt64 n = reinterpret_cast<sal_uInt64>(p);
-
- return hash64(n);
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class NodeID
-//-----------------------------------------------------------------------------
-
-NodeID::NodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rNode)
-: m_pTree( rTree.get() )
-, m_nNode( rNode.getOffset() )
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeID::NodeID(Tree* pImpl, unsigned int nNode)
-: m_pTree( pImpl )
-, m_nNode( nNode )
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeID::isEmpty() const
-{
- OSL_ENSURE( m_pTree == NULL || m_pTree->isValidNode(m_nNode), "Node does not match tree in NodeID");
- return m_pTree == NULL;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeID::isValidNode() const
-{
- return m_pTree != NULL && m_pTree->isValidNode(m_nNode);
-}
-//-----------------------------------------------------------------------------
-
-// hashing
-size_t NodeID::hashCode() const
-{
- return hashAnyPointer(m_pTree) + 5*m_nNode;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int NodeID::toIndex() const
-{
- unsigned int n = m_nNode;
- if (m_pTree)
- {
- OSL_ENSURE(m_pTree->isValidNode(n),"Cannot produce valid Index for NodeID");
-
- n -= Tree::ROOT;
- }
- return n;
-}
-
-NodeRef NodeID::getNode() const {
- return m_pTree == 0 ? NodeRef() : m_pTree->getNode(m_nNode);
-}
-
-//-----------------------------------------------------------------------------
-bool operator < (NodeID const& lhs, NodeID const& rhs)
-{
- if (lhs.m_pTree == rhs.m_pTree)
- return lhs.m_nNode < rhs.m_nNode;
- else
- return std::less<Tree*>()(lhs.m_pTree,rhs.m_pTree);
-}
-
-//-----------------------------------------------------------------------------
-// class SubNodeID
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID()
-: m_sNodeName()
-, m_aParentID(0,0)
-{
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rParentNode, rtl::OUString const& aName)
-: m_sNodeName(aName)
-, m_aParentID(rTree,rParentNode)
-{
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID(NodeID const& rParentNodeID, rtl::OUString const& aName)
-: m_sNodeName(aName)
-, m_aParentID(rParentNodeID)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SubNodeID::isValidNode() const
-{
- if (!m_aParentID.isValidNode()) return false;
-
- OSL_ENSURE(m_sNodeName.getLength() != 0,"Invalid subnode ID: Missing name");
-
- rtl::Reference< Tree > aCheck( m_aParentID.getTree() );
- return aCheck->hasChild( m_aParentID.getNode(), m_sNodeName );
-}
-//-----------------------------------------------------------------------------
-
-bool operator < (SubNodeID const& lhs, SubNodeID const& rhs)
-{
- if (lhs.m_aParentID == rhs.m_aParentID)
- return !!(lhs.m_sNodeName < rhs.m_sNodeName);
- else
- return lhs.m_aParentID < rhs.m_aParentID;
-}
-
-//-----------------------------------------------------------------------------
-// Free functions
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- { (void)aTree; (void)aNode; }
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( view::ViewTreeAccess(aTree.get()).isSetNode(aNode), "ERROR: Configuration: Set node expected.");
-
- return validateElementName(sName);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateChildName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- { (void)aTree; (void)aNode; }
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( view::ViewTreeAccess(aTree.get()).isGroupNode(aNode), "ERROR: Configuration: Group node expected.");
-
- return validateNodeName(sName);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateChildOrElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if (view::ViewTreeAccess(aTree.get()).isSetNode(aNode))
- return validateElementName(sName);
-
- else
- return validateNodeName(sName);
-}
-//-----------------------------------------------------------------------------
-
-Path::Component validateElementPathComponent(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- rtl::OUString aElementName = validateElementName(sName,aTree,aNode);
-
- rtl::Reference<Template> aTemplate = aTree->extractElementInfo(aNode);
- if (aTemplate.is())
- {
- return Path::makeCompositeName( aElementName, aTemplate->getName() );
- }
- else
- {
- OSL_ENSURE(false, "WARNING: Cannot find element type information for building an element name");
- return Path::wrapElementName(aElementName);
- }
-}
-//-----------------------------------------------------------------------------
-
-static void implValidateLocalPath(RelativePath& _rPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- if (_rPath.isEmpty())
- throw InvalidName(_rPath.toString(), "is an empty path.");
-
- // FOR NOW: validate only the first component
- if (!view::ViewTreeAccess(aTree.get()).isSetNode(aNode))
- if (!_rPath.getFirstName().isSimpleName())
- throw InvalidName(_rPath.toString(), "is not valid in this context. Predicate expression used to select group member.");
-}
-//-----------------------------------------------------------------------------
-
-RelativePath validateRelativePath(rtl::OUString const& _sPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if ( Path::isAbsolutePath(_sPath) )
- {
- OSL_ENSURE(false, "Absolute pathes are not allowed here (compatibility support enabled");
- return validateAndReducePath(_sPath,aTree,aNode);
- }
-
- RelativePath aResult = RelativePath::parse(_sPath);
-
- implValidateLocalPath(aResult,aTree,aNode);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-RelativePath validateAndReducePath(rtl::OUString const& _sPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if ( !Path::isAbsolutePath(_sPath) )
- return validateRelativePath(_sPath,aTree,aNode);
-
- AbsolutePath aInputPath = AbsolutePath::parse(_sPath);
-
- RelativePath aStrippedPath = Path::stripPrefix( aInputPath, aTree->getAbsolutePath(aNode) );
-
- implValidateLocalPath(aStrippedPath,aTree,aNode);
-
- return aStrippedPath;
-}
-//-----------------------------------------------------------------------------
-
-bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, rtl::OUString const& aName)
-{
- return view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ? aTree->hasElement(aNode,aName) : aTree->hasChild(aNode,aName);
-}
-//-----------------------------------------------------------------------------
-
-bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, Path::Component const& aName)
-{
- return view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ? aTree->hasElement(aNode,aName) : aTree->hasChild(aNode,aName.getName());
-}
-//-----------------------------------------------------------------------------
-
-bool findInnerChildOrAvailableElement(rtl::Reference< Tree > & aTree, NodeRef& aNode, rtl::OUString const& aName)
-{
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) )
- {
- rtl::Reference< ElementTree > aElement = aTree->getAvailableElement(aNode,aName);
- if (aElement.is())
- {
- aTree = aElement.get();
- aNode = aTree->getRootNode();
- return true;
- }
- }
- else
- {
- NodeRef aChild = aTree->getChildNode(aNode,aName);
-
- if ( aChild.isValid() )
- {
- aNode = aChild;
- return true;
- }
- }
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getChildOrElement(rtl::Reference< Tree > & aTree, NodeRef const& aParentNode, rtl::OUString const& aName)
-{
- if (aTree->hasChildValue(aParentNode,aName))
- {
- return AnyNodeRef(aTree->getChildValue(aParentNode,aName));
- }
-
- else if ( view::ViewTreeAccess(aTree.get()).isSetNode(aParentNode) )
- {
- rtl::Reference< ElementTree > aElement = aTree->getElement(aParentNode,aName);
- if (aElement.is())
- {
- aTree = aElement.get();
- return AnyNodeRef(aTree->getRootNode());
- }
- }
-
- else
- {
- NodeRef aChild = aTree->getChildNode(aParentNode,aName);
-
- if ( aChild.isValid() )
- {
- return AnyNodeRef(aChild);
- }
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool findLocalInnerChild(rtl::Reference< Tree > const& aTree, NodeRef& aNode, Path::Component const& aName)
-{
- NodeRef aChild = aTree->getChildNode(aNode,aName.getName());
-
- if ( !aChild.isValid() ) return false;
-
- OSL_ENSURE( aName.isSimpleName(), "Child of group was found by request using element name format -failing");
- if ( !aName.isSimpleName()) return false;
-
- aNode = aChild;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool findElement(rtl::Reference< Tree > & aTree, NodeRef& aNode, Path::Component const& aName)
-{
- rtl::Reference< ElementTree > aElement = aTree->getElement(aNode,aName.getName());
-
- if (!aElement.is()) return false;
-
- rtl::Reference< Tree > aFoundTree = aElement.get();
-
- OSL_ENSURE(matches(aFoundTree->getExtendedRootName(),aName), "Element found, but type prefix does not match - failing");
- if ( !matches(aFoundTree->getExtendedRootName(),aName) ) return false;
-
- aTree = aFoundTree;
- aNode = aTree->getRootNode();
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-bool findLocalInnerDescendant(rtl::Reference< Tree > const& aTree, NodeRef& aNode, RelativePath& rPath)
-{
- while ( !rPath.isEmpty() )
- {
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ) return false;
-
- if ( ! findLocalInnerChild(aTree,aNode,rPath.getFirstName()) ) return false;
-
- rPath.dropFirstName();
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-bool findDeepInnerDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& rPath)
-{
- while ( !rPath.isEmpty() )
- {
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) )
- {
- if ( ! findElement(aTree,aNode,rPath.getFirstName()) ) return false;
- }
- else
- {
- if ( ! findLocalInnerChild(aTree,aNode,rPath.getFirstName()) ) return false;
- }
-
- rPath.dropFirstName();
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool identifiesLocalValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& aPath)
-{
- if ( aPath.getDepth() == 1 )
- {
- Path::Component const & aLocalName = aPath.getLocalName();
- rtl::OUString aName = aLocalName.getName();
-
- if (aTree->hasChildValue(aNode,aName))
- {
- OSL_ENSURE( aLocalName.isSimpleName(), "Value in group was found by request using element name format");
- if ( aLocalName.isSimpleName())
- return true;
- }
- }
- return false;
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getLocalDescendant(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& rPath)
-{
- NodeRef aNestedNode( aNode );
- RelativePath aRemainingPath(rPath);
-
- if ( findLocalInnerDescendant(aTree,aNestedNode,aRemainingPath) )
- {
- OSL_ASSERT(
- aNestedNode.isValid() &&
- aTree->isValidNode(aNestedNode.getOffset()));
- return AnyNodeRef(aNestedNode);
- }
-
- if ( identifiesLocalValue(aTree,aNestedNode,aRemainingPath) )
- {
- ValueRef aValue = aTree->getChildValue(aNestedNode,rPath.getLocalName().getName());
- OSL_ASSERT(aTree->isValidValueNode(aValue));
- return AnyNodeRef(aValue);
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getDeepDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& rPath)
-{
- if ( findDeepInnerDescendant(aTree,aNode,rPath) )
- {
- OSL_ASSERT(
- aNode.isValid() && aTree->isValidNode(aNode.getOffset()));
- return AnyNodeRef(aNode);
- }
-
- if ( identifiesLocalValue(aTree,aNode,rPath) )
- {
- ValueRef aValue = aTree->getChildValue(aNode,rPath.getLocalName().getName());
- OSL_ASSERT(aTree->isValidValueNode(aValue));
- return AnyNodeRef(aValue);
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-void getAllContainedNodes(rtl::Reference< Tree > const& aTree, std::vector<NodeID>& aList)
-{
- aList.clear();
-
- if (Tree* pImpl = aTree.get())
- {
- unsigned int nCount = pImpl->nodeCount();
- aList.reserve(nCount);
-
- unsigned int const nEnd = Tree::ROOT + nCount;
-
- for(unsigned int nOffset = Tree::ROOT;
- nOffset < nEnd;
- ++nOffset)
- {
- OSL_ASSERT( pImpl->isValidNode(nOffset) );
- aList.push_back( NodeID(pImpl,nOffset) );
- }
-
- OSL_ASSERT( aList.size()==nCount );
- }
-}
-//-----------------------------------------------------------------------------
-
-void getAllChildrenHelper(NodeID const& aNode, std::vector<SubNodeID>& aList)
-{
- aList.clear();
-
- if (Tree* pTreeImpl = aNode.getTree())
- {
- view::ViewTreeAccess aView(pTreeImpl);
-
- if (unsigned int const nParent = aNode.getOffset())
- {
- OSL_ASSERT( pTreeImpl->isValidNode(nParent) );
-
- if (aView.isGroupNodeAt(nParent))
- {
- view::GroupNode aParent = aView.getGroupNodeAt(nParent);
-
- {
- CollectValueIDs aCollector(aNode, aList);
- aView.dispatchToValues(aView.getGroupNodeAt(nParent),aCollector);
- }
-
- for(view::Node aChild = aParent.getFirstChild();
- aChild.is();
- aChild = aParent.getNextChild(aChild))
- {
- OSL_ASSERT( pTreeImpl->isValidNode(aChild.get_offset()) );
- aList.push_back( SubNodeID( aNode, pTreeImpl->getSimpleNodeName(aChild.get_offset())) );
- }
- }
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-NodeID findNodeFromIndex(rtl::Reference< Tree > const& aTree, unsigned int nIndex)
-{
- if (Tree* pImpl = aTree.get())
- {
- unsigned int nNode = nIndex + Tree::ROOT;
- if (pImpl->isValidNode(nNode))
- {
- return NodeID(pImpl,nNode);
- }
- }
- return NodeID(0,0);
-}
-
-//-----------------------------------------------------------------------------
-
-static inline bool isRootNode(NodeRef const& aNode)
-{
- return aNode.getOffset() == Tree::ROOT;
-}
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool isSimpleValueElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && isRootNode(aNode) && aView.isValueNode(aNode);
-}
-#endif
-//-----------------------------------------------------------------------------
-
-bool isStructuralNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && ! aView.isValueNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-bool isGroupNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && aView.isGroupNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-bool isSetNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && aView.isSetNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any getSimpleElementValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid Node");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- if (!aNode.isValid()) return com::sun::star::uno::Any();
-
- OSL_PRECOND( isSimpleValueElement(aTree, aNode), "ERROR: Configuration: Getting value is supported only for value nodes");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- return aView.getValue(aView.toValueNode(aNode));
-}
-
-//-----------------------------------------------------------------------------
- } // namespace configuration
-} // namespace configmgr
diff --git a/configmgr/source/treemgr/readonlyview.cxx b/configmgr/source/treemgr/readonlyview.cxx
deleted file mode 100644
index b0380d0474a0..000000000000
--- a/configmgr/source/treemgr/readonlyview.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "readonlyview.hxx"
-#include "viewfactory.hxx"
-#include "configexcept.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-void ReadOnlyViewStrategy::failReadOnly() const
-{
- OSL_ENSURE(false, "Changing operation attempted on read-only node data");
- throw configuration::ConstraintViolation("INTERNAL ERROR: Trying to update a read-only node");
-}
-
-//-----------------------------------------------------------------------------
-
-bool ReadOnlyViewStrategy::doHasChanges(Node const& ) const
-{
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doMarkChanged(Node const& )
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes ReadOnlyViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- node::Attributes aAttributes = _aAttributes;
- aAttributes.markReadonly();
- return aAttributes;
-}
-//-----------------------------------------------------------------------------
-
-configuration::ValueMemberNode ReadOnlyViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- if (_bForUpdate) failReadOnly();
-
- return ViewStrategy::doGetValueMember(_aNode,_aName,_bForUpdate);
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doInsertElement(SetNode const& , rtl::OUString const& , configuration::SetEntry const& )
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doRemoveElement(SetNode const& /*_aNode*/, rtl::OUString const& /*_aName*/)
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-extern NodeFactory& getReadAccessFactory();
-
-NodeFactory& ReadOnlyViewStrategy::doGetNodeFactory()
-{
- return getReadAccessFactory();
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createReadOnlyStrategy()
-{
- return new ReadOnlyViewStrategy();
-}
-
-//-----------------------------------------------------------------------------
-
- }
-}
diff --git a/configmgr/source/treemgr/readonlyview.hxx b/configmgr/source/treemgr/readonlyview.hxx
deleted file mode 100644
index 9e68f8910684..000000000000
--- a/configmgr/source/treemgr/readonlyview.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_READONLYVIEW_HXX_
-#define CONFIGMGR_READONLYVIEW_HXX_
-
-#include "viewstrategy.hxx"
-
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct read-only access
-//-----------------------------------------------------------------------------
-
- class ReadOnlyViewStrategy : public ViewStrategy
- {
- public:
- explicit
- ReadOnlyViewStrategy() {}
-
- protected:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
- private:
- void failReadOnly() const;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_READONLYVIEW_HXX_
diff --git a/configmgr/source/treemgr/roottree.cxx b/configmgr/source/treemgr/roottree.cxx
deleted file mode 100644
index 7adf4b111b61..000000000000
--- a/configmgr/source/treemgr/roottree.cxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "roottree.hxx"
-#include "roottreeimpl.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-#include "noderef.hxx"
-#include "nodechangeinfo.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// factory methods
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > createReadOnlyTree( AbsolutePath const& aRootPath,
- sharable::Node * cacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-{
- return new RootTree(view::createReadOnlyStrategy(),
- aRootPath, cacheNode, nDepth,
- aTemplateProvider
- );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > createUpdatableTree( AbsolutePath const& aRootPath,
- sharable::Node * cacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-{
- return new RootTree(view::createDeferredChangeStrategy(),
- aRootPath, cacheNode, nDepth,
- aTemplateProvider
- );
-}
-
-//-----------------------------------------------------------------------------
-// update on notify method
-//-----------------------------------------------------------------------------
-bool adjustToChanges( NodeChangesInformation& rLocalChanges,
- rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode,
- SubtreeChange const& aExternalChange)
-{
- OSL_PRECOND( !isEmpty(aBaseTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aBaseNode.isValid() && aBaseTree->isValidNode(aBaseNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- if (!isEmpty(aBaseTree.get()))
- {
- OSL_ENSURE(rLocalChanges.empty(), "Should pass empty container to adjustToChanges(...)");
-
- view::ViewTreeAccess(aBaseTree.get()).adjustToChanges(rLocalChanges, aBaseNode, aExternalChange);
-
- return !rLocalChanges.empty();
- }
- else
- return false;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class CommitHelper
-//-----------------------------------------------------------------------------
-struct CommitHelper::Data
-{
- std::vector< rtl::Reference<ElementTree> > m_aRemovedElements; // filled to keep the elements alive 'till after notification
-};
-
-//-----------------------------------------------------------------------------
-CommitHelper::CommitHelper(rtl::Reference< Tree > const& aTree)
-: m_pData( )
-, m_pTree( aTree.get() )
-{
- OSL_ENSURE(m_pTree, "INTERNAL ERROR: Unexpected NULL tree in commit helper");
-}
-//-----------------------------------------------------------------------------
-CommitHelper::~CommitHelper()
-{
-}
-
-//-----------------------------------------------------------------------------
-bool CommitHelper::prepareCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"ERROR: CommitHelper: Cannot commit without a tree");
- if (m_pTree == NULL)
- return false;
-
- OSL_ENSURE(m_pData.get() == NULL,"ERROR: CommitHelper: Need to reset before reusing");
- m_pData.reset( new Data() );
-
- // get and check the changes
- std::auto_ptr<SubtreeChange> pTreeChange(view::ViewTreeAccess(m_pTree).preCommitChanges(m_pData->m_aRemovedElements));
- if (pTreeChange.get() == NULL)
- return false;
-
- // find the name and path of the change
- OSL_ENSURE(m_pTree->getSimpleRootName() == pTreeChange->getNodeName(), "ERROR in Commit: Change name mismatch");
-
- // now fill the TreeChangeList
- rChangeList.setRootPath( m_pTree->getRootPath() );
- rChangeList.root.swap( *pTreeChange );
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-void CommitHelper::finishCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"INTERNAL ERROR: Nothing to finish without a tree");
-
- // find the name and path of the change
- AbsolutePath aPath = m_pTree->getRootPath();
-
- OSL_ENSURE( rChangeList.getRootNodePath().toString() == aPath.toString(), "ERROR: FinishCommit cannot handle rebased changes trees");
- if ( !matches(rChangeList.getRootNodePath(), aPath) )
- throw configuration::Exception("INTERNAL ERROR: FinishCommit cannot handle rebased changes trees");
-
- view::ViewTreeAccess(m_pTree).finishCommit(rChangeList.root);
-}
-//-----------------------------------------------------------------------------
-
-void CommitHelper::failedCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"INTERNAL ERROR: Nothing to finish without a tree");
-
- AbsolutePath aPath = m_pTree->getRootPath();
-
- OSL_ENSURE( rChangeList.getRootNodePath().toString() == aPath.toString(), "ERROR: FinishCommit cannot handle rebased changes trees");
- if ( !matches(rChangeList.getRootNodePath(), aPath) )
- throw configuration::Exception("INTERNAL ERROR: FinishCommit cannot handle rebased changes trees");
-
- view::ViewTreeAccess(m_pTree).recoverFailedCommit(rChangeList.root);
-}
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/roottreeimpl.hxx b/configmgr/source/treemgr/roottreeimpl.hxx
deleted file mode 100644
index 80932299899c..000000000000
--- a/configmgr/source/treemgr/roottreeimpl.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_ROOTTREEIMPL_HXX_
-#define CONFIGMGR_ROOTTREEIMPL_HXX_
-
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- /** is the Implementation class for class <type>Tree</type>.
- <p> Holds a list of <type>Node</type> which it allows to access by
- <type>unsigned int</type> (which is basically a one-based index).
- </p>
- <p> Also provides for navigation to the context this tree is located in
- </p>
- */
- class RootTree : public Tree
- {
- public:
- // Construction
- /// creates a Tree without a parent tree
- RootTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- AbsolutePath const& aRootPath,
- sharable::Node * cacheNode, unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
- // make it public
- private:
- virtual Path::Component doGetRootName() const;
- virtual void doFinishRootPath(Path::Rep& rPath) const;
-
- AbsolutePath m_aRootPath;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_ROOTTREEIMPL_HXX_
diff --git a/configmgr/source/treemgr/setnodeimpl.cxx b/configmgr/source/treemgr/setnodeimpl.cxx
deleted file mode 100644
index 96f8814b43ca..000000000000
--- a/configmgr/source/treemgr/setnodeimpl.cxx
+++ /dev/null
@@ -1,994 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "builddata.hxx"
-#include "setnodeimpl.hxx"
-#include "treefragment.hxx"
-#include "viewfactory.hxx"
-#include "configpath.hxx"
-#include "tree.hxx"
-#include "valuenodeimpl.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodevisitor.hxx"
-#include "change.hxx"
-#include "viewaccess.hxx"
-#include "nodeconverter.hxx"
-#include "treeactions.hxx"
-#include "treechangefactory.hxx"
-#include "collectchanges.hxx"
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-------------------------------------------------------------------------
-// initialization helpers
-//-------------------------------------------------------------------------
-namespace
-{
- class CollectElementTrees : data::SetVisitor
- {
- public:
- CollectElementTrees(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree* pParentTree, unsigned int nPos,
- unsigned int nDepth,
- rtl::Reference<Template> const& aTemplate,
- TemplateProvider const& aTemplateProvider)
- : m_aTemplate(aTemplate)
- , m_aTemplateProvider(aTemplateProvider)
- , m_xStrategy(_xStrategy)
- , m_pParentTree(pParentTree)
- , m_nPos(nPos)
- , m_nDepth(nDepth)
- {
- OSL_ENSURE(m_aTemplate.is(),"WARNING: Collecting a set without a template");
- }
-
- void collect(sharable::SetNode * node)
- {
- visitElements(node);
- }
-
- ElementTreeData create(sharable::TreeFragment * elementTree)
- {
- OSL_ENSURE(collection.empty(),"warning: trying to reuse a full collection");
-
- collection.resize(1); // make an empty one for case of failure
- this->visitTree(elementTree);
-
- OSL_ENSURE(collection.size()==2,"warning: could not create an element");
- return collection.back();
- }
-
- std::vector<ElementTreeData> collection;
-
- private:
- using SetVisitor::handle;
-
- virtual bool handle(sharable::Node * node);
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::TreeFragment * tree);
-
- void add(sharable::TreeFragment * node);
-
- rtl::Reference<Template> m_aTemplate;
- TemplateProvider m_aTemplateProvider;
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- Tree* m_pParentTree;
- unsigned int m_nPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- static
- rtl::OUString validatedName(ElementTreeData const& aTree)
- {
- OSL_ENSURE(aTree.isValid(), "INTERNAL ERROR: Unexpected null tree constructed in set node");
- if (!aTree.isValid()) throw Exception("INTERNAL ERROR: Unexpected null tree in set node");
-
- OSL_ENSURE(aTree->nodeCount(), "INTERNAL ERROR: Unexpected empty (!) tree constructed in set node");
- OSL_ENSURE(aTree->isValidNode(Tree::ROOT), "INTERNAL ERROR: Corrupt tree constructed in set node");
-
- return aTree->getSimpleRootName();
- }
- //-------------------------------------------------------------------------
-
- static
- bool isInDefault(SetEntry const& _anEntry)
- {
- if (!_anEntry.isValid()) return false;
-
- node::Attributes aAttributes = _anEntry.getTreeView().getRootAttributes();
-
- bool bReplaced = aAttributes.isReplacedForUser();
-
- return !bReplaced;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::ValueNode * node)
- {
- if (m_aTemplate.is())
- {
- OSL_ENSURE(m_aTemplate->isInstanceTypeKnown(),"ERROR: Template must have a validated type when building a set.");
- OSL_ENSURE(m_aTemplate->isInstanceValue(),"ERROR: Found a value node in a Complex Template Set");
-
- if (!m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Corrupt tree contains a value node within a template-set");
-
- com::sun::star::uno::Type aValueType = node->getValueType();
- com::sun::star::uno::Type aExpectedType = m_aTemplate->getInstanceType();
-
- if (aValueType.getTypeClass() != aExpectedType.getTypeClass() &&
- aExpectedType.getTypeClass() != uno::TypeClass_ANY &&
- aValueType.getTypeClass() != uno::TypeClass_VOID)
- {
- OSL_ENSURE(false, "WARNING: ValueType of set node does not match the template type");
- // throw TypeMismatch(aValueType.getTypeName(),aExpectedType.getTypeName(), "INTERNAL ERROR: - Corrupt tree contains mistyped value node within a value-set")));
- }
- }
- return false;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE(!node->isValue(), "Unexpected: Value-node dispatched to wrong handler");
- if (m_aTemplate.is())
- {
- OSL_ENSURE(m_aTemplate->isInstanceTypeKnown(),"ERROR: Template must have a validated type when building a set.");
- OSL_ENSURE(!m_aTemplate->isInstanceValue(),"ERROR: Found a non-leaf node in a Value Set");
-
- if (m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Corrupt tree contains a non-leaf node within a value-set");
-
- }
- return false;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::TreeFragment * tree)
- {
- bool done = visitNode(tree->getRootNode());
- if (!done) {
- add(tree);
- }
- return done;
- }
- //-------------------------------------------------------------------------
- void CollectElementTrees::add(sharable::TreeFragment * tree)
- {
- node::Attributes const aAttributes = tree->getAttributes();
-
- bool bReadonly = aAttributes.isReadonly();
- bool bInDefault = !aAttributes.isReplacedForUser();
-
- rtl::Reference<view::ViewStrategy> xStrategy = !bReadonly ? m_xStrategy : view::createReadOnlyStrategy();
-
- ElementTree * pNewTree;
- if (m_pParentTree)
- pNewTree = new ElementTree(xStrategy, *m_pParentTree, m_nPos, tree, m_nDepth, m_aTemplate, m_aTemplateProvider);
-
- else
- pNewTree = new ElementTree(xStrategy, tree, m_nDepth, m_aTemplate, m_aTemplateProvider);
-
- collection.push_back( ElementTreeData(pNewTree,bInDefault));
- }
-}
-
-//-------------------------------------------------------------------------
-// class ElementSet
-//-------------------------------------------------------------------------
-
-bool ElementSet::hasElement(rtl::OUString const& aName) const
-{
- return m_aData.find(aName) != m_aData.end();
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData* ElementSet::getElement(rtl::OUString const& aName)
-{
- Data::iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- return &it->second;
- else
- return 0;
-}
-//-------------------------------------------------------------------------
-
-
-ElementTreeData const* ElementSet::getElement(rtl::OUString const& aName) const
-{
- Data::const_iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- return &it->second;
- else
- return 0;
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::findElement(rtl::OUString const& aName)
-{
- ElementTreeData aRet;
-
- Data::iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- aRet = it->second;
-
- return aRet;
-}
-//-------------------------------------------------------------------------
-
-void ElementSet::insertElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry)
-{
- bool bInserted = m_aData.insert(Data::value_type(aName, aNewEntry)).second;
-
- OSL_ENSURE(bInserted,"INTERNAL ERROR: Inserted set Element was already present");
- if (!bInserted) throw Exception("INTERNAL ERROR: Inserted set Element was already present");
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry)
-{
- OSL_ENSURE(m_aData.find(aName) != m_aData.end(),"INTERNAL ERROR: Replaced set Element is not present");
-
- ElementTreeData& rElement = m_aData[aName];
-
- ElementTreeData aOld = rElement;
- rElement = aNewEntry;
-
- return aOld;
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::removeElement(rtl::OUString const& aName)
-{
- Data::iterator it = m_aData.find(aName);
- OSL_ENSURE(it != m_aData.end(),"INTERNAL ERROR: Removed set Element is not present");
-
- ElementTreeData aOld;
- if (it != m_aData.end())
- {
- aOld = it->second;
- m_aData.erase(it);
- }
- return aOld;
-}
-//-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class SetEntry
-//-----------------------------------------------------------------------------
-
-SetEntry::SetEntry(ElementTree* pTree_)
-: m_pTree(pTree_)
-{
- OSL_ENSURE(pTree_ == 0 || pTree_->isValidNode(Tree::ROOT),
- "INTERNAL ERROR: Invalid empty tree used for SetEntry ");
-}
-
-//-----------------------------------------------------------------------------
-
-view::ViewTreeAccess SetEntry::getTreeView() const
-{
- OSL_ENSURE(isValid(), "Cannot get View Access for NULL SetEntry");
- return view::ViewTreeAccess(m_pTree);
-}
-
-//-----------------------------------------------------------------------------
-//-------------------------------------------------------------------------
-
-//-------------------------------------------------------------------------
-// class SetNodeImpl
-//-------------------------------------------------------------------------
-
-SetNodeImpl::SetNodeImpl(sharable::SetNode * _pNodeRef,Template* pTemplate)
-: NodeImpl(reinterpret_cast<sharable::Node *>(_pNodeRef))
-,m_aTemplate(pTemplate)
-,m_aTemplateProvider()
-,m_pParentTree(0)
-,m_nContextPos(0)
-,m_aInit(0)
-{
-}
- // unbind the original
-//-----------------------------------------------------------------------------
-
-SetNodeImpl::~SetNodeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::rebuildFrom(SetNodeImpl& rOldData, sharable::SetNode * newNode)
-{
- m_aTemplate = rOldData.m_aTemplate;
- m_aTemplateProvider = rOldData.m_aTemplateProvider;
- m_pParentTree = rOldData.m_pParentTree;
- m_nContextPos = rOldData.m_nContextPos;
- m_aInit = rOldData.m_aInit;
-
- if (rOldData.implHasLoadedElements())
- {
- rOldData.doTransferElements(m_aDataSet);
- implRebuildElements(newNode);
- OSL_ASSERT(this->implHasLoadedElements());
- }
- else
- OSL_ASSERT(!this->implHasLoadedElements());
-
- rOldData.m_aTemplate.clear();
- rOldData.m_aTemplateProvider = TemplateProvider();
- rOldData.m_pParentTree = 0;
- rOldData.m_nContextPos = 0;
-
-}
-
-//-----------------------------------------------------------------------------
-void SetNodeImpl::doTransferElements(ElementSet& rReplacement)
-{
- m_aDataSet.swap(rReplacement);
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implRebuildElements(sharable::SetNode * newNode)
-{
- OSL_ENSURE(m_pParentTree,"Cannot rebuild set without context tree");
- rtl::Reference<view::ViewStrategy> xNewStrategy = m_pParentTree->getViewBehavior();
-
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop;
- ++it)
- {
- OSL_ASSERT(it->isValid());
- if (!it->isValid()) continue;
-
- ElementTreeData aElement = *it;
- rtl::OUString aName = aElement->getSimpleRootName();
-
- sharable::TreeFragment * aNewElementAccess = newNode->getElement(aName);
- OSL_ASSERT(
- aNewElementAccess != 0 && aElement->getOriginalTreeAccess() != 0);
-
- aElement->rebuild(xNewStrategy,aNewElementAccess);
- }
-}
-//-----------------------------------------------------------------------------
-
-sharable::SetNode * SetNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isSet());
- return &node->set;
-}
-//-----------------------------------------------------------------------------
-
-Tree* SetNodeImpl::getParentTree() const
-{
- OSL_ENSURE(m_pParentTree,"Set Node: Parent tree not set !");
- return m_pParentTree;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int SetNodeImpl::getContextOffset() const
-{
- OSL_ENSURE(m_nContextPos,"Set Node: Position within parent tree not set !");
- return m_nContextPos;
-}
-//-----------------------------------------------------------------------------
-
-bool SetNodeImpl::doIsEmpty() const
-{
- /*
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop;
- ++it)
- {
- if (!it->isEmpty())
- return false;
- }
- return true;
- */
- return m_aDataSet.isEmpty();
-}
-//-------------------------------------------------------------------------
-
-ElementTree* SetNodeImpl::doFindElement(rtl::OUString const& aName)
-{
- return m_aDataSet.findElement(aName).get();
-}
-//-------------------------------------------------------------------------
-void SetNodeImpl::doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree)
-{
- OSL_ENSURE(implHasLoadedElements(),"Should not query difference to default state for set that is not loaded");
- implDifferenceToDefaultState(_rChangeToDefault,_rDefaultTree);
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement)
-{
- return implAdjustToAddedElement(aName,aNewElement,aAddNodeChange.isReplacing());
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implAdjustToAddedElement(rtl::OUString const& aName, ElementTreeData const & aNewElement, bool _bReplacing)
-{
- { (void)_bReplacing; }
- OSL_ENSURE( validatedName(aNewElement) == aName, "Unexpected name on new element" );
-
- if (hasStoredElement(aName))
- {
- OSL_ENSURE( _bReplacing, "Added Element already exists - replacing" );
-
- ElementTreeData aOldElement = this->replaceElement(aName,aNewElement);
-
- return implCreateReplace(aName,aNewElement,aOldElement);
- }
- else
- {
- OSL_ENSURE( !_bReplacing, "Replaced Element doesn't exist - simply adding" );
- this->insertElement(aName,aNewElement);
-
- return implCreateInsert(aName,aNewElement);
- }
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& /*aRemoveNodeChange*/)
-{
- return implAdjustToRemovedElement(aName);
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implAdjustToRemovedElement(rtl::OUString const& aName)
-{
- if (ElementTreeData* pOriginal = getStoredElement(aName))
- {
- ElementTreeData aOldElement = *pOriginal;
- this->removeElement(aName);
-
- return implCreateRemove(aName,aOldElement);
- }
- else
- {
- OSL_ENSURE( false, "Removed Element doesn't exist - ignoring" );
- return 0;
- }
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateInsert(rtl::OUString const& aName, ElementTreeData const& aNewElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetInsertImpl(aFullName, aNewElement.tree, true);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateReplace(rtl::OUString const& aName, ElementTreeData const& aNewElement, ElementTreeData const& aOldElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetReplaceImpl(aFullName, aNewElement.tree, aOldElement.tree);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateRemove(rtl::OUString const& aName, ElementTreeData const& aOldElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetRemoveImpl(aFullName, aOldElement.tree);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::insertElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- m_aDataSet.insertElement(aName,aNewElement);
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- ElementTreeData aOldElement = m_aDataSet.replaceElement(aName,aNewElement);
- detach(aOldElement);
- return aOldElement;
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::removeElement(rtl::OUString const& aName)
-{
- ElementTreeData aOldElement = m_aDataSet.removeElement(aName);
- detach(aOldElement);
- return aOldElement;
-}
-//-------------------------------------------------------------------------
-SetNodeVisitor::Result SetNodeImpl::doDispatchToElements(SetNodeVisitor& aVisitor)
-{
- SetNodeVisitor::Result eRet = SetNodeVisitor::CONTINUE;
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- eRet = aVisitor.visit( SetEntry(it->get()) );
- }
- return eRet;
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::attach(ElementTreeData const& aNewElement, rtl::OUString const& aName)
-{
- // check for name (this also reject NULLs, therefore it should go first)
- rtl::OUString aActualName = validatedName(aNewElement);
-
- Tree* pParentContext = getParentTree();
- unsigned int nParentOffset = getContextOffset();
-
- OSL_ENSURE(nParentOffset != 0 && pParentContext != 0,"INTERNAL ERROR: Set has no context");
-
- bool bHasContext = (aNewElement->getContextTree() != 0);
-
- if (bHasContext)
- {
- if (aNewElement->getContextTree() != pParentContext)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: New set element belongs to another context tree" );
- throw Exception("INTERNAL ERROR: New set element belongs to another context tree" );
- }
- if (aNewElement->getContextNode() != nParentOffset)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: New set element belongs to another context node" );
- throw Exception("INTERNAL ERROR: New set element belongs to another context node" );
- }
- }
- else
- {
- OSL_ENSURE(aNewElement->getContextNode() == 0, "INTERNAL ERROR: New element has context position without a parent");
- aNewElement->moveTree(pParentContext,nParentOffset);
- }
-
- // check for and correct a misnomer - do only after parenthood is assured (else we don't own it anyways)
- if (aName != aActualName)
- {
- // OSL_ENSURE(aActualName.isEmpty(), "WARNING: Wrongly named tree inserted in set node");
- aNewElement->renameTree(aName);
-
- aActualName = validatedName(aNewElement);
- if (aName !=aActualName )
- {
- OSL_ENSURE(false, "INTERNAL ERROR: Cannot rename tree in set node");
- throw Exception("INTERNAL ERROR: Cannot rename tree for insertion into set node");
- }
- }
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::detach(ElementTreeData const& aOldElement)
-{
- if (aOldElement.isValid())
- {
- aOldElement->detachTree();
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::entryToElement(SetEntry const& _anEntry)
-{
- ElementTree * pTree = _anEntry.tree();
- return ElementTreeData(pTree, isInDefault(_anEntry));
-}
-//-------------------------------------------------------------------------
-
-
-SetElementChangeImpl* SetNodeImpl::doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& _aElementChange)
-{
- SetElementChangeImpl* pThisChange = NULL;
-
- if (ElementTreeData* pElement = getStoredElement(aName))
- {
- OSL_ASSERT(pElement->isValid());
-
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&_aElementChange))
- {
- // recurse to element tree
- Tree * elementTree = pElement->get();
-
- view::getViewBehavior(elementTree)->adjustToChanges(rLocalChanges, view::getRootNode(elementTree), *subtreeChange);
- }
- else if (ValueChange const * valueChange = dynamic_cast< ValueChange const * >(&_aElementChange))
- {
- // make an element for the old element
- std::auto_ptr<ValueNode> aOldNode = OTreeNodeConverter().createCorrespondingNode(*valueChange);
- aOldNode->setValue(valueChange->getOldValue());
-
- bool bWasDefault = (valueChange->getMode() == ValueChange::wasDefault);
-
- std::auto_ptr<INode> aBasePtr(aOldNode.release());
- rtl::OUString aElementTypeName = getElementTemplate()->getName();
- rtl::Reference< data::TreeSegment > aOldBaseTree = data::TreeSegment::create( aBasePtr, aElementTypeName );
-
- rtl::Reference<ElementTree> aOldElement = new ElementTree(aOldBaseTree, getElementTemplate(), getTemplateProvider());
-
- OSL_ASSERT(aOldBaseTree.is()); // the tree took ownership
- OSL_ASSERT(aOldElement->isFree()); // the tree is free-floating
-
- pThisChange = implCreateReplace(aName,*pElement,ElementTreeData(aOldElement,bWasDefault));
- }
- else
- OSL_ENSURE( false, "Unexpected kind of change to set element" );
-
- }
- else
- {
- // could be changed to do an insert instead (?)
- OSL_ENSURE( false, "Changed Element doesn't exist - (and not adding now)" );
- }
- return pThisChange;
-}
-//-------------------------------------------------------------------------
-
-bool SetNodeImpl::implHasLoadedElements() const
-{
- return m_aInit == 0; // cannot check whether init was called though ...
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::initElements(TemplateProvider const& aTemplateProvider,Tree& rParentTree,unsigned int nPos,unsigned int nDepth)
-{
- OSL_ENSURE(m_pParentTree == 0 || m_pParentTree == &rParentTree, "WARNING: Set Node: Changing parent");
- OSL_ENSURE(m_nContextPos == 0 || m_nContextPos == nPos, "WARNING: Set Node: Changing location within parent");
- m_pParentTree = &rParentTree;
- m_nContextPos = nPos;
-
- OSL_ENSURE(!m_aTemplateProvider.isValid() || !implHasLoadedElements(),"ERROR: Reinitializing set"); //doClearElements();
- OSL_ASSERT(doIsEmpty()); //doClearElements();
-
- OSL_ENSURE(!m_aTemplate.is() || m_aTemplate->isInstanceTypeKnown(),"ERROR: Need a type-validated template to fill a set");
- OSL_ENSURE(aTemplateProvider.isValid() || nDepth == 0 || m_aTemplate->isInstanceValue(), "ERROR: Need a template provider to fill a non-primitive set");
-
- if (nDepth > 0) // dont set a template provider for zero-depth sets
- {
- m_aInit = nDepth;
- m_aTemplateProvider = aTemplateProvider;
- }
-}
-//-----------------------------------------------------------------------------
-
-bool SetNodeImpl::implLoadElements()
-{
- if (m_aInit > 0)
- {
- OSL_ENSURE(!getElementTemplate().is() || getElementTemplate()->isInstanceTypeKnown(),"ERROR: Need a type-validated template to fill a set");
- OSL_ENSURE(getTemplateProvider().isValid() || getElementTemplate()->isInstanceValue(), "ERROR: Need a template provider to fill a non-primitive set");
-
- unsigned int nDepth = m_aInit;
- implInitElements(this->getDataAccess(),nDepth);
- m_aInit = 0;
- }
- OSL_ASSERT(implHasLoadedElements());
-
- return m_aInit == 0;
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implEnsureElementsLoaded()
-{
- if (!implLoadElements())
- throw ConstraintViolation("Trying to access set elements beyond the loaded nestíng level");
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implInitElements(sharable::SetNode * node, unsigned int nDepth)
-{
- Tree* pThisTree = getParentTree();
-
- OSL_ENSURE(pThisTree,"Cannot load elements of a set that has no parent tree");
-
- CollectElementTrees aCollector( pThisTree->getViewBehavior(), pThisTree, getContextOffset(),
- nDepth, getElementTemplate(), getTemplateProvider() );
- aCollector.collect(node);
-
- for(std::vector<ElementTreeData>::const_iterator it = aCollector.collection.begin(), stop = aCollector.collection.end();
- it != stop; ++it)
- {
- implInitElement(implValidateElement(*it));
- }
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::implInitElement(ElementTreeData const& aNewElement)
-{
- OSL_PRECOND(aNewElement.isValid(),"INTERNAL ERROR: Set element is NULL");
- OSL_ENSURE(!aNewElement->isFree(),"INTERNAL ERROR: Set element is free-floating");
-
- OSL_ENSURE(aNewElement->getContextTree() == getParentTree(),"INTERNAL ERROR: Set element has wrong context tree");
- OSL_ENSURE(aNewElement->getContextNode() == getContextOffset(),"INTERNAL ERROR: Set element has wrong context node");
-
- rtl::OUString aName = validatedName(aNewElement);
-
- OSL_ENSURE(aName.getLength() != 0,"INTERNAL ERROR: Unnamed element in set");
- OSL_ENSURE(m_aDataSet.getElement(aName) == 0,"INTERNAL ERROR: Duplicate element name in set");
-
- m_aDataSet.insertElement(aName,aNewElement);
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::makeAdditionalElement(rtl::Reference<view::ViewStrategy> const& _xStrategy, AddNode const& aAddNodeChange, unsigned int nDepth)
-{
- OSL_ENSURE(aAddNodeChange.wasInserted(), "Cannot integrate element that is not in tree yet");
-
- sharable::TreeFragment * aAddedTree = aAddNodeChange.getInsertedTree();
- // need 'unsafe', because ownership would be gone when notifications are sent
- if (aAddedTree != NULL)
- {
- CollectElementTrees aCollector( _xStrategy, getParentTree(), getContextOffset(),
- nDepth, getElementTemplate(), getTemplateProvider() );
-
- return implValidateElement(aCollector.create(aAddedTree));
- }
-
- return ElementTreeData();
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::implValidateElement(ElementTreeData const& aNewElement)
-{
- rtl::Reference<Template> aTemplate = getElementTemplate();
- OSL_ENSURE(aTemplate.is(),"INTERNAL ERROR: No template in set node");
- OSL_ENSURE(aTemplate->isInstanceTypeKnown(),"INTERNAL ERROR: Unspecifed template in set node");
-
- OSL_ENSURE(aNewElement.isValid(),"INTERNAL ERROR: Unexpected NULL element in set node");
- if (aNewElement.isValid())
- {
- if (aTemplate->isInstanceValue())
- {
- if (aNewElement->nodeCount() == 0)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: Invalid (empty) element tree in value set");
- throw Exception("INTERNAL ERROR: Invalid (empty) element tree in value set");
- }
- if (aNewElement->nodeCount() > 1)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: Complex element tree in value set");
- throw Exception("INTERNAL ERROR: Complex element tree in value set");
- }
-
- view::Node aElementRoot = view::getRootNode(aNewElement.get());
-
- OSL_ENSURE(aElementRoot.isValueNode(),"INTERNAL ERROR: Inserting complex type into value set node");
-
- view::ValueNode aValueNode(aElementRoot);
- com::sun::star::uno::Type aValueType = aValueNode.get_impl()->getValueType();
-
- OSL_ENSURE( aValueType.getTypeClass() != uno::TypeClass_INTERFACE,
- "INTERNAL ERROR: Inserting complex type into value set node");
-
- com::sun::star::uno::Type aElementType = aTemplate->getInstanceType();
-
- if (aValueType != aElementType)
- {
- // handle 'Any'
- if (aElementType.getTypeClass() != uno::TypeClass_ANY)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: ´Wrong value type inserting into value set");
- throw TypeMismatch(aValueType.getTypeName(), aElementType.getTypeName(),
- "- INTERNAL ERROR: Mistyped element in value set");
- }
- }
- }
- else // a complete tree
- {
- // TODO: add some validation here
- if (!aNewElement->isTemplateInstance())
- {
- throw TypeMismatch( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<Unknown> [Missing Template]")),
- aTemplate->getName(),
- " - Trying to insert element without template into set");
- }
- if (!aNewElement->isInstanceOf(aTemplate))
- {
- throw TypeMismatch( aNewElement->getTemplate()->getPathString(),
- aTemplate->getPathString(),
- " - Trying to insert element with wrong template into set");
- }
- }
- }
- return aNewElement;
-}
-//-------------------------------------------------------------------------
-
-namespace
-{
- //-------------------------------------------------------------------------
- class DiffToDefault : data::SetVisitor
- {
- SubtreeChange& m_rChange;
- ISubtree& m_rDefaultTree;
- OTreeChangeFactory& m_rChangeFactory;
- public:
- explicit
- DiffToDefault(SubtreeChange& _rChange, ISubtree& _rDefaultTree)
- : m_rChange(_rChange)
- , m_rDefaultTree(_rDefaultTree)
- , m_rChangeFactory( getDefaultTreeChangeFactory() )
- {
- }
-
- void diff(sharable::SetNode * actualTree)
- {
- translate(m_rDefaultTree);
- visitElements(actualTree);
- }
-
- private:
- void translate(ISubtree& _rDefaultTree);
- void handleDefault(rtl::Reference< data::TreeSegment > const & _pDefaultElement);
- void handleActual(sharable::TreeFragment * element);
-
- using SetVisitor::handle;
- virtual bool handle(sharable::TreeFragment * tree)
- { handleActual(tree); return false; }
- };
- //-------------------------------------------------------------------------
-
- void DiffToDefault::translate(ISubtree& _rDefaultTree)
- {
- rtl::OUString aTypeName = _rDefaultTree.getElementTemplateName();
- OSL_ENSURE(aTypeName.getLength(),"Cannot get element type for default set");
-
- CollectNames aCollector;
- aCollector.applyToChildren(_rDefaultTree);
-
- std::vector<rtl::OUString> const& aNames = aCollector.list();
-
- for(std::vector<rtl::OUString>::const_iterator it = aNames.begin(); it != aNames.end(); ++it)
- {
- std::auto_ptr<INode> aChild = _rDefaultTree.removeChild(*it);
- handleDefault( data::TreeSegment::create(aChild,aTypeName) );
- }
-
- }
- //-------------------------------------------------------------------------
-
- void DiffToDefault::handleDefault(rtl::Reference< data::TreeSegment > const &_pDefaultElement)
- {
- OSL_PRECOND(_pDefaultElement.is(), "Unexpected NULL default node");
-
- rtl::OUString sName = _pDefaultElement->fragment->getName();
-
- OSL_ENSURE(_pDefaultElement->fragment->getAttributes().isDefault(), "Missing default state on default element tree");
- OSL_ENSURE(_pDefaultElement->fragment->nodes[0].isDefault(), "Missing default attribute on default node");
-
- std::auto_ptr<AddNode> pAddIt( m_rChangeFactory.createAddNodeChange(_pDefaultElement, sName,true) );
-
- m_rChange.addChange(base_ptr(pAddIt));
- }
- //-------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- void DiffToDefault::handleActual(sharable::TreeFragment * element)
- {
- bool bDefaultElement = element->getRootNode()->isDefault();
-
- rtl::OUString sName = element->getName();
-
- if (Change* pDefaultNode = m_rChange.getChange(sName) )
- {
-
- if (AddNode * addNode = dynamic_cast< AddNode * >(pDefaultNode))
- {
- if (bDefaultElement)
- {
- rtl::Reference< data::TreeSegment > aDefaultTree = addNode->getNewTree();
- m_rDefaultTree.addChild(data::convertTree(aDefaultTree.is() ? aDefaultTree->fragment : 0, true));
-
- // no change needed - remove the change and recover the default
- m_rChange.removeChange(sName);
- }
- }
- else
- {
- // should never happen
- OSL_ASSERT(false);
- if (bDefaultElement) m_rChange.removeChange(sName);
- }
- }
- else
- {
- OSL_ENSURE(!bDefaultElement, "Node marked 'default' not found in actual default data");
-
- std::auto_ptr<RemoveNode> pRemoveIt( m_rChangeFactory.createRemoveNodeChange(sName,true) );
- // pRemoveIt->expectRemovedNode(pActualNode);
- m_rChange.addChange(base_ptr(pRemoveIt));
- }
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-void SetNodeImpl::implDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree) const
-{
- DiffToDefault(_rChangeToDefault,_rDefaultTree).diff( getDataAccess() );
-}
-//-----------------------------------------------------------------------------
-void SetNodeImpl::convertChanges(NodeChangesInformation& rLocalChanges, SubtreeChange const& rExternalChange,
- unsigned int nDepth)
-{
- OSL_ASSERT(nDepth > 0);
-
- if (Tree* pParentTree = this->getParentTree())
- {
- unsigned int nNode = getContextOffset();
-
- OSL_ENSURE(pParentTree->isValidNode(nNode), "Invalid context node in Set");
- OSL_ENSURE(view::Node(pParentTree, nNode).get_impl() == this,
- "Wrong context node in Set");
-
- CollectChanges aCollector(rLocalChanges, *pParentTree, nNode, getElementTemplate(), nDepth);
-
- aCollector.collectFromChildren(rExternalChange);
- }
- else
- OSL_ENSURE(false, "Missing context tree in Set");
-}
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/setnodeimpl.hxx b/configmgr/source/treemgr/setnodeimpl.hxx
deleted file mode 100644
index 7fb9b79823bf..000000000000
--- a/configmgr/source/treemgr/setnodeimpl.hxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SETNODEBEHAVIOR_HXX_
-#define CONFIGMGR_SETNODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-#include "tree.hxx"
-#include "template.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCUDED_MAP
-#include <map>
-#define INCUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class SubtreeChange;
- class AddNode;
- class RemoveNode;
- namespace view { class ViewTreeAccess; }
-//-----------------------------------------------------------------------------
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class SetElementChangeImpl;
-
-//-----------------------------------------------------------------------------
-
- struct SetEntry
- {
- SetEntry(ElementTree* _pTree);
-
- bool isValid() const { return m_pTree != 0; }
-
- ElementTree* tree() const { return m_pTree; };
-
- view::ViewTreeAccess getTreeView() const;
- private:
- ElementTree* m_pTree;
- };
- //-------------------------------------------------------------------------
-
- struct SetNodeVisitor
- {
- enum Result { DONE, CONTINUE };
- virtual Result visit(SetEntry const& anEntry) = 0;
- };
-
- //-----------------------------------------------------------------------------
-
- // basic implementations of set node contents
- //-----------------------------------------------------------------------------
-
- struct ElementTreeData
- {
- // construction
- ElementTreeData() : tree(), inDefault(false) {}
-
- ElementTreeData(rtl::Reference<ElementTree> const& _tree, bool _bDefault)
- : tree(_tree), inDefault(_bDefault) {}
-
- // ORef compatibility
- sal_Bool isValid() const { return this->tree.is(); }
- ElementTree* get() const { return this->tree.get(); }
- rtl::Reference<ElementTree> const& operator->() const { return this->tree; }
- ElementTree& operator*() const { return *get(); }
-
- // data
- rtl::Reference<ElementTree> tree;
- bool inDefault;
- };
- //-----------------------------------------------------------------------------
-
- class ElementSet
- {
- struct FastLess
- {
- bool operator ()(
- rtl::OUString const & a, rtl::OUString const & b) const
- {
- // first sort by length; order is immaterial, and it is fast
- return a.getLength() == b.getLength()
- ? a < b : a.getLength() < b.getLength();
- }
- };
-
- public:
- typedef std::map<rtl::OUString, ElementTreeData, FastLess> Data;
-
- // the following must be implemented by derived classes
- bool isEmpty() const { return m_aData.empty(); }
-
- bool hasElement(rtl::OUString const& aName) const;
- ElementTreeData* getElement(rtl::OUString const& aName);
- ElementTreeData const* getElement(rtl::OUString const& aName) const;
- ElementTreeData findElement(rtl::OUString const& aName);
-
- void insertElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry);
- ElementTreeData replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry);
- ElementTreeData removeElement(rtl::OUString const& aName);
-
- void clearElements() { m_aData.clear(); }
-
- void swap(ElementSet& aOther) { m_aData.swap(aOther.m_aData); }
-
- // STL style iteration
- class ConstIterator
- {
- public:
- ConstIterator(Data::const_iterator const& it) : m_base(it) {}
-
- ElementTreeData const& operator* () const { return m_base->second; }
- ElementTreeData const* operator->() const { return &m_base->second; }
-
- ConstIterator& operator++() { ++m_base; return *this; }
- ConstIterator operator++(int) { return ConstIterator(m_base++); }
-
- ConstIterator& operator--() { --m_base; return *this; }
- ConstIterator operator--(int) { return ConstIterator(m_base--); }
-
- friend bool operator ==(ConstIterator const& lhs, ConstIterator const& rhs)
- { return lhs.m_base == rhs.m_base; }
- friend bool operator !=(ConstIterator const& lhs, ConstIterator const& rhs)
- { return lhs.m_base != rhs.m_base; }
- private:
- Data::const_iterator m_base;
- };
- ConstIterator begin() const { return ConstIterator(m_aData.begin()); }
- ConstIterator end() const { return ConstIterator(m_aData.end()); }
-
- class Iterator
- {
- public:
- Iterator(Data::iterator const& it) : m_base(it) {}
-
- ElementTreeData& operator* () const { return m_base->second; }
- ElementTreeData* operator->() const { return &m_base->second; }
-
- Iterator& operator++() { ++m_base; return *this; }
- Iterator operator++(int) { return Iterator(m_base++); }
-
- Iterator& operator--() { --m_base; return *this; }
- Iterator operator--(int) { return Iterator(m_base--); }
-
- friend bool operator ==(Iterator const& lhs, Iterator const& rhs)
- { return lhs.m_base == rhs.m_base; }
- friend bool operator !=(Iterator const& lhs, Iterator const& rhs)
- { return lhs.m_base != rhs.m_base; }
-
- operator ConstIterator() const { return ConstIterator(m_base); }
- private:
- Data::iterator m_base;
- };
- Iterator begin() { return Iterator(m_aData.begin()); }
- Iterator end() { return Iterator(m_aData.end()); }
-
- Data::const_iterator beginNative() const { return m_aData.begin(); }
- Data::const_iterator endNative() const { return m_aData.end(); }
- private:
- Data m_aData;
- };
- //-------------------------------------------------------------------------
-
- // Basic implementation of a set node
- //-------------------------------------------------------------------------
-
- class SetNodeImpl : public NodeImpl
- {
- friend class view::ViewStrategy;
- ElementSet m_aDataSet;
- rtl::Reference<Template> m_aTemplate;
- TemplateProvider m_aTemplateProvider;
- Tree* m_pParentTree;
- unsigned int m_nContextPos;
-
- unsigned int m_aInit;
-
- public:
- SetNodeImpl(sharable::SetNode * _pNodeRef, Template* pTemplate);
-
- sharable::SetNode * getDataAccess() const;
-
- /// Get the template that describes elements of this set
- rtl::Reference<Template> getElementTemplate() const { return m_aTemplate; }
-
- /// Get a template provider that can create new elements for this set
- TemplateProvider getTemplateProvider() const { return m_aTemplateProvider; }
-
- void convertChanges(NodeChangesInformation& rLocalChanges, SubtreeChange const& rExternalChange, unsigned int nDepth);
-
- void insertElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- ElementTreeData replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- ElementTreeData removeElement(rtl::OUString const& aName);
-
- void rebuildFrom(SetNodeImpl& rOldData, sharable::SetNode * newNode);
-
- protected:
- ~SetNodeImpl();
-
- protected:
- // new overrideables
- virtual bool doIsEmpty() const;
- virtual ElementTree* doFindElement(rtl::OUString const& aName) ;
- virtual SetNodeVisitor::Result doDispatchToElements( SetNodeVisitor& aVisitor);
- virtual void doDifferenceToDefaultState( SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree);
-
- virtual SetElementChangeImpl* doAdjustToAddedElement( rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement);
- virtual SetElementChangeImpl* doAdjustToRemovedElement( rtl::OUString const& aName, RemoveNode const& aRemoveNodeChange);
- virtual SetElementChangeImpl* doAdjustChangedElement( NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange);
-
- virtual void doTransferElements(ElementSet& rReplacement);
-
- protected:
- // helpers
- Tree* getParentTree() const;
- unsigned int getContextOffset() const;
-
- ElementTreeData makeElement( SetEntry const & _anEntry);
- static ElementTreeData entryToElement(SetEntry const& _anEntry);
- view::ViewTreeAccess getElementView();
-
- /// Initialize the set data: Set context information, and build the view (actually loading the elements may be deferred)
- friend class TreeImplBuilder;
- void initElements(TemplateProvider const& aTemplateProvider, Tree& rParentTree, unsigned int nPos, unsigned int nDepth);
-
- protected:
- /// does this set contain any elements (loads elements if needed)
- bool implHasLoadedElements() const;
- bool implLoadElements();
- void implEnsureElementsLoaded();
- void implInitElements(sharable::SetNode * node, unsigned int nDepth);
- void implInitElement(ElementTreeData const& aNewElement);
-
- void implRebuildElements(sharable::SetNode * newNode);
- protected:
- SetElementChangeImpl* implCreateInsert ( rtl::OUString const& aName, ElementTreeData const& aNewElement) const;
- SetElementChangeImpl* implCreateReplace ( rtl::OUString const& aName, ElementTreeData const& aNewElement, ElementTreeData const& aOldElement) const;
- SetElementChangeImpl* implCreateRemove ( rtl::OUString const& aName, ElementTreeData const& aOldElement) const;
-
- SetElementChangeImpl* implAdjustToAddedElement( rtl::OUString const& aName, ElementTreeData const& aNewElement, bool _bReplacing);
- SetElementChangeImpl* implAdjustToRemovedElement( rtl::OUString const& aName);
-
- ElementTreeData makeAdditionalElement( rtl::Reference<view::ViewStrategy> const& _xStrategy, AddNode const& aAddNodeChange, unsigned int nDepth);
-
- ElementTreeData implValidateElement(ElementTreeData const& aNewElement);
-
- void implDifferenceToDefaultState( SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree) const;
- protected:
- bool hasStoredElement(rtl::OUString const& aName) const
- { return m_aDataSet.hasElement(aName); }
- ElementTreeData* getStoredElement(rtl::OUString const& aName)
- { return m_aDataSet.getElement(aName); }
- ElementTreeData const* getStoredElement(rtl::OUString const& aName) const
- { return m_aDataSet.getElement(aName); }
-
- ElementSet::Data::const_iterator beginElementSet() const
- { return m_aDataSet.beginNative(); }
- ElementSet::Data::const_iterator endElementSet() const
- { return m_aDataSet.endNative(); }
-
- void attach(ElementTreeData const& aNewElement, rtl::OUString const& aName);
- void detach(ElementTreeData const& aNewElement);
- };
-
-//-----------------------------------------------------------------------------
- // domain-specific 'dynamic_cast' replacement
- SetNodeImpl& AsSetNode (NodeImpl& rNode);
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_SETNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/template.cxx b/configmgr/source/treemgr/template.cxx
deleted file mode 100644
index 6a345a39716c..000000000000
--- a/configmgr/source/treemgr/template.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "node.hxx"
-#include "template.hxx"
-#include "templateimpl.hxx"
-#include "apitypes.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class TemplateProvider
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider()
-: m_aImpl()
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions)
-: m_aImpl( new TemplateProvider_Impl(xProvider,aOptions) )
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider(TemplateProvider const& aOther)
-: m_aImpl(aOther.m_aImpl)
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider& TemplateProvider::operator =(TemplateProvider const& aOther)
-{
- m_aImpl = aOther.m_aImpl;
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::~TemplateProvider()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class Template
-//-----------------------------------------------------------------------------
-
-Template::Template(rtl::OUString const& aName, rtl::OUString const& aModule,com::sun::star::uno::Type const& aType)
-: m_aName(aName)
-, m_aModule(aModule)
-, m_aInstanceType(aType)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool Template::isInstanceTypeKnown() const
-{
- OSL_ASSERT( TemplateImplHelper::getNoTypeAvailable().getTypeClass() == uno::TypeClass_VOID );
- return m_aInstanceType.getTypeClass() != uno::TypeClass_VOID;
-}
-//-----------------------------------------------------------------------------
-
-/// checks if this is a 'value' template
-bool Template::isInstanceValue() const
-{
- OSL_ENSURE( isInstanceTypeKnown(), "Template instance type unknown - cannot determine kind");
- return m_aInstanceType.getTypeClass() != uno::TypeClass_INTERFACE;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type Template::getInstanceType() const
-{
- OSL_ENSURE( isInstanceTypeKnown(), "Template instance type unknown - returning invalid (VOID) type");
- return m_aInstanceType;
-}
-//-----------------------------------------------------------------------------
-
-/// get the path where the template is located
-rtl::OUString Template::getPathString() const
-{
- TemplateName aNames(m_aName,m_aModule);
- return aNames.makePathString( );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> makeSetElementTemplate(sharable::SetNode * set, TemplateProvider const& _aProvider)
-{
- TemplateName aNames( set->getElementTemplateName(), set->getElementTemplateModule() );
- return TemplateImplHelper::makeElementTemplateWithType(aNames, _aProvider, set);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/templateimpl.cxx b/configmgr/source/treemgr/templateimpl.cxx
deleted file mode 100644
index e7bbd9b9bd3f..000000000000
--- a/configmgr/source/treemgr/templateimpl.cxx
+++ /dev/null
@@ -1,361 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include "templateimpl.hxx"
-#include "treemanager.hxx"
-#include "node.hxx"
-#include "nodevisitor.hxx"
-#include "strdecl.hxx"
-#include "typeconverter.hxx"
-#include "localizedtreeactions.hxx"
-#include "treeactions.hxx"
-#include "apitypes.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type TemplateName::resolveSimpleTypeName(rtl::OUString const& aName)
-{
- rtl::OUString sTypeName = aName;
- return parseTemplateName(sTypeName);
-}
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-rtl::OUString TemplateName::makeNativeTypeModuleName()
-{
- return rtl::OUString( TEMPLATE_MODULE_NATIVE_VALUE );
-}
-
-//-----------------------------------------------------------------------------
-rtl::OUString TemplateName::makeLocalizedTypeModuleName()
-{
- return rtl::OUString( TEMPLATE_MODULE_LOCALIZED_VALUE );
-}
-#endif
-//-----------------------------------------------------------------------------
-bool TemplateName::isSimpleTypeName() const
-{
- bool bIsSimple = (aModule.compareToAscii(TEMPLATE_MODULE_NATIVE_PREFIX,
- TEMPLATE_MODULE_NATIVE_PREFIX.getLength()) == 0);
-
- OSL_ENSURE(!bIsSimple ||
- aModule == makeNativeTypeModuleName() ||
- aModule == makeLocalizedTypeModuleName(),
- "ERROR: Invalid template module with native prefix found");
-
- return bIsSimple;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type TemplateName::resolveToSimpleType() const
-{
- com::sun::star::uno::Type aType;
- if ( isSimpleTypeName() )
- {
- aType = resolveSimpleTypeName( aName );
- }
- else
- OSL_ENSURE(false, "TemplateName::resolveToSimpleType must be called only for simple type name pairs");
- return aType;
-}
-//-----------------------------------------------------------------------------
-// class TemplateImplHelper
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> TemplateImplHelper::createNew (TemplateName const& aNames,com::sun::star::uno::Type const& aType)
-{
- return new Template(aNames.aName, aNames.aModule, aType);
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> TemplateImplHelper::makeElementTemplateWithType(TemplateName const& _aNames, TemplateProvider const& _aProvider, sharable::SetNode * set)
-{
- OSL_ENSURE(_aProvider.m_aImpl.is(), "ERROR: Cannot find a template without a provider");
-
- if (_aProvider.m_aImpl.is())
- return _aProvider.m_aImpl->makeElementTemplateWithType(_aNames, set);
-
- else
- return rtl::Reference<Template>(0);
-}
-//-----------------------------------------------------------------------------
-
-void TemplateImplHelper::assignActualType (Template& aTemplate,com::sun::star::uno::Type const& aType)
-{
- OSL_PRECOND( aType != getNoTypeAvailable(), "ERROR: Assigning NO type to a template" );
-
- if (!aTemplate.isInstanceTypeKnown())
- aTemplate.m_aInstanceType = aType;
-
- OSL_ENSURE(aTemplate.isInstanceTypeKnown(), "ERROR: Could not assign given type to a template");
- OSL_ENSURE(aTemplate.getInstanceType() == aType, "ERROR: Trying to change instance type of a template");
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class TemplateProvider_Impl
-//-----------------------------------------------------------------------------
-
-TemplateProvider_Impl::TemplateProvider_Impl(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions)
-: m_xProvider(xProvider)
-, m_aOptions(aOptions)
-, m_aRepository()
-{
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< data::TreeSegment > TemplateProvider_Impl::instantiate(rtl::Reference<Template> const& aTemplate)
-{
- if (aTemplate.is())
- {
- sharable::TreeFragment * aTemplateData = m_xProvider->requestTemplate(aTemplate->getName(), aTemplate->getModule());
-
- return cloneExpandedForLocale(aTemplateData, m_aOptions.getLocale());
- } else {
- return rtl::Reference< data::TreeSegment >();
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-namespace
-{
-//-----------------------------------------------------------------------------
- struct TypeDetector : data::SetVisitor
- {
- enum State
- {
- Contradicting = -1,
- NotFound = 0,
- SomeValue,
- VariousValue,
- SomeTree
- };
-
- State result;
- com::sun::star::uno::Type type;
-
- TypeDetector() : result(NotFound), type() {}
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::ValueNode * node);
- };
-//-----------------------------------------------------------------------------
- static com::sun::star::uno::Type detectNodeType(sharable::TreeFragment * element)
- {
- if (element == 0)
- throw configuration::Exception("Could not load required template to detect set elements");
-
- TypeDetector aDetector;
- aDetector.visitTree(element);
-
- switch(aDetector.result)
- {
- case TypeDetector::SomeTree: // found tree
- case TypeDetector::VariousValue: // found an Any
- case TypeDetector::SomeValue: // found a particular value type
- break;
-
-#ifdef DBG_UTIL
- case TypeDetector::NotFound: OSL_ENSURE(false,"Impossible Result: Node not handled"); if (false) // dirty abuse of case
- case TypeDetector::Contradicting: OSL_ENSURE(false,"Impossible Result: Node contradicts itself"); if (false) // dirty abuse of case
-#endif // DBG_UTIL
- default: OSL_ENSURE(false,"Impossible Result: Unknown result code");
-
- throw configuration::Exception("INTERNAL ERROR: Could not detect set element type from loaded instance");
- }
- return aDetector.type;
- }
-
- //-------------------------------------------------------------------------
- static bool detectElementType(com::sun::star::uno::Type& aType, sharable::SetNode * set)
- {
- TypeDetector aDetector;
- aDetector.visitElements(set);
-
- bool bResult = false;
- switch(aDetector.result)
- {
- case TypeDetector::SomeTree: // found tree
- case TypeDetector::VariousValue: // found an Any
- aType = aDetector.type;
- bResult = true;
- break;
-
- case TypeDetector::SomeValue: // found a value or an any
- case TypeDetector::NotFound: // found no element
- break;
-
- case TypeDetector::Contradicting:
- OSL_ENSURE(false,"Invalid Set: contains values and subtrees");
- break;
-
- default: OSL_ENSURE(false,"Unreachable code"); break;
- }
- return bResult;
- }
-//-----------------------------------------------------------------------------
-
-}
-//-----------------------------------------------------------------------------
-rtl::Reference<Template> TemplateProvider_Impl::makeElementTemplateWithType(TemplateName const& _aNames, sharable::SetNode * set)
-{
- TemplateRepository::iterator it = m_aRepository.find(_aNames);
-
- if (it == m_aRepository.end() || !it->second->isInstanceTypeKnown())
- {
- com::sun::star::uno::Type aType;
- if (_aNames.isSimpleTypeName()) // native type found
- {
- aType = _aNames.resolveToSimpleType();
-
- if (aType == TemplateImplHelper::getNoTypeAvailable())
- throw configuration::Exception("INTERNAL ERROR: Could not resolve native type");
- }
-
- else if (!detectElementType(aType, set))
- {
- OSL_ASSERT(_aNames.aName == set->getElementTemplateName());
- OSL_ASSERT(_aNames.aModule == set->getElementTemplateModule());
-
- sharable::TreeFragment * aTemplateData = m_xProvider->requestTemplate(_aNames.aName, _aNames.aModule);
-
- aType = detectNodeType(aTemplateData); // throws if necessary
- }
- OSL_ASSERT( aType != TemplateImplHelper::getNoTypeAvailable() );
-
- if (it == m_aRepository.end())
- it = m_aRepository.insert( TemplateRepository::value_type( _aNames, TemplateImplHelper::createNew(_aNames,aType) ) ).first;
-
- else
- TemplateImplHelper::assignActualType(*it->second, aType);
-
- OSL_ENSURE(it->second->isInstanceTypeKnown(), "No type assigned to Template");
- OSL_ENSURE(it->second->getInstanceType() == aType, "Inconsistent type found for Template");
- }
-
-#ifdef DBG_UTIL
- else
- {
- OSL_ENSURE(it->second->isInstanceTypeKnown(), "No type assigned to Template");
- com::sun::star::uno::Type aTestType;
- if (detectElementType(aTestType, set))
- OSL_ENSURE(it->second->getInstanceType() == aTestType, "Inconsistent type found for Template");
- }
-#endif // DBG_UTIL
-
- return it->second;
-
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-namespace
-{
-//-----------------------------------------------------------------------------
- bool TypeDetector::handle(sharable::ValueNode * node)
- {
- com::sun::star::uno::Type aFoundType = node->getValueType();
-
- bool isNullType = (aFoundType.getTypeClass() == uno::TypeClass_VOID);
- bool isAnyType = (aFoundType.getTypeClass() == uno::TypeClass_ANY);
-
- switch (this->result) // transition depends on previous state
- {
- case NotFound:
- this->type = aFoundType;
-
- if (isAnyType)
- this->result = VariousValue;
-
- else if (!isNullType)
- this->result = SomeValue;
-
- break;
-
- case SomeValue:
- if (!isNullType && this->type != aFoundType)
- {
- this->result = VariousValue;
- this->type = configapi::getAnyType();
- OSL_ASSERT(type.getTypeClass() == uno::TypeClass_ANY);
- }
- break;
-
- case VariousValue: // remain unchanged - type already is 'Any'
- break;
-
- case SomeTree: OSL_ENSURE(false, "Found value node does not match previous (tree) sibling");
- default:
- this->result = Contradicting;
- break;
- }
- return false; // always continue to detect errors in data
- }
-//-----------------------------------------------------------------------------
- bool TypeDetector::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE(!node->isValue(), "Value node dipatched to wrong handler");
- switch (this->result) // transition depends on previous state
- {
- case NotFound:
- this->type = configapi::getUnoInterfaceType();
- this->result = SomeTree;
- break;
-
- case SomeTree: // remain unchanged - type already is Tree
- break;
-
- case SomeValue:
- case VariousValue: OSL_ENSURE(false, "Found Subtree node does not match previous (value) sibling");
- default:
- this->result = Contradicting;
- break;
- }
- return false; // always continue to detect errors in data
- }
-
-//-----------------------------------------------------------------------------
-} // anonymous
-//-----------------------------------------------------------------------------
- } // configuration
-} // configmgr
-
diff --git a/configmgr/source/treemgr/templateimpl.hxx b/configmgr/source/treemgr/templateimpl.hxx
deleted file mode 100644
index acfea7488f5a..000000000000
--- a/configmgr/source/treemgr/templateimpl.hxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TEMPLATEIMPL_HXX_
-#define CONFIGMGR_TEMPLATEIMPL_HXX_
-
-#include "template.hxx"
-#include "configpath.hxx"
-#include "requestoptions.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data { class TreeSegment; }
-//-----------------------------------------------------------------------------
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-
- //-----------------------------------------------------------------------------
- // class TemplateName
- //-----------------------------------------------------------------------------
- struct TemplateName
- {
- //-----------------------------------------------------------------
- rtl::OUString aName, aModule;
-
- //-----------------------------------------------------------------
- TemplateName()
- : aName()
- , aModule()
- {}
-
- TemplateName(rtl::OUString const& aName_)
- : aName(aName_)
- , aModule()
- {}
-
- TemplateName(rtl::OUString const& aName_, rtl::OUString const& aModule_)
- : aName(aName_)
- , aModule(aModule_)
- {}
-
- //-----------------------------------------------------------------
-
- /// compose the path where the template is located
- rtl::OUString makePathString() const
- {
- rtl::OUStringBuffer aBuffer;
-
- if (aModule.getLength() != 0)
- aBuffer.append( this->aModule ).append(sal_Unicode('/'));
-
- aBuffer.append( this->aName );
-
- return aBuffer.makeStringAndClear();
- }
- //-----------------------------------------------------------------
- bool isEmpty() const
- {
- return aName.getLength() == 0;
- }
-
- bool isSimpleTypeName() const;
-
- com::sun::star::uno::Type resolveToSimpleType() const;
- //-----------------------------------------------------------------
-
- bool operator<(TemplateName const& aOther) const
- {
- return (aModule == aOther.aModule) ? (aName < aOther.aName) : (aModule < aOther.aModule);
- }
-
- //-----------------------------------------------------------------
- static com::sun::star::uno::Type resolveSimpleTypeName(rtl::OUString const& aName);
- //-----------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
- static rtl::OUString makeNativeTypeModuleName();
- //-----------------------------------------------------------------
- static rtl::OUString makeLocalizedTypeModuleName();
-#endif
- //-----------------------------------------------------------------
- };
- //-------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- // class TemplateImplHelper
- //---------------------------------------------------------------------
-
- class TemplateImplHelper
- {
- public:
- //-----------------------------------------------------------------
-
- static com::sun::star::uno::Type getNoTypeAvailable()
- {
- return getVoidCppuType();
- }
- //-----------------------------------------------------------------
-
- static void assignActualType (Template& aTemplate,com::sun::star::uno::Type const& aType);
- //-----------------------------------------------------------------
-
- static rtl::Reference<Template> makeElementTemplateWithType(TemplateName const& aNames, TemplateProvider const& _aProvider, sharable::SetNode * set);
- //-----------------------------------------------------------------
-
- static rtl::Reference<Template> createNew (TemplateName const& aNames,com::sun::star::uno::Type const& aType);
- //-----------------------------------------------------------------
- };
- //-------------------------------------------------------------------------
-
- typedef std::map< TemplateName, rtl::Reference<Template> > TemplateRepository;
- //-------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- // class TemplateProvider_Impl
- //---------------------------------------------------------------------
-
- struct TemplateProvider_Impl : salhelper::SimpleReferenceObject
- {
- TemplateProvider_Impl(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions);
-
- rtl::Reference< data::TreeSegment > instantiate(rtl::Reference<Template> const& aTemplate);
-
- rtl::Reference<Template> makeElementTemplateWithType(TemplateName const& _aNames, sharable::SetNode * set);
- private:
- rtl::Reference< TreeManager > m_xProvider;
- RequestOptions m_aOptions;
-
- TemplateRepository m_aRepository;
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_TEMPLATEIMPL_HXX_
diff --git a/configmgr/source/treemgr/treeimpl.cxx b/configmgr/source/treemgr/treeimpl.cxx
deleted file mode 100644
index 0e72d3239ffd..000000000000
--- a/configmgr/source/treemgr/treeimpl.cxx
+++ /dev/null
@@ -1,1370 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "anynoderef.hxx"
-#include "builddata.hxx"
-#include "configset.hxx"
-#include "tracer.hxx"
-#include "tree.hxx"
-#include "roottreeimpl.hxx"
-#include "nodeimpl.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "noderef.hxx"
-#include "template.hxx"
-#include "nodevisitor.hxx"
-#include "valueref.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "valuenodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-#include "nodefactory.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class TreeImplBuilder - friend of Tree
-//-----------------------------------------------------------------------------
-
-/** is a visitor-style algorithm to construct a <type>Tree::NodeList</type>
- representing a configuration hierarchy
-*/
-class TreeImplBuilder : public data::NodeVisitor
-{
-public:
- /** constructs a TreeImplBuilder to append onto <var>rList</var>
- the products of <var>rFactory</var> up to depth <var>nDepth</var>
- */
- TreeImplBuilder(
- TemplateProvider const& aTemplateProvider,
- rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rTree
- )
- : m_xStrategy(_xStrategy)
- , m_aTemplateProvider(aTemplateProvider)
- , m_rFactory(_xStrategy->getNodeFactory())
- , m_rTree(rTree)
- , m_nParent(0)
- , m_nDepthLeft(rTree.m_nDepth)
- {
- OSL_ASSERT(m_rTree.m_aNodes.empty());
- OSL_DEBUG_ONLY(m_bMemberCheck = false);
- m_rTree.m_xStrategy = _xStrategy;
- }
-
-private:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::GroupNode * node);
-
- virtual bool handle(sharable::SetNode * node);
-
- /// add a Node for group node <var>_aGroup</var> to the list
- void addGroup(sharable::GroupNode * group);
- /// add a Node for set node <var>_aSet</var> to the list
- void addSet(sharable::SetNode * set);
- /// add a Node for value node <var>rValue</var> to the list
- void addValueElement(sharable::ValueNode * value);
- /// add a Member for value node <var>rValue</var> to the list
- void addValueMember(sharable::ValueNode * value);
-
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- TemplateProvider m_aTemplateProvider;
- view::NodeFactory& m_rFactory;
- Tree& m_rTree;
- unsigned int m_nParent;
- unsigned int m_nDepthLeft;
-#if OSL_DEBUG_LEVEL > 0
- bool m_bMemberCheck;
-#endif
-};
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::ValueNode * node)
-{
- if (m_nParent == 0)
- addValueElement(node); // if it is the root it is a value set element
- else
- addValueMember(node); // if it is not the root it is a group member
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::GroupNode * node)
-{
- addGroup(node);
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::SetNode * node)
-{
- addSet(node);
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addValueElement(sharable::ValueNode * value)
-{
- rtl::Reference<NodeImpl> aValueNode( m_rFactory.makeValueNode(value) );
- OSL_ENSURE( aValueNode.is(), "could not make value node wrapper" );
-
- OSL_ENSURE( m_nParent == 0, "Adding value element that is not root of its fragment" );
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aValueNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aValueNode, value->info.getName(), m_nParent) );
- }
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addValueMember(sharable::ValueNode *)
-{
- // nothing to do
- OSL_DEBUG_ONLY(m_bMemberCheck = true);
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addGroup(sharable::GroupNode * group)
-{
- rtl::Reference<NodeImpl> aGroupNode( m_rFactory.makeGroupNode(group) );
- OSL_ENSURE( aGroupNode.is(), "could not make group node wrapper" );
-
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aGroupNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aGroupNode,group->info.getName(),m_nParent) );
-
- // now fill in group members
- if (m_nDepthLeft > 0)
- {
- unsigned int nSaveParent = m_nParent;
- decDepth(m_nDepthLeft);
-
- m_nParent = m_rTree.m_aNodes.size() + Tree::ROOT - 1;
-
- #if OSL_DEBUG_LEVEL > 0
- bool bSaveMemberCheck = m_bMemberCheck;
- m_bMemberCheck = false;
- #endif
-
- // now recurse:
- this->visitChildren(group);
-
- OSL_ENSURE(m_nParent < m_rTree.m_aNodes.size() || m_bMemberCheck,
- "WARNING: Configuration: Group within requested depth has no members");
-
- OSL_DEBUG_ONLY(m_bMemberCheck = bSaveMemberCheck);
-
- incDepth(m_nDepthLeft);
- m_nParent = nSaveParent;
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addSet(sharable::SetNode * set)
-{
- rtl::Reference<Template> aTemplate = makeSetElementTemplate(set, m_aTemplateProvider);
- OSL_ASSERT(aTemplate.is());
- OSL_ENSURE(aTemplate->isInstanceTypeKnown(),"ERROR: Cannor create set instance without knowing the instance type");
-
- rtl::Reference<NodeImpl> aSetNode( m_rFactory.makeSetNode(set, aTemplate.get()) );
- OSL_ENSURE( aSetNode.is(), "could not make set node wrapper" );
-
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aSetNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aSetNode, set->info.getName(), m_nParent) );
-
- // this also relies on one based offsets
- unsigned int nNodeAdded = m_rTree.m_aNodes.size() + Tree::ROOT - 1;
-
- OSL_ASSERT(&m_rTree.m_aNodes.back().nodeImpl() == aSetNode.get());
- static_cast<SetNodeImpl&>(*aSetNode).initElements(m_aTemplateProvider, m_rTree, nNodeAdded, m_nDepthLeft);
- }
-}
-
-namespace {
- class FindNonDefaultElement: public SetNodeVisitor {
- public:
- static bool hasNonDefaultElement(
- view::ViewTreeAccess const & view, view::SetNode const & set)
- {
- FindNonDefaultElement visitor;
- return view.dispatchToElements(set, visitor) == DONE;
- }
-
- protected:
- virtual Result visit(SetEntry const & entry) {
- OSL_ASSERT(entry.isValid());
- rtl::Reference< Tree > tree(entry.tree());
- OSL_ASSERT(tree.is());
- node::Attributes atts(tree->getAttributes(tree->getRootNode()));
- // A set element is considered default iff it is not replaced/added:
- bool dflt = !atts.isReplacedForUser();
- return dflt ? CONTINUE : DONE;
- }
- };
-
- class SetVisitorAdapter: public SetNodeVisitor {
- public:
- explicit SetVisitorAdapter(NodeVisitor & visitor): m_visitor(visitor) {}
-
- protected:
- virtual Result visit(SetEntry const & entry) {
- OSL_ASSERT(entry.isValid());
- rtl::Reference< Tree > tree(entry.tree());
- if (tree.is()) {
- OSL_ASSERT(
- Result(NodeVisitor::DONE) == SetNodeVisitor::DONE &&
- Result(NodeVisitor::CONTINUE) == SetNodeVisitor::CONTINUE);
- return Result(tree->visit(tree->getRootNode(), m_visitor));
- } else {
- return CONTINUE;
- }
- }
-
- private:
- NodeVisitor & m_visitor;
- };
-
- class GroupVisitorAdapter: public GroupMemberVisitor {
- public:
- GroupVisitorAdapter(
- rtl::Reference< Tree > const & parentTree,
- NodeRef const & parentNode, NodeVisitor & visitor):
- m_parentTree(parentTree), m_parentPos(parentNode.getOffset()),
- m_visitor(visitor)
- {
- OSL_ASSERT(
- !isEmpty(parentTree.get()) && parentNode.isValid() &&
- parentTree->isValidNode(parentNode.getOffset()));
- }
-
- protected:
- virtual Result visit(ValueMemberNode const & value) {
- OSL_ASSERT(
- value.isValid() &&
- Result(NodeVisitor::DONE) == GroupMemberVisitor::DONE &&
- Result(NodeVisitor::CONTINUE) == GroupMemberVisitor::CONTINUE);
- return Result(
- m_parentTree->visit(
- ValueRef(value.getNodeName(), m_parentPos), m_visitor));
- }
-
- private:
- rtl::Reference< Tree > m_parentTree;
- unsigned int m_parentPos;
- NodeVisitor & m_visitor;
- };
-}
-
-//-----------------------------------------------------------------------------
-// class NodeData
-//-----------------------------------------------------------------------------
-
-NodeData::NodeData(rtl::Reference<NodeImpl> const& aSpecificNode, rtl::OUString const& aName, unsigned int nParent)
-: m_pSpecificNode(aSpecificNode)
-, m_aName_(aName)
-, m_nParent(nParent)
-{
-}
-
-//-----------------------------------------------------------------------------
-
-void NodeData::rebuild(rtl::Reference<view::ViewStrategy> const & _xNewStrategy, sharable::Node * newData)
-{
- rtl::Reference<NodeImpl> aNewImpl;
- if (this->isSetNode())
- {
- sharable::SetNode * newSet = newData == 0 ? 0 : newData->setData();
- aNewImpl = _xNewStrategy->getNodeFactory().makeSetNode(newSet, 0);
-
- SetNodeImpl & rOldSetData = this->setImpl();
- SetNodeImpl & rNewSetData = static_cast<SetNodeImpl &>(*aNewImpl);
-
- rNewSetData.rebuildFrom(rOldSetData, newSet);
- }
- else if (this->isGroupNode())
- aNewImpl = _xNewStrategy->getNodeFactory().makeGroupNode(newData == 0 ? 0 : newData->groupData());
-
- else if (this->isValueElementNode())
- aNewImpl = _xNewStrategy->getNodeFactory().makeValueNode(newData == 0 ? 0 : newData->valueData());
-
- m_pSpecificNode = aNewImpl;
-}
-
-//-----------------------------------------------------------------------------
-
-bool NodeData::isSetNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isSet();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeData::isValueElementNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isValue();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeData::isGroupNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isGroup();
-}
-//-----------------------------------------------------------------------------
-
-SetNodeImpl& NodeData::implGetSetImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isSetNode());
-
- if (!isSetNode())
- throw Exception( "INTERNAL ERROR: Node is not a set node. Cast failing." );
-
- return static_cast<SetNodeImpl&>(*m_pSpecificNode);
-}
-//---------------------------------------------------------------------
-
-GroupNodeImpl& NodeData::implGetGroupImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isGroupNode());
-
- if (!isGroupNode())
- throw Exception( "INTERNAL ERROR: Node is not a group node. Cast failing." );
-
- return static_cast<GroupNodeImpl&>(*m_pSpecificNode);
-}
-//---------------------------------------------------------------------
-
-ValueElementNodeImpl& NodeData::implGetValueImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isValueElementNode());
-
- if (!isValueElementNode())
- throw Exception( "INTERNAL ERROR: Node is not a value node. Cast failing." );
-
- return static_cast<ValueElementNodeImpl&>(*m_pSpecificNode);
-}
-
-sharable::Node * NodeData::getOriginalNodeAccess() const
-{
- return m_pSpecificNode->getOriginalNodeAccess();
-}
-
-NodeImpl & NodeData::implGetNodeImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- return *m_pSpecificNode;
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class Tree
-//-----------------------------------------------------------------------------
-
-/// creates a Tree for a detached, virgin instance of <var>aTemplate</var>
-Tree::Tree( )
-: m_aNodes()
-, m_pParentTree(0)
-, m_nParentNode(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-Tree::Tree( Tree& rParentTree, unsigned int nParentNode )
-: m_aNodes()
-, m_pParentTree(&rParentTree)
-, m_nParentNode(nParentNode)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-Tree::~Tree()
-{
-}
-//-----------------------------------------------------------------------------
-
-void Tree::disposeData()
-{
- m_aNodes.clear();
-}
-
-bool Tree::isRootNode(NodeRef const & node) const {
- OSL_ASSERT(
- nodeCount() != 0 && (!node.isValid() || isValidNode(node.getOffset())));
- return node.isValid() && node.getOffset() == ROOT;
-}
-
-NodeRef Tree::getRootNode() const {
- OSL_ASSERT(nodeCount() != 0);
- return NodeRef(ROOT, m_nDepth);
-}
-
-NodeRef Tree::getContextNodeRef() const {
- OSL_ASSERT(nodeCount() != 0 && (m_pParentTree == 0 || m_nParentNode != 0));
- return m_pParentTree == 0
- ? NodeRef() : m_pParentTree->getNode(m_nParentNode);
-}
-
-bool Tree::isValidValueNode(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0);
- if (!(value.isValid() &&
- value.checkValidState() &&
- isValidNode(value.m_nParentPos) &&
- view::ViewTreeAccess(this).isGroupNodeAt(value.m_nParentPos) &&
- getMemberNode(value).isValid()))
- {
- return false;
- }
- OSL_ASSERT(value.m_sNodeName.getLength() != 0); // old value handling?
- return true;
-}
-
-#if OSL_DEBUG_LEVEL > 0
-bool Tree::isValidAnyNode(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0);
- return node.isValid() && isValidNode(node.m_nUsedPos) &&
- (node.isNode() ||
- (view::ViewTreeAccess(this).isGroupNodeAt(node.m_nUsedPos) &&
- getMemberNode(node.toValue()).isValid()));
-}
-#endif
-
-bool Tree::hasElements(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth" );
- }
- view::ViewTreeAccess v(this);
- return v.isSetNode(node) && !v.isEmpty(v.toSetNode(node));
-}
-
-bool Tree::hasElement(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isSetNode(node) &&
- v.findElement(v.toSetNode(node), name).isValid();
-}
-
-bool Tree::hasElement(NodeRef const & node, Path::Component const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findElement(v.toSetNode(node), name.getName()));
- // Check if types match:
- return e.isValid() &&
- Path::matches(e.tree()->getExtendedRootName(), name);
- } else {
- return false;
- }
-}
-
-rtl::Reference< ElementTree > Tree::getElement(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findElement(v.toSetNode(node), name));
- return rtl::Reference< ElementTree >(e.tree());
- } else {
- return rtl::Reference< ElementTree >();
- }
-}
-
-rtl::Reference< ElementTree > Tree::getAvailableElement(
- NodeRef const & node, rtl::OUString const & name)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findAvailableElement(v.toSetNode(node), name));
- return rtl::Reference< ElementTree >(e.tree());
- } else {
- return rtl::Reference< ElementTree >();
- }
-}
-
-bool Tree::hasChildren(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode g(v.toGroupNode(node));
- return v.hasValue(g) || g.getFirstChild().is();
- } else {
- return false;
- }
-}
-
-bool Tree::hasChildValue(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.hasValue(v.toGroupNode(node), name);
-}
-
-bool Tree::hasChildNode(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.toGroupNode(node).findChild(name).is();
-}
-
-bool Tree::hasChild(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode g(v.toGroupNode(node));
- return v.hasValue(g, name) || g.findChild(name).is();
- } else {
- return false;
- }
-}
-
-ValueRef Tree::getChildValue(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.hasValue(v.toGroupNode(node), name)
- ? ValueRef(name, node.getOffset()) : ValueRef();
-}
-
-NodeRef Tree::getChildNode(NodeRef const & node, rtl::OUString const & name)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return NodeRef(
- (v.isGroupNode(node)
- ? v.toGroupNode(node).findChild(name).get_offset() : 0),
- childDepth(node.getDepth()));
-}
-
-AnyNodeRef Tree::getAnyChild(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- unsigned int n = 0;
- if (v.isGroupNode(node)) {
- if (v.hasValue(v.toGroupNode(node), name)) {
- return AnyNodeRef(name, node.getOffset());
- }
- n = v.toGroupNode(node).findChild(name).get_offset();
- }
- return AnyNodeRef(n, childDepth(node.getDepth()));
-}
-
-node::Attributes Tree::getAttributes(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- return view::ViewTreeAccess(this).getAttributes(node);
-}
-
-node::Attributes Tree::getAttributes(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- if (node.isNode()) {
- return view::ViewTreeAccess(this).getAttributes(node.toNode());
- } else {
- return getMemberNode(node.toValue()).getAttributes();
- }
-}
-
-node::Attributes Tree::getAttributes(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).getAttributes();
-}
-
-com::sun::star::uno::Type Tree::getUnoType(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).getValueType();
-}
-
-NodeRef Tree::getParent(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(!v.makeNode(getRootNode()).getParent().is());
- view::Node p(v.makeNode(node).getParent());
- OSL_ASSERT(isValidNode(p.get_offset()));
- return NodeRef(p.get_offset(), parentDepth(node.getDepth()));
-}
-
-NodeRef Tree::getParent(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- unsigned int n = value.m_nParentPos;
- OSL_ASSERT(n == 0 || value.m_sNodeName.getLength() != 0);
- return getNode(n);
-}
-
-AbsolutePath Tree::getAbsolutePath(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- Path::Rep r;
- prependLocalPathTo(node.getOffset(), r);
- r.prepend(getRootPath().rep());
- return AbsolutePath(r);
-}
-
-com::sun::star::uno::Any Tree::getNodeValue(ValueRef const & value) {
- OSL_ASSERT(isValidValueNode(value));
- return getMemberNode(value).getValue();
-}
-
-bool Tree::hasNodeDefault(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).canGetDefaultValue();
-}
-
-bool Tree::isNodeDefault(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return hasNodeDefault(value) && getMemberNode(value).isDefault();
-}
-
-bool Tree::hasNodeDefault(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- // Not a set, then it has no default:
- return view::ViewTreeAccess(this).isSetNode(node);
-}
-
-bool Tree::isNodeDefault(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (!hasNodeDefault(node)) {
- return false;
- }
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isSetNode(node)); // not a set, then it has no default
- // A set is default if all its elements are default:
- return !FindNonDefaultElement::hasNonDefaultElement(v, v.toSetNode(node));
-}
-
-bool Tree::hasNodeDefault(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- return node.isNode()
- ? hasNodeDefault(node.toNode()) : hasNodeDefault(node.toValue());
-}
-
-bool Tree::isNodeDefault(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- return node.isNode()
- ? isNodeDefault(node.toNode()) : isNodeDefault(node.toValue());
-}
-
-bool Tree::areValueDefaultsAvailable(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isGroupNode(node));
- return v.isGroupNode(node) &&
- v.areValueDefaultsAvailable(v.toGroupNode(node));
-}
-
-com::sun::star::uno::Any Tree::getNodeDefaultValue(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- ValueMemberNode m(getMemberNode(value));
- return m.canGetDefaultValue() ?
- m.getDefaultValue() : com::sun::star::uno::Any();
-}
-
-bool Tree::hasChanges() {
- return view::ViewTreeAccess(this).hasChanges();
-}
-
-bool Tree::collectChanges(NodeChanges & changes) {
- OSL_ASSERT(nodeCount() != 0);
- view::ViewTreeAccess v(this);
- if (v.hasChanges()) {
- v.collectChanges(changes);
- return true;
- } else {
- return false;
- }
-}
-
-void Tree::integrate(NodeChange & change, NodeRef const & node, bool local)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (change.test().isChange()) {
- change.apply();
- if (local) {
- view::ViewTreeAccess(this).markChanged(node);
- } else {
- rtl::Reference< Tree > at(change.getAffectedTree());
- NodeRef an(change.getAffectedNode());
- OSL_ASSERT(
- !isEmpty(at.get()) && an.isValid() &&
- at->isValidNode(an.getOffset()));
- view::ViewTreeAccess(at.get()).markChanged(an);
- OSL_ASSERT(view::ViewTreeAccess(this).hasChanges());
- }
- }
-}
-
-void Tree::integrate(NodeChanges& changes, NodeRef const & node, bool local)
-{
- for (std::vector< NodeChange >::iterator it(changes.begin());
- it != changes.end(); ++it)
- {
- integrate(*it, node, local);
- }
-}
-
-NodeVisitor::Result Tree::dispatchToChildren(
- NodeRef const & node, NodeVisitor & visitor)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode const p(v.toGroupNode(node));
- OSL_ASSERT(
- (NodeVisitor::Result(GroupMemberVisitor::DONE) ==
- NodeVisitor::DONE) &&
- (NodeVisitor::Result(GroupMemberVisitor::CONTINUE) ==
- NodeVisitor::CONTINUE));
- GroupVisitorAdapter adapter(this, node, visitor);
- NodeVisitor::Result ret = NodeVisitor::Result(
- v.dispatchToValues(p, adapter));
- unsigned int n = childDepth(node.getDepth());
- for (view::Node c(p.getFirstChild());
- c.is() && ret != NodeVisitor::DONE; c = p.getNextChild(c))
- {
- ret = visit(NodeRef(c.get_offset(), n), visitor);
- }
- return ret;
- } else if (v.isSetNode(node)) {
- OSL_ASSERT(
- NodeVisitor::Result(SetNodeVisitor::DONE) == NodeVisitor::DONE &&
- (NodeVisitor::Result(SetNodeVisitor::CONTINUE) ==
- NodeVisitor::CONTINUE));
- SetVisitorAdapter adapter(visitor);
- return NodeVisitor::Result(
- v.dispatchToElements(v.toSetNode(node), adapter));
- } else {
- OSL_TRACE("configuration: Trying to iterate a value node");
- return NodeVisitor::CONTINUE;
- }
-}
-
-NodeRef Tree::getNode(unsigned int offset) const {
- if (offset == 0) {
- return NodeRef();
- } else {
- OSL_ASSERT(isValidNode(offset));
- return NodeRef(
- offset, remainingDepth(getAvailableDepth(), depthTo(offset)));
- }
-}
-
-rtl::Reference< Template > Tree::extractElementInfo(NodeRef const & node) {
- OSL_ASSERT(node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isSetNode(node));
- return v.getElementTemplate(v.toSetNode(node));
-}
-
-//-----------------------------------------------------------------------------
-void Tree::rebuild(rtl::Reference<view::ViewStrategy> const & _xNewStrategy, sharable::Node * newData)
-{
- m_xStrategy = _xNewStrategy;
- this->implRebuild(ROOT, newData);
-}
-
-//-----------------------------------------------------------------------------
-void Tree::implRebuild(unsigned int nNode, sharable::Node * newData)
-{
- NodeData * pNode = nodeData(nNode);
- if (pNode->isGroupNode())
- {
- // first rebuild the children
- OSL_ASSERT(newData != 0 && newData->isGroup());
- sharable::GroupNode * newGroup = &newData->group;
-
- for (unsigned int nChild = firstChild_(nNode); isValidNode(nChild); nChild = findNextChild_(nNode,nChild))
- {
- sharable::Node * childAccess = newGroup->getChild(implGetOriginalName(nChild));
- OSL_ASSERT(childAccess != 0);
- implRebuild(nChild, childAccess);
- }
- }
-
- pNode->rebuild(m_xStrategy, newData);
-}
-
-//-----------------------------------------------------------------------------
-
-void ElementTree::doFinishRootPath(Path::Rep& rPath) const
-{
- rPath.prepend( doGetRootName() );
- rPath.prepend( AbsolutePath::detachedRoot().rep() );
-}
-//-----------------------------------------------------------------------------
-
-void RootTree::doFinishRootPath(Path::Rep& rPath) const
-{
- rPath.prepend( m_aRootPath.rep() );
-}
-
-//-----------------------------------------------------------------------------
-
-void Tree::implPrependRootPath(Path::Rep& rPath) const
-{
- if (m_pParentTree)
- {
- rPath.prepend( doGetRootName() );
- OSL_ASSERT(m_nParentNode);
- m_pParentTree->prependLocalPathTo(m_nParentNode,rPath);
- m_pParentTree->implPrependRootPath(rPath);
- }
- else
- {
- doFinishRootPath( rPath );
- }
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath Tree::getRootPath() const
-{
- Path::Rep aPath;
- implPrependRootPath(aPath);
- return AbsolutePath(aPath);
-}
-//-----------------------------------------------------------------------------
-void Tree::build(rtl::Reference<view::ViewStrategy> const& _xStrategy, sharable::Node * rootNode, unsigned int nDepth, TemplateProvider const& aTemplateProvider)
-{
- OSL_ASSERT(m_aNodes.empty());
- m_nDepth = nDepth;
- TreeImplBuilder a(aTemplateProvider, _xStrategy,*this);
- a.visitNode(rootNode);
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< view::ViewStrategy > Tree::getViewBehavior() const
-{
- return m_xStrategy;
-}
-
-// context handling
-//-----------------------------------------------------------------------------
-
-void Tree::setContext(Tree* pParentTree, unsigned int nParentNode)
-{
- OSL_ENSURE(pParentTree,"ERROR: Moving tree to nowhere");
-
- if (pParentTree)
- {
- OSL_ENSURE( pParentTree->isValidNode(nParentNode),"ERROR: Moving tree to invalid node");
- if (!pParentTree->isValidNode(nParentNode))
- throw Exception("INTERNAL ERROR: Moving tree to invalid parent node");
-
- // OSL_ENSURE( pParentTree->isSetNodeAt(nParentNode),"WARNING: Moving tree to node that is not a set");
- }
- else
- {
- OSL_ENSURE( nParentNode == 0,"WARNING: Moving tree to node without a tree");
- nParentNode = 0;
- }
-
- m_pParentTree = pParentTree;
- m_nParentNode = nParentNode;
-}
-//-----------------------------------------------------------------------------
-
-void Tree::clearContext()
-{
- m_pParentTree = 0;
- m_nParentNode = 0;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Node Collection navigation
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::parent_(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
- return nodeData(nNode)->getParent();
-}
-//-----------------------------------------------------------------------------
-inline // is protected and should be used only here
-rtl::OUString Tree::implGetOriginalName(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
-
- return nodeData(nNode)->getName();
-}
-//-----------------------------------------------------------------------------
-
-Path::Component ElementTree::doGetRootName() const
-{
- return makeExtendedName( m_aElementName );
-}
-
-//-----------------------------------------------------------------------------
-
-rtl::OUString ElementTree::getSimpleRootName() const
-{
- // Tree::getSimpleRootName tends to parse &
- // then split the same name, burning CPU L&R
- return m_aElementName;
-}
-
-//-----------------------------------------------------------------------------
-
-Path::Component RootTree::doGetRootName() const
-{
- return m_aRootPath.getLocalName();
-}
-//-----------------------------------------------------------------------------
-
-
-rtl::OUString Tree::getSimpleNodeName(unsigned int nNode) const
-{
- if (nNode == ROOT) return getSimpleRootName();
-
- return implGetOriginalName(nNode);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Tree::getSimpleRootName() const
-{
- return doGetRootName().getName();
-}
-
-//-----------------------------------------------------------------------------
-
-Path::Component Tree::getExtendedRootName() const
-{
- return doGetRootName();
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::depthTo(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
-
- unsigned int nDepth = 0;
- while( 0 != (nNode=parent_(nNode)) )
- {
- ++nDepth;
- }
-
- return nDepth;
-}
-//-----------------------------------------------------------------------------
-
-void Tree::prependLocalPathTo(unsigned int nNode, Path::Rep& rNames)
-{
- OSL_ASSERT(isValidNode(nNode));
-
- for (; nNode != ROOT; nNode = parent_(nNode) )
- {
- OSL_ENSURE( isValidNode(nNode), "ERROR: Configuration: node has invalid parent");
- rNames.prepend( Path::wrapSimpleName( implGetOriginalName(nNode) ) );
- }
-
- OSL_ASSERT(nNode == ROOT);
-}
-//-----------------------------------------------------------------------------
-
-// Node iteration and access
-unsigned int Tree::firstChild_ (unsigned int nParent) const
-{
- return findNextChild_(nParent,nParent);
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::findNextChild_(unsigned int nParent, unsigned int nStartAfter) const
-{
- OSL_ASSERT(isValidNode(nParent));
- OSL_ASSERT(nStartAfter == 0 || isValidNode(nStartAfter));
-
- unsigned int nPos = nStartAfter ? nStartAfter : ROOT - 1;
- unsigned int const nAfterLast = nodeCount() + ROOT;
- while (++nPos < nAfterLast)
- {
- if(parent_(nPos) == nParent) return nPos;
- }
- return 0;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::findChild_(unsigned int nParent, rtl::OUString const& aName) const
-{
- OSL_ASSERT(isValidNode(nParent));
-
- unsigned int nPos = nParent;
- unsigned int const nAfterLast = nodeCount() + ROOT;
- while (++nPos < nAfterLast)
- {
- if(parent_(nPos) == nParent && implGetOriginalName(nPos) == aName)
- return nPos;
- }
- return 0;
-}
-
-ValueMemberNode Tree::getMemberNode(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0);
- view::ViewTreeAccess v(this);
- return v.getValue(v.getGroupNodeAt(value.m_nParentPos), value.m_sNodeName);
-}
-
-//-----------------------------------------------------------------------------
-// class RootTree
-//-----------------------------------------------------------------------------
-
-RootTree::RootTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- AbsolutePath const& aRootPath,
- sharable::Node * cacheNode, unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-: Tree()
-, m_aRootPath(aRootPath)
-{
-// OSL_ENSURE( aRootPath.getLocalName().getName() == cacheNode->getName(),
-// "Constructing root node: Path does not match node name");
-
- Tree::build(_xStrategy,cacheNode,nDepth,aTemplateProvider);
-}
-
-bool isEmpty(Tree * tree)
-{
- return tree == 0 || tree->nodeCount() == 0;
-}
-
-//-----------------------------------------------------------------------------
-// class ElementTree
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- sharable::TreeFragment * cacheTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider )
-: Tree()
-, m_aInstanceInfo(aTemplateInfo)
-, m_aElementName(cacheTree->getName())
-, m_aDataAddress(cacheTree)
-, m_aOwnData()
-{
- Tree::build( _xStrategy, cacheTree->getRootNode(), nDepth, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rParentTree, unsigned int nParentNode,
- sharable::TreeFragment * cacheTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider )
-: Tree( rParentTree, nParentNode )
-, m_aInstanceInfo(aTemplateInfo)
-, m_aElementName(cacheTree->getName())
-, m_aDataAddress(cacheTree)
-, m_aOwnData()
-{
- Tree::build( _xStrategy, cacheTree->getRootNode(), nDepth, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference< data::TreeSegment > const& pNewTree,
- rtl::Reference<Template> aTemplate,
- TemplateProvider const& aTemplateProvider )
-: Tree()
-, m_aInstanceInfo(aTemplate)
-, m_aOwnData(pNewTree)
-{
- if (!pNewTree.is())
- throw Exception("ERROR: Provider can't create Element Instance From Template");
- m_aElementName = pNewTree->fragment->getName();
- m_aDataAddress = pNewTree->fragment;
-
- Tree::build( view::createDirectAccessStrategy(m_aOwnData), m_aOwnData->fragment->nodes, c_TreeDepthAll, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::~ElementTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool ElementTree::isUpdatableSegment(Tree& _rTree)
-{
- Tree * pTree = &_rTree;
-
- while (ElementTree * pElement = dynamic_cast< ElementTree * >(pTree))
- {
- if (pElement->m_aOwnData.is())
- {
- OSL_ENSURE( pElement->getContextTree()==NULL ||
- pElement->getContextTree()->getViewBehavior() != pElement->getViewBehavior(),
- "ElementTree with parent in same fragment should not own its data");
- return true;
- }
-
- pTree = pElement->getContextTree();
-
- if (!pTree)
- {
- OSL_ENSURE( false, "ElementTree without own data should have a parent");
- return false;
- }
-
- }
- OSL_ENSURE( false, "Tree is not part of free-floating segment - cannot support direct update");
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::disposeData()
-{
- Tree::disposeData();
- m_aOwnData.clear();
-}
-//-----------------------------------------------------------------------------
-
-Path::Component ElementTree::makeExtendedName(rtl::OUString const& _aSimpleName) const
-{
- rtl::OUString aTypeName = implGetOriginalName(ROOT);
-
- OSL_ENSURE(this->isTemplateInstance(), "ElementTree: Cannot discover the type this instantiatiates");
-
- OSL_ENSURE(! this->isTemplateInstance() || this->getTemplate()->getName() == aTypeName,
- "ElementTree: Type name does not match template");
-
- return Path::makeCompositeName(_aSimpleName, aTypeName);
-}
-//-----------------------------------------------------------------------------
-
-// ownership handling
-//-----------------------------------------------------------------------------
-void ElementTree::rebuild(rtl::Reference<view::ViewStrategy> const & _aStrategy, sharable::TreeFragment * newTree)
-{
- Tree::rebuild(_aStrategy, newTree->getRootNode());
- m_aDataAddress = newTree;
- m_aElementName = newTree->getName();
-}
-
-//-----------------------------------------------------------------------------
-/// transfer ownership to the given set
-// -----------------------------------------------------------------------------
-void ElementTree::attachTo(sharable::SetNode * owningSet, rtl::OUString const& aElementName)
-{
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Cannot add a non-owned node to a subtree");
-
- if (m_aOwnData.is())
- {
- OSL_ENSURE(this->getSimpleRootName() == aElementName,"ElementTree: Attaching with unexpected element name");
- m_aOwnData->fragment->setName(aElementName);
-
- Tree* pOwningTree = this->getContextTree();
- OSL_ENSURE(pOwningTree, "Element Tree Context must be set before attaching data");
-
- if (isUpdatableSegment(*pOwningTree))
- {
- // copy over to the new segment
- sharable::TreeFragment * aNewElement = data::buildTree(m_aOwnData->fragment);
-
- owningSet->addElement(aNewElement);
-
- rtl::Reference<view::ViewStrategy> xNewBehavior = pOwningTree->getViewBehavior();
-
- this->rebuild(xNewBehavior,aNewElement);
- }
- else
- OSL_ENSURE( false, "Cannot attach directly to new tree - no update access available");
-
- m_aOwnData.clear();
- OSL_ASSERT(!m_aOwnData.is());
- }
-}
-//-----------------------------------------------------------------------------
-
-/// tranfer ownership from the given set
-void ElementTree::detachFrom(sharable::SetNode * owningSet, rtl::OUString const& aElementName)
-{
- OSL_ENSURE(!m_aOwnData.is(),"ERROR: Cannot detach a already owned node from a subtree");
- OSL_ENSURE(this->getSimpleRootName() == aElementName,"ElementTree: Detaching with unexpected element name");
-
- rtl::Reference< view::ViewStrategy > xOldStrategy = this->getViewBehavior();
- OSL_ENSURE(xOldStrategy.is(), "Element Tree Context must still have the old strategy when detaching data");
-
- {
- // make a new segment with a copy of the data
- rtl::Reference< data::TreeSegment > aNewSegment = data::TreeSegment::create( this->getOriginalTreeAccess() );
-
- OSL_ENSURE(aNewSegment.is(),"ERROR: Could not create detached copy of elment data");
-
- this->takeTreeAndRebuild( aNewSegment );
-
- sharable::TreeFragment * aOldElement = owningSet->removeElement(aElementName );
- OSL_ENSURE(aOldElement != NULL,"ERROR: Detached node not found in the given subtree");
-
- data::destroyTree(aOldElement);
- }
-
- OSL_ENSURE(m_aOwnData.is(),"ERROR: Could not create own data segment for detached node");
-}
-//-----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-/// transfer ownership from the given owner
-void ElementTree::takeTreeBack(rtl::Reference< data::TreeSegment > const & _aDataSegment)
-{
- OSL_ENSURE(!m_aOwnData.is(), "ERROR: Cannot take over a node - already owning");
- OSL_ENSURE(_aDataSegment.is(), "ERROR: Cannot take over NULL tree segment");
-
- m_aOwnData = _aDataSegment;
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Could not take over data segment");
-
- m_aDataAddress = m_aOwnData->fragment;
- m_aElementName = m_aOwnData->fragment->getName();
-}
-//-----------------------------------------------------------------------------
-
-/// transfer ownership from the given owner
-void ElementTree::takeTreeAndRebuild(rtl::Reference< data::TreeSegment > const & _aDataSegment)
-{
- OSL_ENSURE(!m_aOwnData.is(), "ERROR: Cannot take over a node - already owning");
- OSL_ENSURE(_aDataSegment.is(), "ERROR: Cannot take over NULL tree segment");
- this->rebuild(view::createDirectAccessStrategy(_aDataSegment), _aDataSegment->fragment);
- m_aOwnData = _aDataSegment;
-}
-//-----------------------------------------------------------------------------
-
-/// release ownership
-rtl::Reference< data::TreeSegment > ElementTree::releaseOwnedTree()
-{
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Cannot release and rename a non-owned node");
- rtl::Reference< data::TreeSegment > aTree(m_aOwnData);
- m_aOwnData.clear();
- aTree->fragment->setName(m_aElementName);
- return aTree;
-}
-//-----------------------------------------------------------------------------
-
-// context handling
-//-----------------------------------------------------------------------------
-
-/// renames the tree's root without concern for context consistency !
-void ElementTree::renameTree(rtl::OUString const& aNewName)
-{
- m_aElementName = aNewName;
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::moveTree(Tree* pParentTree, unsigned int nParentNode)
-{
- Tree::setContext(pParentTree,nParentNode);
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::detachTree()
-{
- Tree::clearContext();
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- } // namespace configuration
-} // namespace configmgr
-
diff --git a/configmgr/source/treemgr/valuemembernode.cxx b/configmgr/source/treemgr/valuemembernode.cxx
deleted file mode 100644
index 93ee539704e9..000000000000
--- a/configmgr/source/treemgr/valuemembernode.cxx
+++ /dev/null
@@ -1,333 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "valuemembernode.hxx"
-#include "nodeimplobj.hxx"
-#include "nodechangeimpl.hxx"
-#include "change.hxx"
-#include "valuenode.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-// helpers
-//-----------------------------------------------------------------------------
-
-namespace
-{
-
-//-----------------------------------------------------------------------------
-// internal accessors for direct updates to data
-//-----------------------------------------------------------------------------
-
-inline
-void setOriginalValue(sharable::ValueNode * const& rOriginalAddress, com::sun::star::uno::Any const& aNewValue)
-{
- rOriginalAddress->setValue(aNewValue);
-}
-//-----------------------------------------------------------------------------
-
-inline
-void setOriginalToDefault(sharable::ValueNode * const& rOriginalAddress)
-{
- rOriginalAddress->setToDefault();
-}
-} // anonymous namespace
-
-
-//-----------------------------------------------------------------------------
-// class ValueMemberNode
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::ValueMemberNode(sharable::ValueNode * node)
- : m_node(node)
- , m_xDeferredOperation()
-{}
-//-----------------------------------------------------------------------------
-ValueMemberNode::ValueMemberNode(rtl::Reference<DeferredImpl> const& _xDeferred) // must be valid
- : m_node( _xDeferred->getOriginalNode() )
- , m_xDeferredOperation(_xDeferred)
-{}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::ValueMemberNode(ValueMemberNode const& rOriginal)
- : m_node(rOriginal.m_node)
- , m_xDeferredOperation(rOriginal.m_xDeferredOperation)
-{}
-//-----------------------------------------------------------------------------
-ValueMemberNode& ValueMemberNode::operator=(ValueMemberNode const& rOriginal)
-{
- m_node = rOriginal.m_node;
- m_xDeferredOperation = rOriginal.m_xDeferredOperation;
- return *this;
-}
-//-----------------------------------------------------------------------------
-ValueMemberNode::~ValueMemberNode()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::isValid() const
-{
- OSL_ASSERT( !m_xDeferredOperation.is() ||
- m_node == m_xDeferredOperation->getOriginalNode());
-
- return m_node != 0;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::hasChange() const
-{
- return m_xDeferredOperation.is()
- && m_xDeferredOperation->isChange();
-}
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-// external accessors
-//-----------------------------------------------------------------------------
-
-rtl::OUString ValueMemberNode::getNodeName() const
-{
- return m_node->info.getName();
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes ValueMemberNode::getAttributes() const
-{
- return sharable::node(m_node)->getAttributes();
-}
-//-----------------------------------------------------------------------------
-
-
-bool ValueMemberNode::isDefault() const
-{
- if (hasChange())
- return m_xDeferredOperation->isToDefault();
-
- return m_node->info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::canGetDefaultValue() const
-{
- return m_node->hasUsableDefault();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueMemberNode::getValue() const
-{
- if (hasChange())
- return m_xDeferredOperation->getNewValue();
-
- return m_node->getValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueMemberNode::getDefaultValue() const
-{
- return m_node->getDefaultValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueMemberNode::getValueType() const
-{
- return m_node->getValueType();
-}
-//-----------------------------------------------------------------------------
-
-
-void ValueMemberUpdate::setValue(com::sun::star::uno::Any const& aNewValue)
-{
- if (m_aMemberNode.m_xDeferredOperation.is())
- m_aMemberNode.m_xDeferredOperation->setValue(aNewValue, m_aMemberNode.m_node);
- else
- setOriginalValue(m_aMemberNode.m_node, aNewValue );
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberUpdate::setDefault()
-{
- if (m_aMemberNode.m_xDeferredOperation.is())
- m_aMemberNode.m_xDeferredOperation->setValueToDefault(m_aMemberNode.m_node);
- else
- setOriginalToDefault(m_aMemberNode.m_node);
-}
-
-//-----------------------------------------------------------------------------
-// class ValueMemberNode::DeferredImpl
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::DeferredImpl::DeferredImpl(sharable::ValueNode * valueNode)
-: m_valueNode(valueNode)
-, m_aNewValue(valueNode->getValue())
-, m_bToDefault(false)
-, m_bChange(false)
-{}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::setValue(com::sun::star::uno::Any const& aNewValue, sharable::ValueNode * originalNode)
-{
- OSL_ENSURE(originalNode == m_valueNode, "Incorrect original node passed");
-
- m_aNewValue = aNewValue;
- m_bToDefault = false;
-
- m_bChange = originalNode->info.isDefault() || aNewValue != originalNode->getValue();
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::setValueToDefault(sharable::ValueNode * originalNode)
-{
- OSL_ENSURE(originalNode == m_valueNode, "Incorrect original node passed");
-
- m_aNewValue = originalNode->getDefaultValue();
- m_bToDefault = true;
-
- m_bChange = !originalNode->info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ValueChange> ValueMemberNode::DeferredImpl::preCommitChange()
-{
- OSL_ENSURE(isChange(), "Trying to commit a non-change");
-
- sharable::ValueNode * originalNode = getOriginalNode();
-
- // first find the mode of the change
- ValueChange::Mode eMode;
-
- if (m_bToDefault)
- eMode = ValueChange::setToDefault;
-
- else if (! originalNode->info.isDefault())
- eMode = ValueChange::changeValue;
-
- else
- eMode = ValueChange::wasDefault;
-
- // now make a ValueChange
- std::auto_ptr<ValueChange>pChange( new ValueChange( originalNode->info.getName(),
- sharable::node(originalNode)->getAttributes(),
- eMode,
- this->getNewValue(),
- originalNode->getValue()
- ) );
-
- return pChange;
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::finishCommit(ValueChange& rChange)
-{
- { (void)rChange; }
- OSL_ENSURE(rChange.getNewValue() == this->getNewValue(),"Committed change does not match the intended value");
-
- sharable::ValueNode * originalNode = getOriginalNode();
-
- m_aNewValue = originalNode->getValue();
- m_bToDefault = false;
-
- OSL_ENSURE(rChange.getNewValue() == m_aNewValue,"Committed change does not match the actual value");
- m_bChange= false;
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::revertCommit(ValueChange& rChange)
-{
- { (void)rChange; }
-
- OSL_ENSURE(rChange.getNewValue() == this->getNewValue(),"Reverted change does not match the intended value");
- OSL_ENSURE(isChange(), "ValueMemeberNode::DeferredImpl: No Changes to revert");
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::failedCommit(ValueChange&)
-{
- sharable::ValueNode * originalNode = getOriginalNode();
-
- // discard the change
- m_aNewValue = originalNode->getValue();
- m_bToDefault = false;
-
- m_bChange= false;
-}
-//-----------------------------------------------------------------------------
-ValueChangeImpl* ValueMemberNode::DeferredImpl::collectChange()
-{
- sharable::ValueNode * originalNode = getOriginalNode();
-
- com::sun::star::uno::Any aOldValue = originalNode->getValue();
- if (!m_bChange)
- {
- return NULL;
- }
- else if (m_bToDefault)
- {
- OSL_ASSERT( m_aNewValue == originalNode->getDefaultValue() );
- return new ValueResetImpl( m_aNewValue, aOldValue );
- }
-
- else
- {
- return new ValueReplaceImpl( m_aNewValue, aOldValue );
- }
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl* ValueMemberNode::DeferredImpl::adjustToChange(ValueChange const& rExternalChange)
-{
- if (!m_bChange)
- {
- return NULL;
- }
- else if (m_bToDefault && rExternalChange.getMode() == ValueChange::changeDefault)
- {
- OSL_ASSERT( m_aNewValue == rExternalChange.getOldValue() );
-
- m_aNewValue = rExternalChange.getNewValue();
-
- return new ValueReplaceImpl(m_aNewValue, rExternalChange.getOldValue());
- }
- else // return Surrogate - does not honor m_bToDefault
- {
- return new ValueReplaceImpl(m_aNewValue, m_aNewValue);
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/valuemembernode.hxx b/configmgr/source/treemgr/valuemembernode.hxx
deleted file mode 100644
index fce95868a5ba..000000000000
--- a/configmgr/source/treemgr/valuemembernode.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUEMEMBERNODE_HXX_
-#define CONFIGMGR_VALUEMEMBERNODE_HXX_
-
-#include "nodeimpl.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- /// handle class for values that are not nodes themselves, but members of a group
- class ValueMemberNode
- {
- public:
- class DeferredImpl;
- private:
- sharable::ValueNode * m_node;
- rtl::Reference<DeferredImpl> m_xDeferredOperation;
- private:
- friend class GroupNodeImpl;
- friend class DeferredGroupNodeImpl;
- friend class ValueMemberUpdate;
-
- /// create a ValueMemberNode for a given node
- explicit ValueMemberNode(sharable::ValueNode * node);
- /// create a deferred ValueMemberNode (xOriginal must not be empty)
- ValueMemberNode(rtl::Reference<DeferredImpl> const& _xDeferred);
- public:
- ValueMemberNode(ValueMemberNode const& rOriginal);
- ValueMemberNode& operator=(ValueMemberNode const& rOriginal);
- ~ValueMemberNode();
-
- /// does this wrap a valid value ?
- bool isValid() const;
-
- /// does this wrap a change
- bool hasChange() const;
-
- /// retrieve the name of the underlying node
- rtl::OUString getNodeName() const;
- /// retrieve the attributes
- node::Attributes getAttributes() const;
-
- /// Does this node assume its default value
- bool isDefault() const;
- /// is the default value of this node available
- bool canGetDefaultValue() const;
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue() const;
- /// retrieve the default value of this node
- com::sun::star::uno::Any getDefaultValue() const;
-
- com::sun::star::uno::Type getValueType() const;
-
- };
- //-------------------------------------------------------------------------
-
- /// handle class for updating values that are members of a group
- class ValueMemberUpdate
- {
- ValueMemberNode m_aMemberNode;
- view::ViewStrategy * m_pStrategy;
- private:
- friend class view::ViewStrategy;
-
- ValueMemberUpdate(ValueMemberNode const& rOriginal, view::ViewStrategy& _rStrategy)
- : m_aMemberNode(rOriginal), m_pStrategy(&_rStrategy) {}
-
- public:
- /// does this wrap a valid value ?
- bool isValid() const { return m_aMemberNode.isValid(); }
-
- /// get access to the wrapped data
- ValueMemberNode getNode() const { return m_aMemberNode; }
-
- /// Set this node to a new value
- void setValue(com::sun::star::uno::Any const& aNewValue);
-
- /// Set this node to assume its default value
- void setDefault();
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/valuenodeimpl.hxx b/configmgr/source/treemgr/valuenodeimpl.hxx
deleted file mode 100644
index 7be2362af464..000000000000
--- a/configmgr/source/treemgr/valuenodeimpl.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUENODEBEHAVIOR_HXX_
-#define CONFIGMGR_VALUENODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-
-namespace configmgr
-{
- class ValueChange;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// Another types of node
-//-----------------------------------------------------------------------------
-
- /** a special kind of node that is used to represent an element of a set of values
- <p> This is an immutable value (changes are done by adding/replacing/removing set elements)
- </p>
- */
- class ValueElementNodeImpl : public NodeImpl
- {
- public:
- explicit ValueElementNodeImpl(sharable::ValueNode * const& _aNodeRef) ;
-
- // the following delegate directly to the original node
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue() const;
-
- /// get the type of this value
- com::sun::star::uno::Type getValueType() const;
-
- sharable::ValueNode * getDataAccess() const;
- };
-
- // domain-specific 'dynamic_cast' replacement
- ValueElementNodeImpl& AsValueNode(NodeImpl& rNode);
- }
-}
-
-#endif // CONFIGMGR_VALUENODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/viewaccess.hxx b/configmgr/source/treemgr/viewaccess.hxx
deleted file mode 100644
index e3153867851b..000000000000
--- a/configmgr/source/treemgr/viewaccess.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWACCESS_HXX_
-#define CONFIGMGR_VIEWACCESS_HXX_
-
-#include "viewnode.hxx"
-#include "viewstrategy.hxx"
-#include <rtl/ref.hxx>
-
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration { class NodeRef; }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
-
- class ViewTreeAccess
- {
- rtl::Reference< ViewStrategy > m_xStrategy;
- configuration::Tree * m_tree;
-
- public:
- explicit ViewTreeAccess(configuration::Tree * tree):
- m_xStrategy(tree->getViewBehavior()), m_tree(tree) {}
-
- rtl::Reference< view::ViewStrategy > getViewBehavior() { return m_xStrategy; }
- public:
- configuration::NodeData* nodeData(configuration::NodeRef const& _aNodeArg) const;
- configuration::NodeData* nodeData(unsigned int _aNodePos) const;
-
- Node makeNode(configuration::NodeRef const& _aNodeArg) const { return Node(m_tree,nodeData(_aNodeArg)); }
- Node makeNode(unsigned int _aNodePos) const { return Node(m_tree,nodeData(_aNodePos)); }
-
- bool isSetNode (configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isSetNode(); }
- bool isGroupNode(configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isGroupNode(); }
- bool isValueNode(configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isValueNode(); }
-
- bool isSetNodeAt (unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isSetNode(); }
- bool isGroupNodeAt(unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isGroupNode(); }
- bool isValueNodeAt(unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isValueNode(); }
-
- SetNode toSetNode (configuration::NodeRef const& _aNodeArg) const
- { return SetNode (makeNode(_aNodeArg)); }
-
- GroupNode toGroupNode(configuration::NodeRef const& _aNodeArg) const
- { return GroupNode(makeNode(_aNodeArg)); }
-
- ValueNode toValueNode(configuration::NodeRef const& _aNodeArg) const
- { return ValueNode(makeNode(_aNodeArg)); }
-
- SetNode getSetNodeAt (unsigned int _aNodeArg) const
- { return SetNode (makeNode(_aNodeArg)); }
-
- GroupNode getGroupNodeAt(unsigned int _aNodeArg) const
- { return GroupNode(makeNode(_aNodeArg)); }
-
- ValueNode getValueNodeAt(unsigned int _aNodeArg) const
- { return ValueNode(makeNode(_aNodeArg)); }
- // node attributes
- public:
- /// retrieve the name of the node
- rtl::OUString getName(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->getName(makeNode(_aNode)); }
-
- /// retrieve the attributes of the node
- node::Attributes getAttributes(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->getAttributes(makeNode(_aNode)); }
-
- /// retrieve the name of the tree root
- rtl::OUString getRootName() const
- { return m_xStrategy->getName( getRootNode(m_tree) ); }
-
- /// retrieve the attributes of the tree root
- node::Attributes getRootAttributes() const
- { return m_xStrategy->getAttributes( getRootNode(m_tree) ); }
-
- // tracking pending changes
- public:
- void collectChanges(configuration::NodeChanges& rChanges) const
- { m_xStrategy->collectChanges(m_tree,rChanges); }
-
- bool hasChanges() const
- { return m_xStrategy->hasChanges(m_tree); }
-
- bool hasChanges(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->hasChanges(makeNode(_aNode)); }
-
- void markChanged(configuration::NodeRef const& _aNode)
- { m_xStrategy->markChanged(makeNode(_aNode)); }
-
- // commit protocol
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
- { return m_xStrategy->preCommitChanges(m_tree,_rRemovedElements); }
-
- void finishCommit(SubtreeChange& rRootChange)
- { m_xStrategy->finishCommit(m_tree,rRootChange); }
-
- void revertCommit(SubtreeChange& rRootChange)
- { m_xStrategy->revertCommit(m_tree,rRootChange); }
-
- void recoverFailedCommit(SubtreeChange& rRootChange)
- { m_xStrategy->recoverFailedCommit(m_tree,rRootChange); }
-
- // notification protocol
- public:
- /// Adjust the internal representation after external changes to the original data - build NodeChangeInformation objects for notification
- void adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, configuration::NodeRef const& _aNode, SubtreeChange const& aExternalChange)
- { m_xStrategy->adjustToChanges(rLocalChanges,makeNode(_aNode), aExternalChange); }
-
- // visitor dispatch
- public:
- configuration::GroupMemberVisitor::Result dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor) const
- { return m_xStrategy->dispatchToValues(_aNode,_aVisitor); }
-
- /// Call <code>aVisitor.visit(aElement)</code> for each element in this set until SetNodeVisitor::DONE is returned.
- configuration::SetNodeVisitor::Result dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor) const
- { return m_xStrategy->dispatchToElements(_aNode,_aVisitor); }
-
- // value (element) node specific operations
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue(ValueNode const& _aNode) const
- { return m_xStrategy->getValue(_aNode); }
-#if OSL_DEBUG_LEVEL > 0
- /// get the type of this value
- com::sun::star::uno::Type getValueType(ValueNode const& _aNode) const
- { return m_xStrategy->getValueType(_aNode); }
-#endif
-
- // group node specific operations
- public:
- /// does this hold a child value of the given name
- bool hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->hasValue(_aNode,_aName); }
-
- /// does this hold a child value
- bool hasValue(GroupNode const& _aNode) const
- { return m_xStrategy->hasValue(_aNode); }
-
- /// are defaults for this node available ?
- bool areValueDefaultsAvailable(GroupNode const& _aNode) const
- { return m_xStrategy->areValueDefaultsAvailable(_aNode); }
-
- /// retrieve data for the child value of the given name
- configuration::ValueMemberNode getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->getValue(_aNode,_aName); }
-
- /// retrieve data for updating the child value of the given name
- configuration::ValueMemberUpdate getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->getValueForUpdate(_aNode,_aName); }
-
- // set node specific operations
- public:
- /// does this set contain any elements (loads elements if needed)
- bool isEmpty(SetNode const& _aNode) const
- { return m_xStrategy->isEmpty(_aNode); }
-
- /// does this set contain an element named <var>aName</var> (loads elements if needed)
- configuration::SetEntry findElement(SetNode const& _aNode, rtl::OUString const& aName) const
- { return m_xStrategy->findElement(_aNode,aName); }
-
- /// does this set contain an element named <var>aName</var> (and is that element loaded ?)
- configuration::SetEntry findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const
- { return m_xStrategy->findAvailableElement(_aNode,aName); }
-
- /// insert a new entry into this set
- void insertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry)
- { m_xStrategy->insertElement(_aNode,aName,aNewEntry); }
-
- /// remove an existing entry into this set
- void removeElement(SetNode const& _aNode, rtl::OUString const& aName)
- { m_xStrategy->removeElement(_aNode,aName); }
-
- /** Create a Subtree change as 'diff' which allows transforming the set to its default state
- (given that <var>_rDefaultTree</var> points to a default instance of this set)
- <p>Ownership of added trees should be transferred to the SubtreeChange.</p>
- */
- std::auto_ptr<SubtreeChange> differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree)
- { return m_xStrategy->differenceToDefaultState(_aNode,_rDefaultTree); }
-
- /// Get the template that describes elements of this set
- rtl::Reference<configuration::Template> getElementTemplate(SetNode const& _aNode) const
- { return m_xStrategy->getElementTemplate(_aNode); }
-
- /// Get a template provider that can create new elements for this set
- configuration::TemplateProvider getTemplateProvider(SetNode const& _aNode) const
- { return m_xStrategy->getTemplateProvider(_aNode); }
-
- // changing state/strategy
- public:
- // replace m_xStrategy by a direct ViewStrategy (commiting changes to the data), if possible
- // void makeDirect ();
-
- };
- }
-}
-
-#endif // CONFIGMGR_VIEWACCESS_HXX_
diff --git a/configmgr/source/treemgr/viewnode.cxx b/configmgr/source/treemgr/viewnode.cxx
deleted file mode 100644
index d057fbbd6ed8..000000000000
--- a/configmgr/source/treemgr/viewnode.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "viewnode.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "tree.hxx"
-#include "viewstrategy.hxx"
-
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- rtl::Reference< view::ViewStrategy > getViewBehavior(configuration::Tree * _aTree)
- {
- return _aTree->getViewBehavior();
- }
-
-//-----------------------------------------------------------------------------
- static inline Node makeNode_(configuration::Tree * _aTree, unsigned int nOffset)
- {
- return Node(_aTree, _aTree->nodeData(nOffset));
- }
-//-----------------------------------------------------------------------------
- Node Node::getParent() const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->parent_(this->get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::findChild(rtl::OUString const& _aName) const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->findChild_(node().get_offset(), _aName));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::getFirstChild() const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->firstChild_(node().get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::getNextChild(Node const& _aAfterNode) const
- {
- configuration::Tree * pTreeData = this->tree();
- OSL_ASSERT(pTreeData->parent_(_aAfterNode.get_offset()) == this->node().get_offset());
- return makeNode_(tree(), pTreeData->findNextChild_(node().get_offset(),_aAfterNode.get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- sharable::Node * Node::getAccessRef() const
- {
- return get_impl()->getOriginalNodeAccess();
- }
-
-//-----------------------------------------------------------------------------
- sharable::GroupNode * GroupNode::getAccess() const
- {
- return get_impl()->getDataAccess();
- }
-
-//-----------------------------------------------------------------------------
- sharable::SetNode * SetNode::getAccess() const
- {
- return get_impl()->getDataAccess();
- }
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/viewnode.hxx b/configmgr/source/treemgr/viewnode.hxx
deleted file mode 100644
index 2d2e05c37fa9..000000000000
--- a/configmgr/source/treemgr/viewnode.hxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWNODE_HXX_
-#define CONFIGMGR_VIEWNODE_HXX_
-
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- struct ElementTreeData;
- }
- namespace sharable { struct GroupNode; }
-//-----------------------------------------------------------------------------
- namespace view
- {
- //-------------------------------------------------------------------------
- struct Node
- {
- Node(configuration::Tree * _tree, configuration::NodeData* _addr)
- : m_tree(_tree), m_addr(_addr)
- {}
-
- Node(configuration::Tree * _tree, unsigned int _offs)
- : m_tree(_tree), m_addr( _tree->nodeData(_offs))
- {}
-
- bool is() const { return m_addr != 0; }
-
- Node getParent() const;
-
- bool isSetNode() const { return is() && data().isSetNode(); }
- bool isGroupNode() const { return is() && data().isGroupNode(); }
- bool isValueNode() const { return is() && data().isValueElementNode(); }
-
- // low-level access
-// configuration::NodeImpl * operator->() const { return &data().nodeImpl(); }
-
- configuration::NodeData& data() const { return *m_addr; }
-
- configuration::NodeImpl * get_impl() const
- { return is() ? &data().nodeImpl() : NULL; }
-
- unsigned int get_offset() const
- { return is() ? m_tree->nodeOffset( this->data() ) : 0; }
-
- configuration::Tree * tree() const // has a tree
- { return m_tree; }
-
- sharable::Node * getAccessRef() const; // has a Node
-
- private:
- configuration::Tree * m_tree; // has a Tree + Accessor
- configuration::NodeData* m_addr; // has a configuration::NodeImpl *
- };
- //-------------------------------------------------------------------------
- struct ValueNode // has/is a Node
- {
- Node m_node;
-
- explicit
- ValueNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isValueNode(); }
-
- // low-level access
- // configuration::ValueElementNodeImpl* operator->() const { return &m_node.data().valueElementImpl(); }
-
- configuration::ValueElementNodeImpl* get_impl() const
- { return is() ? &m_node.data().valueElementImpl() : NULL; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
- };
- //-------------------------------------------------------------------------
- struct GroupNode // has/is a Node
- {
- Node m_node;
-
- explicit
- GroupNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isGroupNode(); }
-
- Node findChild(rtl::OUString const& _aName) const;
- Node getFirstChild() const;
- Node getNextChild(Node const& _aAfterNode) const;
-
-// configuration::GroupNodeImpl* operator->() const { return &m_node.data().groupImpl(); }
-
- configuration::GroupNodeImpl* get_impl() const
- { return is() ? &m_node.data().groupImpl() : NULL; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
-
- sharable::GroupNode * getAccess() const; // has a GroupNode
- };
- //-------------------------------------------------------------------------
- struct SetNode // has/is a Node
- {
- Node m_node;
-
- explicit
- SetNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isSetNode(); }
-
- // configuration::SetNodeImpl* operator->() const { return &m_node.data().setImpl(); }
-
- configuration::SetNodeImpl* get_impl() const
- { return is() ? &m_node.data().setImpl() : 0; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
-
- sharable::SetNode * getAccess() const; // has a SetNode
- };
- //-------------------------------------------------------------------------
- inline
- Node getRootNode(configuration::Tree * _aTree)
- {
- return Node(_aTree,_aTree->nodeData(configuration::Tree::ROOT));
- }
-
- //-------------------------------------------------------------------------
- inline
- rtl::OUString getSimpleRootName(configuration::Tree * _aTree)
- {
- return _aTree->getSimpleRootName();
- }
-
- //-------------------------------------------------------------------------
- inline
- bool isValidNode(Node const & _aNode)
- {
- configuration::Tree* pTreeData = _aNode.tree();
- return pTreeData->isValidNode(_aNode.get_offset());
- }
-
- //-------------------------------------------------------------------------
- inline
- rtl::OUString getSimpleNodeName(Node const & _aNode)
- {
- configuration::Tree* pTreeData = _aNode.tree();
- return pTreeData->getSimpleNodeName(_aNode.get_offset());
- }
-
- //-------------------------------------------------------------------------
- extern
- rtl::Reference< view::ViewStrategy > getViewBehavior(configuration::Tree * _aTree);
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_VIEWNODE_HXX_
diff --git a/configmgr/source/treemgr/viewstrategy.cxx b/configmgr/source/treemgr/viewstrategy.cxx
deleted file mode 100644
index 1a651f7ac211..000000000000
--- a/configmgr/source/treemgr/viewstrategy.cxx
+++ /dev/null
@@ -1,620 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "viewstrategy.hxx"
-#include "valuenodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "change.hxx"
-#include "nodevisitor.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodeconverter.hxx"
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- static
- inline
- sharable::ValueNode * getMemberValueAccess( GroupNode const & _aGroupNode, rtl::OUString const & _aName )
- {
- configuration::GroupNodeImpl* pGroupData = _aGroupNode.get_impl();
- return pGroupData->getOriginalValueNode(_aName);
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::checkInstance(configuration::Tree * tree) const
- {
- (void) tree; // avoid warnings
- OSL_ENSURE( getViewBehavior(tree).get() == this,
- "Tree operation dispatched to wrong strategy instance");
- }
-//-----------------------------------------------------------------------------
- void ViewStrategy::collectChanges(configuration::Tree * tree, configuration::NodeChanges& rChanges) const
- {
- checkInstance(tree);
- doCollectChanges( getRootNode(tree), rChanges );
- }
-
- bool ViewStrategy::hasChanges(configuration::Tree * tree) const
- {
- checkInstance(tree);
- return hasChanges( getRootNode(tree) );
- }
-
- // mark the given node and all its ancestors (we can stop when we hit a node that already is marked)
- void ViewStrategy::markChanged(Node const& _aNode)
- {
- configuration::Tree * tree = _aNode.tree();
- checkInstance(tree);
-
- Node aNode = _aNode;
- if (aNode.is())
- {
- do
- {
- this->doMarkChanged(aNode);
-
- aNode = aNode.getParent();
- }
- while (aNode.is() && !this->hasChanges( aNode ));
- }
-
- if (!aNode.is()) // just marked the root
- {
- configuration::Tree* pContext = tree->getContextTree();
- unsigned int nContext = tree->getContextNode();
- if (pContext)
- {
- OSL_ASSERT(pContext->isValidNode(nContext));
-
- view::Node aContextNode(pContext,nContext);
- pContext->getViewBehavior()->markChanged(aContextNode);
- }
- }
- }
-
-//-----------------------------------------------------------------------------
- std::auto_ptr<SubtreeChange> ViewStrategy::preCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
- {
- checkInstance(tree);
- return doPreCommitChanges( tree, _rRemovedElements);
- }
-
- void ViewStrategy::finishCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doFinishCommit(tree, rRootChange);
- }
-
- void ViewStrategy::revertCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doRevertCommit(tree, rRootChange);
- }
-
- void ViewStrategy::recoverFailedCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doFailedCommit(tree, rRootChange);
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, Node const& _aNode, SubtreeChange const& aExternalChange)
- {
- OSL_PRECOND( isValidNode(_aNode), "ERROR: Valid node required for adjusting to changes" );
- OSL_PRECOND( getSimpleNodeName(_aNode) == aExternalChange.getNodeName(), "name of change does not match actual node" );
-
- checkInstance(_aNode.tree());
-
- configuration::Tree * pTreeData = _aNode.tree();
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(aExternalChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- unsigned int nDepth = pTreeData->getRemainingDepth(_aNode.get_offset());
-
- implAdjustToElementChanges( rLocalChanges, SetNode(_aNode), aExternalChange, nDepth);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!aExternalChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- GroupNode aGroupNode(_aNode);
-
- implAdjustToValueChanges(rLocalChanges, aGroupNode, aExternalChange);
- implAdjustToSubChanges( rLocalChanges, aGroupNode, aExternalChange);
- }
- else // might occur on external change (?)
- {
- OSL_ENSURE(_aNode.isValueNode(), "Tree: Unknown node type to adjust to changes");
-
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
-
- OSL_ENSURE(false,"ERROR: Change type does not match node: Trying to apply subtree change to value element.");
- }
- }
-
-//-----------------------------------------------------------------------------
-
- void ViewStrategy::addLocalChangeHelper( configuration::NodeChangesInformation& rLocalChanges_, configuration::NodeChange const& aChange_)
- {
- aChange_.getChangeInfos(rLocalChanges_);
- }
-
-//-----------------------------------------------------------------------------
- // TO DO: create CommitAction class, which is returned by precommit (if applicable)
-
- std::auto_ptr<SubtreeChange> ViewStrategy::doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- return std::auto_ptr<SubtreeChange>();
- }
-
- void ViewStrategy::doFinishCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot finish commit for unexpected changes");
- }
-
- void ViewStrategy::doRevertCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot revert commit for unexpected changes");
- }
-
- void ViewStrategy::doFailedCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot recover commit for unexpected changes");
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::implAdjustToElementChange(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aSetNode, Change const& rElementChange, unsigned int nDepth)
- {
- configuration::SetNodeImpl * pSetData = _aSetNode.get_impl();
-
- OSL_ENSURE( pSetData->implHasLoadedElements() , "Unexpected call: Processing element change in uninitialized set");
-
- rtl::OUString aName( rElementChange.getNodeName() );
-
- configuration::SetElementChangeImpl* pThisChange = 0;
- if (AddNode const * addNode = dynamic_cast< AddNode const *>(&rElementChange))
- {
- configuration::ElementTreeData aNewElement = pSetData->makeAdditionalElement(this, *addNode, nDepth);
-
- pThisChange = pSetData->doAdjustToAddedElement(aName, *addNode, aNewElement);
- }
- else if (RemoveNode const * removeNode = dynamic_cast< RemoveNode const * >(&rElementChange))
- {
- pThisChange = pSetData->doAdjustToRemovedElement(aName, *removeNode);
- }
- else
- {
- if (nDepth > 0 || (NULL != pSetData->doFindElement(aName)) )// found even beyond nDepth ?
- {
- pThisChange = pSetData->doAdjustChangedElement(rLocalChanges,aName, rElementChange);
- }
- }
-
- if (pThisChange)
- {
- addLocalChangeHelper( rLocalChanges, configuration::NodeChange(pThisChange) );
- }
- }
-
- void ViewStrategy::implAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aSetNode, SubtreeChange const& rExternalChanges, unsigned int nDepth)
- {
-
- if (nDepth > 0)
- {
- configuration::SetNodeImpl * pSetData = _aSetNode.get_impl();
-
- OSL_ENSURE( pSetData->getTemplateProvider().isValid(), "Cannot adjust SetNode to changes - node was never initialized" );
-
- if (pSetData->implHasLoadedElements())
- {
- unsigned int const nElementDepth = configuration::childDepth(nDepth);
- for (SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- this->implAdjustToElementChange(rLocalChanges, _aSetNode, *it, nElementDepth);
- }
- }
- else
- {
- OSL_ENSURE( !hasChanges(_aSetNode.node()),"Cannot have changes to consider when no elements are loaded");
-
- pSetData->convertChanges( rLocalChanges, rExternalChanges, nDepth);
- }
- }
- }
-
- configuration::ValueChangeImpl* ViewStrategy::doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& _aName, ValueChange const& _rExternalChange)
- {
- configuration::ValueChangeImpl* pChangeImpl = NULL;
-
- sharable::ValueNode * localNode = getMemberValueAccess(_aGroupNode,_aName);
- if (localNode != 0)
- {
- switch( _rExternalChange. getMode() )
- {
- case ValueChange::wasDefault:
- case ValueChange::changeValue:
- pChangeImpl = new configuration::ValueReplaceImpl( _rExternalChange.getNewValue(), _rExternalChange.getOldValue() );
- break;
-
- case ValueChange::setToDefault:
- pChangeImpl = new configuration::ValueResetImpl( _rExternalChange.getNewValue(), _rExternalChange.getOldValue() );
- break;
-
- default: OSL_ENSURE(false, "Unknown change mode");
- // fall thru to next case for somewhat meaningful return value
- case ValueChange::changeDefault:
- {
- com::sun::star::uno::Any aLocalValue = localNode->getValue();
-
- pChangeImpl = new configuration::ValueReplaceImpl( aLocalValue, aLocalValue );
- }
- break;
- }
- OSL_ASSERT( pChangeImpl );
- }
- else
- {
- OSL_ENSURE(false, "ERROR: Notification tries to change nonexistent value within group");
- }
-
- return pChangeImpl;
- }
-
- void ViewStrategy::implAdjustToValueChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges)
- {
- for (SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- if (ValueChange const * valueChange = dynamic_cast< ValueChange const * >(&*it))
- {
- rtl::OUString aValueName( valueChange->getNodeName() );
-
- if (configuration::ValueChangeImpl* pThisChange = doAdjustToValueChange(_aGroupNode, aValueName, *valueChange))
- {
- pThisChange->setTarget(_aGroupNode,aValueName);
- addLocalChangeHelper(rLocalChanges, configuration::NodeChange(pThisChange));
- }
- else
- OSL_TRACE("WARNING: Configuration: derived class hides an external value member change from listeners");
- }
- else
- OSL_ENSURE(dynamic_cast< SubtreeChange const * >(&*it) != 0, "Unexpected change type within group");
- }
- }
-
- void ViewStrategy::implAdjustToSubChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges)
- {
-#if (OSL_DEBUG_LEVEL > 0)
- configuration::Tree * pTreeData = _aGroupNode.tree();
-#endif
- for(SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&*it))
- {
- Node aSubNode = _aGroupNode.findChild( it->getNodeName() );
- OSL_ENSURE( aSubNode.is() || pTreeData->depthTo(_aGroupNode.node().get_offset()) >= pTreeData->getAvailableDepth(), "Changed node not found in tree");
-
- if (aSubNode.is())
- {
- OSL_ENSURE( pTreeData->getRemainingDepth(_aGroupNode.node().get_offset()) > 0, "Depth is smaller than expected for tree");
- this->adjustToChanges(rLocalChanges, aSubNode, *subtreeChange);
- }
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange const * >(&*it) != 0, "Unexpected change type for child of group node; change is ignored");
- OSL_ENSURE( !_aGroupNode.findChild(it->getNodeName()).is(),
- "Found sub(tree) node where a value was expected");
- }
- }
- }
-//-----------------------------------------------------------------------------
- void ViewStrategy::doCollectChanges(Node const& _aNode, configuration::NodeChanges& ) const
- {
- { (void)_aNode; }
- // no-op: there are no changes to collect
- OSL_ENSURE(!hasChanges(_aNode),"Unexpected changes in View");
- }
-
-
-//-----------------------------------------------------------------------------
- com::sun::star::uno::Any ViewStrategy::getValue(ValueNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getValue();
- }
-#if OSL_DEBUG_LEVEL > 0
- com::sun::star::uno::Type ViewStrategy::getValueType(ValueNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getValueType();
- }
-#endif
-//-----------------------------------------------------------------------------
-// group member access
-
-//-----------------------------------------------------------------------------
- namespace { // helpers
- struct GroupMemberDispatch : data::NodeVisitor
- {
- GroupMemberDispatch(ViewStrategy& _rStrategy, GroupNode const& _aGroup, configuration::GroupMemberVisitor& rVisitor)
- : m_rStrategy(_rStrategy)
- , m_aGroup(_aGroup)
- , m_rVisitor(rVisitor)
- {}
-
- static bool mapResult(configuration::GroupMemberVisitor::Result _aResult)
- {
- return _aResult == configuration::GroupMemberVisitor::DONE;
- }
-
- static configuration::GroupMemberVisitor::Result unmapResult(bool done)
- {
- return done
- ? configuration::GroupMemberVisitor::DONE
- : configuration::GroupMemberVisitor::CONTINUE;
- }
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::ValueNode * node);
-#if (OSL_DEBUG_LEVEL > 0)
- bool test_value(sharable::Node * node) const;
-#endif
- ViewStrategy& m_rStrategy;
- GroupNode m_aGroup;
- configuration::GroupMemberVisitor& m_rVisitor;
-
- configuration::GroupMemberVisitor::Result m_aResult;
- };
-
-#if (OSL_DEBUG_LEVEL > 0)
- bool GroupMemberDispatch::test_value(sharable::Node * node) const
- {
- return m_rStrategy.hasValue(m_aGroup, node->getName());
- }
-#endif
-
- bool GroupMemberDispatch::handle(sharable::ValueNode * node)
- {
- OSL_ENSURE( test_value(sharable::node(node)), "ERROR: Group MemberDispatch:Did not find a ValueMember for a value child.");
-
- rtl::OUString aValueName = node->info.getName();
-
- return mapResult( m_rVisitor.visit( m_rStrategy.getValue(m_aGroup,aValueName) ) );
- }
-
- bool GroupMemberDispatch::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE( !test_value(node), "ERROR: Group MemberDispatch:Found a ValueMember for a subtree child.");
-
- return false;
- }
- }
-//-----------------------------------------------------------------------------
- configuration::ValueMemberNode ViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool ) const
- {
- sharable::ValueNode * valueData = getMemberValueAccess(_aNode,_aName);
- return _aNode.get_impl()->makeValueMember(valueData);
- }
-
- bool ViewStrategy::hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- {
- checkInstance(_aNode.tree());
- return getMemberValueAccess(_aNode,_aName) != 0;
- }
-
- bool ViewStrategy::hasValue(GroupNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- configuration::GroupNodeImpl* pGroupNode=_aNode.get_impl();
- sharable::GroupNode * group = pGroupNode->getDataAccess();
- return group->numDescendants > 0;
- }
-
-
- bool ViewStrategy::areValueDefaultsAvailable(GroupNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
-
- return _aNode.get_impl()->areValueDefaultsAvailable();
- }
-
- configuration::ValueMemberNode ViewStrategy::getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- {
- checkInstance(_aNode.tree());
- return doGetValueMember(_aNode,_aName,false);
- }
-
- configuration::ValueMemberUpdate ViewStrategy::getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName)
- {
- checkInstance(_aNode.tree());
- return configuration::ValueMemberUpdate( doGetValueMember(_aNode,_aName,true), *this );
- }
-
- configuration::GroupMemberVisitor::Result ViewStrategy::dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor)
- {
- checkInstance(_aNode.tree());
-
- GroupMemberDispatch aDispatch(*this,_aNode,_aVisitor);
-
- bool done = aDispatch.visitChildren( _aNode.getAccess() );
-
- return aDispatch.unmapResult(done);
- }
-
-//-----------------------------------------------------------------------------
- configuration::ElementTreeData ViewStrategy::implMakeElement(SetNode const& _aNode, configuration::SetEntry const& anEntry) const
- {
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
- return pNodeData->implValidateElement(pNodeData->entryToElement(anEntry));
- }
-//-----------------------------------------------------------------------------
- configuration::SetEntry ViewStrategy::implFindElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- OSL_ENSURE(pNodeData->implHasLoadedElements(),"Cannot find elements in set that is not loaded");
- configuration::ElementTree * pElement = pNodeData->doFindElement(aName);
-
- return configuration::SetEntry(pElement);
- }
-
- configuration::SetEntry ViewStrategy::findElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- return implFindElement(_aNode,aName);
- }
-
- configuration::SetEntry ViewStrategy::findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- checkInstance(_aNode.tree());
- if (_aNode.get_impl()->implHasLoadedElements())
- return implFindElement(_aNode,aName);
- else
- return configuration::SetEntry(0);
- }
-
- static
- inline
- std::auto_ptr<SubtreeChange> makeChangeToDefault(sharable::SetNode * setNode)
- {
- return std::auto_ptr<SubtreeChange>(
- new SubtreeChange(
- setNode->info.getName(),
- setNode->getElementTemplateName(),
- setNode->getElementTemplateModule(),
- sharable::node(setNode)->getAttributes(),
- true // to default
- ) );
- }
-
- std::auto_ptr<SubtreeChange> ViewStrategy::differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree) const
- {
- checkInstance(_aNode.tree());
- std::auto_ptr<SubtreeChange> aResult;
-
- sharable::SetNode * originalSetNode = _aNode.getAccess();
- OSL_ASSERT(originalSetNode != 0);
- if (!originalSetNode->info.isDefault())
- {
- aResult = makeChangeToDefault(originalSetNode);
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
- if (this->hasChanges(_aNode.node()))
- {
- OSL_ENSURE(pNodeData->implHasLoadedElements(),"Unexpected: Found set with changes but elements are not loaded");
- pNodeData->doDifferenceToDefaultState(*aResult,_rDefaultTree);
- }
- else
- pNodeData->implDifferenceToDefaultState(*aResult,_rDefaultTree);
- }
- return aResult;
- }
-
- rtl::Reference<configuration::Template> ViewStrategy::getElementTemplate(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getElementTemplate();
- }
-
- configuration::TemplateProvider ViewStrategy::getTemplateProvider(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getTemplateProvider();
- }
-
- node::Attributes ViewStrategy::getNodeAttributes(Node const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.getAccessRef()->getAttributes();
- }
-
-//-----------------------------------------------------------------------------
- configuration::SetNodeVisitor::Result ViewStrategy::dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor)
- {
- checkInstance(_aNode.tree());
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- if (pNodeData->implLoadElements())
- return pNodeData->doDispatchToElements(_aVisitor);
-
- else
- return configuration::SetNodeVisitor::CONTINUE;
- }
-
- bool ViewStrategy::isEmpty(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- return !pNodeData->implLoadElements() || pNodeData->doIsEmpty();
- }
-//-----------------------------------------------------------------------------
-
- void ViewStrategy::insertElement(SetNode const& _aNode, rtl::OUString const& _aName, configuration::SetEntry const& _aNewEntry)
- {
- // cannot insert, if we cannot check for collisions
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- doInsertElement(_aNode,_aName,_aNewEntry);
- }
-
- void ViewStrategy::removeElement(SetNode const& _aNode, rtl::OUString const& _aName)
- {
- // cannot remove, if we cannot check for existance
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- doRemoveElement(_aNode,_aName);
- }
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
diff --git a/configmgr/source/treemgr/viewstrategy.hxx b/configmgr/source/treemgr/viewstrategy.hxx
deleted file mode 100644
index ed561f8e6133..000000000000
--- a/configmgr/source/treemgr/viewstrategy.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWBEHAVIOR_HXX_
-#define CONFIGMGR_VIEWBEHAVIOR_HXX_
-
-#include "viewnode.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- class SetElementChangeImpl;
- class ValueChangeImpl;
- }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- struct NodeFactory;
-//-----------------------------------------------------------------------------
- class ViewStrategy : public salhelper::SimpleReferenceObject
- {
- // node attributes
- public:
- /// retrieve the attributes of the node
- rtl::OUString getName(Node const& _aNode) const;
-
- /// retrieve the attributes of the node
- node::Attributes getAttributes(Node const& _aNode) const;
-
- // tracking pending changes
- public:
- void collectChanges(configuration::Tree * tree, configuration::NodeChanges& rChanges) const;
-
- bool hasChanges(configuration::Tree * tree) const;
-
- bool hasChanges(Node const& _aNode) const;
-
- void markChanged(Node const& _aNode);
-
- // commit protocol
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
-
- void finishCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- void revertCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- void recoverFailedCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- // notification protocol
- public:
- /// Adjust the internal representation after external changes to the original data - build NodeChangeInformation objects for notification
- void adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, Node const & _aNode, SubtreeChange const& aExternalChange);
-
- // visitor dispatch
- public:
- configuration::GroupMemberVisitor::Result dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor);
-
- /// Call <code>aVisitor.visit(aElement)</code> for each element in this set until SetNodeVisitor::DONE is returned.
- configuration::SetNodeVisitor::Result dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor);
-
- // value (element) node specific operations
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue(ValueNode const& _aNode) const;
-#if OSL_DEBUG_LEVEL > 0
- /// get the type of this value
- com::sun::star::uno::Type getValueType(ValueNode const& _aNode) const;
-#endif
-
- // group node specific operations
- public:
- /// does this hold a child value of the given name
- bool hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const;
-
- /// does this hold a child value
- bool hasValue(GroupNode const& _aNode) const;
-
- /// are defaults for this node available ?
- bool areValueDefaultsAvailable(GroupNode const& _aNode) const;
-
- /// retrieve data for the child value of the given name
- configuration::ValueMemberNode getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const;
-
- /// retrieve data for updating the child value of the given name
- configuration::ValueMemberUpdate getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName);
-
- // set node specific operations
- public:
- /// does this set contain any elements (loads elements if needed)
- bool isEmpty(SetNode const& _aNode) const;
-
- /// does this set contain an element named <var>aName</var> (loads elements if needed)
- configuration::SetEntry findElement(SetNode const& _aNode, rtl::OUString const& aName) const;
-
- /// does this set contain an element named <var>aName</var> (and is that element loaded ?)
- configuration::SetEntry findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const;
-
- /// insert a new entry into this set
- void insertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
-
- /// remove an existing entry into this set
- void removeElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- /** Create a Subtree change as 'diff' which allows transforming the set to its default state
- (given that <var>_rDefaultTree</var> points to a default instance of this set)
- <p>Ownership of added trees should be transferred to the SubtreeChange.</p>
- */
- std::auto_ptr<SubtreeChange> differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree) const;
-
- /// Get the template that describes elements of this set
- rtl::Reference<configuration::Template> getElementTemplate(SetNode const& _aNode) const;
-
- /// Get a template provider that can create new elements for this set
- configuration::TemplateProvider getTemplateProvider(SetNode const& _aNode) const;
-
- // create a configuration::Tree * from a configuration::SetEntry
- configuration::Tree * extractTree(configuration::SetEntry const& _anEntry);
-
- // creating/changing state/strategy
- public:
- NodeFactory& getNodeFactory();
-
- // access to node innards
- protected:
- /// provide access to the address of the underlying node
- sharable::Node * getNodeAddress(Node const& _aNode) const;
-
- /// retrieve the attributes of the underlying node
- node::Attributes getNodeAttributes(Node const& _aNode) const;
-
- protected:
- //helper for migration to new (info based) model for adjusting to changes
- static void addLocalChangeHelper( configuration::NodeChangesInformation& rLocalChanges, configuration::NodeChange const& aChange);
-
- private:
- void implAdjustToValueChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges);
- void implAdjustToSubChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const & _aGroupNode, SubtreeChange const& rExternalChanges);
- void implAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, SubtreeChange const& rExternalChanges, unsigned int nDepth);
- void implAdjustToElementChange (configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, Change const& rElementChange, unsigned int nElementDepth);
- void implCommitDirectIn(sharable::TreeFragment * placeHolder, Node const& _aNode);
-
- protected:
- void checkInstance(configuration::Tree * tree) const;
- configuration::SetEntry implFindElement(SetNode const& _aNode, rtl::OUString const& aName) const;
- configuration::ElementTreeData implMakeElement(SetNode const& _aNode, configuration::SetEntry const& anEntry) const;
-
- // virtual interface - these functions must be provided
- private:
- // change handling
- virtual bool doHasChanges(Node const& _aNode) const = 0;
- virtual void doMarkChanged(Node const& _aNode) = 0;
-
- virtual NodeFactory& doGetNodeFactory() = 0;
-
- // virtual interface - these functions all have default implementations without support for pending changes
- protected:
- // change handling
- virtual void doCollectChanges(Node const& _aNode, configuration::NodeChanges& rChanges) const;
-
- // commit protocol
- virtual std::auto_ptr<SubtreeChange> doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- virtual void doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges);
-
- // notification protocol
- virtual configuration::ValueChangeImpl* doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& aName, ValueChange const& rExternalChange);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const = 0;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const = 0;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry) = 0;
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName) = 0;
- };
-
- inline node::Attributes ViewStrategy::getAttributes(Node const& _aNode) const
- { return doAdjustAttributes(getNodeAttributes(_aNode)); }
-
- inline bool ViewStrategy::hasChanges(Node const& _aNode) const
- { return doHasChanges(_aNode); }
-
- inline NodeFactory& ViewStrategy::getNodeFactory()
- { return doGetNodeFactory(); }
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/type.cxx b/configmgr/source/type.cxx
new file mode 100644
index 000000000000..e1b8a95859ef
--- /dev/null
+++ b/configmgr/source/type.cxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+bool isListType(Type type) {
+ return type >= TYPE_BOOLEAN_LIST;
+}
+
+Type elementType(Type type) {
+ switch (type) {
+ case TYPE_BOOLEAN_LIST:
+ return TYPE_BOOLEAN;
+ case TYPE_SHORT_LIST:
+ return TYPE_SHORT;
+ case TYPE_INT_LIST:
+ return TYPE_INT;
+ case TYPE_LONG_LIST:
+ return TYPE_LONG;
+ case TYPE_DOUBLE_LIST:
+ return TYPE_DOUBLE;
+ case TYPE_STRING_LIST:
+ return TYPE_STRING;
+ case TYPE_HEXBINARY_LIST:
+ return TYPE_HEXBINARY;
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+css::uno::Type mapType(Type type) {
+ switch (type) {
+ case TYPE_ANY:
+ return cppu::UnoType< css::uno::Any >::get();
+ case TYPE_BOOLEAN:
+ return cppu::UnoType< sal_Bool >::get();
+ case TYPE_SHORT:
+ return cppu::UnoType< sal_Int16 >::get();
+ case TYPE_INT:
+ return cppu::UnoType< sal_Int32 >::get();
+ case TYPE_LONG:
+ return cppu::UnoType< sal_Int64 >::get();
+ case TYPE_DOUBLE:
+ return cppu::UnoType< double >::get();
+ case TYPE_STRING:
+ return cppu::UnoType< rtl::OUString >::get();
+ case TYPE_HEXBINARY:
+ return cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get();
+ case TYPE_BOOLEAN_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Bool > >::get();
+ case TYPE_SHORT_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int16 > >::get();
+ case TYPE_INT_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int32 > >::get();
+ case TYPE_LONG_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int64 > >::get();
+ case TYPE_DOUBLE_LIST:
+ return cppu::UnoType< css::uno::Sequence< double > >::get();
+ case TYPE_STRING_LIST:
+ return cppu::UnoType< css::uno::Sequence< rtl::OUString > >::get();
+ case TYPE_HEXBINARY_LIST:
+ return cppu::UnoType<
+ css::uno::Sequence< css::uno::Sequence< sal_Int8 > > >::get();
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Type getDynamicType(css::uno::Any const & value) {
+ switch (value.getValueType().getTypeClass()) {
+ case css::uno::TypeClass_VOID:
+ return TYPE_NIL;
+ case css::uno::TypeClass_BOOLEAN:
+ return TYPE_BOOLEAN;
+ case css::uno::TypeClass_BYTE:
+ return TYPE_SHORT;
+ case css::uno::TypeClass_SHORT:
+ return TYPE_SHORT;
+ case css::uno::TypeClass_UNSIGNED_SHORT:
+ return value.has< sal_Int16 >() ? TYPE_SHORT : TYPE_INT;
+ case css::uno::TypeClass_LONG:
+ return TYPE_INT;
+ case css::uno::TypeClass_UNSIGNED_LONG:
+ return value.has< sal_Int32 >() ? TYPE_INT : TYPE_LONG;
+ case css::uno::TypeClass_HYPER:
+ return TYPE_LONG;
+ case css::uno::TypeClass_UNSIGNED_HYPER:
+ return value.has< sal_Int64 >() ? TYPE_LONG : TYPE_ERROR;
+ case css::uno::TypeClass_FLOAT:
+ case css::uno::TypeClass_DOUBLE:
+ return TYPE_DOUBLE;
+ case css::uno::TypeClass_STRING:
+ return TYPE_STRING;
+ case css::uno::TypeClass_SEQUENCE: //TODO
+ {
+ rtl::OUString name(value.getValueType().getTypeName());
+ if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]byte"))) {
+ return TYPE_HEXBINARY;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]boolean")))
+ {
+ return TYPE_BOOLEAN_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]short")))
+ {
+ return TYPE_SHORT_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]long")))
+ {
+ return TYPE_INT_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]hyper")))
+ {
+ return TYPE_LONG_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]double")))
+ {
+ return TYPE_DOUBLE_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]string")))
+ {
+ return TYPE_STRING_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[][]byte")))
+ {
+ return TYPE_HEXBINARY_LIST;
+ }
+ }
+ // fall through
+ default:
+ return TYPE_ERROR;
+ }
+}
+
+}
diff --git a/configmgr/source/type.hxx b/configmgr/source/type.hxx
new file mode 100644
index 000000000000..85edc9b5e9cd
--- /dev/null
+++ b/configmgr/source/type.hxx
@@ -0,0 +1,56 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_TYPE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_TYPE_HXX
+
+#include "sal/config.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+ class Type;
+} } } }
+
+namespace configmgr {
+
+enum Type {
+ TYPE_ERROR, TYPE_NIL, TYPE_ANY, TYPE_BOOLEAN, TYPE_SHORT, TYPE_INT,
+ TYPE_LONG, TYPE_DOUBLE, TYPE_STRING, TYPE_HEXBINARY, TYPE_BOOLEAN_LIST,
+ TYPE_SHORT_LIST, TYPE_INT_LIST, TYPE_LONG_LIST, TYPE_DOUBLE_LIST,
+ TYPE_STRING_LIST, TYPE_HEXBINARY_LIST };
+
+bool isListType(Type type);
+
+Type elementType(Type type);
+
+com::sun::star::uno::Type mapType(Type type);
+
+Type getDynamicType(com::sun::star::uno::Any const & value);
+
+}
+
+#endif
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
new file mode 100644
index 000000000000..ab711c3bec10
--- /dev/null
+++ b/configmgr/source/update.cxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "configmgr/update.hxx"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+#include "components.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr {
+
+namespace update {
+
+void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri) {
+ osl::MutexGuard g(lock);
+ Components::getSingleton().insertExtensionXcsFile(shared, fileUri);
+}
+
+void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) {
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ Modifications mods;
+ Components::getSingleton().insertExtensionXcuFile(
+ shared, fileUri, &mods);
+ Components::getSingleton().initGlobalBroadcaster(
+ mods, rtl::Reference< RootAccess >(), &bc);
+ }
+ bc.send();
+}
+
+}
+
+}
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
new file mode 100644
index 000000000000..f951aac5ca01
--- /dev/null
+++ b/configmgr/source/valueparser.cxx
@@ -0,0 +1,476 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "valueparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool parseHexDigit(char c, int * value) {
+ OSL_ASSERT(value != 0);
+ if (c >= '0' && c <= '9') {
+ *value = c - '0';
+ return true;
+ }
+ if (c >= 'A' && c <= 'F') {
+ *value = c - 'A' + 10;
+ return true;
+ }
+ if (c >= 'a' && c <= 'f') {
+ *value = c - 'a' + 10;
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Bool * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
+ text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
+ {
+ *value = true;
+ return true;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("false")) ||
+ text.equals(RTL_CONSTASCII_STRINGPARAM("0")))
+ {
+ *value = false;
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Int16 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ sal_Int32 n =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt32(16) :
+ rtl::OString(text.begin, text.length).toInt32();
+ //TODO: check valid lexical representation
+ if (n >= SAL_MIN_INT16 && n <= SAL_MAX_INT16) {
+ *value = static_cast< sal_Int16 >(n);
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Int32 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ *value =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt32(16) :
+ rtl::OString(text.begin, text.length).toInt32();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, sal_Int64 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ *value =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt64(16) :
+ rtl::OString(text.begin, text.length).toInt64();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, double * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ *value = rtl::OString(text.begin, text.length).toDouble();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, rtl::OUString * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ *value = xmldata::convertFromUtf8(text);
+ return true;
+}
+
+bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ if ((text.length & 1) != 0) {
+ return false;
+ }
+ comphelper::SequenceAsVector< sal_Int8 > seq;
+ for (sal_Int32 i = 0; i != text.length;) {
+ int n1;
+ int n2;
+ if (!parseHexDigit(text.begin[i++], &n1) ||
+ !parseHexDigit(text.begin[i++], &n2))
+ {
+ return false;
+ }
+ seq.push_back(static_cast< sal_Int8 >((n1 << 4) | n2));
+ }
+ *value = seq.getAsConstList();
+ return true;
+}
+
+template< typename T > css::uno::Any parseSingleValue(Span const & text) {
+ T val;
+ if (!parseValue(text, &val)) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return css::uno::makeAny(val);
+}
+
+template< typename T > css::uno::Any parseListValue(
+ rtl::OString const & separator, Span const & text)
+{
+ comphelper::SequenceAsVector< T > seq;
+ Span sep;
+ if (separator.getLength() == 0) {
+ sep = Span(RTL_CONSTASCII_STRINGPARAM(" "));
+ } else {
+ sep = Span(separator.getStr(), separator.getLength());
+ }
+ if (text.length != 0) {
+ for (Span t(text);;) {
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ t.begin, t.length, sep.begin, sep.length);
+ T val;
+ if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ seq.push_back(val);
+ if (i < 0) {
+ break;
+ }
+ t.begin += i + sep.length;
+ t.length -= i + sep.length;
+ }
+ }
+ return css::uno::makeAny(seq.getAsConstList());
+}
+
+css::uno::Any parseValue(
+ rtl::OString const & separator, Span const & text, Type type)
+{
+ switch (type) {
+ case TYPE_ANY:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value of type any")),
+ css::uno::Reference< css::uno::XInterface >());
+ case TYPE_BOOLEAN:
+ return parseSingleValue< sal_Bool >(text);
+ case TYPE_SHORT:
+ return parseSingleValue< sal_Int16 >(text);
+ case TYPE_INT:
+ return parseSingleValue< sal_Int32 >(text);
+ case TYPE_LONG:
+ return parseSingleValue< sal_Int64 >(text);
+ case TYPE_DOUBLE:
+ return parseSingleValue< double >(text);
+ case TYPE_STRING:
+ return parseSingleValue< rtl::OUString >(text);
+ case TYPE_HEXBINARY:
+ return parseSingleValue< css::uno::Sequence< sal_Int8 > >(text);
+ case TYPE_BOOLEAN_LIST:
+ return parseListValue< sal_Bool >(separator, text);
+ case TYPE_SHORT_LIST:
+ return parseListValue< sal_Int16 >(separator, text);
+ case TYPE_INT_LIST:
+ return parseListValue< sal_Int32 >(separator, text);
+ case TYPE_LONG_LIST:
+ return parseListValue< sal_Int64 >(separator, text);
+ case TYPE_DOUBLE_LIST:
+ return parseListValue< double >(separator, text);
+ case TYPE_STRING_LIST:
+ return parseListValue< rtl::OUString >(separator, text);
+ case TYPE_HEXBINARY_LIST:
+ return parseListValue< css::uno::Sequence< sal_Int8 > >(
+ separator, text);
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+}
+
+ValueParser::ValueParser(int layer): layer_(layer) {}
+
+ValueParser::~ValueParser() {}
+
+XmlReader::Text ValueParser::getTextMode() const {
+ if (node_.is()) {
+ switch (state_) {
+ case STATE_TEXT:
+ case STATE_IT:
+ return
+ (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
+ separator_.getLength() != 0)
+ ? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED;
+ default:
+ break;
+ }
+ }
+ return XmlReader::TEXT_NONE;
+}
+
+bool ValueParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (!node_.is()) {
+ return false;
+ }
+ switch (state_) {
+ case STATE_TEXT:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
+ isListType(type_) && separator_.getLength() == 0)
+ {
+ checkEmptyPad(reader);
+ state_ = STATE_IT;
+ return true;
+ }
+ // fall through
+ case STATE_IT:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
+ (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
+ {
+ sal_Int32 scalar = -1;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
+ {
+ if (!parseValue(reader.getAttributeValue(true), &scalar)) {
+ scalar = -1;
+ }
+ break;
+ }
+ }
+ if (scalar >= 0 && scalar < 0x20 && scalar != 0x09 &&
+ scalar != 0x0A && scalar != 0x0D)
+ {
+ char c = static_cast< char >(scalar);
+ pad_.add(&c, 1);
+ } else if (scalar == 0xFFFE) {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\xEF\xBF\xBE"));
+ } else if (scalar == 0xFFFF) {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\xEF\xBF\xBF"));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad unicode scalar attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ state_ = State(state_ + 1);
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+bool ValueParser::endElement(XmlReader const & reader) {
+ if (!node_.is()) {
+ return false;
+ }
+ switch (state_) {
+ case STATE_TEXT:
+ {
+ css::uno::Any value;
+ if (items_.empty()) {
+ value = parseValue(separator_, pad_.get(), type_);
+ pad_.clear();
+ } else {
+ checkEmptyPad(reader);
+ switch (type_) {
+ case TYPE_BOOLEAN_LIST:
+ value = convertItems< sal_Bool >();
+ break;
+ case TYPE_SHORT_LIST:
+ value = convertItems< sal_Int16 >();
+ break;
+ case TYPE_INT_LIST:
+ value = convertItems< sal_Int32 >();
+ break;
+ case TYPE_LONG_LIST:
+ value = convertItems< sal_Int64 >();
+ break;
+ case TYPE_DOUBLE_LIST:
+ value = convertItems< double >();
+ break;
+ case TYPE_STRING_LIST:
+ value = convertItems< rtl::OUString >();
+ break;
+ case TYPE_HEXBINARY_LIST:
+ value = convertItems< css::uno::Sequence< sal_Int8 > >();
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ items_.clear();
+ }
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ dynamic_cast< PropertyNode * >(node_.get())->setValue(
+ layer_, value);
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ NodeMap::iterator i(
+ node_->getMembers().find(localizedName_));
+ if (i == node_->getMembers().end()) {
+ node_->getMembers().insert(
+ NodeMap::value_type(
+ localizedName_,
+ new LocalizedValueNode(layer_, value)));
+ } else {
+ dynamic_cast< LocalizedValueNode * >(i->second.get())->
+ setValue(layer_, value);
+ }
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ separator_ = rtl::OString();
+ node_.clear();
+ }
+ break;
+ case STATE_TEXT_UNICODE:
+ case STATE_IT_UNICODE:
+ state_ = State(state_ - 1);
+ break;
+ case STATE_IT:
+ items_.push_back(
+ parseValue(rtl::OString(), pad_.get(), elementType(type_)));
+ pad_.clear();
+ state_ = STATE_TEXT;
+ break;
+ }
+ return true;
+}
+
+void ValueParser::characters(Span const & text) {
+ if (node_.is()) {
+ OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
+ pad_.add(text.begin, text.length);
+ }
+}
+
+void ValueParser::start(
+ rtl::Reference< Node > const & node, rtl::OUString const & localizedName)
+{
+ OSL_ASSERT(node.is() && !node_.is());
+ node_ = node;
+ localizedName_ = localizedName;
+ state_ = STATE_TEXT;
+}
+
+int ValueParser::getLayer() const {
+ return layer_;
+}
+
+void ValueParser::checkEmptyPad(XmlReader const & reader) const {
+ if (pad_.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "mixed text and <it> elements in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+template< typename T > css::uno::Any ValueParser::convertItems() {
+ css::uno::Sequence< T > seq(items_.size());
+ for (sal_Int32 i = 0; i < seq.getLength(); ++i) {
+ OSL_VERIFY(items_[i] >>= seq[i]);
+ }
+ return css::uno::makeAny(seq);
+}
+
+}
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
new file mode 100644
index 000000000000..c328fe7eddce
--- /dev/null
+++ b/configmgr/source/valueparser.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_VALUEPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_VALUEPARSER_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+#include "rtl/ustring.hxx"
+
+#include "pad.hxx"
+#include "type.hxx"
+#include "xmlreader.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+namespace configmgr {
+
+class Node;
+struct Span;
+
+class ValueParser: private boost::noncopyable {
+public:
+ ValueParser(int layer);
+
+ ~ValueParser();
+
+ XmlReader::Text getTextMode() const;
+
+ bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ bool endElement(XmlReader const & reader);
+
+ void characters(Span const & text);
+
+ void start(
+ rtl::Reference< Node > const & property,
+ rtl::OUString const & localizedName = rtl::OUString());
+
+ int getLayer() const;
+
+ Type type_;
+ rtl::OString separator_;
+
+private:
+ void checkEmptyPad(XmlReader const & reader) const;
+
+ template< typename T > com::sun::star::uno::Any convertItems();
+
+ enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE };
+
+ int layer_;
+ rtl::Reference< Node > node_;
+ rtl::OUString localizedName_;
+ State state_;
+ Pad pad_;
+ std::vector< com::sun::star::uno::Any > items_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
new file mode 100644
index 000000000000..a8e0f77cbd2e
--- /dev/null
+++ b/configmgr/source/writemodfile.cxx
@@ -0,0 +1,631 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "osl/file.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "writemodfile.hxx"
+
+namespace configmgr {
+
+class Components;
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OString convertToUtf8(
+ rtl::OUString const & text, sal_Int32 offset, sal_Int32 length)
+{
+ OSL_ASSERT(
+ offset <= text.getLength() && text.getLength() - offset >= length);
+ rtl::OString s;
+ if (!rtl_convertUStringToString(
+ &s.pData, text.pData->buffer + offset, length,
+ RTL_TEXTENCODING_UTF8,
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot convert to UTF-8")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return s;
+}
+
+struct TempFile: public boost::noncopyable {
+ rtl::OUString url;
+ oslFileHandle handle;
+ bool closed;
+
+ TempFile(): handle(0), closed(false) {}
+
+ ~TempFile();
+};
+
+TempFile::~TempFile() {
+ if (handle != 0) {
+ if (!closed) {
+ oslFileError e = osl_closeFile(handle);
+ if (e != osl_File_E_None) {
+ OSL_TRACE(
+ "osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+ }
+ osl::FileBase::RC e = osl::File::remove(url);
+ if (e != osl::FileBase::E_None) {
+ OSL_TRACE("osl_removeFile failed with %ld", static_cast< long >(e));
+ }
+ }
+}
+
+void writeData(oslFileHandle handle, char const * begin, sal_Int32 length) {
+ OSL_ASSERT(length >= 0);
+ sal_uInt64 n;
+ if ((osl_writeFile(handle, begin, static_cast< sal_uInt32 >(length), &n) !=
+ osl_File_E_None) ||
+ n != static_cast< sal_uInt32 >(length))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("write failure")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void writeData(oslFileHandle handle, rtl::OString const & text) {
+ writeData(handle, text.getStr(), text.getLength());
+}
+
+void writeAttributeValue(oslFileHandle handle, rtl::OUString const & value) {
+ sal_Int32 i = 0;
+ sal_Int32 j = i;
+ for (; j < value.getLength(); ++j) {
+ OSL_ASSERT(
+ value[j] == 0x0009 || value[j] == 0x000A || value[j] == 0x000D ||
+ (value[j] >= 0x0020 && value[j] != 0xFFFE && value[j] != 0xFFFF));
+ switch(value[j]) {
+ case '\x09':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#9;"));
+ i = j + 1;
+ break;
+ case '\x0A':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xA;"));
+ i = j + 1;
+ break;
+ case '\x0D':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xD;"));
+ i = j + 1;
+ break;
+ case '"':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&quot;"));
+ i = j + 1;
+ break;
+ case '&':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ i = j + 1;
+ break;
+ case '<':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&lt;"));
+ i = j + 1;
+ break;
+ default:
+ break;
+ }
+ }
+ writeData(handle, convertToUtf8(value, i, j - i));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Bool value) {
+ if (value) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("true"));
+ } else {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("false"));
+ }
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int16 value) {
+ writeData(handle, rtl::OString::valueOf(static_cast< sal_Int32 >(value)));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int32 value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int64 value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, double value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, rtl::OUString const & value) {
+ sal_Int32 i = 0;
+ sal_Int32 j = i;
+ for (; j < value.getLength(); ++j) {
+ sal_Unicode c = value[j];
+ if ((c < 0x0020 && c != 0x0009 && c != 0x000A && c != 0x000D) ||
+ c == 0xFFFE || c == 0xFFFF)
+ {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("<unicode oor:scalar=\""));
+ writeData(
+ handle, rtl::OString::valueOf(static_cast< sal_Int32 >(c)));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\"/>"));
+ i = j + 1;
+ } else if (c == '\x0D') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xD;"));
+ i = j + 1;
+ } else if (c == '&') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ i = j + 1;
+ } else if (c == '<') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&lt;"));
+ i = j + 1;
+ } else if (c == '>') {
+ // "MUST, for compatibility, be escaped [...] when it appears in the
+ // string ']]>'":
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&gt;"));
+ i = j + 1;
+ }
+ }
+ writeData(handle, convertToUtf8(value, i, j - i));
+}
+
+void writeValueContent(
+ oslFileHandle handle, css::uno::Sequence< sal_Int8 > const & value)
+{
+ for (sal_Int32 i = 0; i < value.getLength(); ++i) {
+ static char const hexDigit[16] = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
+ 'D', 'E', 'F' };
+ writeData(handle, hexDigit + ((value[i] >> 4) & 0xF), 1);
+ writeData(handle, hexDigit + (value[i] & 0xF), 1);
+ }
+}
+
+template< typename T > void writeSingleValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ T val = T();
+ value >>= val;
+ writeValueContent(handle, val);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+template< typename T > void writeListValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ css::uno::Sequence< T > val;
+ value >>= val;
+ for (sal_Int32 i = 0; i < val.getLength(); ++i) {
+ if (i != 0) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(" "));
+ }
+ writeValueContent(handle, val[i]);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+template< typename T > void writeItemListValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ css::uno::Sequence< T > val;
+ value >>= val;
+ for (sal_Int32 i = 0; i < val.getLength(); ++i) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<it>"));
+ writeValueContent(handle, val[i]);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</it>"));
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+void writeValue(oslFileHandle handle, Type type, css::uno::Any const & value) {
+ switch (type) {
+ case TYPE_BOOLEAN:
+ writeSingleValue< sal_Bool >(handle, value);
+ break;
+ case TYPE_SHORT:
+ writeSingleValue< sal_Int16 >(handle, value);
+ break;
+ case TYPE_INT:
+ writeSingleValue< sal_Int32 >(handle, value);
+ break;
+ case TYPE_LONG:
+ writeSingleValue< sal_Int64 >(handle, value);
+ break;
+ case TYPE_DOUBLE:
+ writeSingleValue< double >(handle, value);
+ break;
+ case TYPE_STRING:
+ writeSingleValue< rtl::OUString >(handle, value);
+ break;
+ case TYPE_HEXBINARY:
+ writeSingleValue< css::uno::Sequence< sal_Int8 > >(handle, value);
+ break;
+ case TYPE_BOOLEAN_LIST:
+ writeListValue< sal_Bool >(handle, value);
+ break;
+ case TYPE_SHORT_LIST:
+ writeListValue< sal_Int16 >(handle, value);
+ break;
+ case TYPE_INT_LIST:
+ writeListValue< sal_Int32 >(handle, value);
+ break;
+ case TYPE_LONG_LIST:
+ writeListValue< sal_Int64 >(handle, value);
+ break;
+ case TYPE_DOUBLE_LIST:
+ writeListValue< double >(handle, value);
+ break;
+ case TYPE_STRING_LIST:
+ writeItemListValue< rtl::OUString >(handle, value);
+ break;
+ case TYPE_HEXBINARY_LIST:
+ writeItemListValue< css::uno::Sequence< sal_Int8 > >(handle, value);
+ break;
+ default: // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+ OSL_ASSERT(false); // this cannot happen
+ }
+}
+
+void writeNode(
+ Components & components, oslFileHandle handle,
+ rtl::Reference< Node > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node)
+{
+ static Span const typeNames[] = {
+ Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
+ switch (node->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(node.get());
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\""));
+ Type type = prop->getStaticType();
+ Type dynType = getDynamicType(prop->getValue(components));
+ OSL_ASSERT(dynType != TYPE_ERROR);
+ if (type == TYPE_ANY) {
+ type = dynType;
+ if (type != TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" oor:type=\""));
+ writeData(
+ handle, typeNames[type].begin, typeNames[type].length);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ }
+ writeData(handle, "><value");
+ if (dynType == TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xsi:nil=\"true\"/>"));
+ } else {
+ writeValue(handle, type, prop->getValue(components));
+ }
+ writeData(handle, "</prop>");
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\">"));
+ for (NodeMap::iterator i(node->getMembers().begin());
+ i != node->getMembers().end(); ++i)
+ {
+ writeNode(components, handle, node, i->first, i->second);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</prop>"));
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<value"));
+ if (name.getLength() != 0) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ Type type = dynamic_cast< LocalizedPropertyNode * >(parent.get())->
+ getStaticType();
+ css::uno::Any value(
+ dynamic_cast< LocalizedValueNode * >(node.get())->getValue());
+ Type dynType = getDynamicType(value);
+ OSL_ASSERT(dynType != TYPE_ERROR);
+ if (type == TYPE_ANY) {
+ type = dynType;
+ if (type != TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" oor:type=\""));
+ writeData(
+ handle, typeNames[type].begin, typeNames[type].length);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ }
+ if (dynType == TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xsi:nil=\"true\"/>"));
+ } else {
+ writeValue(handle, type, value);
+ }
+ }
+ break;
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<node oor:name=\""));
+ writeAttributeValue(handle, name);
+ if (node->getTemplateName().getLength() != 0) { // set member
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"replace"));
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
+ for (NodeMap::iterator i(node->getMembers().begin());
+ i != node->getMembers().end(); ++i)
+ {
+ writeNode(components, handle, node, i->first, i->second);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</node>"));
+ break;
+ }
+}
+
+void writeModifications(
+ Components & components, oslFileHandle handle,
+ rtl::OUString const & grandparentPathRepresentation,
+ rtl::OUString const & parentName, rtl::Reference< Node > const & parent,
+ rtl::OUString const & nodeName, rtl::Reference< Node > const & node,
+ Modifications::Node const & modifications)
+{
+ // It is never necessary to write oor:finalized or oor:mandatory attributes,
+ // as they cannot be set via the UNO API.
+ if (modifications.children.empty()) {
+ OSL_ASSERT(parent.is());
+ // components themselves have no parent but must have children
+ if (node.is()) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(parent->getTemplateName(), parentName)));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
+ writeNode(components, handle, parent, nodeName, node);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</item>"));
+ } else {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
+ switch (parent->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ writeAttributeValue(handle, grandparentPathRepresentation);
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
+ writeAttributeValue(handle, parentName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\"><value"));
+ if (nodeName.getLength() != 0) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ " oor:op=\"remove\"/></prop></item>"));
+ break;
+ case Node::KIND_GROUP:
+ OSL_ASSERT(
+ dynamic_cast< GroupNode * >(parent.get())->isExtensible());
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(
+ parent->getTemplateName(), parentName)));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "\" oor:op=\"remove\"/></item>"));
+ break;
+ case Node::KIND_SET:
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(
+ parent->getTemplateName(), parentName)));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><node oor:name=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "\" oor:op=\"remove\"/></item>"));
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ } else {
+ rtl::OUString parentPathRep;
+ if (parent.is()) { // components themselves have no parent
+ parentPathRep = grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(parent->getTemplateName(), parentName);
+ }
+ OSL_ASSERT(node.is());
+ for (Modifications::Node::Children::const_iterator i(
+ modifications.children.begin());
+ i != modifications.children.end(); ++i)
+ {
+ writeModifications(
+ components, handle, parentPathRep, nodeName, node, i->first,
+ node->getMember(i->first), i->second);
+ }
+ }
+}
+
+}
+
+void writeModFile(
+ Components & components, rtl::OUString const & url, Data const & data)
+{
+ sal_Int32 i = url.lastIndexOf('/');
+ OSL_ASSERT(i != -1);
+ rtl::OUString dir(url.copy(0, i));
+ switch (osl::Directory::createPath(dir)) {
+ case osl::FileBase::E_None:
+ case osl::FileBase::E_EXIST:
+ break;
+ case osl::FileBase::E_ACCES:
+ OSL_TRACE(
+ "cannot create registrymodifications.xcu path (E_ACCES); changes"
+ " will be lost");
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot create directory ")) +
+ dir),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ TempFile tmp;
+ switch (osl::FileBase::createTempFile(&dir, &tmp.handle, &tmp.url)) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_ACCES:
+ OSL_TRACE(
+ "cannot create temp registrymodifications.xcu (E_ACCES); changes"
+ " will be lost");
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot create temporary file in ")) +
+ dir),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ writeData(
+ tmp.handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><oor:items"
+ " xmlns:oor=\"http://openoffice.org/2001/registry\""
+ " xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"));
+ //TODO: Do not write back information about those removed items that did not
+ // come from the .xcs/.xcu files, anyway (but had been added dynamically
+ // instead):
+ for (Modifications::Node::Children::const_iterator j(
+ data.modifications.getRoot().children.begin());
+ j != data.modifications.getRoot().children.end(); ++j)
+ {
+ writeModifications(
+ components, tmp.handle, rtl::OUString(), rtl::OUString(),
+ rtl::Reference< Node >(), j->first,
+ Data::findNode(Data::NO_LAYER, data.components, j->first),
+ j->second);
+ }
+ writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM("</oor:items>"));
+ oslFileError e = osl_closeFile(tmp.handle);
+ tmp.closed = true;
+ if (e != osl_File_E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot close ")) +
+ tmp.url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (osl::File::move(tmp.url, url) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot move ")) +
+ tmp.url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ tmp.handle = 0;
+}
+
+}
diff --git a/configmgr/source/writemodfile.hxx b/configmgr/source/writemodfile.hxx
new file mode 100644
index 000000000000..250edfd095af
--- /dev/null
+++ b/configmgr/source/writemodfile.hxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
+
+#include "sal/config.h"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Components;
+struct Data;
+
+void writeModFile(
+ Components & components, rtl::OUString const & url, Data const & data);
+
+}
+
+#endif
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
new file mode 100644
index 000000000000..2f860f805487
--- /dev/null
+++ b/configmgr/source/xcdparser.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "span.hxx"
+#include "xcdparser.hxx"
+#include "xcsparser.hxx"
+#include "xcuparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data * data):
+ layer_(layer), dependencies_(dependencies), data_(data), state_(STATE_START)
+{}
+
+XcdParser::~XcdParser() {}
+
+XmlReader::Text XcdParser::getTextMode() {
+ return nestedParser_.is()
+ ? nestedParser_->getTextMode() : XmlReader::TEXT_NONE;
+}
+
+bool XcdParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (nestedParser_.is()) {
+ OSL_ASSERT(nesting_ != LONG_MAX);
+ ++nesting_;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ switch (state_) {
+ case STATE_START:
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
+ {
+ state_ = STATE_DEPENDENCIES;
+ return true;
+ }
+ break;
+ case STATE_DEPENDENCIES:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
+ {
+ if (dependency_.getLength() == 0) {
+ Span attrFile;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
+ {
+ attrFile = reader.getAttributeValue(false);
+ }
+ }
+ if (!attrFile.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no dependency file attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ dependency_ = xmldata::convertFromUtf8(attrFile);
+ if (dependency_.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad dependency file attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ if (dependencies_.find(dependency_) == dependencies_.end()) {
+ return false;
+ }
+ state_ = STATE_DEPENDENCY;
+ dependency_ = rtl::OUString();
+ return true;
+ }
+ state_ = STATE_COMPONENTS;
+ // fall through
+ case STATE_COMPONENTS:
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
+ {
+ nestedParser_ = new XcsParser(layer_, data_);
+ nesting_ = 1;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
+ {
+ nestedParser_ = new XcuParser(layer_ + 1, data_, 0);
+ nesting_ = 1;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ break;
+ default: // STATE_DEPENDENCY
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcdParser::endElement(XmlReader const & reader) {
+ if (nestedParser_.is()) {
+ nestedParser_->endElement(reader);
+ if (--nesting_ == 0) {
+ nestedParser_.clear();
+ }
+ } else {
+ switch (state_) {
+ case STATE_DEPENDENCY:
+ state_ = STATE_DEPENDENCIES;
+ break;
+ case STATE_DEPENDENCIES:
+ case STATE_COMPONENTS:
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+}
+
+void XcdParser::characters(Span const & text) {
+ if (nestedParser_.is()) {
+ nestedParser_->characters(text);
+ }
+}
+
+}
diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx
new file mode 100644
index 000000000000..2e35b3686e60
--- /dev/null
+++ b/configmgr/source/xcdparser.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
+
+#include "sal/config.h"
+
+#include <set>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "parser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+struct Data;
+struct Span;
+
+class XcdParser: public Parser {
+public:
+ typedef std::set< rtl::OUString > Dependencies;
+
+ XcdParser(int layer, Dependencies const & dependencies, Data * data);
+
+private:
+ virtual ~XcdParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & text);
+
+ enum State {
+ STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };
+
+ int layer_;
+ Dependencies const & dependencies_;
+ Data * data_;
+ State state_;
+ rtl::OUString dependency_;
+ rtl::Reference< Parser > nestedParser_;
+ long nesting_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
new file mode 100644
index 000000000000..15141844a276
--- /dev/null
+++ b/configmgr/source/xcsparser.cxx
@@ -0,0 +1,598 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "localizedpropertynode.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "xcsparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcsParser::XcsParser(int layer, Data * data):
+ valueParser_(layer), data_(data), state_(STATE_START)
+{}
+
+XcsParser::~XcsParser() {}
+
+XmlReader::Text XcsParser::getTextMode() {
+ return valueParser_.getTextMode();
+}
+
+bool XcsParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (valueParser_.startElement(reader, ns, name)) {
+ return true;
+ }
+ if (state_ == STATE_START) {
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
+ handleComponentSchema(reader);
+ state_ = STATE_COMPONENT_SCHEMA;
+ ignoring_ = 0;
+ return true;
+ }
+ } else {
+ //TODO: ignoring component-schema import, component-schema uses, and
+ // prop constraints; accepting all four at illegal places (and with
+ // illegal content):
+ if (ignoring_ > 0 ||
+ (ns == XmlReader::NAMESPACE_NONE &&
+ (name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("constraints")))))
+ {
+ OSL_ASSERT(ignoring_ < LONG_MAX);
+ ++ignoring_;
+ return true;
+ }
+ switch (state_) {
+ case STATE_COMPONENT_SCHEMA:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
+ {
+ state_ = STATE_TEMPLATES;
+ return true;
+ }
+ // fall through
+ case STATE_TEMPLATES_DONE:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ state_ = STATE_COMPONENT;
+ OSL_ASSERT(elements_.empty());
+ elements_.push(
+ Element(
+ new GroupNode(
+ valueParser_.getLayer(), false, rtl::OUString()),
+ componentName_));
+ return true;
+ }
+ break;
+ case STATE_TEMPLATES:
+ if (elements_.empty()) {
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
+ {
+ handleGroup(reader, true);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
+ {
+ handleSet(reader, true);
+ return true;
+ }
+ break;
+ }
+ // fall through
+ case STATE_COMPONENT:
+ OSL_ASSERT(!elements_.empty());
+ switch (elements_.top().node->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handlePropValue(reader, elements_.top().node);
+ return true;
+ }
+ break;
+ case Node::KIND_GROUP:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
+ {
+ handleProp(reader);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
+ {
+ handleNodeRef(reader);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
+ {
+ handleGroup(reader, false);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
+ {
+ handleSet(reader, false);
+ return true;
+ }
+ break;
+ case Node::KIND_SET:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
+ {
+ handleSetItem(
+ reader,
+ dynamic_cast< SetNode * >(elements_.top().node.get()));
+ return true;
+ }
+ break;
+ default: // Node::KIND_LOCALIZED_VALUE
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ break;
+ case STATE_COMPONENT_DONE:
+ break;
+ default: // STATE_START
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcsParser::endElement(XmlReader const & reader) {
+ if (valueParser_.endElement(reader)) {
+ return;
+ }
+ if (ignoring_ > 0) {
+ --ignoring_;
+ } else if (!elements_.empty()) {
+ Element top(elements_.top());
+ elements_.pop();
+ if (top.node.is()) {
+ NodeMap * map;
+ if (elements_.empty()) {
+ switch (state_) {
+ case STATE_TEMPLATES:
+ map = &data_->templates;
+ break;
+ case STATE_COMPONENT:
+ map = &data_->components;
+ state_ = STATE_COMPONENT_DONE;
+ break;
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ map = &elements_.top().node->getMembers();
+ }
+ if (!map->insert(NodeMap::value_type(top.name, top.node)).second) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate ")) +
+ top.name +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ } else {
+ switch (state_) {
+ case STATE_COMPONENT_SCHEMA:
+ case STATE_TEMPLATES_DONE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no component element in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ case STATE_TEMPLATES:
+ state_ = STATE_TEMPLATES_DONE;
+ break;
+ case STATE_COMPONENT_DONE:
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ }
+ }
+}
+
+void XcsParser::characters(Span const & text) {
+ valueParser_.characters(text);
+}
+
+void XcsParser::handleComponentSchema(XmlReader & reader) {
+ //TODO: oor:version, xml:lang attributes
+ rtl::OStringBuffer buf;
+ buf.append('.');
+ bool hasPackage = false;
+ bool hasName = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
+ {
+ if (hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-schema package attributes"
+ " in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasPackage = true;
+ Span s(reader.getAttributeValue(false));
+ buf.insert(0, s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ if (hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-schema name attributes in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasName = true;
+ Span s(reader.getAttributeValue(false));
+ buf.append(s.begin, s.length);
+ }
+ }
+ if (!hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-schema package attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-schema name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ componentName_ = xmldata::convertFromUtf8(
+ Span(buf.getStr(), buf.getLength()));
+}
+
+void XcsParser::handleNodeRef(XmlReader & reader) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node-ref name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > tmpl(
+ data_->getTemplate(
+ valueParser_.getLayer(),
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, 0)));
+ if (!tmpl.is()) {
+ //TODO: this can erroneously happen as long as import/uses attributes
+ // are not correctly processed
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node-ref ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > node(tmpl->clone());
+ node->setLayer(valueParser_.getLayer());
+ elements_.push(Element(node, name));
+}
+
+void XcsParser::handleProp(XmlReader & reader) {
+ bool hasName = false;
+ rtl::OUString name;
+ valueParser_.type_ = TYPE_ERROR;
+ bool localized = false;
+ bool nillable = true;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ valueParser_.type_ = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
+ {
+ localized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
+ {
+ nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (valueParser_.type_ == TYPE_ERROR) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop type attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ elements_.push(
+ Element(
+ (localized
+ ? rtl::Reference< Node >(
+ new LocalizedPropertyNode(
+ valueParser_.getLayer(), valueParser_.type_, nillable))
+ : rtl::Reference< Node >(
+ new PropertyNode(
+ valueParser_.getLayer(), valueParser_.type_, nillable,
+ css::uno::Any(), false))),
+ name));
+}
+
+void XcsParser::handlePropValue(
+ XmlReader & reader, rtl::Reference< Node > const & property)
+{
+ Span attrSeparator;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ attrSeparator = reader.getAttributeValue(false);
+ if (attrSeparator.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ valueParser_.separator_ = rtl::OString(
+ attrSeparator.begin, attrSeparator.length);
+ valueParser_.start(property);
+}
+
+void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
+ bool hasName = false;
+ rtl::OUString name;
+ bool extensible = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
+ {
+ extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no group name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (isTemplate) {
+ name = Data::fullTemplateName(componentName_, name);
+ }
+ elements_.push(
+ Element(
+ new GroupNode(
+ valueParser_.getLayer(), extensible,
+ isTemplate ? name : rtl::OUString()),
+ name));
+}
+
+void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no set name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (isTemplate) {
+ name = Data::fullTemplateName(componentName_, name);
+ }
+ elements_.push(
+ Element(
+ new SetNode(
+ valueParser_.getLayer(),
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, 0),
+ isTemplate ? name : rtl::OUString()),
+ name));
+}
+
+void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) {
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ set->getAdditionalTemplateNames().push_back(
+ xmldata::parseTemplateReference(component, hasNodeType, nodeType, 0));
+ elements_.push(Element(rtl::Reference< Node >(), rtl::OUString()));
+}
+
+}
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
new file mode 100644
index 000000000000..21a124945a2e
--- /dev/null
+++ b/configmgr/source/xcsparser.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCSPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCSPARSER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "parser.hxx"
+#include "valueparser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+class SetNode;
+struct Data;
+struct Span;
+
+class XcsParser: public Parser {
+public:
+ XcsParser(int layer, Data * data);
+
+private:
+ virtual ~XcsParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & text);
+
+ void handleComponentSchema(XmlReader & reader);
+
+ void handleNodeRef(XmlReader & reader);
+
+ void handleProp(XmlReader & reader);
+
+ void handlePropValue(
+ XmlReader & reader, rtl::Reference< Node > const & property);
+
+ void handleGroup(XmlReader & reader, bool isTemplate);
+
+ void handleSet(XmlReader & reader, bool isTemplate);
+
+ void handleSetItem(XmlReader & reader, SetNode * set);
+
+ enum State {
+ STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,
+ STATE_TEMPLATES_DONE, STATE_COMPONENT, STATE_COMPONENT_DONE };
+
+ struct Element {
+ rtl::Reference< Node > node;
+ rtl::OUString name;
+
+ inline Element(
+ rtl::Reference< Node > const & theNode,
+ rtl::OUString const & theName):
+ node(theNode), name(theName) {}
+ };
+
+ typedef std::stack< Element > ElementStack;
+
+ ValueParser valueParser_;
+ Data * data_;
+ rtl::OUString componentName_;
+ State state_;
+ long ignoring_;
+ ElementStack elements_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
new file mode 100644
index 000000000000..220168c62725
--- /dev/null
+++ b/configmgr/source/xcuparser.cxx
@@ -0,0 +1,1077 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "groupnode.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "xcuparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcuParser::XcuParser(int layer, Data * data, Modifications * modifications):
+ valueParser_(layer), data_(data), modifications_(modifications)
+{
+ if (layer == Data::NO_LAYER) {
+ OSL_ASSERT(modifications_ == 0);
+ modifications_ = &data_->modifications;
+ }
+}
+
+XcuParser::~XcuParser() {}
+
+XmlReader::Text XcuParser::getTextMode() {
+ return valueParser_.getTextMode();
+}
+
+bool XcuParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (valueParser_.startElement(reader, ns, name)) {
+ return true;
+ }
+ if (state_.empty()) {
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
+ {
+ handleComponentData(reader);
+ } else if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
+ {
+ state_.push(State(rtl::Reference< Node >(), false));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else if (state_.top().ignore) {
+ state_.push(state_.top());
+ } else if (!state_.top().node.is()) {
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
+ {
+ handleItem(reader);
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ switch (state_.top().node->kind()) {
+ case Node::KIND_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handlePropValue(
+ reader,
+ dynamic_cast< PropertyNode * >(state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad property node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handleLocpropValue(
+ reader,
+ dynamic_cast< LocalizedPropertyNode * >(
+ state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad localized property node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ case Node::KIND_GROUP:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
+ {
+ handleGroupProp(
+ reader,
+ dynamic_cast< GroupNode * >(state_.top().node.get()));
+ } else if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
+ {
+ handleGroupNode(reader, state_.top().node);
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad group node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_SET:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
+ {
+ handleSetNode(
+ reader, dynamic_cast< SetNode * >(state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ }
+ }
+ return true;
+}
+
+void XcuParser::endElement(XmlReader const & reader) {
+ if (valueParser_.endElement(reader)) {
+ return;
+ }
+ OSL_ASSERT(!state_.empty());
+ bool ignore = state_.top().ignore;
+ rtl::Reference< Node > insert;
+ rtl::OUString name;
+ if (state_.top().insert) {
+ insert = state_.top().node;
+ OSL_ASSERT(insert.is());
+ name = state_.top().name;
+ }
+ state_.pop();
+ if (insert.is()) {
+ OSL_ASSERT(!state_.empty() && state_.top().node.is());
+ state_.top().node->getMembers()[name] = insert;
+ }
+ if (!ignore && !modificationPath_.empty()) {
+ modificationPath_.pop_back();
+ // </item> will pop less than <item> pushed, but that is harmless,
+ // as the next <item> will reset modificationPath_
+ }
+}
+
+void XcuParser::characters(Span const & text) {
+ valueParser_.characters(text);
+}
+
+XcuParser::Operation XcuParser::parseOperation(Span const & text) {
+ OSL_ASSERT(text.is());
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
+ return OPERATION_MODIFY;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("replace"))) {
+ return OPERATION_REPLACE;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("fuse"))) {
+ return OPERATION_FUSE;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("remove"))) {
+ return OPERATION_REMOVE;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
+ xmldata::convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcuParser::handleComponentData(XmlReader & reader) {
+ rtl::OStringBuffer buf;
+ buf.append('.');
+ bool hasPackage = false;
+ bool hasName = false;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
+ {
+ if (hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-update package attributes"
+ " in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasPackage = true;
+ Span s(reader.getAttributeValue(false));
+ buf.insert(0, s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ if (hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-update name attributes in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasName = true;
+ Span s(reader.getAttributeValue(false));
+ buf.append(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-data package attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-data name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ componentName_ = xmldata::convertFromUtf8(
+ Span(buf.getStr(), buf.getLength()));
+ rtl::Reference< Node > node(
+ Data::findNode(
+ valueParser_.getLayer(), data_->components, componentName_));
+ if (!node.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown component ")) +
+ componentName_ +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (op) {
+ case OPERATION_MODIFY:
+ case OPERATION_FUSE:
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid operation on root node in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ node->getFinalized());
+ node->setFinalized(finalizedLayer);
+ state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
+ if (modifications_ != 0) {
+ OSL_ASSERT(modificationPath_.empty());
+ modificationPath_.push_back(componentName_);
+ }
+}
+
+void XcuParser::handleItem(XmlReader & reader) {
+ Span attrPath;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
+ {
+ attrPath = reader.getAttributeValue(false);
+ }
+ }
+ if (!attrPath.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("missing path attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString path(xmldata::convertFromUtf8(attrPath));
+ int finalizedLayer;
+ rtl::Reference< Node > node(
+ data_->resolvePathRepresentation(
+ path, &modificationPath_, &finalizedLayer));
+ if (!node.is()) {
+ //TODO: Within Components::parseModificationLayer (but only there) it
+ // can rightly happen that data is read that does not match a schema
+ // (that no schema exists, or that the schema specifies a different
+ // type), namely if the schema was brought along by an extension that
+ // has been removed or replaced; instead of taking care of that at all
+ // the relevant places, as a hack, only "top-level" <item>s (that only
+ // appear in modification layer data) with unknown path are filtered out
+ // here.
+ OSL_TRACE(
+ "configmgr unknown <item path=\"%s\">",
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State()); // ignored
+ return;
+ }
+ OSL_ASSERT(!modificationPath_.empty());
+ componentName_ = modificationPath_.front();
+ if (modifications_ == 0) {
+ modificationPath_.clear();
+ }
+ state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
+}
+
+void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
+ bool nil = false;
+ rtl::OString separator;
+ rtl::OUString external;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_XSI &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
+ {
+ nil = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ Type type = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ if (valueParser_.type_ != TYPE_ANY && type != valueParser_.type_) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value type in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ Span s(reader.getAttributeValue(false));
+ if (s.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ separator = rtl::OString(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
+ {
+ external = xmldata::convertFromUtf8(reader.getAttributeValue(true));
+ if (external.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:external attribute value in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ if (nil) {
+ if (!prop->isNillable()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil attribute for non-nillable prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (external.getLength() != 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil and oor:external attributes for prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ prop->setValue(valueParser_.getLayer(), css::uno::Any());
+ state_.push(State());
+ } else if (external.getLength() == 0) {
+ valueParser_.separator_ = separator;
+ valueParser_.start(prop);
+ } else {
+ prop->setExternal(valueParser_.getLayer(), external);
+ state_.push(State());
+ }
+}
+
+void XcuParser::handleLocpropValue(
+ XmlReader & reader, LocalizedPropertyNode * locprop)
+{
+ rtl::OUString name;
+ bool nil = false;
+ rtl::OString separator;
+ Operation op = OPERATION_FUSE;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_XML &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
+ {
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_XSI &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
+ {
+ nil = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ Type type = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ if (valueParser_.type_ != TYPE_ANY && type != valueParser_.type_) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value type in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ Span s(reader.getAttributeValue(false));
+ if (s.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ separator = rtl::OString(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ }
+ }
+ NodeMap::iterator i(locprop->getMembers().find(name));
+ if (i != locprop->getMembers().end() &&
+ i->second->getLayer() > valueParser_.getLayer())
+ {
+ state_.push(State()); // ignored
+ return;
+ }
+ if (nil && !locprop->isNillable()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil attribute for non-nillable prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (op) {
+ case OPERATION_FUSE:
+ if (nil) {
+ if (i == locprop->getMembers().end()) {
+ locprop->getMembers()[name] = new LocalizedValueNode(
+ valueParser_.getLayer(), css::uno::Any());
+ } else {
+ dynamic_cast< LocalizedValueNode * >(i->second.get())->setValue(
+ valueParser_.getLayer(), css::uno::Any());
+ }
+ state_.push(State());
+ } else {
+ valueParser_.separator_ = separator;
+ valueParser_.start(locprop, name);
+ }
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ case OPERATION_REMOVE:
+ //TODO: only allow if parent.op == OPERATION_FUSE
+ //TODO: disallow removing when e.g. lang=""?
+ if (i != locprop->getMembers().end()) {
+ locprop->getMembers().erase(i);
+ }
+ state_.push(State());
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad op attribute for value element in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
+ bool hasName = false;
+ rtl::OUString name;
+ Type type = TYPE_ERROR;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ type = xmldata::parseType(reader, reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ NodeMap::iterator i(group->getMembers().find(name));
+ if (i == group->getMembers().end()) {
+ handleUnknownGroupProp(reader, group, name, type, op, finalized);
+ } else {
+ switch (i->second->kind()) {
+ case Node::KIND_PROPERTY:
+ handlePlainGroupProp(reader, group, i, name, type, op, finalized);
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ handleLocalizedGroupProp(
+ reader,
+ dynamic_cast< LocalizedPropertyNode * >(i->second.get()), name,
+ type, op, finalized);
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("inappropriate prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+}
+
+void XcuParser::handleUnknownGroupProp(
+ XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized)
+{
+ if (!group->isExtensible()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (operation) {
+ case OPERATION_REPLACE:
+ case OPERATION_FUSE:
+ {
+ if (type == TYPE_ERROR) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing type attribute for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ rtl::Reference< Node > prop(
+ new PropertyNode(
+ valueParser_.getLayer(), TYPE_ANY, true, css::uno::Any(),
+ true));
+ if (finalized) {
+ prop->setFinalized(valueParser_.getLayer());
+ }
+ state_.push(State(prop, name, state_.top().locked));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ default:
+ OSL_TRACE(
+ "ignoring modify or remove of unknown (presumably extension)"
+ " property");
+ state_.push(State());
+ break;
+ }
+}
+
+void XcuParser::handlePlainGroupProp(
+ XmlReader const & reader, GroupNode * group,
+ NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized)
+{
+ PropertyNode * property = dynamic_cast< PropertyNode * >(
+ propertyIndex->second.get());
+ if (property->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ property->getFinalized());
+ property->setFinalized(finalizedLayer);
+ if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY &&
+ type != property->getStaticType())
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid type for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type == TYPE_ERROR ? property->getStaticType() : type;
+ switch (operation) {
+ case OPERATION_MODIFY:
+ case OPERATION_REPLACE:
+ case OPERATION_FUSE:
+ state_.push(
+ State(
+ property,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ break;
+ case OPERATION_REMOVE:
+ if (!property->isExtension()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid remove of non-extension prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ group->getMembers().erase(propertyIndex);
+ state_.push(State()); // ignore children
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ }
+}
+
+void XcuParser::handleLocalizedGroupProp(
+ XmlReader const & reader, LocalizedPropertyNode * property,
+ rtl::OUString const & name, Type type, Operation operation, bool finalized)
+{
+ if (property->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ property->getFinalized());
+ property->setFinalized(finalizedLayer);
+ if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY &&
+ type != property->getStaticType())
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid type for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type == TYPE_ERROR ? property->getStaticType() : type;
+ switch (operation) {
+ case OPERATION_MODIFY:
+ case OPERATION_FUSE:
+ state_.push(
+ State(
+ property,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ break;
+ case OPERATION_REPLACE:
+ {
+ rtl::Reference< Node > replacement(
+ new LocalizedPropertyNode(
+ valueParser_.getLayer(), property->getStaticType(),
+ property->isNillable()));
+ replacement->setFinalized(property->getFinalized());
+ state_.push(
+ State(
+ replacement, name,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ case OPERATION_REMOVE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid remove of non-extension prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void XcuParser::handleGroupNode(
+ XmlReader & reader, rtl::Reference< Node > const & group)
+{
+ bool hasName = false;
+ rtl::OUString name;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > child(
+ Data::findNode(valueParser_.getLayer(), group->getMembers(), name));
+ if (!child.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (op != OPERATION_MODIFY && op != OPERATION_FUSE) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid operation on group node in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ child->getFinalized());
+ child->setFinalized(finalizedLayer);
+ state_.push(
+ State(
+ child,
+ state_.top().locked || finalizedLayer < valueParser_.getLayer()));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+}
+
+void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ bool mandatory = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
+ {
+ mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString templateName(
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, &set->getDefaultTemplateName()));
+ if (!set->isValidTemplate(templateName)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) +
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(" references invalid template ")) +
+ templateName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > tmpl(
+ data_->getTemplate(valueParser_.getLayer(), templateName));
+ if (!tmpl.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) +
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ " references undefined template ")) +
+ templateName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = finalized ? valueParser_.getLayer() : Data::NO_LAYER;
+ int mandatoryLayer = mandatory ? valueParser_.getLayer() : Data::NO_LAYER;
+ NodeMap::iterator i(set->getMembers().find(name));
+ if (i != set->getMembers().end()) {
+ finalizedLayer = std::min(finalizedLayer, i->second->getFinalized());
+ i->second->setFinalized(finalizedLayer);
+ mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory());
+ i->second->setMandatory(mandatoryLayer);
+ if (i->second->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ }
+ switch (op) {
+ case OPERATION_MODIFY:
+ if (i == set->getMembers().end()) {
+ OSL_TRACE("ignoring modify of unknown set member node");
+ state_.push(State());
+ } else {
+ state_.push(
+ State(
+ i->second,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ }
+ break;
+ case OPERATION_REPLACE:
+ if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ } else {
+ rtl::Reference< Node > member(tmpl->clone());
+ member->setLayer(valueParser_.getLayer());
+ member->setFinalized(finalizedLayer);
+ member->setMandatory(mandatoryLayer);
+ state_.push(State(member, name, false));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ case OPERATION_FUSE:
+ if (i == set->getMembers().end()) {
+ if (state_.top().locked || finalizedLayer < valueParser_.getLayer())
+ {
+ state_.push(State()); // ignored
+ } else {
+ rtl::Reference< Node > member(tmpl->clone());
+ member->setLayer(valueParser_.getLayer());
+ member->setFinalized(finalizedLayer);
+ member->setMandatory(mandatoryLayer);
+ state_.push(State(member, name, false));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ } else {
+ state_.push(
+ State(
+ i->second,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ }
+ break;
+ case OPERATION_REMOVE:
+ // Ignore removal of unknown members, members finalized in a lower
+ // layer, and members made mandatory in this or a lower layer:
+ if (i != set->getMembers().end() && !state_.top().locked &&
+ finalizedLayer >= valueParser_.getLayer() &&
+ mandatoryLayer > valueParser_.getLayer())
+ {
+ set->getMembers().erase(i);
+ }
+ state_.push(State());
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ }
+}
+
+}
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
new file mode 100644
index 000000000000..21806edebe9c
--- /dev/null
+++ b/configmgr/source/xcuparser.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCUPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCUPARSER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "parser.hxx"
+#include "path.hxx"
+#include "type.hxx"
+#include "valueparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+class GroupNode;
+class LocalizedPropertyNode;
+class Modifications;
+class PropertyNode;
+class SetNode;
+struct Data;
+struct Span;
+
+class XcuParser: public Parser {
+public:
+ XcuParser(int layer, Data * data, Modifications * modifications);
+
+private:
+ virtual ~XcuParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & span);
+
+ enum Operation {
+ OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE };
+
+ static Operation parseOperation(Span const & text);
+
+ void handleComponentData(XmlReader & reader);
+
+ void handleItem(XmlReader & reader);
+
+ void handlePropValue(XmlReader & reader, PropertyNode * prop);
+
+ void handleLocpropValue(
+ XmlReader & reader, LocalizedPropertyNode * locprop);
+
+ void handleGroupProp(XmlReader & reader, GroupNode * group);
+
+ void handleUnknownGroupProp(
+ XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized);
+
+ void handlePlainGroupProp(
+ XmlReader const & reader, GroupNode * group,
+ NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized);
+
+ void handleLocalizedGroupProp(
+ XmlReader const & reader, LocalizedPropertyNode * property,
+ rtl::OUString const & name, Type type, Operation operation,
+ bool finalized);
+
+ void handleGroupNode(
+ XmlReader & reader, rtl::Reference< Node > const & group);
+
+ void handleSetNode(XmlReader & reader, SetNode * set);
+
+ struct State {
+ rtl::Reference< Node > node; // empty iff ignore or <items>
+ rtl::OUString name; // empty and ignored if !insert
+ bool ignore;
+ bool insert;
+ bool locked;
+
+ inline State(): ignore(true), insert(false), locked(false) {}
+
+ inline State(rtl::Reference< Node > const & theNode, bool theLocked):
+ node(theNode), ignore(false), insert(false), locked(theLocked)
+ {}
+
+ inline State(
+ rtl::Reference< Node > const & theNode,
+ rtl::OUString const & theName, bool theLocked):
+ node(theNode), name(theName), ignore(false), insert(true),
+ locked(theLocked)
+ {}
+ };
+
+ typedef std::stack< State > StateStack;
+
+ ValueParser valueParser_;
+ Data * data_;
+ Modifications * modifications_;
+ rtl::OUString componentName_;
+ StateStack state_;
+ Path modificationPath_;
+ rtl::OUString path_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xml/basicparser.cxx b/configmgr/source/xml/basicparser.cxx
deleted file mode 100644
index 94d97e34fc45..000000000000
--- a/configmgr/source/xml/basicparser.cxx
+++ /dev/null
@@ -1,533 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicparser.hxx"
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include "valuetypeconverter.hxx"
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-namespace
-{
- static inline
- uno::Reference< script::XTypeConverter > createTCV(uno::Reference< uno::XComponentContext > const & _xContext)
- {
- OSL_ENSURE(_xContext.is(),"Cannot create Parser without a Context");
-
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- uno::Reference< lang::XMultiComponentFactory > xSvcFactory = _xContext->getServiceManager();
- return uno::Reference< script::XTypeConverter >::query(xSvcFactory->createInstanceWithContext(k_sTCVService,_xContext));
- }
-}
-// -----------------------------------------------------------------------------
-
-struct BasicParser::ValueData : ValueConverter
-{
- rtl::OUString content;
- rtl::OUString locale;
- bool isLocalized;
-
- ValueData(uno::Type const& _aType, uno::Reference< script::XTypeConverter > const & _xTCV)
- : ValueConverter(_aType, _xTCV)
- , content()
- , locale()
- , isLocalized(false)
- {
- }
-
- uno::Any convertToAny() const
- {
- return ValueConverter::convertToAny(this->content);
- }
-
- rtl::OUString toString() const
- {
- return this->content;
- }
-
- uno::Sequence<rtl::OUString> toStringList() const
- {
- return ValueConverter::splitStringList(this->content);
- }
-
- void setLocalized(rtl::OUString const & _aLocale)
- {
- isLocalized = true;
- locale = _aLocale;
- }
-};
-// -----------------------------------------------------------------------------
-
-BasicParser::BasicParser(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xTypeConverter( createTCV(_xContext) )
-, m_xLocator(NULL)
-, m_aDataParser(Logger(_xContext))
-, m_aNodes()
-, m_aValueType()
-, m_pValueData(NULL)
-, m_nSkipLevels(0)
-, m_bEmpty(true)
-, m_bInProperty(false)
-{
- if (!m_xTypeConverter.is())
- throw uno::RuntimeException();
-
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-BasicParser::~BasicParser()
-{
- delete m_pValueData;
-}
-// -----------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-void BasicParser::dbgUpdateLocation()
-{
-#ifndef DBG_UTIL
- rtl::OUString dbgPublicId, dbgSystemId;
- sal_Int32 dbgLineNo, dbgColumnNo;
-#endif // OSL_DEBUG_LEVEL
-
- if (m_xLocator.is())
- {
- dbgPublicId = m_xLocator->getPublicId();
- dbgSystemId = m_xLocator->getSystemId();
- dbgLineNo = m_xLocator->getLineNumber();
- dbgColumnNo = m_xLocator->getColumnNumber();
- }
- else
- {
- dbgPublicId = dbgSystemId = rtl::OUString::createFromAscii("<<<unknown>>>");
- dbgLineNo = dbgColumnNo = -1;
- }
-}
-#endif
-// -----------------------------------------------------------------------------
-void SAL_CALL BasicParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- m_aDataParser.reset();
- m_aValueType = uno::Type();
- m_bInProperty = false;
- m_nSkipLevels = 0;
-
- delete m_pValueData, m_pValueData = NULL;
-
- while (!m_aNodes.empty()) m_aNodes.pop();
-
- m_bEmpty = true;
-
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (!m_aNodes.empty() || isSkipping() || isInValueData())
- raiseParseException( "Configuration XML Parser - Invalid XML: Unexpected end of document" );
-
- m_xLocator.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::characters( const rtl::OUString& aChars )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (isInValueData())
- {
- m_pValueData->content += aChars;
- }
-#ifdef CONFIG_XMLPARSER_VALIDATE_WHITESPACE
- else
- OSL_ENSURE( isSkipping() || aChars.trim().getLength() == 0, "Unexpected text content in configuration XML");
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::ignorableWhitespace( const rtl::OUString& aWhitespaces )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
- if (isInValueData())
- {
- OSL_ENSURE(false, "Configuration XML: Unexpected ignorable (!) whitespace instruction in value data");
- if (!m_pValueData->isNull())
- m_pValueData->content += aWhitespaces;
- }
-#ifdef CONFIG_XMLPARSER_VALIDATE_WHITESPACE
- else
- OSL_ENSURE( aChars.trim().getLength() == 0, "Unexpected non-space content in ignorable whitespace");
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::processingInstruction( const rtl::OUString& /*aTarget*/, const rtl::OUString& /*aData*/ )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
- OSL_ENSURE(false, "Unexpected processing instruction in Configuration XML");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::setDocumentLocator( const uno::Reference< sax::XLocator >& xLocator )
- throw (sax::SAXException, uno::RuntimeException)
-{
- m_xLocator = xLocator;
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- { (void)aInfo; }
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, call startSkipping() instead of startNode()");
- OSL_ENSURE( aInfo.type != ElementType::property, "For properties, call startProperty() instead of startNode()");
-
- if (isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: Cannot have a node nested in a property" );
-
- m_aNodes.push(aInfo);
- m_bEmpty = (aInfo.flags != 0) || (aInfo.op > Operation::modify);
-
- OSL_POSTCOND( isInNode(), "Could not start a node ");
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::endNode( )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, honor wasSkipping() instead of calling endNode()");
- OSL_ENSURE( !isInProperty(), "For properties, call endProperty() instead of endNode()" );
-
- ensureInNode();
-
- m_aNodes.pop();
- m_bEmpty = false;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::ensureInNode( )
-{
- if (!isInNode())
- raiseParseException("Unexpected endElement without matching startElement");
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInNode( )
-{
- return ! m_aNodes.empty();
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isEmptyNode( )
-{
- return m_bEmpty;
-}
-// -----------------------------------------------------------------------------
-
-ElementInfo const & BasicParser::getActiveNodeInfo( )
-{
- ensureInNode();
-
- return m_aNodes.top();
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, call startSkipping() instead of startProperty()");
- OSL_ENSURE( aInfo.type == ElementType::property, "For non-property nodes, call startNode() instead of startProperty()");
-
- if (isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: Properties may not nest" );
-
- try
- {
- m_aValueType = getDataParser().getPropertyValueType(xAttribs);
- }
- catch (ElementParser::BadValueType & error)
- {
- raiseParseException(error.message());
- }
-
- m_bInProperty = true;
-
- m_aNodes.push(aInfo);
- m_bEmpty = true;
-
- OSL_POSTCOND( isInProperty(), "Could not get data to start a property" );
- OSL_POSTCOND( isInUnhandledProperty(), "Could not mark property as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::endProperty( )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, honor wasSkipping() instead of calling endProperty()");
- OSL_ENSURE( isInProperty(), "For non-property nodes, call endNode() instead of endProperty()" );
-
- ensureInNode();
-
- m_aNodes.pop();
- m_bEmpty = false;
-
- m_aValueType = uno::Type();
- m_bInProperty = false;
-
- OSL_POSTCOND( !isInProperty(), "Could not get mark end of property" );
-}
-// -----------------------------------------------------------------------------
-
-uno::Type BasicParser::getActivePropertyType()
-{
- return m_aValueType;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInProperty()
-{
- return m_bInProperty;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInUnhandledProperty()
-{
- return m_bEmpty && m_bInProperty;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (!isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: A value may occur only within a property" );
-
- if (m_aValueType.getTypeClass() == uno::TypeClass_ANY)
- raiseParseException( "Configuration XML Parser - Invalid Data: Cannot have values for properties of type 'Any'" );
-
- if (isInValueData())
- raiseParseException( "Configuration XML Parser - Invalid Data: Unexpected element while parsing value data" );
-
- m_pValueData = new ValueData(m_aValueType, m_xTypeConverter);
-
- m_pValueData->setIsNull( getDataParser().isNull(xAttribs) );
-
- m_pValueData->setSeparator( getDataParser().getSeparator(xAttribs) );
-
- OSL_ENSURE( !m_pValueData->hasSeparator() ||
- !m_pValueData->isTypeSet() ||
- m_pValueData->isList(),
- "Warning: Spurious oor:separator on value that is not a list");
- OSL_ENSURE( !m_pValueData->hasSeparator() ||
- !m_pValueData->isNull(),
- "Warning: Spurious oor:separator on value that is not a list");
-
- rtl::OUString aLocale;
- if ( getDataParser().getLanguage(xAttribs,aLocale) )
- m_pValueData->setLocalized( aLocale );
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInValueData()
-{
- return m_pValueData != NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isValueDataLocalized()
-{
- OSL_ENSURE(isInValueData(), "There is no value data that could be localized");
-
- return m_pValueData && m_pValueData->isLocalized;
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString BasicParser::getValueDataLocale()
-{
- OSL_ENSURE(isValueDataLocalized(), "There is no value data or it is not localized");
-
- return m_pValueData->locale;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any BasicParser::getCurrentValue()
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ASSERT( isInValueData() );
-
- uno::Any aResult;
-
- if (m_pValueData->isTypeSet())
- try
- {
- aResult = m_pValueData->convertToAny();
- }
- catch (script::CannotConvertException & e)
- {
- this->raiseParseException(uno::makeAny(e),"Configuration XML Parser - Invalid Data: Cannot convert value to type of property" );
- }
- else if (m_pValueData->isNull())
- {
- // nothing to do
- }
- else if (m_pValueData->hasSeparator() || m_pValueData->isList())
- {
- aResult <<= m_pValueData->toStringList();
- }
- else
- {
- aResult <<= m_pValueData->toString();
- }
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-/// end collecting data for a value
-void BasicParser::endValueData()
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ASSERT( isInValueData() );
-
- delete m_pValueData, m_pValueData = NULL;
- m_bEmpty = false;
-
- OSL_POSTCOND( !isInValueData(), "Could not end value data tag" );
- OSL_POSTCOND( !isInUnhandledProperty(), "Could not mark property as handled" );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startSkipping( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- m_aNodes.push( ElementInfo(aName) );
- ++m_nSkipLevels;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::wasSkipping( const rtl::OUString& aName )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (m_nSkipLevels == 0) return false;
-
- if (m_aNodes.empty())
- raiseParseException( "Configuration XML Parser - Invalid XML: Unexpected end of element (while skipping data)" );
-
- if (aName != m_aNodes.top().name)
- raiseParseException( "Configuration XML Parser - Invalid XML: End tag does not match start tag (while skipping data)" );
-
- --m_nSkipLevels;
- m_aNodes.pop();
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isSkipping( )
-{
- return m_nSkipLevels != 0;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( uno::Any const & _aTargetException, sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (_pMsg == 0) _pMsg = "Configuration XML Parser: Invalid Data: ";
-
- rtl::OUString sMessage = rtl::OUString::createFromAscii(_pMsg);
-
- uno::Exception aEx;
- if (_aTargetException >>= aEx)
- sMessage += aEx.Message;
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, _aTargetException );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (_pMsg == 0) _pMsg = "Configuration XML Parser: Invalid XML";
-
- rtl::OUString const sMessage = rtl::OUString::createFromAscii(_pMsg);
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, uno::Any() );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( rtl::OUString const & sMessage )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (sMessage.getLength() == 0) raiseParseException(NULL);
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, uno::Any() );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/basicparser.hxx b/configmgr/source/xml/basicparser.hxx
deleted file mode 100644
index f0c862daddb4..000000000000
--- a/configmgr/source/xml/basicparser.hxx
+++ /dev/null
@@ -1,175 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_BASICPARSER_HXX
-#define CONFIGMGR_XML_BASICPARSER_HXX
-
-#include "elementparser.hxx"
-#include "utility.hxx"
-#include "stack.hxx"
-#ifndef CONFIGMGR_LOGGER_HXX_
-#include "logger.hxx"
-#endif
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace com { namespace sun { namespace star { namespace script {
- class XTypeConverter;
-} } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- class BasicParser
- : public cppu::WeakImplHelper1<sax::XDocumentHandler>
- {
- struct ValueData;
-
- uno::Reference< com::sun::star::script::XTypeConverter >
- m_xTypeConverter;
- uno::Reference< sax::XLocator > m_xLocator;
- ElementParser m_aDataParser;
- Stack< ElementInfo > m_aNodes;
- uno::Type m_aValueType;
- ValueData * m_pValueData;
- sal_uInt16 m_nSkipLevels;
- bool m_bEmpty;
- bool m_bInProperty;
-
-#if OSL_DEBUG_LEVEL > 0
-#ifdef DBG_UTIL
- rtl::OUString dbgPublicId, dbgSystemId;
- sal_Int32 dbgLineNo, dbgColumnNo;
-#endif // DBG_UTIL
- void dbgUpdateLocation();
-#endif // OSL_DEBUG_LEVEL
-
- public:
- explicit BasicParser(uno::Reference< uno::XComponentContext > const & _xContext);
- virtual ~BasicParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- characters( const rtl::OUString& aChars )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- ignorableWhitespace( const rtl::OUString& aWhitespaces )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setDocumentLocator( const uno::Reference< sax::XLocator >& xLocator )
- throw (sax::SAXException, uno::RuntimeException);
-
- protected:
- ElementParser const & getDataParser() const { return m_aDataParser; }
-
- Logger const & getLogger() { return m_aDataParser.logger(); }
-
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we in the content of a node ?
- bool isInNode();
- /// are we in the content of node for which no content was started yet ?
- bool isEmptyNode();
- /// make sure we are in the content of a node ?
- void ensureInNode();
- /// get the info about of the node currently being processed
- ElementInfo const & getActiveNodeInfo();
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we in the content of a property node ?
- bool isInProperty();
- /// are we in the content of a property node (and there has been no value for that property) ?
- bool isInUnhandledProperty();
- /// get the data type of the active property ?
- uno::Type getActivePropertyType();
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// are we in the content of a property node ?
- bool isInValueData();
- /// check if the current value data has a locale set
- bool isValueDataLocalized();
- /// get the locale of the current value data, if localized
- rtl::OUString getValueDataLocale();
- /// return the collected value
- uno::Any getCurrentValue();
- /// end collecting data for a value
- void endValueData();
-
- /// start a node to be skipped
- void startSkipping( const rtl::OUString& aTag, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we inside a skipped node ?
- bool isSkipping( );
- /// ending a node: was this skipped ?
- bool wasSkipping( const rtl::OUString& aTag );
-
- protected:
- void raiseParseException( uno::Any const & _aTargetException, sal_Char const * _pMsg = NULL)
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- void raiseParseException( sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- void raiseParseException( rtl::OUString const & aMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/elementformatter.cxx b/configmgr/source/xml/elementformatter.cxx
deleted file mode 100644
index 217d3f2bbd92..000000000000
--- a/configmgr/source/xml/elementformatter.cxx
+++ /dev/null
@@ -1,321 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementformatter.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-
-#include <comphelper/attributelist.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-ElementFormatter::ElementFormatter()
-: m_aElementType(ElementType::unknown)
-, m_xAttributes()
-{
-}
-// -----------------------------------------------------------------------------
-
-ElementFormatter::~ElementFormatter()
-{
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::reset()
-{
- m_aElementType = ElementType::unknown;
- m_xAttributes.clear();
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addAttribute(rtl::OUString const & _anAttributeName, rtl::OUString const & _aValue)
-{
- OSL_PRECOND(m_xAttributes.is(),"Trying to add an attribute to a non-existing list");
-
- m_xAttributes->AddAttribute(_anAttributeName,
- XML_ATTRTYPE_CDATA,
- _aValue);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addAttribute(rtl::OUString const & _anAttributeName, bool _bValue)
-{
- OSL_PRECOND(m_xAttributes.is(),"Trying to add an attribute to a non-existing list");
-
- m_xAttributes->AddAttribute(_anAttributeName,
- XML_ATTRTYPE_CDATA,
- _bValue ? ATTR_VALUE_TRUE : ATTR_VALUE_FALSE);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addNamespaces()
-{
- static rtl::OUString const sNamespaceDecl( RTL_CONSTASCII_USTRINGPARAM("xmlns:") );
-
- addAttribute( sNamespaceDecl.concat(NS_PREFIX_OOR), static_cast<rtl::OUString const &>(NS_URI_OOR));
- addAttribute( sNamespaceDecl.concat(NS_PREFIX_XS ), static_cast<rtl::OUString const &>(NS_URI_XS ));
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::prepareElement(ElementInfo const& _aInfo)
-{
- if (!m_xAttributes.is())
- {
- m_xAttributes.set( new ::comphelper::AttributeList() );
- addNamespaces();
- }
- else
- m_xAttributes->Clear();
-
- m_aElementType = _aInfo.type;
-
- addName(_aInfo.name);
- addNodeFlags(_aInfo.flags);
- addOperation(_aInfo.op);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::prepareSimpleElement(ElementType::Enum _eType)
-{
- if (!m_xAttributes.is())
- {
- m_xAttributes.set( new ::comphelper::AttributeList() );
- addNamespaces();
- }
- else
- m_xAttributes->Clear();
-
- m_aElementType = _eType;
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addName(rtl::OUString const & _aName)
-{
- if (_aName.getLength())
- {
- switch( m_aElementType )
- {
- case ElementType::schema:
- case ElementType::layer:
- {
- sal_Int32 nIndex = _aName.lastIndexOf('.');
-
- rtl::OUString aNodeName = _aName.copy(nIndex + 1);
- addAttribute(ATTR_NAME, aNodeName);
-
- OSL_ENSURE(nIndex > 0,"Found component root element without a package part in its name");
- if (nIndex > 0)
- {
- rtl::OUString aPackage = _aName.copy(0, nIndex);
- addAttribute(ATTR_PACKAGE, aPackage);
- }
- }
- break;
-
- default:
- addAttribute(ATTR_NAME, _aName);
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-inline
-void ElementFormatter::maybeAddFlag(sal_Int16 _eFlags, sal_Int16 _eSelect, rtl::OUString const & _anAttributeName, bool _bValue)
-{
- if (_eFlags & _eSelect) addAttribute(_anAttributeName,_bValue);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addNodeFlags(sal_Int16 _eFlags)
-{
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::REQUIRED, ATTR_FLAG_NULLABLE, false);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::LOCALIZED, ATTR_FLAG_LOCALIZED);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::EXTENSIBLE, ATTR_FLAG_EXTENSIBLE);
-
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::FINALIZED, ATTR_FLAG_FINALIZED);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::MANDATORY, ATTR_FLAG_MANDATORY);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::READONLY, ATTR_FLAG_READONLY);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addOperation(Operation::Enum _eOp)
-{
- switch (_eOp)
- {
- case Operation::none: break;
- case Operation::modify: break ; //addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_MODIFY)); break;
- case Operation::clear: OSL_ENSURE(false,"'clear' operation is not yet supported"); break ;
- //addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_CLEAR)); break;
- case Operation::replace: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_REPLACE)); break;
- case Operation::fuse: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_FUSE)); break;
- case Operation::remove: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_REMOVE)); break;
-
- case Operation::unknown:
- OSL_ENSURE(false, "ElementFormatter: Trying to add attribute for 'unknown' operation");
- break;
- default:
- OSL_ENSURE(false, "ElementFormatter: Trying to add attribute for invalid operation");
- break;
- }
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addInstanceType(rtl::OUString const & /*_aElementType*/, rtl::OUString const & /*_aElementTypeModule*/)
-{
-}
-// -----------------------------------------------------------------------------
-
-static ::rtl::OUString toXmlTypeName(const uno::TypeClass& _rTypeClass)
-{
- ::rtl::OUString aRet;
- switch(_rTypeClass)
- {
- case uno::TypeClass_BOOLEAN: aRet = VALUETYPE_BOOLEAN; break;
- case uno::TypeClass_SHORT: aRet = VALUETYPE_SHORT; break;
- case uno::TypeClass_LONG: aRet = VALUETYPE_INT; break;
- case uno::TypeClass_HYPER: aRet = VALUETYPE_LONG; break;
- case uno::TypeClass_DOUBLE: aRet = VALUETYPE_DOUBLE; break;
- case uno::TypeClass_STRING: aRet = VALUETYPE_STRING; break;
- case uno::TypeClass_SEQUENCE: aRet = VALUETYPE_BINARY; break;
- case uno::TypeClass_ANY: aRet = VALUETYPE_ANY; break;
- default:
- OSL_ENSURE(false,"Cannot get type name: unknown typeclass");
- break;
- }
- return aRet;
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addPropertyValueType(uno::Type const& _aType)
-{
- if (_aType == uno::Type()) return;
-
- bool bList = false;
- uno::Type aSimpleType = getBasicType(_aType, bList);
- uno::TypeClass aSimpleTypeClass = aSimpleType.getTypeClass();
- rtl::OUString aSimpleTypeName = toXmlTypeName(aSimpleTypeClass);
-
- rtl::OUString sNsPrefix = (bList || aSimpleTypeClass == uno::TypeClass_ANY) ?
- rtl::OUString( NS_PREFIX_OOR ) : rtl::OUString( NS_PREFIX_XS );
-
- rtl::OUStringBuffer aTypeNameBuf(sNsPrefix);
-
- if (sNsPrefix.getLength())
- aTypeNameBuf. append(k_NS_SEPARATOR);
-
- aTypeNameBuf. append(aSimpleTypeName);
-
- if (bList)
- aTypeNameBuf. append(VALUETYPE_LIST_SUFFIX);
-
- addAttribute( ATTR_VALUETYPE, aTypeNameBuf.makeStringAndClear());
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addLanguage(rtl::OUString const & _sLanguage)
-{
- OSL_ENSURE(_sLanguage.getLength(), "ElementFormatter: Trying to add empty language attribute");
- addAttribute(EXT_ATTR_LANGUAGE, _sLanguage);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addIsNull(bool _bIsNull)
-{
- addAttribute( EXT_ATTR_NULL, _bIsNull);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addSeparator(rtl::OUString const& _sSeparator)
-{
- addAttribute( ATTR_VALUESEPARATOR, _sSeparator);
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString ElementFormatter::getElementTag() const
-{
- switch (m_aElementType)
- {
- case ElementType::schema: return rtl::OUString( TAG_SCHEMA );
- case ElementType::layer: return rtl::OUString( TAG_LAYER );
-
- case ElementType::component: return rtl::OUString( TAG_COMPONENT );
- case ElementType::templates: return rtl::OUString( TAG_TEMPLATES );
-
- case ElementType::property: return rtl::OUString( TAG_PROP );
- case ElementType::node: return rtl::OUString( TAG_NODE );
- case ElementType::group: return rtl::OUString( TAG_GROUP );
- case ElementType::set: return rtl::OUString( TAG_SET );
-
- case ElementType::import: return rtl::OUString( TAG_IMPORT );
- case ElementType::instance: return rtl::OUString( TAG_INSTANCE );
- case ElementType::item_type: return rtl::OUString( TAG_ITEMTYPE );
- case ElementType::value: return rtl::OUString( TAG_VALUE );
- case ElementType::uses: return rtl::OUString( TAG_USES );
-
- case ElementType::unknown:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for 'unknown' element type");
- break;
- case ElementType::other:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for 'other' element type");
- break;
- default:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for invalid element type");
- break;
- }
- return rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< sax::XAttributeList > ElementFormatter::getElementAttributes() const
-{
- return m_xAttributes.get();
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-} // namespace
-} // namespace
-
diff --git a/configmgr/source/xml/elementformatter.hxx b/configmgr/source/xml/elementformatter.hxx
deleted file mode 100644
index 19c6f025bc56..000000000000
--- a/configmgr/source/xml/elementformatter.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_ELEMENTFORMATTER_HXX
-#define CONFIGMGR_XML_ELEMENTFORMATTER_HXX
-
-#include "elementinfo.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <rtl/ref.hxx>
-
-namespace comphelper {
- class AttributeList;
-}
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-
-// -----------------------------------------------------------------------------
- class ElementFormatter
- {
- public:
- ElementFormatter();
- ~ElementFormatter();
-
- /// reset the formatter for a new document
- void reset();
-
- /// resets the formatter for a new element type
- void prepareElement(ElementInfo const& _aInfo);
-
- /// resets the formatter for a new element type
- void prepareSimpleElement(ElementType::Enum _eType);
-
- /// sets the instantiated type of a set item,
- void addInstanceType(rtl::OUString const & _aElementType, rtl::OUString const & _aElementTypeModule);
-
- /// retrieve element type and associated module name of a set,
- void addPropertyValueType(uno::Type const& _aType);
-
- /// add a language for the current element
- void addLanguage(rtl::OUString const & _sLanguage);
-
- /// adds a value attribute to the attribute list
- void addIsNull(bool _bIsNull = true);
-
- /// adds a value attribute to the attribute list
- void addSeparator(rtl::OUString const& _sSeparator);
-
- /// retrieve the tag to use for the current element
- rtl::OUString getElementTag() const;
-
- /// retrieve the attributes to use for the current element
- uno::Reference< sax::XAttributeList > getElementAttributes() const;
-
- /// retrieve the attributes to use for an element with associated component
- private:
- void addNamespaces();
- /// sets an attributes for a node
- void addName(rtl::OUString const & _aName);
- /// sets attributes for nodes from the flags
- void addNodeFlags(sal_Int16 _eFlags);
- /// sets attributes for nodes from the flags
- void addOperation(Operation::Enum _eOp);
- /// sets attributes for nodes from the flags
- void maybeAddFlag(sal_Int16 _eFlags, sal_Int16 _eSelect,
- rtl::OUString const & _anAttributeName, bool _bValue = true);
-
- /// sets attributes for nodes
- void addAttribute(rtl::OUString const & _anAttributeName, rtl::OUString const & _aValue);
- void addAttribute(rtl::OUString const & _anAttributeName, bool _bValue);
-
- private:
- ElementType::Enum m_aElementType;
- rtl::Reference< ::comphelper::AttributeList> m_xAttributes;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/elementinfo.hxx b/configmgr/source/xml/elementinfo.hxx
deleted file mode 100644
index 03d9da367795..000000000000
--- a/configmgr/source/xml/elementinfo.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_XML_ELEMENTINFO_HXX
-#define CONFIGMGR_XML_ELEMENTINFO_HXX
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace ElementType
- {
- enum Enum
- {
- unknown,
-
- schema,
- layer,
-
- component,
- templates,
-
- property,
- node,
- group,
- set,
-
- import,
- instance,
- item_type,
- value,
- uses,
-
- other
- };
- }
-// -----------------------------------------------------------------------------
- namespace Operation
- {
- enum Enum
- {
- none,
-
- modify,
- clear,
-
- replace,
- fuse,
- remove,
-
- unknown
- };
- }
-// -----------------------------------------------------------------------------
- struct ElementInfo
- {
- explicit
- ElementInfo(ElementType::Enum _type = ElementType::unknown)
- : name()
- , type(_type)
- , op(Operation::none)
- , flags()
- {}
-
- explicit
- ElementInfo(rtl::OUString const & _name, ElementType::Enum _type = ElementType::unknown)
- : name(_name)
- , type(_type)
- , op(Operation::none)
- , flags()
- {}
-
-
- rtl::OUString name;
- ElementType::Enum type;
- Operation::Enum op;
- sal_Int16 flags;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/elementparser.cxx b/configmgr/source/xml/elementparser.cxx
deleted file mode 100644
index 57d184529da1..000000000000
--- a/configmgr/source/xml/elementparser.cxx
+++ /dev/null
@@ -1,582 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementparser.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-static
-inline
-sal_Int16 impl_getIndexByName(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName)
-{
- OSL_PRECOND( xAttribs.is(), "ERROR: NULL Attribute list");
-
- sal_Int16 nIndex = xAttribs->getLength();
-
- while (--nIndex >= 0)
- {
- if (xAttribs->getNameByIndex(nIndex).equals(aAttributeName))
- break;
- }
- // nIndex == -1 if not found
-
- return nIndex;
-}
-// -----------------------------------------------------------------------------
-static
-inline
-bool impl_maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, /* OUT */ rtl::OUString& rAttributeValue)
-{
- OSL_PRECOND( xAttribs.is(), "ERROR: NULL Attribute list");
-
- rtl::OUString aValue = xAttribs->getValueByName(aAttributeName);
- if( aValue.getLength()!=0)
- {
- rAttributeValue = aValue;
- return true;
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve the (almost) complete information for an element
-ElementInfo ElementParser::parseElementInfo(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- ElementType::Enum aType = this->getNodeType(_sTag,_xAttribs);
-
- ElementInfo aInfo( this->getName(_sTag,_xAttribs,aType), aType );
-
- aInfo.op = this->getOperation(_xAttribs,aType);
- aInfo.flags = this->getNodeFlags(_xAttribs,aType);
-
- return aInfo;
-}
-// -----------------------------------------------------------------------------
-
-ElementType::Enum ElementParser::getNodeType(rtl::OUString const& _sElementName, uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- { (void)_xAttribs; }
- OSL_PRECOND( _xAttribs.is(), "ERROR: NULL Attribute list");
-
- // todo: make this use a table, if necessary
- ElementType::Enum eResult = ElementType::unknown;
- if (_sElementName.equals(TAG_VALUE))
- eResult = ElementType::value;
-
- else if (_sElementName.equals(TAG_PROP))
- eResult = ElementType::property;
-
- else if (_sElementName.equals(TAG_NODE))
- eResult = ElementType::node;
-
- else if (_sElementName.equals(TAG_GROUP))
- eResult = ElementType::group;
-
- else if (_sElementName.equals(TAG_SET))
- eResult = ElementType::set;
-
- else if (_sElementName.equals(TAG_INSTANCE))
- eResult = ElementType::instance;
-
- else if (_sElementName.equals(TAG_ITEMTYPE))
- eResult = ElementType::item_type;
-
- else if (_sElementName.equals(TAG_IMPORT))
- eResult = ElementType::import;
-
- else if (_sElementName.equals(TAG_LAYER))
- eResult = ElementType::layer;
-
- else if (_sElementName.equals(TAG_SCHEMA))
- eResult = ElementType::schema;
-
- else if (_sElementName.equals(TAG_COMPONENT))
- eResult = ElementType::component;
-
- else if (_sElementName.equals(TAG_TEMPLATES))
- eResult = ElementType::templates;
-
- else if (_sElementName.equals(TAG_USES))
- eResult = ElementType::uses;
-
- // #109668# maintain support for old tag on load
- else if (_sElementName.equals(DEPRECATED_TAG_LAYER))
- {
- logger().warning("Layer starts with invalid root tag \"oor:node\". Use \"oor:component-data\" instead.",
- "getNodeType()","configmgr::xml::ElementParser");
- eResult = ElementType::layer;
- }
-
- else
- eResult = ElementType::other;
-
- return eResult;
-}
-// -----------------------------------------------------------------------------
-
-/// takes the node name from either an attribute or the element name
-rtl::OUString ElementParser::getName(rtl::OUString const& _sElementName, uno::Reference< sax::XAttributeList > const& _xAttribs, ElementType::Enum _eType) const
-{
- rtl::OUString aName;
- rtl::OUString aPackage;
-
- bool bNameFound = this->maybeGetAttribute(_xAttribs, ATTR_NAME, aName);
- bool bPackage = false;
-
- switch (_eType)
- {
- case ElementType::schema:
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
- OSL_ENSURE(bPackage, "configmgr::xml::ElementParser: Found schema without package.");
- break;
-
- case ElementType::layer:
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
-
- if (!bPackage) // for compatibility we still support 'oor:context'
- {
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_CONTEXT,aPackage);
-
- if (bPackage)
- {
- // TODO: log this
- OSL_TRACE("configmgr::xml::ElementParser: Found obsolete layer attribute "
- "oor:context=\"%s\" in component \"%s\".\n",
- rtl::OUStringToOString(aPackage,RTL_TEXTENCODING_ASCII_US).getStr(),
- rtl::OUStringToOString(aName,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- }
-
- OSL_ENSURE(bPackage, "configmgr::xml::ElementParser: Found layer without package.");
- break;
-
- case ElementType::node:
- case ElementType::set:
- case ElementType::group:
- case ElementType::instance:
- case ElementType::property:
- break;
-
- // these have no name to speak of
- case ElementType::value:
- case ElementType::item_type:
- case ElementType::import:
- case ElementType::uses:
- case ElementType::templates:
- case ElementType::component:
- OSL_ENSURE(!bNameFound, "Configuration Parser: Unexpected name attribute is ignored\n");
- return _sElementName;
-
- // for unknown prefer name to
- case ElementType::unknown:
- if (!bNameFound) return _sElementName;
-
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
- break;
-
- default:
- if (!bNameFound) return _sElementName;
- break;
- }
-
- OSL_ENSURE(aName.getLength(),"Found empty name tag on element");
-
- if (bPackage)
- {
- static const sal_Unicode chPackageSep = '.';
-
- aName = aPackage.concat(rtl::OUString(&chPackageSep,1)).concat(aName);
- }
- else
- {
- OSL_ENSURE(!this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage),
- "configmgr::xml::ElementParser: Found unexpected 'oor:package' on inner or unknown node." );
- }
-
- return aName;
-}
-// -----------------------------------------------------------------------------
-
-Operation::Enum ElementParser::getOperation(uno::Reference< sax::XAttributeList > const& xAttribs,ElementType::Enum _eType) const
-{
- rtl::OUString sOpName;
- if ((_eType != ElementType::property) && (_eType !=ElementType::node))
- {
- return Operation::none;
- }
-
- if ( !this->maybeGetAttribute(xAttribs,ATTR_OPERATION, sOpName) )
- return Operation::none;
-
- if (sOpName.equals(OPERATION_MODIFY))
- return Operation::modify;
-
- else if (sOpName.equals(OPERATION_REPLACE))
- return Operation::replace;
- else if (sOpName.equals(OPERATION_FUSE))
- return Operation::fuse;
-
- else if (sOpName.equals(OPERATION_REMOVE))
- return Operation::remove;
-#if 0
- else if (sOpName.equals(OPERATION_CLEAR))
- return Operation::clear;
-#endif
- else
- return Operation::unknown;
-}
-// -----------------------------------------------------------------------------
-
-
-/// retrieve the locale stored in the attribute list
-bool ElementParser::getLanguage(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& _rsLanguage) const
-{
- return this->maybeGetAttribute(xAttribs, EXT_ATTR_LANGUAGE, _rsLanguage);
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for nodes from the attribute list
-sal_Int16 ElementParser::getNodeFlags(uno::Reference< sax::XAttributeList > const& xAttribs,ElementType::Enum _eType) const
-{
- namespace NodeAttribute = ::com::sun::star::configuration::backend::NodeAttribute;
- namespace SchemaAttribute = ::com::sun::star::configuration::backend::SchemaAttribute;
-
- bool bValue;
-
- sal_Int16 aResult = 0;
-
- switch(_eType)
- {
- case ElementType::property :
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_NULLABLE, bValue) && ! bValue)
- aResult |= SchemaAttribute::REQUIRED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_LOCALIZED, bValue) && bValue)
- aResult |= SchemaAttribute::LOCALIZED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- break;
-
- case ElementType::node:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_MANDATORY, bValue) && bValue)
- aResult |= NodeAttribute::MANDATORY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- break;
-
- case ElementType::group:
- case ElementType::set:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_EXTENSIBLE, bValue) && bValue)
- aResult |= SchemaAttribute::EXTENSIBLE;
- break;
-
- case ElementType::layer:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- break;
-
- default:
- break;
-
- }
- return aResult;
-}
-// -----------------------------------------------------------------------------
-static
-void badValueType(Logger const & logger, sal_Char const * _pMsg, rtl::OUString const & _sType)
-{
- rtl::OUStringBuffer sMessageBuf;
- sMessageBuf.appendAscii( "Configuration XML parser: Bad value type attribute: " );
- if (_pMsg) sMessageBuf.appendAscii(_pMsg);
-
- const sal_Unicode kQuote = '"';
- sMessageBuf.append(kQuote).append(_sType).append(kQuote);
-
- rtl::OUString const sMessage = sMessageBuf.makeStringAndClear();
- logger.error(sMessage);
- throw ElementParser::BadValueType(sMessage);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Bool matchNsPrefix(rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- return _sString.match(_sPrefix) &&
- _sString.getStr()[_sPrefix.getLength()] == k_NS_SEPARATOR;
-}
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Bool matchSuffix(rtl::OUString const & _sString, rtl::OUString const & _sSuffix)
-{
- sal_Int32 nSuffixStart = _sString.getLength() - _sSuffix.getLength();
- if (nSuffixStart < 0)
- return false;
-
- return _sString.match(_sSuffix,nSuffixStart);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripNsPrefix(rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- OSL_ASSERT( matchNsPrefix(_sString,_sPrefix) );
-
- return _sString.copy(_sPrefix.getLength() + 1);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripSuffix(rtl::OUString const & _sString, rtl::OUString const & _sSuffix)
-{
- OSL_ASSERT( matchSuffix(_sString,_sSuffix) );
-
- sal_Int32 nSuffixStart = _sString.getLength() - _sSuffix.getLength();
-
- return _sString.copy(0,nSuffixStart);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripTypeName(Logger const & logger, rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- if ( matchNsPrefix(_sString,_sPrefix))
- return stripNsPrefix(_sString, _sPrefix);
-
- badValueType(logger, "Missing expected namespace prefix on type name: ", _sString);
-
- return _sString;
-}
-// -----------------------------------------------------------------------------
-static
-uno::Type xmlToScalarType(const rtl::OUString& _rType)
-{
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BOOLEAN))
- aRet = ::getBooleanCppuType();
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_SHORT))
- aRet = ::getCppuType(static_cast<sal_Int16 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_INT))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_LONG))
- aRet = ::getCppuType(static_cast<sal_Int64 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_DOUBLE))
- aRet = ::getCppuType(static_cast< double const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_STRING))
- aRet = ::getCppuType(static_cast<rtl::OUString const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BINARY))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_ANY))
- aRet = ::getCppuType(static_cast<uno::Any const*>(0));
-
- else
- OSL_ENSURE(false,"Cannot parse: Unknown value type");
-
- return aRet;
-}
-// -----------------------------------------------------------------------------
-uno::Type xmlToListType(const rtl::OUString& _aElementType)
-{
- uno::Type aRet;
-
- if (_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BOOLEAN))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_SHORT))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_INT))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_LONG))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_DOUBLE))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_STRING))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BINARY))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
- else
- OSL_ENSURE(false,"Cannot parse: Unknown list value type");
-
- return aRet;
-}
-// -----------------------------------------------------------------------------
-/// retrieve data type of a property,
-uno::Type ElementParser::getPropertyValueType(uno::Reference< sax::XAttributeList > const& xAttribs) const
-{
- rtl::OUString sTypeName;
- if (!this->maybeGetAttribute(xAttribs, ATTR_VALUETYPE, sTypeName))
- return uno::Type(); // => VOID
-
- uno::Type aType;
-
- // valuetype names are either 'xs:<type>' or 'oor:<type>' or 'oor:<type>-list'
- if (matchSuffix(sTypeName,VALUETYPE_LIST_SUFFIX))
- {
- rtl::OUString sBasicName = stripTypeName( mLogger, stripSuffix(sTypeName,VALUETYPE_LIST_SUFFIX), NS_PREFIX_OOR );
-
- aType = xmlToListType(sBasicName);
- }
- else
- {
- rtl::OUString sPrefix = matchNsPrefix(sTypeName,NS_PREFIX_OOR) ? rtl::OUString( NS_PREFIX_OOR ) : rtl::OUString( NS_PREFIX_XS );
-
- rtl::OUString sBasicName = stripTypeName( mLogger, sTypeName, sPrefix );
-
- aType = xmlToScalarType(sBasicName);
- }
-
- if (aType == uno::Type())
- badValueType(mLogger,"Unknown type name: ", sTypeName);
-
- return aType;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve element type and associated module name of a set,
-bool ElementParser::getSetElementType(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& aElementType, rtl::OUString& aElementTypeModule) const
-{
- if (!this->maybeGetAttribute(xAttribs, ATTR_ITEMTYPE, aElementType))
- return false;
-
- maybeGetAttribute(xAttribs, ATTR_ITEMTYPECOMPONENT, aElementTypeModule);
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve instance type and associated module name of a set,
-bool ElementParser::getInstanceType(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& aElementType, rtl::OUString& aElementTypeModule) const
-{
- if (!this->maybeGetAttribute(xAttribs, ATTR_ITEMTYPE, aElementType))
- return false;
-
- maybeGetAttribute(xAttribs, ATTR_ITEMTYPECOMPONENT, aElementTypeModule);
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve the component for an import or uses element,
-bool ElementParser::getImportComponent(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& _rsComponent) const
-{
- return this->maybeGetAttribute(xAttribs, ATTR_COMPONENT, _rsComponent);
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for values from the attribute list
-bool ElementParser::isNull(uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- bool bNull;
- return maybeGetAttribute(_xAttribs, EXT_ATTR_NULL, bNull) && bNull;
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for values from the attribute list
-rtl::OUString ElementParser::getSeparator(uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- rtl::OUString aSeparator;
- maybeGetAttribute(_xAttribs, ATTR_VALUESEPARATOR, aSeparator);
- return aSeparator;
-}
-// -----------------------------------------------------------------------------
-
-// low-level internal methods
-/// checks for presence of a boolean attribute and assigns its value if it exists (and is a bool)
-bool ElementParser::maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, bool& rAttributeValue) const
-{
- rtl::OUString sAttribute;
-
- if ( !this->maybeGetAttribute(xAttribs, aAttributeName, sAttribute) )
- {
- return false;
- }
-
- else if (sAttribute.equals(ATTR_VALUE_TRUE))
- rAttributeValue = true; // will return true
-
- else if (sAttribute.equals(ATTR_VALUE_FALSE))
- rAttributeValue = false; // will return true
-
- else
- {
- OSL_ENSURE(sAttribute.getLength() == 0, "Invalid text found in boolean attribute");
- return false;
- }
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// checks for presence of an attribute and assigns its value if it exists
-bool ElementParser::maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, rtl::OUString& rAttributeValue) const
-{
- return xAttribs.is() && impl_maybeGetAttribute(xAttribs, aAttributeName, rAttributeValue);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
-} // namespace
-
diff --git a/configmgr/source/xml/elementparser.hxx b/configmgr/source/xml/elementparser.hxx
deleted file mode 100644
index 083168aec120..000000000000
--- a/configmgr/source/xml/elementparser.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_ELEMENTPARSER_HXX
-#define CONFIGMGR_XML_ELEMENTPARSER_HXX
-
-#include "elementinfo.hxx"
-#include "logger.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-
-// -----------------------------------------------------------------------------
- class ElementParser
- {
- Logger mLogger;
- public:
- class BadValueType
- {
- rtl::OUString mMessage;
- public:
- BadValueType(rtl::OUString const & aMessage) : mMessage(aMessage) {}
-
- rtl::OUString message() const { return mMessage.getStr(); }
- };
- public:
- explicit
- ElementParser(Logger const & xLogger)
- : mLogger(xLogger)
- {}
-
- Logger const & logger() const { return mLogger; }
-
- /// reset the parser for a new document
- void reset()
- {}
-
- /// retrieve the (almost) complete information for an element
- ElementInfo parseElementInfo(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- /// retrieve the node name for an element
- ElementType::Enum getNodeType(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& xAttribs) const;
-
- /// retrieve the node name for an element
- rtl::OUString getName(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum eType = ElementType::unknown) const;
-
- /// query whether the node has an operation
- Operation::Enum getOperation(uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum _eType) const;
-
- /// retrieve the language (if any) stored in the attribute list
- bool getLanguage(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString & _rsLanguage) const;
-
- /// reads attributes for nodes from the attribute list
- sal_Int16 getNodeFlags(uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum _eType) const;
-
- /// retrieve element type and associated module name of a set,
- bool getSetElementType(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsElementType, rtl::OUString& _rsElementTypeModule) const;
-
- /// retrieve the instance type and associated module name of a instance,
- bool getInstanceType(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsElementType, rtl::OUString& _rsElementTypeModule) const;
-
- /// retrieve the component for an import or uses element,
- bool getImportComponent(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsComponent) const;
-
- /// retrieve element type and associated module name of a set,
- uno::Type getPropertyValueType(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
- // throw( BadValueType )
-
- /// reads a value attribute from the attribute list
- bool isNull(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- /// reads a value attribute from the attribute list
- rtl::OUString getSeparator(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- // low-level internal methods
-
- /// checks for presence of a boolean attribute and assigns its value if it exists (and is a bool)
- bool maybeGetAttribute(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString const& _aAttributeName, bool& _rbAttributeValue) const;
-
- /// checks for presence of an attribute and assigns its value if it exists
- bool maybeGetAttribute(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString const& _aAttributeName, rtl::OUString& _rsAttributeValue) const;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/layerparser.cxx b/configmgr/source/xml/layerparser.cxx
deleted file mode 100644
index c22d7cb61ec7..000000000000
--- a/configmgr/source/xml/layerparser.cxx
+++ /dev/null
@@ -1,368 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "com/sun/star/configuration/backend/NodeAttribute.hpp"
-#include "layerparser.hxx"
-
-// -----------------------------------------------------------------------------
-#include "wrapexception.hxx"
-
-#define WRAP_PARSE_EXCEPTIONS() \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS( raiseParseException ) \
- WRAP_OTHER_EXCEPTIONS( raiseParseException )
-
-#define WRAP_PARSE_EXCEPTIONS_MSG( msg ) \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS1( raiseParseException, msg ) \
- WRAP_OTHER_EXCEPTIONS1( raiseParseException, msg )
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-LayerParser::LayerParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XLayerHandler > const & _xHandler)
-: BasicParser(_xContext)
-, m_xHandler(_xHandler)
-, m_bRemoved(false)
-, m_bNewProp(false)
-{
- if (!m_xHandler.is())
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Cannot create LayerParser: Unexpected NULL Handler"));
- throw uno::RuntimeException(sMessage, NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LayerParser::~LayerParser()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- BasicParser::startDocument();
-
- try
- {
- OSL_ENSURE(isEmptyNode(), "BasicParser does not mark new document as empty");
-
- m_xHandler->startLayer();
- m_bRemoved = false;
- m_bNewProp = false;
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting layer")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- if (isEmptyNode()) OSL_TRACE("Configuration Parser: XML layer document ended without any data");
-
- BasicParser::endDocument();
-
- try
- {
- m_xHandler->endLayer();
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending layer")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->isSkipping() )
- {
- this->startSkipping( aName, xAttribs );
- return;
- }
-
- ElementInfo aInfo = getDataParser().parseElementInfo(aName,xAttribs);
-
- try
- {
- switch (aInfo.type)
- {
- case ElementType::group: case ElementType::set:
- OSL_ENSURE( false, "Layer XML parser - Unexpected: found group/set element (should be 'node')\n");
- // fall thru
- case ElementType::layer:
- case ElementType::node:
- this->startNode(aInfo,xAttribs);
- OSL_ASSERT( this->isInNode() && !this->isInProperty() );
- break;
-
- case ElementType::property:
- this->startProperty(aInfo,xAttribs);
- OSL_ASSERT( this->isInUnhandledProperty() );
- break;
-
- case ElementType::value:
- this->startValueData(xAttribs);
- OSL_ASSERT( this->isInValueData() );
- break;
-
- default: // skip unknown elements
- OSL_ENSURE( aInfo.type >= ElementType::other, "Layer XML parser - Unexpected: found schema element in layer data\n");
- OSL_ENSURE( aInfo.type < ElementType::other, "Layer XML parser - Warning: ignoring unknown element tag\n");
- this->startSkipping( aName, xAttribs );
- return;
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting Element")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->wasSkipping(aName) )
- return;
-
- try
- {
- if ( this->isInValueData())
- this->endValueData();
-
- else if (this->isInProperty())
- this->endProperty();
-
- else if (this->isInNode())
- this->endNode();
-
- else {
- this->raiseParseException("Layer parser: Invalid XML: endElement without matching startElement");
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending Element")
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void LayerParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- this->checkNotRemoved();
-
- BasicParser::startNode(aInfo,xAttribs);
-
- switch (aInfo.op)
- {
- case Operation::none:
- case Operation::modify:
- m_xHandler->overrideNode(aInfo.name,aInfo.flags,false);
- break;
-
- case Operation::clear:
- m_xHandler->overrideNode(aInfo.name,aInfo.flags,true);
- break;
-
- case Operation::replace:
- case Operation::fuse:
- {
- backenduno::TemplateIdentifier aTemplate;
- sal_Int16 flags = aInfo.flags;
- if (aInfo.op == Operation::fuse) {
- flags |=
- com::sun::star::configuration::backend::NodeAttribute::FUSE;
- }
- if (getDataParser().getInstanceType(xAttribs,aTemplate.Name,aTemplate.Component))
- m_xHandler->addOrReplaceNodeFromTemplate(aInfo.name,aTemplate,flags);
- else
- m_xHandler->addOrReplaceNode(aInfo.name,flags);
- }
- break;
-
- case Operation::remove:
- m_xHandler->dropNode(aInfo.name);
- m_bRemoved = true;
- break;
-
- default: OSL_ASSERT(false);
- case Operation::unknown:
- this->raiseParseException("Layer parser: Invalid Data: unknown operation");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endNode()
-{
- if (!this->isInRemoved())
- m_xHandler->endNode();
- else
- m_bRemoved = false;
-
- BasicParser::endNode();
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- this->checkNotRemoved();
-
- BasicParser::startProperty(aInfo,xAttribs);
-
- switch (aInfo.op)
- {
- case Operation::none:
- case Operation::modify:
- m_xHandler->overrideProperty(aInfo.name,aInfo.flags,getActivePropertyType(),false);
- OSL_ASSERT(!m_bNewProp);
- break;
-
- case Operation::clear:
- m_xHandler->overrideProperty(aInfo.name,aInfo.flags,getActivePropertyType(),true);
- OSL_ASSERT(!m_bNewProp);
- break;
-
- case Operation::replace:
- // defer to later
- m_bNewProp = true;
- break;
-
- case Operation::fuse:
- this->raiseParseException("Layer parser: Invalid Data: operation 'fuse' is not permitted for properties");
-
- case Operation::remove:
- this->raiseParseException("Layer parser: Invalid Data: operation 'remove' is not permitted for properties");
-
- default: OSL_ASSERT(false);
- case Operation::unknown:
- this->raiseParseException("Layer parser: Invalid Data: unknown operation");
- }
- OSL_POSTCOND(this->isInUnhandledProperty(),"Error: Property not reckognized as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::addOrReplaceCurrentProperty(const uno::Any& aValue)
-{
- const ElementInfo& currentInfo = getActiveNodeInfo() ;
-
- OSL_ASSERT(currentInfo.op == Operation::replace) ;
-
- if (aValue.hasValue())
- {
- m_xHandler->addPropertyWithValue(currentInfo.name,
- currentInfo.flags, aValue) ;
- }
- else
- {
- m_xHandler->addProperty(currentInfo.name, currentInfo.flags,
- getActivePropertyType()) ;
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endProperty()
-{
- OSL_ASSERT(!this->isInRemoved());
-
- if (m_bNewProp)
- {
- OSL_ASSERT(getActiveNodeInfo().op == Operation::replace);
- if (this->isInUnhandledProperty())
- {
- // No value tag is treated as NULL
- addOrReplaceCurrentProperty( uno::Any() ) ;
- }
- m_bNewProp = false;
- }
- else
- {
- OSL_ASSERT(getActiveNodeInfo().op != Operation::replace);
- m_xHandler->endProperty();
- }
-
- BasicParser::endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- this->checkNotRemoved();
-
- BasicParser::startValueData(xAttribs);
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endValueData()
-{
- uno::Any aValue = this->getCurrentValue();
-
- if (m_bNewProp)
- {
- if (this->isValueDataLocalized())
- getLogger().warning("Language attribute ignored for value of added property.",
- "endValueData()","configuration::xml::SchemaParser");
-
- addOrReplaceCurrentProperty(aValue) ;
- }
- else if (this->isValueDataLocalized())
- {
- rtl::OUString aLocale = this->getValueDataLocale();
-
- m_xHandler->setPropertyValueForLocale(aValue,aLocale);
- }
- else
- {
- m_xHandler->setPropertyValue(aValue);
- }
-
- BasicParser::endValueData();
-
- OSL_POSTCOND(!this->isInUnhandledProperty(),"Error: Property not reckognized as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::checkNotRemoved()
-{
- if (m_bRemoved)
- raiseParseException("Layer parser: Invalid Data: Data inside removed node.");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/layerparser.hxx b/configmgr/source/xml/layerparser.hxx
deleted file mode 100644
index 839ae3766db5..000000000000
--- a/configmgr/source/xml/layerparser.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERPARSER_HXX
-#define CONFIGMGR_XML_LAYERPARSER_HXX
-
-#include "basicparser.hxx"
-
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
-
- class LayerParser : public BasicParser
- {
- public:
- LayerParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XLayerHandler > const & _xHandler);
- virtual ~LayerParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException);
-
- private:
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// end collecting data for a value - returns the collected value
- void endValueData();
-
- /**
- Forces the addition or replacement of a property.
- As it is possible to "replace" an existing property,
- even though this amounts to a modify, this method
- first tries to add a new property and failing that,
- to replace the value of an existing one.
-
- @param aValue value to be set for the property
- */
- void addOrReplaceCurrentProperty(const uno::Any& aValue) ;
-
- bool isInRemoved() const { return m_bRemoved; }
- void checkNotRemoved();
- private:
- uno::Reference< backenduno::XLayerHandler > m_xHandler;
- bool m_bRemoved;
- bool m_bNewProp;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/layerwriter.cxx b/configmgr/source/xml/layerwriter.cxx
deleted file mode 100644
index e20f78455b5f..000000000000
--- a/configmgr/source/xml/layerwriter.cxx
+++ /dev/null
@@ -1,541 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerwriter.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "valueformatter.hxx"
-#include <com/sun/star/beans/IllegalTypeException.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace xml
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- // -----------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerWriter
- ( uno::Reference< uno::XComponentContext > const& xContext )
- {
- return * new LayerWriter(xContext);
- }
- // -----------------------------------------------------------------------------
-
- namespace
- {
- static inline
- uno::Reference< script::XTypeConverter > createTCV(uno::Reference< lang::XMultiServiceFactory > const & _xSvcFactory)
- {
- OSL_ENSURE(_xSvcFactory.is(),"Cannot create Write Formatter without a ServiceManager");
-
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- return uno::Reference< script::XTypeConverter >::query(_xSvcFactory->createInstance(k_sTCVService));
- }
- // -----------------------------------------------------------------------------
- static
- void translateSAXException( sax::SAXException & aSAXException,
- backenduno::XLayerHandler * context)
- {
- rtl::OUString sMessage = aSAXException.Message;
-
- uno::Any const & aWrappedException = aSAXException.WrappedException;
- if (aWrappedException.hasValue())
- {
- if (aWrappedException.getValueTypeClass() != uno::TypeClass_EXCEPTION)
- OSL_ENSURE(false, "ERROR: WrappedException is not an exception");
-
- else if (sMessage.getLength() == 0)
- sMessage = static_cast<uno::Exception const *>(aWrappedException.getValue())->Message;
-
- // assume that a SAXException with WrappedException indicates a storage access error
- throw backenduno::BackendAccessException(sMessage,context,aWrappedException);
- }
- else
- {
- // assume that a SAXException without WrappedException indicates non-well-formed data
- throw backenduno::MalformedDataException(sMessage,context,uno::makeAny(aSAXException));
- }
- }
- // -----------------------------------------------------------------------------
- static inline uno::Type getIOExceptionType()
- {
- io::IOException const * const ioexception = 0;
- return ::getCppuType(ioexception);
- }
- static inline uno::Type getNotConnectedExceptionType()
- {
- io::NotConnectedException const * const ncexception = 0;
- return ::getCppuType(ncexception);
- }
- static
- void translateIOException(uno::Any const & anIOException,
- backenduno::XLayerHandler * context)
- {
- OSL_ASSERT(anIOException.isExtractableTo(getIOExceptionType()));
- io::IOException const * pException = static_cast<io::IOException const *>(anIOException.getValue());
- rtl::OUString sMessage = pException->Message;
-
- if (anIOException.isExtractableTo(getNotConnectedExceptionType()))
- {
- throw backenduno::ConnectionLostException(sMessage,context,anIOException);
- }
- else
- {
- throw backenduno::BackendAccessException(sMessage,context,anIOException);
- }
- }
- // -----------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-
- LayerWriter::LayerWriter(uno::Reference< uno::XComponentContext > const & _xContext)
- : WriterService< ::com::sun::star::configuration::backend::XLayerHandler >(_xContext)
- , m_xTCV( createTCV( WriterService< ::com::sun::star::configuration::backend::XLayerHandler >::getServiceFactory() ) )
- , m_bInProperty(false)
- , m_bStartedDocument(false)
- {
- }
- // -----------------------------------------------------------------------------
-
- LayerWriter::~LayerWriter()
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- m_aFormatter.reset();
- m_bInProperty = false;
- m_bStartedDocument = false;
-
- checkInElement(false);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(false);
- try
- {
- if (!m_bStartedDocument)
- {
- uno::Reference< io::XOutputStream > aStream = this->getOutputStream( );
- aStream->closeOutput();
- }
- else
- {
- getWriteHandler()->endDocument();
- m_aFormatter.reset();
- m_bStartedDocument = false;
- }
- }
- catch (sax::SAXException & xe) { translateSAXException(xe,this); }
- catch (io::NotConnectedException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- catch (io::BufferSizeExceededException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- catch (io::IOException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- if (!m_bStartedDocument)
- {
- getWriteHandler()->startDocument();
- m_bStartedDocument = true;
- }
- ElementInfo aInfo(aName, this->isInElement() ? ElementType::node : ElementType::layer);
- aInfo.flags = aAttributes;
- aInfo.op = bClear ? Operation::clear : Operation::modify;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::prepareAddOrReplaceElement(
- rtl::OUString const & name, sal_Int16 attributes)
- {
- ElementInfo info(name, ElementType::node);
- info.flags = attributes &
- ~com::sun::star::configuration::backend::NodeAttribute::FUSE;
- info.op =
- (attributes &
- com::sun::star::configuration::backend::NodeAttribute::FUSE)
- == 0
- ? Operation::replace : Operation::fuse;
- m_aFormatter.prepareElement(info);
- }
-
- void SAL_CALL LayerWriter::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- prepareAddOrReplaceElement(aName, aAttributes);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- prepareAddOrReplaceElement(aName, aAttributes);
- m_aFormatter.addInstanceType(aTemplate.Name,aTemplate.Component);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
- try
- {
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::node);
- aInfo.flags = 0;
- aInfo.op = Operation::remove;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startNode();
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = Operation::replace;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aType, true);
- this->writeValue(uno::Any());
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = Operation::replace;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aValue.getValueType(), true);
- this->writeValue(aValue);
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = bClear ? Operation::modify : Operation::modify;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aType, aType.getTypeClass() != uno::TypeClass_VOID);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->writeValue(aValue);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->writeValue(aValue,aLocale);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::raiseMalformedDataException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::raiseIllegalTypeException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- com::sun::star::beans::IllegalTypeException e( sMsg, *this );
- throw backenduno::MalformedDataException( sMsg, *this, uno::makeAny(e) );
- }
- // -----------------------------------------------------------------------------
-
- bool LayerWriter::isInElement() const
- {
- return !m_aTagStack.empty();
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::checkInElement(bool bInElement, bool bInProperty)
- {
- if (bInElement != this->isInElement())
- {
- sal_Char const * pMsg = bInElement ?
- "LayerWriter: Illegal Data: Operation requires a started node" :
- "LayerWriter: Illegal Data: There is a started node already" ;
- raiseMalformedDataException(pMsg);
- }
-
- if (bInProperty != m_bInProperty)
- {
- sal_Char const * pMsg = bInProperty ?
- "LayerWriter: Illegal Data: Operation requires a started property" :
- "LayerWriter: Illegal Data: There is a started property already" ;
- raiseMalformedDataException(pMsg);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::startNode()
- {
- rtl::OUString sTag = m_aFormatter.getElementTag();
- getWriteHandler()->startElement(sTag,m_aFormatter.getElementAttributes());
- getWriteHandler()->ignorableWhitespace(rtl::OUString());
- m_aTagStack.push(sTag);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::startProp(uno::Type const & _aType, bool bNeedType)
- {
- if (bNeedType && _aType == uno::Type())
- raiseIllegalTypeException("LayerWriter: Illegal Data: Cannot add VOID property");
-
- m_aFormatter.addPropertyValueType(_aType);
-
- startNode();
-
- m_aPropertyType = _aType;
- m_bInProperty = true;
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::endElement()
- {
- OSL_ASSERT(!m_aTagStack.empty()); // checks done elsewhere
-
- getWriteHandler()->endElement(m_aTagStack.top());
- getWriteHandler()->ignorableWhitespace(rtl::OUString());
-
- m_aTagStack.pop();
- m_bInProperty = false;
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::writeValue(uno::Any const & _aValue)
- {
- m_aFormatter.prepareSimpleElement( ElementType::value );
- outputValue(_aValue);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::writeValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- {
- m_aFormatter.prepareSimpleElement( ElementType::value );
- m_aFormatter.addLanguage(_aLocale);
- outputValue(_aValue);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::outputValue(uno::Any const & _aValue)
- {
- ValueFormatter aValueFormatter(_aValue);
-
- aValueFormatter.addValueAttributes(m_aFormatter);
-
- rtl::OUString sTag = m_aFormatter.getElementTag();
- rtl::OUString sContent = aValueFormatter.getContent( this->m_xTCV );
-
- uno::Reference< sax::XDocumentHandler > xOut = getWriteHandler();
- xOut->startElement(sTag, m_aFormatter.getElementAttributes());
-
- if (sContent.getLength()) xOut->characters(sContent);
-
- xOut->endElement(sTag);
- xOut->ignorableWhitespace(rtl::OUString());
- }
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/layerwriter.hxx b/configmgr/source/xml/layerwriter.hxx
deleted file mode 100644
index f3900a065fa8..000000000000
--- a/configmgr/source/xml/layerwriter.hxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERWRITER_HXX
-#define CONFIGMGR_XML_LAYERWRITER_HXX
-
-#include "writersvc.hxx"
-#include "elementformatter.hxx"
-#include "stack.hxx"
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-namespace com { namespace sun { namespace star { namespace script {
- class XTypeConverter;
-} } } }
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace xml
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
- // -----------------------------------------------------------------------------
-
-
- class LayerWriter : public WriterService< ::com::sun::star::configuration::backend::XLayerHandler >
- {
- public:
- explicit
- LayerWriter(uno::Reference< uno::XComponentContext > const & _xContext);
- virtual ~LayerWriter();
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- private:
- bool isInElement() const;
- void checkInElement(bool bInElement, bool bInProperty = false);
-
- void startNode();
- void startProp(uno::Type const & _aType, bool bNeedType);
-
- void endElement();
-
- void writeValue(uno::Any const & _aValue);
- void writeValue(uno::Any const & _aValue, rtl::OUString const & _aLocale);
-
- void outputValue(uno::Any const & _aValue);
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- void raiseIllegalTypeException(sal_Char const * pMsg);
-
- void prepareAddOrReplaceElement(
- rtl::OUString const & name, sal_Int16 attributes);
-
- private:
- uno::Reference< com::sun::star::script::XTypeConverter > m_xTCV;
- Stack< rtl::OUString > m_aTagStack;
- ElementFormatter m_aFormatter;
- uno::Type m_aPropertyType;
- bool m_bInProperty;
- bool m_bStartedDocument;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/makefile.mk b/configmgr/source/xml/makefile.mk
deleted file mode 100644
index 3f8633ed9a3c..000000000000
--- a/configmgr/source/xml/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=xml
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
-CFLAGSCXX+=-instances=static
-.ENDIF
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/matchlocale.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
- $(SLO)$/valueconverter.obj \
- $(SLO)$/elementparser.obj \
- $(SLO)$/elementformatter.obj \
- $(SLO)$/basicparser.obj \
- $(SLO)$/layerparser.obj \
- $(SLO)$/schemaparser.obj \
- $(SLO)$/parsersvc.obj \
- $(SLO)$/writersvc.obj \
- $(SLO)$/layerwriter.obj \
- $(SLO)$/valueformatter.obj \
- $(SLO)$/xmlstrings.obj \
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/xml/matchlocale.cxx b/configmgr/source/xml/matchlocale.cxx
deleted file mode 100644
index d0f5f3dceced..000000000000
--- a/configmgr/source/xml/matchlocale.cxx
+++ /dev/null
@@ -1,384 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "matchlocale.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <algorithm>
-#include <iterator>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localehelper
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-#define ARRAYSIZE( arr ) (sizeof(arr) / sizeof 0[arr] )
-// -----------------------------------------------------------------------------
- struct StaticLocale
- {
- char const * aLanguage;
- char const * aCountry;
- };
-
- char const * const c_sAnyLanguage = "*"; // exported !
- char const * const c_sDefLanguage = "x-default"; // exported !
-
- char const * const c_sNoCountry = "";
-
- char const * const c_sLanguageEnglish = "en";
- char const * const c_sCountryUS = "US";
-
- StaticLocale const c_aFallbackLocales[] =
- {
- { c_sLanguageEnglish, c_sCountryUS }, // english [cannot make 'en' better than 'en-US' :-(]
- { c_sAnyLanguage, c_sNoCountry } // just take the first you find
- };
- std::vector< com::sun::star::lang::Locale >::size_type const c_nFallbackLocales = ARRAYSIZE(c_aFallbackLocales);
-
-// -----------------------------------------------------------------------------
- bool isAnyLanguage(rtl::OUString const & _sLanguage)
- {
- return !!_sLanguage.equalsAscii(c_sAnyLanguage);
- }
-
-// -----------------------------------------------------------------------------
- bool isDefaultLanguage(rtl::OUString const & _sLanguage)
- {
- return !!_sLanguage.equalsAscii(c_sDefLanguage);
- }
-
-// -----------------------------------------------------------------------------
- rtl::OUString getAnyLanguage()
- {
- return rtl::OUString::createFromAscii( c_sAnyLanguage );
- }
-
-// -----------------------------------------------------------------------------
- rtl::OUString getDefaultLanguage()
- {
- return rtl::OUString::createFromAscii( c_sDefLanguage );
- }
-
-// -----------------------------------------------------------------------------
- com::sun::star::lang::Locale getAnyLocale()
- {
- return com::sun::star::lang::Locale( getAnyLanguage(), rtl::OUString(), rtl::OUString() );
- }
-
-// -----------------------------------------------------------------------------
- com::sun::star::lang::Locale getDefaultLocale()
- {
- return com::sun::star::lang::Locale( getDefaultLanguage(), rtl::OUString(), rtl::OUString() );
- }
-
-// -----------------------------------------------------------------------------
- static inline sal_Int32 countrySeparatorPos(rtl::OUString const& aLocaleName_)
- {
- sal_Int32 pos = aLocaleName_.indexOf('-');
- if (pos == 1) // allow for x-LL or i-LL
- pos = aLocaleName_.indexOf('-',pos+1);
-
- if (pos < 0)
- pos = aLocaleName_.indexOf('_');
-
- return pos;
- }
- // -------------------------------------------------------------------------
- static inline sal_Int32 countryLength(rtl::OUString const& aLocaleName_, sal_Int32 nCountryPos)
- {
- sal_Int32 pos1 = aLocaleName_.indexOf('.',nCountryPos);
- sal_Int32 pos2 = aLocaleName_.indexOf('_',nCountryPos);
-
- if (pos1 < 0) pos1 = aLocaleName_.getLength();
-
- if (pos2 < 0 || pos1 < pos2)
- return pos1 - nCountryPos;
-
- else
- return pos2 - nCountryPos;
- }
- // -------------------------------------------------------------------------
- static inline void splitLocaleString(rtl::OUString const& aLocaleName_, rtl::OUString& rLanguage_, rtl::OUString& rCountry_)
- {
- sal_Int32 nCountryPos = countrySeparatorPos(aLocaleName_);
- if (nCountryPos >= 0)
- {
- rLanguage_ = aLocaleName_.copy(0,nCountryPos).toAsciiLowerCase();
-
- ++nCountryPos; // advance past separator
- sal_Int32 nCountryLength = countryLength(aLocaleName_, nCountryPos);
-
- rCountry_ = aLocaleName_.copy(nCountryPos,nCountryLength).toAsciiUpperCase();
- }
- else
- {
- rLanguage_ = aLocaleName_.toAsciiLowerCase();
- rCountry_ = rtl::OUString();
- }
- }
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// conversion helpers
-com::sun::star::lang::Locale makeLocale(rtl::OUString const& sLocaleName_)
-{
- com::sun::star::lang::Locale aResult;
- splitLocaleString(sLocaleName_, aResult.Language, aResult.Country);
- return aResult;
-}
-rtl::OUString makeIsoLocale(com::sun::star::lang::Locale const& aUnoLocale_)
-{
- rtl::OUStringBuffer aResult(aUnoLocale_.Language.toAsciiLowerCase());
- if (aUnoLocale_.Country.getLength())
- {
- aResult.append( sal_Unicode('-') ).append(aUnoLocale_.Country.toAsciiUpperCase());
- }
- return aResult.makeStringAndClear();
-}
-static
-com::sun::star::lang::Locale makeLocale(StaticLocale const& aConstLocale_)
-{
- com::sun::star::lang::Locale aResult;
- aResult.Language = rtl::OUString::createFromAscii(aConstLocale_.aLanguage);
- aResult.Country = rtl::OUString::createFromAscii(aConstLocale_.aCountry);
- return aResult;
-}
-// -----------------------------------------------------------------------------
-template <class T>
-inline
-void addLocaleSeq_impl(T const* first, T const* last, std::vector< com::sun::star::lang::Locale >& rSeq)
-{
- com::sun::star::lang::Locale (* const xlate)(T const&) = &makeLocale;
-
- std::transform(first, last, std::back_inserter(rSeq), xlate);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <class T>
-inline
-std::vector< com::sun::star::lang::Locale > makeLocaleSeq_impl(uno::Sequence< T > const& aLocales_)
-{
- sal_Int32 const nLocaleCount = aLocales_.getLength();
-
- T const* pLocaleBegin = aLocales_.getConstArray();
-
- std::vector< com::sun::star::lang::Locale > aResult;
- aResult.reserve( nLocaleCount + c_nFallbackLocales ); // make room for fallback stuff as well
-
- addLocaleSeq_impl(pLocaleBegin, pLocaleBegin + nLocaleCount, aResult);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-void addFallbackLocales(std::vector< com::sun::star::lang::Locale >& aTargetList_)
-{
- addLocaleSeq_impl(c_aFallbackLocales, c_aFallbackLocales + c_nFallbackLocales, aTargetList_);
-}
-// -----------------------------------------------------------------------------
-
-std::vector< com::sun::star::lang::Locale > makeLocaleSequence(uno::Sequence<rtl::OUString> const& sLocaleNames_)
-{
- return makeLocaleSeq_impl(sLocaleNames_);
-}
-// -----------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> makeIsoSequence(std::vector< com::sun::star::lang::Locale > const& aLocales_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nLocaleCount = aLocales_.size();
- sal_Int32 const nSeqSize = sal_Int32(nLocaleCount);
- OSL_ASSERT( nSeqSize >= 0 && sal_uInt32(nSeqSize) == nLocaleCount );
-
- uno::Sequence<rtl::OUString> aResult(nSeqSize);
- std::transform(aLocales_.begin(), aLocales_.end(), aResult.getArray(), &makeIsoLocale);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-bool designatesAllLocales(com::sun::star::lang::Locale const& aLocale_)
-{
- return aLocale_.Language.equalsAscii(c_sAnyLanguage);
-}
-bool designatesAllLocales(std::vector< com::sun::star::lang::Locale > const& aLocales_)
-{
- return aLocales_.size() <= 1 &&
- (aLocales_.size() == 0 || designatesAllLocales(aLocales_));
-}
-// -----------------------------------------------------------------------------
-
-MatchQuality match(com::sun::star::lang::Locale const& aLocale_, com::sun::star::lang::Locale const& aTarget_)
-{
- // check language
- if (!aLocale_.Language.equals(aTarget_.Language))
- {
- // can we accept any language
- if (aTarget_.Language.equalsAscii(c_sAnyLanguage))
- return MATCH_LANGUAGE;
-
- return MISMATCH;
- }
-
- // check for exact match
- else if (aLocale_.Country.equals(aTarget_.Country))
- return MATCH_LOCALE;
-
- // check for plain language
- else if (aLocale_.Country.getLength() == 0)
- return MATCH_LANGUAGE_PLAIN;
-
- // so we are left with the wrong country
- else
- return MATCH_LANGUAGE;
-}
-
-// -----------------------------------------------------------------------------
-
-/// check the given position and quality, if they are an improvement
-bool MatchResult::improve(std::vector< com::sun::star::lang::Locale >::size_type nPos_, MatchQuality eQuality_)
-{
- // is this a match at all ?
- if (eQuality_ == MISMATCH)
- return false;
-
- // is the position worse ?
- if (nPos_ > m_nPos )
- return false;
-
- // is this just a non-positive quality change ?
- if (nPos_ == m_nPos && eQuality_ <= m_eQuality)
- return false;
-
- // Improvement found
- m_nPos = nPos_;
- m_eQuality = eQuality_;
-
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-bool isMatch(com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_, MatchQuality eRequiredQuality_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nEnd = aTarget_.size();
-
- for (std::vector< com::sun::star::lang::Locale >::size_type nPos = 0; nPos < nEnd; ++nPos)
- {
- MatchQuality eQuality = match(aLocale_, aTarget_[nPos]);
- if (eQuality >= eRequiredQuality_)
- {
- return true;
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-std::vector< com::sun::star::lang::Locale >::size_type getSearchLimitPosition(MatchResult const& aPrevMatch_,std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type nSize = aTarget_.size();
-
- if (aPrevMatch_.isMatch())
- {
- std::vector< com::sun::star::lang::Locale >::size_type nMatchPos = aPrevMatch_.position();
-
- OSL_ENSURE(nMatchPos < nSize,"localehelper::getSearchLimitPosition: ERROR - previous position is out-of-bounds");
-
- if (nMatchPos < nSize)
- {
- return nMatchPos + 1;
- }
- }
- return nSize;
-}
-// -----------------------------------------------------------------------------
-
-bool improveMatch(MatchResult& rMatch_, com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nEnd = getSearchLimitPosition(rMatch_,aTarget_);
-
- for (std::vector< com::sun::star::lang::Locale >::size_type nPos = 0; nPos < nEnd; ++nPos)
- {
- if (rMatch_.improve(nPos, match(aLocale_, aTarget_[nPos])))
- {
- return true;
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-
-// -----------------------------------------------------------------------------
-// class FindBestLocale
-// -----------------------------------------------------------------------------
-
-inline
-void FindBestLocale::implSetTarget(std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- m_aTarget = aTarget_;
- addFallbackLocales(m_aTarget);
-}
-// -----------------------------------------------------------------------------
-
-FindBestLocale::FindBestLocale(com::sun::star::lang::Locale const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale > aSeq(1,aTarget_);
- implSetTarget( aSeq );
-}
-// -----------------------------------------------------------------------------
-
-bool FindBestLocale::accept(com::sun::star::lang::Locale const& aLocale_)
-{
- return improveMatch(m_aResult, aLocale_, m_aTarget);
-}
-// -----------------------------------------------------------------------------
-
-void FindBestLocale::reset(bool bNeedLocale_)
-{
- if (bNeedLocale_)
- m_aResult.reset();
-
- else // mark as best match already (no improvement possible)
- m_aResult = m_aResult.best();
-}
-// -----------------------------------------------------------------------------
-
- } // namespace locale helper
-// -----------------------------------------------------------------------------
-
-} // namespace
-
-
diff --git a/configmgr/source/xml/parsersvc.cxx b/configmgr/source/xml/parsersvc.cxx
deleted file mode 100644
index 635a4cd9f231..000000000000
--- a/configmgr/source/xml/parsersvc.cxx
+++ /dev/null
@@ -1,382 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "parsersvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "schemaparser.hxx"
-#include "layerparser.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <com/sun/star/configuration/backend/XSchema.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/xml/sax/XParser.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-struct ParserServiceTraits;
-// -----------------------------------------------------------------------------
-static inline void clear(rtl::OUString & _rs) { _rs = rtl::OUString(); }
-
-// -----------------------------------------------------------------------------
-template <class BackendInterface>
-ParserService<BackendInterface>::ParserService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xContext(_xContext)
-, m_aInputSource()
-{
- if (!m_xContext.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Parser: NULL Context"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-template <class BackendInterface>
-void SAL_CALL
- ParserService<BackendInterface>::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- switch(aArguments.getLength())
- {
- case 0:
- break;
-
- case 1:
- if (aArguments[0] >>= m_aInputSource)
- break;
-
- if (aArguments[0] >>= m_aInputSource.aInputStream)
- break;
-
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Parser"
- "- InputSource or XInputStream expected"));
- throw lang::IllegalArgumentException(sMessage,*this,1);
- }
- default:
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Parser"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-inline
-ServiceInfoHelper ParserService<BackendInterface>::getServiceInfo()
-{
- return ParserServiceTraits<BackendInterface>::getServiceInfo();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-template <class BackendInterface>
-::rtl::OUString SAL_CALL
- ParserService<BackendInterface>::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName();
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-sal_Bool SAL_CALL
- ParserService<BackendInterface>::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Sequence< ::rtl::OUString > SAL_CALL
- ParserService<BackendInterface>::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void SAL_CALL
- ParserService<BackendInterface>::setInputStream( const uno::Reference< io::XInputStream >& aStream )
- throw (uno::RuntimeException)
-{
- clear( m_aInputSource.sEncoding );
- clear( m_aInputSource.sSystemId );
- // clear( m_aInputSource.sPublicId );
- m_aInputSource.aInputStream = aStream;
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< io::XInputStream > SAL_CALL
- ParserService<BackendInterface>::getInputStream( )
- throw (uno::RuntimeException)
-{
- return m_aInputSource.aInputStream;
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void ParserService<BackendInterface>::parse(uno::Reference< sax::XDocumentHandler > const & _xHandler)
-// throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- OSL_PRECOND( _xHandler.is(), "ParserService: No SAX handler to parse to");
-
- rtl::OUString const k_sSaxParserService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"));
-
- uno::Reference< lang::XMultiComponentFactory > xServiceFactory = m_xContext->getServiceManager();
-
- uno::Reference< sax::XParser > xParser = uno::Reference< sax::XParser >::query( xServiceFactory->createInstanceWithContext(k_sSaxParserService,m_xContext) );
-
- if (!xParser.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Parser: Cannot create SAX Parser"));
- throw uno::RuntimeException(sMessage,*this);
- }
-
- try
- {
- xParser->setDocumentHandler(_xHandler);
-
- sax::InputSource aInputSourceCopy = m_aInputSource;
- //Set the sax input stream to null, an input stream can only be parsed once
- m_aInputSource.aInputStream = NULL;
- xParser->parseStream( aInputSourceCopy );
- }
- catch (sax::SAXException & e)
- {
- uno::Any aWrapped = e.WrappedException.hasValue() ? e.WrappedException : uno::makeAny( e );
- rtl::OUString sSAXMessage = e.Message;
-
- // Expatwrap SAX service doubly wraps its errors ??
- sax::SAXException eInner;
- if (aWrapped >>= eInner)
- {
- if (eInner.WrappedException.hasValue()) aWrapped = eInner.WrappedException;
-
- rtl::OUStringBuffer sMsgBuf(eInner.Message);
- sMsgBuf.appendAscii("- {Parser Error: ").append(sSAXMessage).appendAscii(" }.");
- sSAXMessage = sMsgBuf.makeStringAndClear();
- }
-
- static backenduno::MalformedDataException const * const forDataError = 0;
- static lang::WrappedTargetException const * const forWrappedError = 0;
- if (aWrapped.isExtractableTo(getCppuType(forDataError)) ||
- aWrapped.isExtractableTo(getCppuType(forWrappedError)))
- {
- cppu::throwException(aWrapped);
-
- OSL_ASSERT(!"not reached");
- }
-
- rtl::OUStringBuffer sMessageBuf;
- sMessageBuf.appendAscii("Configuration Parser: a ").append( aWrapped.getValueTypeName() );
- sMessageBuf.appendAscii(" occurred while parsing: ");
- sMessageBuf.append(sSAXMessage);
-
- throw lang::WrappedTargetException(sMessageBuf.makeStringAndClear(),*this,aWrapped);
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-sal_Char const * const aSchemaParserServices[] =
-{
- "com.sun.star.configuration.backend.xml.SchemaParser",
- 0
-};
-const ServiceImplementationInfo aSchemaParserSI =
-{
- "com.sun.star.comp.configuration.backend.xml.SchemaParser",
- aSchemaParserServices,
- 0
-};
-// -----------------------------------------------------------------------------
-sal_Char const * const aLayerParserServices[] =
-{
- "com.sun.star.configuration.backend.xml.LayerParser",
- 0
-};
-const ServiceImplementationInfo aLayerParserSI =
-{
- "com.sun.star.comp.configuration.backend.xml.LayerParser",
- aLayerParserServices,
- 0
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <>
-struct ParserServiceTraits< backenduno::XSchema >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aSchemaParserSI; }
-};
-// -----------------------------------------------------------------------------
-template <>
-struct ParserServiceTraits< backenduno::XLayer >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aLayerParserSI; }
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-class SchemaParserService : public ParserService< backenduno::XSchema >
-{
-public:
- SchemaParserService(uno::Reference< uno::XComponentContext > const & _xContext)
- : ParserService< backenduno::XSchema >(_xContext)
- {
- }
-
- virtual void SAL_CALL readSchema( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL readComponent( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL readTemplates( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-};
-// -----------------------------------------------------------------------------
-
-class LayerParserService : public ParserService< backenduno::XLayer >
-{
-public:
- LayerParserService(uno::Reference< uno::XComponentContext > const & _xContext)
- : ParserService< backenduno::XLayer >(_xContext)
- {
- }
-
- virtual void SAL_CALL readData( uno::Reference< backenduno::XLayerHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-};
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL instantiateSchemaParser( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new SchemaParserService(xContext);
-}
-uno::Reference< uno::XInterface > SAL_CALL instantiateLayerParser( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LayerParserService(xContext);
-}
-// -----------------------------------------------------------------------------
-const ServiceRegistrationInfo* getSchemaParserServiceInfo()
-{ return getRegistrationInfo(& aSchemaParserSI); }
-const ServiceRegistrationInfo* getLayerParserServiceInfo()
-{ return getRegistrationInfo(& aLayerParserSI); }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-static rtl::OUString nullHandlerMessage(char const * where)
-{
- OSL_ASSERT(where);
- rtl::OUString msg = rtl::OUString::createFromAscii(where);
- return msg.concat(rtl::OUString::createFromAscii(": Error - NULL handler passed."));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readSchema( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readSchema"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectAll);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readComponent( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readComponent"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectComponent);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readTemplates( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readTemplates"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectTemplates);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL LayerParserService::readData( uno::Reference< backenduno::XLayerHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("LayerParserService::readData"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new LayerParser(this->getContext(),aHandler);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/parsersvc.hxx b/configmgr/source/xml/parsersvc.hxx
deleted file mode 100644
index 8eebb7c5d67b..000000000000
--- a/configmgr/source/xml/parsersvc.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_PARSERSVC_HXX
-#define CONFIGMGR_XML_PARSERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase4.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- template <class BackendInterface>
- class ParserService : public ::cppu::WeakImplHelper4<
- lang::XInitialization,
- lang::XServiceInfo,
- io::XActiveDataSink,
- BackendInterface
- >
- {
- public:
- explicit
- ParserService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XActiveDataSink
- virtual void SAL_CALL
- setInputStream( const uno::Reference< io::XInputStream >& aStream )
- throw (uno::RuntimeException);
-
- virtual uno::Reference< io::XInputStream > SAL_CALL
- getInputStream( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< uno::XComponentContext > getContext() const
- { return m_xContext; }
-
- void parse(uno::Reference< sax::XDocumentHandler > const & _xHandler);
- // throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- uno::Reference< uno::XComponentContext > m_xContext;
- sax::InputSource m_aInputSource;
-
- static ServiceInfoHelper getServiceInfo();
- };
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/schemaparser.cxx b/configmgr/source/xml/schemaparser.cxx
deleted file mode 100644
index 7c53790964c4..000000000000
--- a/configmgr/source/xml/schemaparser.cxx
+++ /dev/null
@@ -1,406 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "schemaparser.hxx"
-
-// -----------------------------------------------------------------------------
-#include "wrapexception.hxx"
-
-#define WRAP_PARSE_EXCEPTIONS() \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS( raiseParseException ) \
- WRAP_OTHER_EXCEPTIONS( raiseParseException )
-
-#define WRAP_PARSE_EXCEPTIONS_MSG( msg ) \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS1( raiseParseException, msg ) \
- WRAP_OTHER_EXCEPTIONS1( raiseParseException, msg )
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-SchemaParser::SchemaParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XSchemaHandler > const & _xHandler, Select _selector)
-: BasicParser(_xContext)
-, m_xHandler(_xHandler)
-, m_sComponent()
-, m_selector(_selector)
-, m_selected(selectNone)
-{
- if (!m_xHandler.is())
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Cannot create SchemaParser: Unexpected NULL Handler"));
- throw uno::RuntimeException(sMessage, *this);
- }
- OSL_ENSURE(m_selector != selectNone, "Warning: Schema handler will handle no part of the schema");
-}
-// -----------------------------------------------------------------------------
-
-SchemaParser::~SchemaParser()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- BasicParser::startDocument();
-
- OSL_ENSURE(isEmptyNode(), "BasicParser does not mark new document as empty");
-
- m_sComponent = rtl::OUString();
- m_selected = selectNone;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- if (isSelected())
- raiseParseException("Schema XML Parser: Invalid XML: Document ends while section is open");
-
- if (isEmptyNode()) OSL_TRACE("Configuration Parser: XML schema document ended without any data");
-
- BasicParser::endDocument();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->isSkipping() )
- {
- this->startSkipping( aName, xAttribs );
- return;
- }
-
- ElementInfo aInfo = getDataParser().parseElementInfo(aName,xAttribs);
-
- try
- {
- switch (aInfo.type)
- {
- case ElementType::schema:
- this->startSchema(aInfo,xAttribs);
- break;
-
- case ElementType::component:
- this->startSection(selectComponent, aInfo, xAttribs);
- break;
-
- case ElementType::templates:
- this->startSection(selectTemplates, aInfo, xAttribs);
- break;
-
- case ElementType::import:
- this->handleImport(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::uses:
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::instance:
- this->handleInstance(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::item_type:
- this->handleItemType(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::layer:
- case ElementType::node:
- raiseParseException( "Schema XML parser - Invalid data: found unspecified 'node' element.\n");
- // fall thru
- case ElementType::group: case ElementType::set:
- this->startNode(aInfo,xAttribs);
- OSL_ASSERT( this->isInNode() );
- break;
-
- case ElementType::property:
- this->startProperty(aInfo,xAttribs);
- OSL_ASSERT( this->isInUnhandledProperty() );
- break;
-
- case ElementType::value:
- this->startValueData(xAttribs);
- OSL_ASSERT( this->isInValueData() );
- break;
-
- default: // skip unknown elements
- OSL_ENSURE( aInfo.type <= ElementType::other, "Schema XML parser - Error: invalid element type value\n");
- OSL_ENSURE( aInfo.type >= ElementType::other, "Schema XML parser - Unexpected: found layer element in schema data\n");
- // accept (and skip) unknown (ElementType::other) tags in schema to allow documentation and constraints to pass without assertion
- //OSL_ENSURE( aInfo.type < ElementType::other, "Schema XML parser - Warning: ignoring unknown element tag\n");
-
- this->startSkipping( aName, xAttribs );
- OSL_ASSERT( this->isSkipping() );
- return;
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting Element")
-
- OSL_ENSURE(aInfo.op == Operation::none || this->isSkipping(),
- "Schema Parser: The 'op' attribute is not supported in a schema");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->wasSkipping(aName) )
- return;
-
- try
- {
- if ( this->isInValueData())
- this->endValueData();
-
- else if (this->isInProperty())
- this->endProperty();
-
- else if (this->isInNode())
- this->endNode();
-
- else if (this->isSelected())
- this->endSection();
-
- else
- this->endSchema();
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending Element")
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startSchema( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- m_sComponent = aInfo.name;
- m_xHandler->startSchema();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endSchema( )
-{
- m_xHandler->endSchema();
- m_sComponent = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-bool SchemaParser::select(Select _select)
-{
- if (isSelected())
- raiseParseException("Schema XML parser - Invalid data: found start of section while a section is still open.\n");
-
- m_selected = static_cast<Select>(m_selector & _select);
-
- return m_selected != 0;
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startSection( Select _select, ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- if (this->select(_select))
- {
- if (_select == selectComponent)
- {
- m_xHandler->startComponent(m_sComponent);
- }
- }
- else
- startSkipping(aInfo.name,xAttribs);
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endSection( )
-{
- if (m_selected == selectComponent)
- {
- m_xHandler->endComponent();
- }
- m_selected = selectNone;
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleImport( ElementInfo const & /*aInfo*/, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- rtl::OUString aComponent;
- if (getDataParser().getImportComponent(xAttribs,aComponent))
- m_xHandler->importComponent(aComponent);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing component attribute for import directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleInstance( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- backenduno::TemplateIdentifier aTemplate;
- if (getDataParser().getInstanceType(xAttribs, aTemplate.Name, aTemplate.Component))
- m_xHandler->addInstance(aInfo.name, aTemplate);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing type information for instantiation directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleItemType( ElementInfo const & /*aInfo*/, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- backenduno::TemplateIdentifier aTemplate;
- if (getDataParser().getInstanceType(xAttribs, aTemplate.Name, aTemplate.Component))
- m_xHandler->addItemType(aTemplate);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing type information for instantiation directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- bool bStartTemplate = ( !isInNode() && m_selected == selectTemplates );
-
- BasicParser::startNode(aInfo,xAttribs);
-
- OSL_ASSERT(aInfo.type == ElementType::set || aInfo.type == ElementType::group);
-
- if (aInfo.type == ElementType::group)
- {
- if (bStartTemplate)
- m_xHandler->startGroupTemplate( backenduno::TemplateIdentifier(aInfo.name,m_sComponent), aInfo.flags );
-
- else
- m_xHandler->startGroup( aInfo.name, aInfo.flags );
- }
- else
- {
- backenduno::TemplateIdentifier aItemType;
-
- if (!getDataParser().getSetElementType(xAttribs, aItemType.Name, aItemType.Component))
- raiseParseException("Schema XML parser - Invalid data: Missing item-type information for set node.\n");
-
- if (bStartTemplate)
- m_xHandler->startSetTemplate( backenduno::TemplateIdentifier(aInfo.name,m_sComponent), aInfo.flags, aItemType );
-
- else
- m_xHandler->startSet( aInfo.name, aInfo.flags, aItemType );
- }
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endNode()
-{
- BasicParser::endNode();
-
- bool bEndedTemplate = ( !isInNode() && m_selected == selectTemplates );
-
- if (bEndedTemplate)
- m_xHandler->endTemplate();
-
- else
- m_xHandler->endNode();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- BasicParser::startProperty(aInfo,xAttribs);
-
- OSL_ENSURE( isInUnhandledProperty(), "Property not recognizable as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endProperty()
-{
- if (isInUnhandledProperty())
- {
- ElementInfo const & aInfo = this->getActiveNodeInfo();
-
- m_xHandler->addProperty(aInfo.name,
- aInfo.flags,
- getActivePropertyType());
- }
-
- BasicParser::endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- OSL_ENSURE( this->isInUnhandledProperty(),"Schema XML parser - multiple values in property are not permitted in the schema.\n");
-
- BasicParser::startValueData(xAttribs);
-
- if (this->isValueDataLocalized())
- getLogger().warning("Language attributes on values are ignored in the schema.",
- "endValueData()","configuration::xml::SchemaParser");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endValueData()
-{
- uno::Any aValue = this->getCurrentValue();
-
- ElementInfo const & aInfo = this->getActiveNodeInfo();
-
- if (aValue.hasValue())
- {
- m_xHandler->addPropertyWithDefault(aInfo.name,aInfo.flags,aValue);
- }
- else
- {
- getLogger().warning("Found deprecated explicit NIL value in schema data.",
- "endValueData()","configuration::xml::SchemaParser");
- m_xHandler->addProperty(aInfo.name,aInfo.flags,getActivePropertyType());
- }
-
- BasicParser::endValueData();
-
- OSL_ENSURE( !isInUnhandledProperty(), "Property not recognizable as handled");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/schemaparser.hxx b/configmgr/source/xml/schemaparser.hxx
deleted file mode 100644
index b129b140a7c9..000000000000
--- a/configmgr/source/xml/schemaparser.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_SCHEMAPARSER_HXX
-#define CONFIGMGR_XML_SCHEMAPARSER_HXX
-
-#include "basicparser.hxx"
-
-#include <com/sun/star/configuration/backend/XSchemaHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
-
- class SchemaParser : public BasicParser
- {
- public:
- enum Select {
- selectNone = 0,
- selectComponent = 0x01,
- selectTemplates = 0x02,
- selectAll = 0x03
- };
-
- public:
- SchemaParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XSchemaHandler > const & _xHandler, Select _selector);
- virtual ~SchemaParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException);
-
- private:
- /// start the schema
- void startSchema( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end the schema
- void endSchema();
-
- /// start a section (components or templates)
- void startSection( Select _select, ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end the current section
- void endSection();
-
- /// handle a import directive element
- void handleImport( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
-
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// end collecting data for a value - returns the collected value
- void endValueData();
-
- /// handle a instance ref element
- void handleInstance( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// handle a item-type declaration element
- void handleItemType( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
-
- bool isSelected() const { return m_selected != selectNone; }
- bool select(Select _select);
- private:
- uno::Reference< backenduno::XSchemaHandler > m_xHandler;
- rtl::OUString m_sComponent;
- Select m_selector;
- Select m_selected;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/simpletypehelper.cxx b/configmgr/source/xml/simpletypehelper.cxx
deleted file mode 100644
index a9038b6afa6b..000000000000
--- a/configmgr/source/xml/simpletypehelper.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simpletypehelper.hxx"
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
- namespace SimpleTypeHelper
- {
-
- uno::Type getBooleanType() { return ::getBooleanCppuType(); }
-
- uno::Type getShortType() { return ::getCppuType(static_cast<sal_Int16 const*>(0)); }
- uno::Type getIntType() { return ::getCppuType(static_cast<sal_Int32 const*>(0)); }
- uno::Type getLongType() { return ::getCppuType(static_cast<sal_Int64 const*>(0)); }
-
- uno::Type getDoubleType() { return ::getCppuType(static_cast<double const*>(0)); }
-
- uno::Type getStringType() { return ::getCppuType(static_cast<rtl::OUString const*>(0)); }
-
- uno::Type getBinaryType() { return ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0)); }
- uno::Type getAnyType() { return ::getCppuType(static_cast<uno::Any const*>(0)); }
- }
-}
diff --git a/configmgr/source/xml/typeconverter.cxx b/configmgr/source/xml/typeconverter.cxx
deleted file mode 100644
index 7e56cced723c..000000000000
--- a/configmgr/source/xml/typeconverter.cxx
+++ /dev/null
@@ -1,351 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "typeconverter.hxx"
-#include "utility.hxx"
-#include "simpletypehelper.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/script/FailReason.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <strdecl.hxx>
-#include <typelib/typedescription.hxx>
-
-
-#include <rtl/ustring.hxx>
-#include <osl/diagnose.h>
-
-namespace uno = ::com::sun::star::uno;
-namespace script = ::com::sun::star::script;
-namespace lang = ::com::sun::star::lang;
-
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------------------------------
- rtl::OUString toString(const uno::Reference< script::XTypeConverter >& xTypeConverter, const uno::Any& rValue)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
- {
- rtl::OUString aRes;
- uno::TypeClass aDestinationClass = rValue.getValueType().getTypeClass();
-
- switch (aDestinationClass)
- {
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_CHAR:
- case uno::TypeClass_BYTE:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_FLOAT:
- case uno::TypeClass_DOUBLE:
- if (!xTypeConverter.is())
- {
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Missing Converter Service!"),
- uno::Reference< uno::XInterface > (),
- aDestinationClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- xTypeConverter->convertToSimpleType(rValue, uno::TypeClass_STRING) >>= aRes;
- break;
-
- case ::uno::TypeClass_STRING:
- rValue >>= aRes;
- break;
-
- default:
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Unsupported type: ") + rValue.getValueType().getTypeName(),
- uno::Reference< uno::XInterface > (),
- aDestinationClass,
- script::FailReason::TYPE_NOT_SUPPORTED, 0
- );
-
- }
- return aRes;
- }
-
- uno::Any toAny(const uno::Reference< script::XTypeConverter >& xTypeConverter, const ::rtl::OUString& _rValue,const uno::TypeClass& _rTypeClass)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
- {
- uno::Any aRes;
-
- if (uno::TypeClass_STRING == _rTypeClass)
- {
- aRes <<= _rValue;
- }
- else if (!xTypeConverter.is())
- {
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Missing Converter Service!"),
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- else try
- {
- aRes = xTypeConverter->convertToSimpleType(uno::makeAny(_rValue), _rTypeClass);
- }
- catch (script::CannotConvertException& )
- {
- // ok, next try with trim()
- ::rtl::OUString const sTrimmed = _rValue.trim();
- if (sTrimmed.getLength() != 0)
- {
- try
- {
- aRes = xTypeConverter->convertToSimpleType(uno::makeAny(sTrimmed), _rTypeClass);
-
- OSL_ENSURE(aRes.hasValue(),"Converted non-empty string to NULL\n");
- }
- catch (script::CannotConvertException&)
- {
- OSL_ASSERT(!aRes.hasValue());
- }
- catch (uno::Exception&)
- {
- OSL_ENSURE(false,"Unexpected exception from XTypeConverter::convertToSimpleType()\n");
- OSL_ASSERT(!aRes.hasValue());
- }
-
- if (!aRes.hasValue()) throw;
- }
- }
- catch (lang::IllegalArgumentException& iae)
- {
- OSL_ENSURE(sal_False, "Illegal argument for typeconverter. Maybe invalid typeclass ?");
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Invalid Converter Argument:") + iae.Message,
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- catch (uno::Exception& e)
- {
- OSL_ENSURE(false,"Unexpected exception from XTypeConverter::convertToSimpleType()\n");
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Unexpected TypeConverter Failure:") + e.Message,
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- return aRes;
- }
-
- ::rtl::OUString toTypeName(const uno::TypeClass& _rTypeClass)
- {
- ::rtl::OUString aRet;
- switch(_rTypeClass)
- {
- case uno::TypeClass_BOOLEAN: aRet = TYPE_BOOLEAN; break;
- case uno::TypeClass_SHORT: aRet = TYPE_SHORT; break;
- case uno::TypeClass_LONG: aRet = TYPE_INT; break;
- case uno::TypeClass_HYPER: aRet = TYPE_LONG; break;
- case uno::TypeClass_DOUBLE: aRet = TYPE_DOUBLE; break;
- case uno::TypeClass_STRING: aRet = TYPE_STRING; break;
- case uno::TypeClass_SEQUENCE: aRet = TYPE_BINARY; break;
- case uno::TypeClass_ANY: aRet = TYPE_ANY; break;
- default:
- {
- ::rtl::OString aStr("Wrong typeclass! ");
- aStr += ::rtl::OString::valueOf((sal_Int32)_rTypeClass);
- OSL_ENSURE(0,aStr.getStr());
- }
- }
- return aRet;
- }
-
-// *************************************************************************
- uno::Type toType(const ::rtl::OUString& _rType)
- {
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean"))) aRet = SimpleTypeHelper::getBooleanType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short"))) aRet = SimpleTypeHelper::getShortType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int"))) aRet = SimpleTypeHelper::getIntType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer"))) aRet = SimpleTypeHelper::getIntType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long"))) aRet = SimpleTypeHelper::getLongType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double"))) aRet = SimpleTypeHelper::getDoubleType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string"))) aRet = SimpleTypeHelper::getStringType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary"))) aRet = SimpleTypeHelper::getBinaryType();
-// else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("sequence"))) aRet = uno::TypeClass_SEQUENCE;
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("any"))) aRet = SimpleTypeHelper::getAnyType();
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
- uno::Type toListType(const ::rtl::OUString& _rsElementType)
- {
- uno::Type aRet;
-
- if (_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double")))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string")))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary")))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
-// else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("sequence"))) aRet = uno::TypeClass_SEQUENCE;
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rsElementType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
-
- uno::Type getSequenceElementType(uno::Type const& rSequenceType)
- {
- OSL_ENSURE(rSequenceType.getTypeClass() == uno::TypeClass_SEQUENCE,
- "getSequenceElementType() must be called with a sequence type");
-
- if (!(rSequenceType.getTypeClass() == uno::TypeClass_SEQUENCE))
- return uno::Type();
-
- uno::TypeDescription aTD(rSequenceType);
- typelib_IndirectTypeDescription* pSequenceTD =
- reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get());
-
- OSL_ASSERT(pSequenceTD);
- OSL_ASSERT(pSequenceTD->pType);
-
- if ( pSequenceTD && pSequenceTD->pType )
- {
- return uno::Type(pSequenceTD->pType);
- } //if
-
- return uno::Type();
- }
- uno::Type getBasicType(uno::Type const& rType, bool& bSequence)
- {
- bSequence = rType.getTypeClass() == uno::TypeClass_SEQUENCE &&
- rType != SimpleTypeHelper::getBinaryType();
-
- if (!bSequence)
- return rType;
-
- return getSequenceElementType(rType);
- }
-
-
- // template names
-// *************************************************************************
- ::rtl::OUString toTemplateName(const uno::Type& _rType)
- {
- bool bList;
- uno::Type aBaseType = getBasicType(_rType,bList);
- return toTemplateName(aBaseType.getTypeClass(), bList);
- }
-
- ::rtl::OUString toTemplateName(const uno::TypeClass& _rBasicType, bool bList)
- {
- return toTemplateName(toTypeName(_rBasicType), bList);
- }
-
-// *************************************************************************
- uno::Type parseTemplateName(::rtl::OUString const& sTypeName)
- {
- uno::Type aRet;
-
- ::rtl::OUString sBasicTypeName;
- bool bList;
- if (parseTemplateName(sTypeName, sBasicTypeName,bList))
- aRet = toType(sBasicTypeName,bList);
- // else leave as void
-
- return aRet;
- }
-
-// *************************************************************************
- ::rtl::OUString toTemplateName(const ::rtl::OUString& _rBasicTypeName, bool bList)
- {
- ::rtl::OUString sName = TEMPLATE_MODULE_NATIVE_PREFIX + _rBasicTypeName;
- if (bList)
- sName += TEMPLATE_LIST_SUFFIX;
-
-
- return sName;
- }
-
- bool parseTemplateName(::rtl::OUString const& sTypeName, ::rtl::OUString& _rBasicName, bool& bList)
- {
- ::rtl::OUString const sSuffix( TEMPLATE_LIST_SUFFIX );
-
- sal_Int32 nIndex = sTypeName.lastIndexOf(sSuffix);
- if (nIndex >= 0 && nIndex + sSuffix.getLength() == sTypeName.getLength())
- {
- bList = true;
- _rBasicName = sTypeName.copy(0,nIndex);
- }
- else
- {
- bList = false;
- _rBasicName = sTypeName;
- }
- // erase the default prefix 'cfg:'
- if (_rBasicName.indexOf(TEMPLATE_MODULE_NATIVE_PREFIX) == 0)
- _rBasicName = _rBasicName.copy(TEMPLATE_MODULE_NATIVE_PREFIX.m_nLen);
-
- return true;
-
- }
-// *************************************************************************
-
-} // namespace configmgr
diff --git a/configmgr/source/xml/valueconverter.cxx b/configmgr/source/xml/valueconverter.cxx
deleted file mode 100644
index 390204c741b2..000000000000
--- a/configmgr/source/xml/valueconverter.cxx
+++ /dev/null
@@ -1,501 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "valuetypeconverter.hxx"
-#include "typeconverter.hxx"
-
-inline sal_Bool rtl_ascii_isWhitespace( sal_Unicode ch )
-{
- return ch <= 0x20 && ch;
-}
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-static
-void throwConversionError(sal_Char const* pErrorMsg) SAL_THROW((script::CannotConvertException))
-{
- OSL_ENSURE(false, pErrorMsg);
-
- script::CannotConvertException error;
- error.Message = rtl::OUString::createFromAscii(pErrorMsg);
- throw error;
-}
-// -----------------------------------------------------------------------------
-template <class Char>
-inline
-bool charInRange(Char ch, char from, char to) throw()
-{
- return Char(from) <= ch && ch <= Char(to);
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned makeHexNibble(unsigned char ch) SAL_THROW((script::CannotConvertException))
-{
- unsigned nRet = 0;
-
- if (charInRange(ch, '0', '9')) nRet = ch - unsigned('0');
-
- else if (charInRange(ch, 'a', 'f')) nRet = ch - unsigned('a' - 10u);
-
- else if (charInRange(ch, 'A', 'F')) nRet = ch - unsigned('A' - 10u);
-
- else throwConversionError("Invalid Hex Character in binary value");
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned readHexNibble(sal_Unicode ch) SAL_THROW((script::CannotConvertException))
-{
- if (!charInRange(ch, 0, 127)) throwConversionError("Non-Ascii Character in binary value");
-
- return makeHexNibble(static_cast<unsigned char>(ch));
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned int readHexByte(sal_Unicode const*& pStr) SAL_THROW((script::CannotConvertException))
-{
- register unsigned int nHigh = readHexNibble(*pStr++);
- register unsigned int nLow = readHexNibble(*pStr++);
- return (nHigh << 4) | nLow;
-}
-
-// -----------------------------------------------------------------------------
-static
-void parseHexBinary(rtl::OUString const& aHexString_, uno::Sequence<sal_Int8>& rBinarySeq_)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- // PRE: aBinaryString with HexCode
- // POST: rBinarySeq with the to Hex converted String
-
- sal_uInt32 nCount = aHexString_.getLength();
- sal_Unicode const * pHex = aHexString_.getStr();
-
- if (nCount % 2) throwConversionError("Hex string has odd number of characters");
- nCount /= 2;
-
- rBinarySeq_.realloc(nCount);
- sal_Int8 * pBinary = rBinarySeq_.getArray();
-
- while (nCount--)
- {
- *pBinary++ = static_cast<sal_Int8>(readHexByte(pHex));
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-uno::Sequence<sal_Int8> ValueConverter::parseBinary(rtl::OUString const& aBinaryString_) const
- SAL_THROW((script::CannotConvertException, com::sun::star::uno::RuntimeException))
-{
- uno::Sequence<sal_Int8> aResultSeq;
-
- parseHexBinary(aBinaryString_,aResultSeq);
-
- return aResultSeq;
-}
-
-// -----------------------------------------------------------------------------
-static inline
-uno::Type getBinaryType()
-{
- uno::Sequence<sal_Int8> const * const for_binary = 0;
- return ::getCppuType(for_binary);
-}
-
-// -----------------------------------------------------------------------------
-bool ValueConverter::isList() const
-{
- return m_aType.getTypeClass() == uno::TypeClass_SEQUENCE &&
- m_aType != getBinaryType();
-}
-
-// -----------------------------------------------------------------------------
-uno::Any ValueConverter::convertToAny(rtl::OUString const& aContent) const
- SAL_THROW((script::CannotConvertException, com::sun::star::uno::RuntimeException))
-{
- uno::Any aValue;
-
- if (this->isNull())
- {
- OSL_ENSURE(aContent.trim().getLength() == 0, "ValueConverter: Non-empty Null Value - ignoring content");
- OSL_ASSERT(!aValue.hasValue());
- }
-
- else if (this->isList())
- {
- std::vector< rtl::OUString > aContentList;
- splitListData(aContent, aContentList);
- convertListToAny(aContentList, aValue);
- }
-
- else
- {
- convertScalarToAny(aContent, aValue);
- }
-
- return aValue;
-}
-
-// -----------------------------------------------------------------------------
-bool ValueConverter::convertScalarToAny(rtl::OUString const& aContent, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!this->isNull(),"ValueConverter::convertScalarToAny - check for NULL before calling");
- OSL_ENSURE(m_aType.getTypeClass() != uno::TypeClass_ANY,"'Any' values must be NULL");
-
- // check for Binary
- if (m_aType == getBinaryType())
- {
- com::sun::star::uno::Sequence<sal_Int8> aBinarySeq = parseBinary(aContent);
- rValue <<= aBinarySeq;
- }
-
- else
- {
- rValue = toAny(m_xTypeConverter, aContent, m_aType.getTypeClass());
- }
-
- return !! rValue.hasValue();
-}
-
-// -----------------------------------------------------------------------------
-template <class T>
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< T >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& rConverter)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(aElementTypeClass == ::getCppuType(static_cast<T const*>(0)).getTypeClass());
-
- rSequence.realloc(aStringList.size());
-
- sal_uInt32 nPos = 0;
-
- for(std::vector< rtl::OUString >::const_iterator it = aStringList.begin();
- it != aStringList.end();
- ++it)
- {
- uno::Any aValueAny = toAny(rConverter.getTypeConverter(), *it, aElementTypeClass);
-
- if (aValueAny >>= rSequence[nPos])
- ++nPos;
-
- else if (!aValueAny.hasValue())
- OSL_ENSURE(false,"UNEXPECTED: Found NULL value in List - ignoring value !");
-
- else
- OSL_ENSURE(false,"ERROR: Cannot extract converted value into List - skipping value !");
- }
-
- bool bOK = (nPos == aStringList.size());
-
- if (!bOK)
- {
- OSL_ASSERT(nPos < aStringList.size());
- rSequence.realloc(nPos);
- }
- return bOK;
-}
-
-// -----------------------------------------------------------------------------
-// special conversion for string sequence
-
-static
-inline
-void stringListToSequence(uno::Sequence< rtl::OUString > & rSequence, std::vector< rtl::OUString > const & aStringList)
-{
- rSequence .realloc( aStringList.size() );
-
- std::copy( aStringList.begin(), aStringList.end(), rSequence.getArray() );
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-std::vector< rtl::OUString > sequenceToStringList(uno::Sequence< rtl::OUString > const & aSequence)
-{
- rtl::OUString const * const pBegin = aSequence.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSequence.getLength();
-
- return std::vector< rtl::OUString >(pBegin,pEnd);
-}
-// -----------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > ValueConverter::splitStringList(rtl::OUString const& aContent) const
-{
- std::vector< rtl::OUString > aList;
- splitListData(aContent, aList);
-
- uno::Sequence< rtl::OUString > aResult;
- stringListToSequence(aResult,aList);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any ValueConverter::convertListToAny(uno::Sequence< rtl::OUString > const& aContentList) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- uno::Any aResult;
- std::vector< rtl::OUString > const aStringList = sequenceToStringList(aContentList);
- convertListToAny(aStringList,aResult);
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// special overload for binary sequence
-
-// template<> // use an explicit specialization
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< uno::Sequence<sal_Int8> >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& rParser )
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- { (void)aElementTypeClass; }
- OSL_ASSERT(aElementTypeClass == uno::TypeClass_SEQUENCE);
-
- rSequence.realloc(aStringList.size());
-
- sal_uInt32 nPos = 0;
-
- for(std::vector< rtl::OUString >::const_iterator it = aStringList.begin();
- it != aStringList.end();
- ++it)
- {
- rSequence[nPos++] = rParser.parseBinary(*it);
- }
- return true;
-}
-
-// -----------------------------------------------------------------------------
-// special overload for string sequence
-
-// template<> // use an explicit specialization
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< rtl::OUString >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& /*rParser*/ )
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- { (void)aElementTypeClass; }
- OSL_ASSERT(aElementTypeClass == uno::TypeClass_STRING);
-
- stringListToSequence(rSequence, aStringList);
-
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-#define MAYBE_EXTRACT_SEQUENCE( type ) \
- if (aElementType == ::getCppuType( (type const *)0)) \
- { \
- com::sun::star::uno::Sequence< type > aSequence; \
- convertListToSequence(aContentList,aSequence,aElementTypeClass, *this); \
- rValue <<= aSequence; \
- }
-
-bool ValueConverter::convertListToAny(std::vector< rtl::OUString > const& aContentList, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!this->isNull(),"ValueConverter::convertListToAny - check for NULL before calling");
- OSL_ENSURE(m_aType.getTypeClass() == uno::TypeClass_SEQUENCE,"'Any' not allowed for lists");
-
- uno::Type aElementType = getSequenceElementType(m_aType);
- uno::TypeClass aElementTypeClass = aElementType.getTypeClass();
-
- OSL_ENSURE(aElementTypeClass != uno::TypeClass_ANY,"'Any' not allowed for list elements");
-
- MAYBE_EXTRACT_SEQUENCE( rtl::OUString )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Bool )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int16 )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int32 )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int64 )
- else
- MAYBE_EXTRACT_SEQUENCE( double )
- else
- MAYBE_EXTRACT_SEQUENCE( com::sun::star::uno::Sequence<sal_Int8> )
- else
- {
- OSL_ENSURE(false, "Unknown element type in list");
- throwConversionError("Invalid value-type found in list value");
- }
-
- return !! rValue.hasValue();
-}
-#undef MAYBE_EXTRACT_SEQUENCE
-
-// -----------------------------------------------------------------------------
-namespace
-{
- sal_Int32 const NO_MORE_TOKENS = -1;
- struct OTokenizeByWhitespace
- {
-
- static inline bool isWhitespace(sal_Unicode ch)
- {
- // note: for definition of whitescape see also
- // canUseWhitespace(rtl::OUString const&)
- // in xmlformater.cxx
- // -----------------------------------------------------------------------------
- return rtl_ascii_isWhitespace(ch) ? true : false;
- }
-
- sal_Int32 findFirstTokenStart(rtl::OUString const& sText) const SAL_THROW(())
- {
- return findNextTokenStart(sText,0);
- }
-
- sal_Int32 findNextTokenStart(rtl::OUString const& sText, sal_Int32 nPrevTokenEnd) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nPrevTokenEnd;
-
- OSL_PRECOND( nPos == 0 || (0 < nPos && nPos < nEnd && isWhitespace(sText[nPos])) || nPos == nEnd,
- "Invalid nPrevTokenEnd");
-
- while (nPos < nEnd && isWhitespace(sText[nPos]))
- {
- ++nPos;
- }
-
- if (nPos < nEnd)
- return nPos;
- else
- return NO_MORE_TOKENS;
- }
-
- sal_Int32 findTokenEnd(rtl::OUString const& sText, sal_Int32 nTokenStart) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nTokenStart;
-
- OSL_PRECOND( 0 <= nPos && nPos < nEnd && !isWhitespace(sText[nPos]),
- "Invalid nTokenStart");
-
- while (nPos < nEnd && !isWhitespace(sText[nPos]))
- {
- ++nPos;
- }
-
- return nPos;
- }
- };
-// -----------------------------------------------------------------------------
- struct OTokenizeBySeparator
- {
- rtl::OUString const sSeparator;
- OTokenizeBySeparator(rtl::OUString const& _sSeparator) SAL_THROW(())
- : sSeparator(_sSeparator)
- {
- OSL_PRECOND(sSeparator.trim().getLength() > 0, "Invalid empty separator string");
- }
-
- sal_Int32 findFirstTokenStart(rtl::OUString const& /*sText*/) const SAL_THROW(())
- {
- return 0;
- }
- sal_Int32 findNextTokenStart(rtl::OUString const& sText, sal_Int32 nPrevTokenEnd) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nPrevTokenEnd;
- OSL_PRECOND( nPos == nEnd || (0 <= nPos && nPos < nEnd && sText.indexOf(sSeparator, nPos) == nPos),
- "Invalid nPrevTokenEnd");
-
- if (nPos < nEnd)
- return nPos + sSeparator.getLength();
- else
- return NO_MORE_TOKENS;
- }
- sal_Int32 findTokenEnd(rtl::OUString const& sText, sal_Int32 nTokenStart) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- OSL_PRECOND( 0 <= nTokenStart && nTokenStart <= nEnd ,
- "Invalid nTokenStart");
-
- sal_Int32 nPos = sText.indexOf(sSeparator,nTokenStart);
-
- if (nPos >= 0)
- return nPos;
- else
- return nEnd;
- }
- };
-// -----------------------------------------------------------------------------
- template <class Tokenizer>
- void tokenizeListData(Tokenizer const& aTokenizer, rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList)
- SAL_THROW(())
- {
- sal_Int32 nTokenPos = aTokenizer.findFirstTokenStart(aContent);
-
- while(nTokenPos != NO_MORE_TOKENS)
- {
- sal_Int32 nTokenEnd = aTokenizer.findTokenEnd(aContent, nTokenPos);
-
- // this is what the tokenizer must provide
- OSL_ASSERT(0 <= nTokenPos && nTokenPos <= nTokenEnd && nTokenEnd <= aContent.getLength());
-
- rContentList.push_back( aContent.copy(nTokenPos, nTokenEnd-nTokenPos) );
-
- nTokenPos= aTokenizer.findNextTokenStart(aContent, nTokenEnd);
- }
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-void ValueConverter::splitListData(rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList) const
- SAL_THROW(())
-{
- rtl::OUString sSeparator = m_sSeparator;
-
- bool bSeparateByWhitespace = (sSeparator.trim().getLength() == 0);
-
- if (bSeparateByWhitespace)
- {
- OSL_ENSURE( sSeparator.getLength()==0 || sSeparator.equalsAscii(" "),
- "Unexpected whitespace-only separator");
-
- tokenizeListData( OTokenizeByWhitespace(), aContent, rContentList );
- }
- else
- {
- OSL_ENSURE( sSeparator.trim()==sSeparator,
- "Unexpected whitespace in separator");
-
- tokenizeListData( OTokenizeBySeparator(sSeparator), aContent, rContentList );
- }
-}
-// -----------------------------------------------------------------------------
-
-} // namespace
diff --git a/configmgr/source/xml/valueformatter.cxx b/configmgr/source/xml/valueformatter.cxx
deleted file mode 100644
index d9dabbdbb4be..000000000000
--- a/configmgr/source/xml/valueformatter.cxx
+++ /dev/null
@@ -1,495 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "valueformatter.hxx"
-#include "elementformatter.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-#include "simpletypehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
-
- namespace xml
- {
-
-//==========================================================================
-//= Helper
-//==========================================================================
-
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
-
-static
-inline
-bool isWhitespaceCharacter( sal_Unicode ch )
-{
- return ch <= 0x20 && ch;
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-bool isWhitespaceString(rtl::OUString const & aStr)
-{
- sal_Unicode const * const pBegin = aStr.getStr();
- sal_Unicode const * const pEnd = pBegin + aStr.getLength();
-
- // BACK: true, if any whitespace in string or string is empty
- if (pBegin == pEnd)
- return true;
-
- sal_Unicode const * const pSpace = std::find_if(pBegin,pEnd,isWhitespaceCharacter);
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-static
-bool hasWhitespaceString( uno::Sequence< rtl::OUString > const & aSeq)
-{
- // BACK: true, if whitespace Separator is ok, (no whitespace in Strings, no empty strings)
- rtl::OUString const * const pBegin = aSeq.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSeq.getLength();
-
- rtl::OUString const * const pSpace = std::find_if(pBegin,pEnd,isWhitespaceString);
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-struct HasSubString
-{
- HasSubString(rtl::OUString const & _aSubStr)
- : m_aSubStr(_aSubStr)
- {}
-
- bool operator()(rtl::OUString const & _aStr)
- { return _aStr.indexOf(m_aSubStr) >= 0; }
-
- rtl::OUString const m_aSubStr;
-};
-// -----------------------------------------------------------------------------
-
-static
-bool hasStringWithSubstring(const uno::Sequence< rtl::OUString > &aSeq, rtl::OUString const & _aSubStr)
-{
- rtl::OUString const * const pBegin = aSeq.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSeq.getLength();
-
- rtl::OUString const * const pSpace = std::find_if(pBegin,pEnd,HasSubString(_aSubStr));
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-
-template <class Element_>
-struct IsEmptySequence
-{
- bool operator()(uno::Sequence<Element_> const & aSeq) const
- {
- return aSeq.getLength() == 0;
- }
-};
-// -----------------------------------------------------------------------------
-
-template <class Element_>
-bool hasEmptySequence(uno::Sequence< uno::Sequence<Element_> > const & aSeqSeq)
-{
- // BACK: true, if whitespace Separator is ok, (no whitespace in Strings, no empty strings)
- uno::Sequence<Element_> const * const pBegin = aSeqSeq.getConstArray();
- uno::Sequence<Element_> const * const pEnd = pBegin + aSeqSeq.getLength();
-
- uno::Sequence<Element_> const * const pEmpty = std::find_if(pBegin, pEnd, IsEmptySequence<Element_>() );
-
- return pEmpty != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-inline
-bool canUseSeparator(uno::Sequence< rtl::OUString > const & aSeq, rtl::OUString const & aSeparator)
-{
- return ! hasStringWithSubstring(aSeq,aSeparator);
-}
-// -----------------------------------------------------------------------------
-
-inline
-bool canUseWhitespaceSeparator(uno::Sequence< rtl::OUString > const & aSeq)
-{
- return ! hasWhitespaceString(aSeq);
-}
-// -----------------------------------------------------------------------------
-
-template <class Element_>
-inline
-bool canUseWhitespaceSeparator(const uno::Sequence< uno::Sequence<Element_> > &aSeq)
-{
- return ! hasEmptySequence(aSeq);
-}
-// -----------------------------------------------------------------------------
-
-class Separator
-{
- rtl::OUString m_sValue;
-public:
- // -----------------------------------------------------------------------------
- Separator() : m_sValue() {}
- // -----------------------------------------------------------------------------
- bool isDefault() const { return m_sValue.getLength() == 0; }
- // -----------------------------------------------------------------------------
- rtl::OUString value() const { return isDefault() ? static_cast<rtl::OUString>(SEPARATOR_WHITESPACE) : m_sValue; }
- // -----------------------------------------------------------------------------
-
- bool check(const uno::Sequence<rtl::OUString> &aSeq) const
- {
- return isDefault() ? canUseWhitespaceSeparator(aSeq) : canUseSeparator(aSeq, m_sValue);
- }
-
- // -----------------------------------------------------------------------------
- bool trySeparator(rtl::OUString const& sSep, const uno::Sequence<rtl::OUString> & aSeq)
- {
- OSL_ENSURE( ! isWhitespaceString(sSep), "There should be no spaces in non-default separators");
- // BACK: true, if Separator is ok, not in Strings
- if (!canUseSeparator(aSeq, sSep))
- return false;
- this->setSeparator(sSep);
- return true;
- }
- // -----------------------------------------------------------------------------
- void setSeparator(rtl::OUString const& sSep)
- {
- m_sValue = sSep;
- }
- // -----------------------------------------------------------------------------
-};
-// -----------------------------------------------------------------------------
-#define ASCII( STRING_LIT_ ) ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STRING_LIT_ ) ) )
-// -----------------------------------------------------------------------------
-static
-Separator createSeparator(const uno::Any& aAny)
-{
- Separator aResult;
-
- // create a Separator which isn't in any value
- if (aAny.getValueTypeClass() == uno::TypeClass_SEQUENCE)
- {
- uno::Type aElementType = configmgr::getSequenceElementType(aAny.getValueType());
- if (aElementType.getTypeClass() == uno::TypeClass_STRING)
- {
- // only in strings we need to search a separator
- uno::Sequence<rtl::OUString> aSeq;
-
- OSL_VERIFY (aAny >>= aSeq);
-
- bool bValidSeparator =
- canUseWhitespaceSeparator(aSeq) ||
- aResult.trySeparator(ASCII(","), aSeq) ||
- aResult.trySeparator(ASCII(";"), aSeq) ||
- aResult.trySeparator(ASCII(":"), aSeq) ||
- aResult.trySeparator(ASCII("|"), aSeq) ||
- aResult.trySeparator(ASCII("#"), aSeq) ||
- aResult.trySeparator(ASCII("-#*=+#-"), aSeq);
-
- if (!bValidSeparator)
- {
- OSL_TRACE("ERROR: configuration formatter: Could not create Separator for string list");
- OSL_ENSURE(false, "ERROR: Could not create Separator for string list");
- }
- else
- {
- // maybe the whitespace test was invalid ?
- OSL_ENSURE(aResult.check(aSeq), "Found Separator does not pass check ?!");
- }
- }
- else if (aElementType == SimpleTypeHelper::getBinaryType())
- {
- // only in strings we need to search a separator
- uno::Sequence< uno::Sequence<sal_Int8> > aSeq;
- OSL_VERIFY(aAny >>= aSeq);
-
- if (!canUseWhitespaceSeparator(aSeq))
- {
- aResult.setSeparator( ASCII(":") );
- }
- }
- }
-
- // DefaultSeparator
- return aResult;
-}
-#undef ASCII
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Unicode hexNibble(sal_uInt8 _nNibble)
-{
- OSL_ASSERT(_nNibble <= 0x0F);
-
- const sal_uInt8 cDecOffset = sal_uInt8('0');
- const sal_uInt8 cHexOffset = sal_uInt8('a') - 10;
-
- return _nNibble + (_nNibble<10 ? cDecOffset : cHexOffset);
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-void appendHex(rtl::OUStringBuffer& rBuff, sal_uInt8 _nByte)
-{
- rBuff.append( hexNibble(_nByte >> 4) );
- rBuff.append( hexNibble(_nByte & 0x0f) );
-}
-
-// -----------------------------------------------------------------------------
-static
-rtl::OUString binaryToHex(const uno::Sequence<sal_Int8>& _aBinarySeq)
-{
- sal_Int32 const nLength = _aBinarySeq.getLength();
-
- rtl::OUStringBuffer sHex(2*nLength);
-
- for (sal_Int32 nPos = 0;nPos < nLength; ++nPos)
- {
- appendHex( sHex, _aBinarySeq[nPos] );
- }
-
- OSL_ASSERT(sHex.getLength() == 2*nLength);
- return sHex.makeStringAndClear();;
-}
-// -----------------------------------------------------------------------------
-rtl::OUString formatSimpleValue(uno::Any const & _aValue, uno::Reference< script::XTypeConverter > const & _xTCV)
-{
- rtl::OUString sResult;
-
- if (_aValue.hasValue())
- {
- if (_aValue .getValueType() == SimpleTypeHelper::getBinaryType())
- {
- uno::Sequence<sal_Int8> aBinarySeq;
-
- OSL_VERIFY(_aValue >>= aBinarySeq);
-
- sResult = binaryToHex(aBinarySeq);
- }
- else
- {
- // cannot have nested any
- OSL_ASSERT(_aValue.getValueTypeClass() != uno::TypeClass_ANY);
-
- sResult = toString(_xTCV, _aValue);
- }
- }
- return sResult;
-}
-
-// -----------------------------------------------------------------------------
-template <class Element_>
-rtl::OUString formatSequence(uno::Sequence< Element_ > const& aSequence, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & _xTCV)
-{
- rtl::OUStringBuffer aResult;
-
- if (sal_Int32 const nLength = aSequence.getLength())
- {
- Element_ const * pSeq = aSequence.getConstArray();
-
- aResult = formatSimpleValue( uno::makeAny(pSeq[0]),_xTCV);
-
- for(sal_Int32 i=1; i<nLength; ++i)
- {
- aResult.append( sSeparator );
- aResult.append( formatSimpleValue(uno::makeAny(pSeq[i]),_xTCV) );
- }
- }
-
- return aResult.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-// template <> // optimized overload for String
-rtl::OUString formatSequence(uno::Sequence< rtl::OUString > const& aSequence, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & )
-{
- rtl::OUStringBuffer aResult;
-
- if (sal_Int32 const nLength = aSequence.getLength())
- {
- rtl::OUString const * pSeq = aSequence.getConstArray();
-
- aResult = pSeq[0];
-
- for(sal_Int32 i=1; i<nLength; ++i)
- {
- aResult.append( sSeparator ).append( pSeq[i] );
- }
- }
-
- return aResult.makeStringAndClear();
-}
-
-// -----------------------------------------------------------------------------
-
-#define CASE_WRITE_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- uno::Sequence< DATA_TYPE > aData; \
- OSL_ENSURE( ::getCppuType(static_cast< DATA_TYPE const*>(0)).getTypeClass() == (TYPE_CLASS), \
- "Usage Error for CASE_WRITE_SEQUENCE: Type extracted does not match type class"); \
- OSL_VERIFY( _aValue >>= aData ); \
- aResult = formatSequence(aData,sSeparator,xTCV); \
- } break \
-
-rtl::OUString formatSequenceValue(uno::Any const& _aValue, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & xTCV)
-{
- rtl::OUString aResult;
-
- uno::Type aElementType = getSequenceElementType( _aValue.getValueType() );
-
- switch(aElementType.getTypeClass())
- {
- CASE_WRITE_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SEQUENCE, uno::Sequence<sal_Int8> );
-
- default:
- OSL_ENSURE(false, "Unexpected typeclass for sequence elements");
- break;
- }
-
- return aResult;
-}
-
-#undef CASE_WRITE_SEQUENCE
-// -----------------------------------------------------------------------------
-} // anonymous namspace
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-static inline bool isListVal(uno::Any const & _aValue)
-{
- bool bList = false;
- if (_aValue.hasValue())
- {
- getBasicType(_aValue.getValueType(),bList);
- }
- return bList;
-}
-// -----------------------------------------------------------------------------
-void ValueFormatter::makeSeparator()
-{
- if (isListVal(m_aValue))
- {
- Separator aSeparator = createSeparator(m_aValue);
-
- m_sSeparator = aSeparator.value();
- m_bUseSeparator = !aSeparator.isDefault();
-
- OSL_POSTCOND( this->isList() , "ValueFormatter: Could not mark as list");
- }
- else
- {
- m_sSeparator = rtl::OUString();
- m_bUseSeparator = false;
-
- OSL_POSTCOND( !this->isList(), "ValueFormatter: Could not mark as non-list");
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString ValueFormatter::getContent(uno::Reference< script::XTypeConverter > const & _xTCV) const
-{
- rtl::OUString aResult;
- try
- {
- if (this->isList())
- {
- aResult = formatSequenceValue(m_aValue, m_sSeparator, _xTCV);
- }
- else
- {
- aResult = formatSimpleValue(m_aValue, _xTCV);
- }
- }
- catch (script::CannotConvertException& cce)
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM("Configuration: Could not convert value to XML representation: "));
- throw uno::RuntimeException(sMessage + cce.Message, cce.Context);
- }
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-bool ValueFormatter::addValueAttributes(ElementFormatter & _rFormatter) const
-{
- // do we have a NULL value
- if (!m_aValue.hasValue())
- {
- _rFormatter.addIsNull();
- return false;
- }
-
- // create a sequence separator
- if (m_bUseSeparator)
- {
- OSL_ASSERT(this->isList());
- _rFormatter.addSeparator(m_sSeparator);
- }
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-} // namespace xml
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/xml/valueformatter.hxx b/configmgr/source/xml/valueformatter.hxx
deleted file mode 100644
index aed94b9f72a3..000000000000
--- a/configmgr/source/xml/valueformatter.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_VALUEFORMATTER_HXX
-#define CONFIGMGR_XML_VALUEFORMATTER_HXX
-
-#include <com/sun/star/script/XTypeConverter.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace script= ::com::sun::star::script;
-// -----------------------------------------------------------------------------
- class ElementFormatter;
-// -----------------------------------------------------------------------------
-
- // Value to XML (String) conversions
- class ValueFormatter
- {
- public:
- explicit
- ValueFormatter(uno::Any const & _aValue)
- : m_aValue(_aValue)
- {
- makeSeparator();
- }
-
- void reset(uno::Any const & _aValue)
- { m_aValue = _aValue; makeSeparator(); }
-
- bool addValueAttributes(ElementFormatter & _rFormatter) const;
-
- bool hasContent() const;
-
- rtl::OUString getContent(uno::Reference< script::XTypeConverter > const & _xTCV) const;
-
- private:
- bool isList() const { return m_sSeparator.getLength() != 0; }
- void makeSeparator();
-
- uno::Any m_aValue;
- rtl::OUString m_sSeparator;
- bool m_bUseSeparator;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/xml/writersvc.cxx b/configmgr/source/xml/writersvc.cxx
deleted file mode 100644
index 8ded71e6c5ab..000000000000
--- a/configmgr/source/xml/writersvc.cxx
+++ /dev/null
@@ -1,258 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "writersvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-struct WriterServiceTraits;
-// -----------------------------------------------------------------------------
-static inline void clear(rtl::OUString & _rs) { _rs = rtl::OUString(); }
-
-// -----------------------------------------------------------------------------
-template <class BackendInterface>
-WriterService<BackendInterface>::WriterService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-, m_xWriter()
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration XML Writer: Context has no service manager"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-template <class BackendInterface>
-void SAL_CALL
- WriterService<BackendInterface>::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- switch(aArguments.getLength())
- {
- case 0:
- {
- break;
- }
-
- case 1:
- {
- if (aArguments[0] >>= m_xWriter)
- break;
-
- uno::Reference< io::XOutputStream > xStream;
-
- if (aArguments[0] >>= xStream)
- {
- this->setOutputStream(xStream);
- break;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration XML Writer"
- "- SAX XDocumentHandler or XOutputStream expected"));
- throw lang::IllegalArgumentException(sMessage,*this,1);
- }
- default:
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Parser"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-inline
-ServiceInfoHelper WriterService<BackendInterface>::getServiceInfo()
-{
- return WriterServiceTraits<BackendInterface>::getServiceInfo();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-template <class BackendInterface>
-::rtl::OUString SAL_CALL
- WriterService<BackendInterface>::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-sal_Bool SAL_CALL
- WriterService<BackendInterface>::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Sequence< ::rtl::OUString > SAL_CALL
- WriterService<BackendInterface>::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void SAL_CALL
- WriterService<BackendInterface>::setOutputStream( const uno::Reference< io::XOutputStream >& aStream )
- throw (uno::RuntimeException)
-{
- uno::Reference< io::XActiveDataSource > xDS( m_xWriter, uno::UNO_QUERY );
-
- if (xDS.is())
- {
- xDS->setOutputStream(aStream);
- }
- else
- {
- uno::Reference< sax::XDocumentHandler > xNewHandler = this->createHandler();
-
- xDS.set( xNewHandler, uno::UNO_QUERY );
- if (!xDS.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration XML Writer: Cannot set output stream to sax.Writer - missing interface XActiveDataSource."));
- throw uno::RuntimeException(sMessage,*this);
- }
- xDS->setOutputStream(aStream);
-
- m_xWriter = xNewHandler;
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< io::XOutputStream > SAL_CALL
- WriterService<BackendInterface>::getOutputStream( )
- throw (uno::RuntimeException)
-{
- uno::Reference< io::XActiveDataSource > xDS( m_xWriter, uno::UNO_QUERY );
-
- return xDS.is()? xDS->getOutputStream() : uno::Reference< io::XOutputStream >();
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< sax::XDocumentHandler > WriterService<BackendInterface>::getWriteHandler()
- throw (uno::RuntimeException)
-{
- if (!m_xWriter.is())
- m_xWriter = this->createHandler();
-
- return m_xWriter;
-}
-
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< sax::XDocumentHandler > WriterService<BackendInterface>::createHandler() const
- throw (uno::RuntimeException)
-{
- try
- {
- static rtl::OUString const k_sSaxWriterSvc( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") );
-
- return uno::Reference< sax::XDocumentHandler >::query( getServiceFactory()->createInstance(k_sSaxWriterSvc) );
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- lang::XInitialization * const pThis = const_cast<WriterService *>(this);
- throw lang::WrappedTargetRuntimeException(e.Message, pThis, uno::makeAny(e));
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-sal_Char const * const aLayerWriterServices[] =
-{
- "com.sun.star.configuration.backend.xml.LayerWriter",
- 0
-};
-extern // needed by SunCC 5.2, if used from template
-const ServiceImplementationInfo aLayerWriterSI =
-{
- "com.sun.star.comp.configuration.backend.xml.LayerWriter",
- aLayerWriterServices,
- 0
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <>
-struct WriterServiceTraits< backenduno::XLayerHandler >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aLayerWriterSI; }
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLayerWriterServiceInfo()
-{ return getRegistrationInfo(& aLayerWriterSI); }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-// instantiate here !
-template class WriterService< backenduno::XLayerHandler >;
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/writersvc.hxx b/configmgr/source/xml/writersvc.hxx
deleted file mode 100644
index 3929322b772a..000000000000
--- a/configmgr/source/xml/writersvc.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_WRITERSVC_HXX
-#define CONFIGMGR_XML_WRITERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase4.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- template <class BackendInterface>
- class WriterService : public ::cppu::WeakImplHelper4<
- lang::XInitialization,
- lang::XServiceInfo,
- io::XActiveDataSource,
- BackendInterface
- >
- {
- public:
- explicit
- WriterService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XActiveDataSink
- virtual void SAL_CALL
- setOutputStream( const uno::Reference< io::XOutputStream >& aStream )
- throw (uno::RuntimeException);
-
- virtual uno::Reference< io::XOutputStream > SAL_CALL
- getOutputStream( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- uno::Reference< sax::XDocumentHandler > getWriteHandler() throw (uno::RuntimeException);
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
- uno::Reference< sax::XDocumentHandler > m_xWriter;
-
- uno::Reference< sax::XDocumentHandler > createHandler() const throw (uno::RuntimeException);
-
- static ServiceInfoHelper getServiceInfo();
- };
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/xmlstrings.cxx b/configmgr/source/xml/xmlstrings.cxx
deleted file mode 100644
index 1612f952b5fa..000000000000
--- a/configmgr/source/xml/xmlstrings.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "xmlstrings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
- namespace xml
- {
-//----------------------------------------------------------------------------
-// For now: Include the fixed OOR prefix into (most) attribute names
-#define OOR_PREFIX_ "oor:"
-// ... but not into (most) tag names
-#define OOR_TAG_PREFIX_
-// ... but into root tag names
-#define OOR_ROOTTAG_PREFIX_ OOR_PREFIX_
-//----------------------------------------------------------------------------
- // extern declaration for strings used in the XML format
- // namespace prefixes
- IMPLEMENT_CONSTASCII_USTRING(NS_PREFIX_OOR, "oor");
- IMPLEMENT_CONSTASCII_USTRING(NS_PREFIX_XS, "xs");
-
- // namespace urls
- IMPLEMENT_CONSTASCII_USTRING(NS_URI_OOR,"http://openoffice.org/2001/registry");
- IMPLEMENT_CONSTASCII_USTRING(NS_URI_XS, "http://www.w3.org/2001/XMLSchema");
-
- // tag names
- IMPLEMENT_CONSTASCII_USTRING(TAG_SCHEMA, OOR_ROOTTAG_PREFIX_"component-schema");
- IMPLEMENT_CONSTASCII_USTRING(TAG_LAYER, OOR_ROOTTAG_PREFIX_"component-data");
- IMPLEMENT_CONSTASCII_USTRING(DEPRECATED_TAG_LAYER, OOR_ROOTTAG_PREFIX_"node");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_COMPONENT, OOR_TAG_PREFIX_"component");
- IMPLEMENT_CONSTASCII_USTRING(TAG_TEMPLATES, OOR_TAG_PREFIX_"templates");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_NODE, OOR_TAG_PREFIX_"node");
- IMPLEMENT_CONSTASCII_USTRING(TAG_GROUP, OOR_TAG_PREFIX_"group");
- IMPLEMENT_CONSTASCII_USTRING(TAG_SET, OOR_TAG_PREFIX_"set");
- IMPLEMENT_CONSTASCII_USTRING(TAG_PROP, OOR_TAG_PREFIX_"prop");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_VALUE, OOR_TAG_PREFIX_"value");
- IMPLEMENT_CONSTASCII_USTRING(TAG_IMPORT, OOR_TAG_PREFIX_"import");
- IMPLEMENT_CONSTASCII_USTRING(TAG_INSTANCE, OOR_TAG_PREFIX_"node-ref");
- IMPLEMENT_CONSTASCII_USTRING(TAG_ITEMTYPE, OOR_TAG_PREFIX_"item");
- IMPLEMENT_CONSTASCII_USTRING(TAG_USES, OOR_TAG_PREFIX_"uses");
-
- // attribute names
- IMPLEMENT_CONSTASCII_USTRING(ATTR_NAME, OOR_PREFIX_"name");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_CONTEXT, OOR_PREFIX_"context");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_PACKAGE, OOR_PREFIX_"package");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_COMPONENT,OOR_PREFIX_"component");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_ITEMTYPE, OOR_PREFIX_"node-type");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_ITEMTYPECOMPONENT,OOR_PREFIX_"component");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUETYPE, OOR_PREFIX_"type");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUESEPARATOR, OOR_PREFIX_"separator");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_EXTENSIBLE, OOR_PREFIX_"extensible");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_FINALIZED, OOR_PREFIX_"finalized");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_READONLY, OOR_PREFIX_"readonly");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_MANDATORY, OOR_PREFIX_"mandatory");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_NULLABLE, OOR_PREFIX_"nillable");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_LOCALIZED, OOR_PREFIX_"localized");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_OPERATION, OOR_PREFIX_"op");
-
- // attributes defined elsewhere
- IMPLEMENT_CONSTASCII_USTRING(EXT_ATTR_LANGUAGE, "xml:lang");
- IMPLEMENT_CONSTASCII_USTRING(EXT_ATTR_NULL, "xsi:nil");
-
- // attribute contents
- // boolean constants
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_TRUE, "true");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_FALSE, "false");
-
- // simple types names
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_BOOLEAN, "boolean");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_SHORT, "short");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_INT, "int");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_LONG, "long");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_DOUBLE, "double");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_STRING, "string");
- // Type: Sequence<bytes>
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_BINARY, "hexBinary");
- // Universal type: Any
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_ANY, "any");
-
- // modifier suffix for list types
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_LIST_SUFFIX, "-list");
-
- // States for update actions
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_MODIFY, "modify");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_REPLACE, "replace");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_FUSE, "fuse");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_REMOVE, "remove");
-
- // the default separator for strings
- IMPLEMENT_CONSTASCII_USTRING(SEPARATOR_WHITESPACE, " ");
-
- // Needed for building attribute lists
- IMPLEMENT_CONSTASCII_USTRING(XML_ATTRTYPE_CDATA, "CDATA");
-
- } // namespace xml
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/xml/xmlstrings.hxx b/configmgr/source/xml/xmlstrings.hxx
deleted file mode 100644
index fd20a0985c5d..000000000000
--- a/configmgr/source/xml/xmlstrings.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_XML_STRINGS_HXX_
-#define CONFIGMGR_XML_STRINGS_HXX_
-
-#include "strings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
- namespace xml
- {
- // extern declaration for strings used in the XML format
- // namespace prefixes
- DECLARE_CONSTASCII_USTRING(NS_PREFIX_OOR);
- DECLARE_CONSTASCII_USTRING(NS_PREFIX_XS);
-
- const sal_Unicode k_NS_SEPARATOR(':');
-
- // namespace urls
- DECLARE_CONSTASCII_USTRING(NS_URI_OOR);
- DECLARE_CONSTASCII_USTRING(NS_URI_XS);
- DECLARE_CONSTASCII_USTRING(NS_URI_XSI);
-
- // tag names
- DECLARE_CONSTASCII_USTRING(TAG_SCHEMA);
- DECLARE_CONSTASCII_USTRING(TAG_LAYER);
- DECLARE_CONSTASCII_USTRING(DEPRECATED_TAG_LAYER);
-
- DECLARE_CONSTASCII_USTRING(TAG_COMPONENT);
- DECLARE_CONSTASCII_USTRING(TAG_TEMPLATES);
-
- DECLARE_CONSTASCII_USTRING(TAG_NODE);
- DECLARE_CONSTASCII_USTRING(TAG_GROUP);
- DECLARE_CONSTASCII_USTRING(TAG_SET);
- DECLARE_CONSTASCII_USTRING(TAG_PROP);
-
- DECLARE_CONSTASCII_USTRING(TAG_IMPORT);
- DECLARE_CONSTASCII_USTRING(TAG_INSTANCE);
- DECLARE_CONSTASCII_USTRING(TAG_ITEMTYPE);
- DECLARE_CONSTASCII_USTRING(TAG_VALUE);
- DECLARE_CONSTASCII_USTRING(TAG_USES);
-
- // attribute names
- DECLARE_CONSTASCII_USTRING(ATTR_NAME);
- DECLARE_CONSTASCII_USTRING(ATTR_CONTEXT);
- DECLARE_CONSTASCII_USTRING(ATTR_PACKAGE);
- DECLARE_CONSTASCII_USTRING(ATTR_COMPONENT);
-
- DECLARE_CONSTASCII_USTRING(ATTR_ITEMTYPE);
- DECLARE_CONSTASCII_USTRING(ATTR_ITEMTYPECOMPONENT);
-
- DECLARE_CONSTASCII_USTRING(ATTR_VALUETYPE);
- DECLARE_CONSTASCII_USTRING(ATTR_VALUESEPARATOR);
-
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_EXTENSIBLE);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_FINALIZED);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_READONLY);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_MANDATORY);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_NULLABLE);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_LOCALIZED);
-
- DECLARE_CONSTASCII_USTRING(ATTR_OPERATION);
-
- // attributes defined elsewhere
- DECLARE_CONSTASCII_USTRING(EXT_ATTR_LANGUAGE);
- DECLARE_CONSTASCII_USTRING(EXT_ATTR_NULL);
-
- // attribute contents
- // boolean constants
- DECLARE_CONSTASCII_USTRING(ATTR_VALUE_TRUE);
- DECLARE_CONSTASCII_USTRING(ATTR_VALUE_FALSE);
-
- // simple types names
- DECLARE_CONSTASCII_USTRING(VALUETYPE_BOOLEAN);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_SHORT);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_INT);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_LONG);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_DOUBLE);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_STRING);
- // Type: Sequence<bytes>
- DECLARE_CONSTASCII_USTRING(VALUETYPE_BINARY);
- // Universal type: Any
- DECLARE_CONSTASCII_USTRING(VALUETYPE_ANY);
-
- // modifier suffix for list types
- DECLARE_CONSTASCII_USTRING(VALUETYPE_LIST_SUFFIX);
-
- // States for update actions
- DECLARE_CONSTASCII_USTRING(OPERATION_MODIFY);
- DECLARE_CONSTASCII_USTRING(OPERATION_REPLACE);
- DECLARE_CONSTASCII_USTRING(OPERATION_FUSE);
- DECLARE_CONSTASCII_USTRING(OPERATION_REMOVE);
-
- // the default separator for strings
- DECLARE_CONSTASCII_USTRING(SEPARATOR_WHITESPACE);
-
- // Needed for building attribute lists
- DECLARE_CONSTASCII_USTRING(XML_ATTRTYPE_CDATA);
-
- } // namespace xml
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx
new file mode 100644
index 000000000000..07ad4d17a345
--- /dev/null
+++ b/configmgr/source/xmldata.cxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <climits>
+#include <stack>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "parsemanager.hxx"
+#include "parser.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace xmldata {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+rtl::OUString convertFromUtf8(Span const & text) {
+ OSL_ASSERT(text.is());
+ rtl_uString * s = 0;
+ if (!rtl_convertStringToUString(
+ &s, text.begin, text.length, RTL_TEXTENCODING_UTF8,
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot convert from UTF-8")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return rtl::OUString(s, SAL_NO_ACQUIRE);
+}
+
+Type parseType(XmlReader const & reader, Span const & text) {
+ OSL_ASSERT(text.is());
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
+ if (i >= 0) {
+ switch (reader.getNamespace(Span(text.begin, i))) {
+ case XmlReader::NAMESPACE_OOR:
+ if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("any")))
+ {
+ return TYPE_ANY;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("boolean-list")))
+ {
+ return TYPE_BOOLEAN_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("short-list")))
+ {
+ return TYPE_SHORT_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("int-list")))
+ {
+ return TYPE_INT_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("long-list")))
+ {
+ return TYPE_LONG_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("double-list")))
+ {
+ return TYPE_DOUBLE_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("string-list")))
+ {
+ return TYPE_STRING_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
+ {
+ return TYPE_HEXBINARY_LIST;
+ }
+ break;
+ case XmlReader::NAMESPACE_XS:
+ if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("boolean")))
+ {
+ return TYPE_BOOLEAN;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("short")))
+ {
+ return TYPE_SHORT;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("int")))
+ {
+ return TYPE_INT;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("long")))
+ {
+ return TYPE_LONG;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("double")))
+ {
+ return TYPE_DOUBLE;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("string")))
+ {
+ return TYPE_STRING;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("hexBinary")))
+ {
+ return TYPE_HEXBINARY;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) +
+ convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+bool parseBoolean(Span const & text) {
+ OSL_ASSERT(text.is());
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
+ return true;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("false"))) {
+ return false;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) +
+ convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+rtl::OUString parseTemplateReference(
+ rtl::OUString const & component, bool hasNodeType,
+ rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName)
+{
+ if (!hasNodeType) {
+ if (defaultTemplateName != 0) {
+ return *defaultTemplateName;
+ }
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("missing node-type attribute")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return Data::fullTemplateName(component, nodeType);
+}
+
+}
+
+}
diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx
new file mode 100644
index 000000000000..15a0a36336ad
--- /dev/null
+++ b/configmgr/source/xmldata.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLDATA_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XMLDATA_HXX
+
+#include "sal/config.h"
+
+#include "type.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class XmlReader;
+struct Span;
+
+namespace xmldata {
+
+rtl::OUString convertFromUtf8(Span const & text);
+
+Type parseType(XmlReader const & reader, Span const & text);
+
+bool parseBoolean(Span const & text);
+
+rtl::OUString parseTemplateReference(
+ rtl::OUString const & component, bool hasNodeType,
+ rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName);
+
+}
+
+}
+
+#endif
diff --git a/configmgr/source/xmlreader.cxx b/configmgr/source/xmlreader.cxx
new file mode 100644
index 000000000000..ac6a08d18604
--- /dev/null
+++ b/configmgr/source/xmlreader.cxx
@@ -0,0 +1,1054 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool isSpace(char c) {
+ switch (c) {
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ case ' ':
+ return true;
+ default:
+ return false;
+ }
+}
+
+}
+
+XmlReader::XmlReader(rtl::OUString const & fileUrl)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException)):
+ fileUrl_(fileUrl)
+{
+ switch (osl_openFile(fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read))
+ {
+ case osl_File_E_None:
+ break;
+ case osl_File_E_NOENT:
+ throw css::container::NoSuchElementException(
+ fileUrl_, css::uno::Reference< css::uno::XInterface >());
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot open ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ oslFileError e = osl_getFileSize(fileHandle_, &fileSize_);
+ if (e == osl_File_E_None) {
+ e = osl_mapFile(
+ fileHandle_, &fileAddress_, fileSize_, 0,
+ osl_File_MapFlag_WillNeed);
+ }
+ if (e != osl_File_E_None) {
+ e = osl_closeFile(fileHandle_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot mmap ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ namespaces_.push_back(
+ NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xml")), NAMESPACE_XML));
+ namespaces_.push_back(
+ NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xsi")), NAMESPACE_XSI));
+ // old user layer .xcu files used the xsi namespace prefix without
+ // declaring a corresponding namespace binding, see issue 77174; reading
+ // those files during migration would fail without this hack that can be
+ // removed once migration is no longer relevant (see
+ // Components::parseModificationLayer)
+ pos_ = static_cast< char * >(fileAddress_);
+ end_ = pos_ + fileSize_;
+ state_ = STATE_CONTENT;
+}
+
+XmlReader::~XmlReader() {
+ oslFileError e = osl_unmapFile(fileAddress_, fileSize_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_unmapFile failed with %ld", static_cast< long >(e));
+ }
+ e = osl_closeFile(fileHandle_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+}
+
+XmlReader::Result XmlReader::nextItem(
+ Text reportText, Span * data, Namespace * ns)
+{
+ switch (state_) {
+ case STATE_CONTENT:
+ switch (reportText) {
+ case TEXT_NONE:
+ return handleSkippedText(data, ns);
+ case TEXT_RAW:
+ return handleRawText(data);
+ case TEXT_NORMALIZED:
+ return handleNormalizedText(data);
+ }
+ case STATE_START_TAG:
+ return handleStartTag(ns, data);
+ case STATE_END_TAG:
+ return handleEndTag();
+ case STATE_EMPTY_ELEMENT_TAG:
+ handleElementEnd();
+ return RESULT_END;
+ default: // STATE_DONE
+ return RESULT_DONE;
+ }
+}
+
+bool XmlReader::nextAttribute(Namespace * ns, Span * localName) {
+ OSL_ASSERT(ns != 0 && localName != 0);
+ if (firstAttribute_) {
+ currentAttribute_ = attributes_.begin();
+ firstAttribute_ = false;
+ } else {
+ ++currentAttribute_;
+ }
+ if (currentAttribute_ == attributes_.end()) {
+ return false;
+ }
+ if (currentAttribute_->nameColon == 0) {
+ *ns = NAMESPACE_NONE;
+ *localName = Span(
+ currentAttribute_->nameBegin,
+ currentAttribute_->nameEnd - currentAttribute_->nameBegin);
+ } else {
+ *ns = getNamespace(
+ Span(
+ currentAttribute_->nameBegin,
+ currentAttribute_->nameColon - currentAttribute_->nameBegin));
+ *localName = Span(
+ currentAttribute_->nameColon + 1,
+ currentAttribute_->nameEnd - (currentAttribute_->nameColon + 1));
+ }
+ return true;
+}
+
+Span XmlReader::getAttributeValue(bool fullyNormalize) {
+ return handleAttributeValue(
+ currentAttribute_->valueBegin, currentAttribute_->valueEnd,
+ fullyNormalize);
+}
+
+XmlReader::Namespace XmlReader::getNamespace(Span const & prefix) const {
+ for (NamespaceList::const_reverse_iterator i(namespaces_.rbegin());
+ i != namespaces_.rend(); ++i)
+ {
+ if (prefix.equals(i->prefix)) {
+ return i->ns;
+ }
+ }
+ return NAMESPACE_OTHER;
+}
+
+rtl::OUString XmlReader::getUrl() const {
+ return fileUrl_;
+}
+
+void XmlReader::normalizeLineEnds(Span const & text) {
+ char const * p = text.begin;
+ sal_Int32 n = text.length;
+ for (;;) {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(p, n, '\x0D');
+ if (i < 0) {
+ break;
+ }
+ pad_.add(p, i);
+ p += i + 1;
+ n -= i + 1;
+ if (n == 0 || *p != '\x0A') {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
+ }
+ }
+ pad_.add(p, n);
+}
+
+void XmlReader::skipSpace() {
+ while (isSpace(peek())) {
+ ++pos_;
+ }
+}
+
+bool XmlReader::skipComment() {
+ if (rtl_str_shortenedCompare_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"),
+ RTL_CONSTASCII_LENGTH("--")) !=
+ 0)
+ {
+ return false;
+ }
+ pos_ += RTL_CONSTASCII_LENGTH("--");
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within comment) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("--");
+ if (read() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "illegal \"--\" within comment in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return true;
+}
+
+void XmlReader::skipProcessingInstruction() {
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad '<?' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("?>");
+}
+
+void XmlReader::skipDocumentTypeDeclaration() {
+ // Neither is it checked that the doctypedecl is at the correct position in
+ // the document, nor that it is well-formed:
+ for (;;) {
+ char c = read();
+ switch (c) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '"':
+ case '\'':
+ {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(
+ pos_, end_ - pos_, c);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ }
+ break;
+ case '>':
+ return;
+ case '[':
+ for (;;) {
+ c = read();
+ switch (c) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '"':
+ case '\'':
+ {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(
+ pos_, end_ - pos_, c);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ }
+ break;
+ case '<':
+ switch (read()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '!':
+ skipComment();
+ break;
+ case '?':
+ skipProcessingInstruction();
+ break;
+ default:
+ break;
+ }
+ break;
+ case ']':
+ skipSpace();
+ if (read() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing \">\" of DTD in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return;
+ default:
+ break;
+ }
+ }
+ default:
+ break;
+ }
+ }
+}
+
+Span XmlReader::scanCdataSection() {
+ if (rtl_str_shortenedCompare_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("[CDATA["),
+ RTL_CONSTASCII_LENGTH("[CDATA[")) !=
+ 0)
+ {
+ return Span();
+ }
+ pos_ += RTL_CONSTASCII_LENGTH("[CDATA[");
+ char const * begin = pos_;
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within CDATA section) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("]]>");
+ return Span(begin, i);
+}
+
+bool XmlReader::scanName(char const ** nameColon) {
+ OSL_ASSERT(nameColon != 0 && *nameColon == 0);
+ for (char const * begin = pos_;; ++pos_) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ case ' ':
+ case '/':
+ case '=':
+ case '>':
+ return pos_ != begin;
+ case ':':
+ *nameColon = pos_;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+XmlReader::Namespace XmlReader::scanNamespaceIri(
+ char const * begin, char const * end)
+{
+ OSL_ASSERT(begin != 0 && begin <= end);
+ Span iri(handleAttributeValue(begin, end, false));
+ struct Iri {
+ char const * begin;
+ sal_Int32 length;
+ XmlReader::Namespace ns;
+ };
+ static Iri const iris[] = {
+ { RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"),
+ XmlReader::NAMESPACE_OOR },
+ { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"),
+ XmlReader::NAMESPACE_XS },
+ { RTL_CONSTASCII_STRINGPARAM(
+ "http://www.w3.org/2001/XMLSchema-instance"),
+ XmlReader::NAMESPACE_XSI },
+ { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/XML/1998/namespace"),
+ XmlReader::NAMESPACE_XML } };
+ for (std::size_t i = 0; i < sizeof iris / sizeof iris[0]; ++i) {
+ if (rtl_str_compare_WithLength(
+ iri.begin, iri.length, iris[i].begin, iris[i].length) ==
+ 0)
+ {
+ return iris[i].ns;
+ }
+ }
+ return XmlReader::NAMESPACE_OTHER;
+}
+
+char const * XmlReader::handleReference(char const * position, char const * end)
+{
+ OSL_ASSERT(position != 0 && *position == '&' && position < end);
+ ++position;
+ if (*position == '#') {
+ ++position;
+ sal_Int32 val = 0;
+ char const * p;
+ if (*position == 'x') {
+ ++position;
+ p = position;
+ for (;; ++position) {
+ char c = *position;
+ if (c >= '0' && c <= '9') {
+ val = 16 * val + (c - '0');
+ } else if (c >= 'A' && c <= 'F') {
+ val = 16 * val + (c - 'A') + 10;
+ } else if (c >= 'a' && c <= 'f') {
+ val = 16 * val + (c - 'a') + 10;
+ } else {
+ break;
+ }
+ if (val > 0x10FFFF) { // avoid overflow
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "'&#x...' too large in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ } else {
+ p = position;
+ for (;; ++position) {
+ char c = *position;
+ if (c >= '0' && c <= '9') {
+ val = 10 * val + (c - '0');
+ } else {
+ break;
+ }
+ if (val > 0x10FFFF) { // avoid overflow
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "'&#...' too large in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ if (position == p || *position++ != ';') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("'&#...' missing ';' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ OSL_ASSERT(val >= 0 && val <= 0x10FFFF);
+ if ((val < 0x20 && val != 0x9 && val != 0xA && val != 0xD) ||
+ (val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF)
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "character reference denoting invalid character in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char buf[4];
+ sal_Int32 len;
+ if (val < 0x80) {
+ buf[0] = static_cast< char >(val);
+ len = 1;
+ } else if (val < 0x800) {
+ buf[0] = static_cast< char >((val >> 6) | 0xC0);
+ buf[1] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 2;
+ } else if (val < 0x10000) {
+ buf[0] = static_cast< char >((val >> 12) | 0xE0);
+ buf[1] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
+ buf[2] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 3;
+ } else {
+ buf[0] = static_cast< char >((val >> 18) | 0xF0);
+ buf[1] = static_cast< char >(((val >> 12) & 0x3F) | 0x80);
+ buf[2] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
+ buf[3] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 4;
+ }
+ pad_.addEphemeral(buf, len);
+ return position;
+ } else {
+ struct EntityRef {
+ char const * inBegin;
+ sal_Int32 inLength;
+ char const * outBegin;
+ sal_Int32 outLength;
+ };
+ static EntityRef const refs[] = {
+ { RTL_CONSTASCII_STRINGPARAM("amp;"),
+ RTL_CONSTASCII_STRINGPARAM("&") },
+ { RTL_CONSTASCII_STRINGPARAM("lt;"),
+ RTL_CONSTASCII_STRINGPARAM("<") },
+ { RTL_CONSTASCII_STRINGPARAM("gt;"),
+ RTL_CONSTASCII_STRINGPARAM(">") },
+ { RTL_CONSTASCII_STRINGPARAM("apos;"),
+ RTL_CONSTASCII_STRINGPARAM("'") },
+ { RTL_CONSTASCII_STRINGPARAM("quot;"),
+ RTL_CONSTASCII_STRINGPARAM("\"") } };
+ for (std::size_t i = 0; i < sizeof refs / sizeof refs[0]; ++i) {
+ if (rtl_str_shortenedCompare_WithLength(
+ position, end - position, refs[i].inBegin, refs[i].inLength,
+ refs[i].inLength) ==
+ 0)
+ {
+ position += refs[i].inLength;
+ pad_.add(refs[i].outBegin, refs[i].outLength);
+ return position;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("unknown entity reference in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Span XmlReader::handleAttributeValue(
+ char const * begin, char const * end, bool fullyNormalize)
+{
+ pad_.clear();
+ if (fullyNormalize) {
+ while (begin != end && isSpace(*begin)) {
+ ++begin;
+ }
+ while (end != begin && isSpace(end[-1])) {
+ --end;
+ }
+ char const * p = begin;
+ enum Space { SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
+ // a single true space character can go into the current span,
+ // everything else breaks the span
+ Space space = SPACE_NONE;
+ while (p != end) {
+ switch (*p) {
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ switch (space) {
+ case SPACE_NONE:
+ pad_.add(begin, p - begin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ space = SPACE_BREAK;
+ break;
+ case SPACE_SPAN:
+ pad_.add(begin, p - begin);
+ space = SPACE_BREAK;
+ break;
+ case SPACE_BREAK:
+ break;
+ }
+ begin = ++p;
+ break;
+ case ' ':
+ switch (space) {
+ case SPACE_NONE:
+ ++p;
+ space = SPACE_SPAN;
+ break;
+ case SPACE_SPAN:
+ pad_.add(begin, p - begin);
+ begin = ++p;
+ space = SPACE_BREAK;
+ break;
+ case SPACE_BREAK:
+ begin = ++p;
+ break;
+ }
+ break;
+ case '&':
+ pad_.add(begin, p - begin);
+ p = handleReference(p, end);
+ begin = p;
+ space = SPACE_NONE;
+ break;
+ default:
+ ++p;
+ space = SPACE_NONE;
+ break;
+ }
+ }
+ pad_.add(begin, p - begin);
+ } else {
+ char const * p = begin;
+ while (p != end) {
+ switch (*p) {
+ case '\x09':
+ case '\x0A':
+ pad_.add(begin, p - begin);
+ begin = ++p;
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ case '\x0D':
+ pad_.add(begin, p - begin);
+ ++p;
+ if (peek() == '\x0A') {
+ ++p;
+ }
+ begin = p;
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ case '&':
+ pad_.add(begin, p - begin);
+ p = handleReference(p, end);
+ begin = p;
+ break;
+ default:
+ ++p;
+ break;
+ }
+ }
+ pad_.add(begin, p - begin);
+ }
+ return pad_.get();
+}
+
+XmlReader::Result XmlReader::handleStartTag(Namespace * ns, Span * localName) {
+ OSL_ASSERT(ns != 0 && localName);
+ char const * nameBegin = pos_;
+ char const * nameColon = 0;
+ if (!scanName(&nameColon)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad tag name in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * nameEnd = pos_;
+ NamespaceList::size_type inheritedNamespaces = namespaces_.size();
+ bool hasDefaultNs = false;
+ Namespace defaultNs = NAMESPACE_NONE;
+ attributes_.clear();
+ for (;;) {
+ char const * p = pos_;
+ skipSpace();
+ if (peek() == '/' || peek() == '>') {
+ break;
+ }
+ if (pos_ == p) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing whitespace before attribute in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * attrNameBegin = pos_;
+ char const * attrNameColon = 0;
+ if (!scanName(&attrNameColon)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad attribute name in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * attrNameEnd = pos_;
+ skipSpace();
+ if (read() != '=') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '=' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ skipSpace();
+ char del = read();
+ if (del != '\'' && del != '"') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad attribute value in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * valueBegin = pos_;
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unterminated attribute value in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * valueEnd = pos_ + i;
+ pos_ += i + 1;
+ if (attrNameColon == 0 &&
+ Span(attrNameBegin, attrNameEnd - attrNameBegin).equals(
+ RTL_CONSTASCII_STRINGPARAM("xmlns")))
+ {
+ hasDefaultNs = true;
+ defaultNs = scanNamespaceIri(valueBegin, valueEnd);
+ } else if (attrNameColon != 0 &&
+ Span(attrNameBegin, attrNameColon - attrNameBegin).equals(
+ RTL_CONSTASCII_STRINGPARAM("xmlns")))
+ {
+ namespaces_.push_back(
+ NamespaceData(
+ Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)),
+ scanNamespaceIri(valueBegin, valueEnd)));
+ } else {
+ attributes_.push_back(
+ AttributeData(
+ attrNameBegin, attrNameEnd, attrNameColon, valueBegin,
+ valueEnd));
+ }
+ }
+ if (!hasDefaultNs && !elements_.empty()) {
+ defaultNs = elements_.top().defaultNamespace;
+ }
+ firstAttribute_ = true;
+ if (peek() == '/') {
+ state_ = STATE_EMPTY_ELEMENT_TAG;
+ ++pos_;
+ } else {
+ state_ = STATE_CONTENT;
+ }
+ if (peek() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ ++pos_;
+ elements_.push(
+ ElementData(
+ Span(nameBegin, nameEnd - nameBegin), inheritedNamespaces,
+ defaultNs));
+ if (nameColon == 0) {
+ *ns = defaultNs;
+ *localName = Span(nameBegin, nameEnd - nameBegin);
+ } else {
+ *ns = getNamespace(Span(nameBegin, nameColon - nameBegin));
+ *localName = Span(nameColon + 1, nameEnd - (nameColon + 1));
+ }
+ return RESULT_BEGIN;
+}
+
+XmlReader::Result XmlReader::handleEndTag() {
+ if (elements_.empty()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("spurious end tag in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * nameBegin = pos_;
+ char const * nameColon = 0;
+ if (!scanName(&nameColon) ||
+ !elements_.top().name.equals(nameBegin, pos_ - nameBegin))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ handleElementEnd();
+ skipSpace();
+ if (peek() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ ++pos_;
+ return RESULT_END;
+}
+
+void XmlReader::handleElementEnd() {
+ OSL_ASSERT(!elements_.empty());
+ namespaces_.resize(elements_.top().inheritedNamespaces);
+ elements_.pop();
+ state_ = elements_.empty() ? STATE_DONE : STATE_CONTENT;
+}
+
+XmlReader::Result XmlReader::handleSkippedText(Span * data, Namespace * ns) {
+ for (;;) {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<');
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (!skipComment() && !scanCdataSection().is()) {
+ skipDocumentTypeDeclaration();
+ }
+ break;
+ case '/':
+ ++pos_;
+ return handleEndTag();
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ break;
+ default:
+ return handleStartTag(ns, data);
+ }
+ }
+}
+
+XmlReader::Result XmlReader::handleRawText(Span * text) {
+ pad_.clear();
+ for (char const * begin = pos_;;) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '\x0D':
+ pad_.add(begin, pos_ - begin);
+ ++pos_;
+ if (peek() != '\x0A') {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
+ }
+ begin = pos_;
+ break;
+ case '&':
+ pad_.add(begin, pos_ - begin);
+ pos_ = handleReference(pos_, end_);
+ begin = pos_;
+ break;
+ case '<':
+ pad_.add(begin, pos_ - begin);
+ ++pos_;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (!skipComment()) {
+ Span cdata(scanCdataSection());
+ if (cdata.is()) {
+ normalizeLineEnds(cdata);
+ } else {
+ skipDocumentTypeDeclaration();
+ }
+ }
+ begin = pos_;
+ break;
+ case '/':
+ *text = pad_.get();
+ ++pos_;
+ state_ = STATE_END_TAG;
+ return RESULT_TEXT;
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ begin = pos_;
+ break;
+ default:
+ *text = pad_.get();
+ state_ = STATE_START_TAG;
+ return RESULT_TEXT;
+ }
+ break;
+ default:
+ ++pos_;
+ break;
+ }
+ }
+}
+
+XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
+ pad_.clear();
+ char const * flowBegin = pos_;
+ char const * flowEnd = pos_;
+ enum Space { SPACE_START, SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
+ // a single true space character can go into the current flow,
+ // everything else breaks the flow
+ Space space = SPACE_START;
+ for (;;) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ switch (space) {
+ case SPACE_START:
+ case SPACE_BREAK:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ space = SPACE_BREAK;
+ break;
+ }
+ ++pos_;
+ break;
+ case ' ':
+ switch (space) {
+ case SPACE_START:
+ case SPACE_BREAK:
+ break;
+ case SPACE_NONE:
+ space = SPACE_SPAN;
+ break;
+ case SPACE_SPAN:
+ space = SPACE_BREAK;
+ break;
+ }
+ ++pos_;
+ break;
+ case '&':
+ switch (space) {
+ case SPACE_START:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ pad_.add(flowBegin, pos_ - flowBegin);
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ }
+ pos_ = handleReference(pos_, end_);
+ flowBegin = pos_;
+ flowEnd = pos_;
+ space = SPACE_NONE;
+ break;
+ case '<':
+ ++pos_;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (skipComment()) {
+ space = SPACE_BREAK;
+ } else {
+ Span cdata(scanCdataSection());
+ if (cdata.is()) {
+ // CDATA is not normalized (similar to character
+ // references; it keeps the code simple), but it might
+ // arguably be better to normalize it:
+ switch (space) {
+ case SPACE_START:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ pad_.add(flowBegin, pos_ - flowBegin);
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ }
+ normalizeLineEnds(cdata);
+ flowBegin = pos_;
+ flowEnd = pos_;
+ space = SPACE_NONE;
+ } else {
+ skipDocumentTypeDeclaration();
+ }
+ }
+ break;
+ case '/':
+ ++pos_;
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ *text = pad_.get();
+ state_ = STATE_END_TAG;
+ return RESULT_TEXT;
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ space = SPACE_BREAK;
+ break;
+ default:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ *text = pad_.get();
+ state_ = STATE_START_TAG;
+ return RESULT_TEXT;
+ }
+ break;
+ default:
+ switch (space) {
+ case SPACE_START:
+ flowBegin = pos_;
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ flowBegin = pos_;
+ break;
+ }
+ flowEnd = ++pos_;
+ space = SPACE_NONE;
+ break;
+ }
+ }
+}
+
+}
diff --git a/configmgr/source/xmlreader.hxx b/configmgr/source/xmlreader.hxx
new file mode 100644
index 000000000000..83ccac148cd4
--- /dev/null
+++ b/configmgr/source/xmlreader.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/file.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+
+namespace configmgr {
+
+class XmlReader: private boost::noncopyable {
+public:
+ explicit XmlReader(rtl::OUString const & fileUrl)
+ SAL_THROW((
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException));
+
+ ~XmlReader();
+
+ enum Namespace {
+ NAMESPACE_NONE, NAMESPACE_XML, NAMESPACE_OOR, NAMESPACE_XS,
+ NAMESPACE_XSI, NAMESPACE_OTHER };
+
+ enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED };
+
+ enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE };
+
+ // RESULT_BEGIN: data = localName, ns = ns
+ // RESULT_END: data, ns unused
+ // RESULT_TEXT: data = text, ns unused
+ Result nextItem(Text reportText, Span * data, Namespace * ns);
+
+ bool nextAttribute(Namespace * ns, Span * localName);
+
+ // the span returned by getAttributeValue is only valid until the next call
+ // to nextItem or getAttributeValue
+ Span getAttributeValue(bool fullyNormalize);
+
+ Namespace getNamespace(Span const & prefix) const;
+
+ rtl::OUString getUrl() const;
+
+private:
+ inline char read() { return pos_ == end_ ? '\0' : *pos_++; }
+
+ inline char peek() { return pos_ == end_ ? '\0' : *pos_; }
+
+ void normalizeLineEnds(Span const & text);
+
+ void skipSpace();
+
+ bool skipComment();
+
+ void skipProcessingInstruction();
+
+ void skipDocumentTypeDeclaration();
+
+ Span scanCdataSection();
+
+ bool scanName(char const ** nameColon);
+
+ Namespace scanNamespaceIri(char const * begin, char const * end);
+
+ char const * handleReference(char const * position, char const * end);
+
+ Span handleAttributeValue(
+ char const * begin, char const * end, bool fullyNormalize);
+
+ Result handleStartTag(Namespace * ns, Span * localName);
+
+ Result handleEndTag();
+
+ void handleElementEnd();
+
+ Result handleSkippedText(Span * data, Namespace * ns);
+
+ Result handleRawText(Span * text);
+
+ Result handleNormalizedText(Span * text);
+
+ struct NamespaceData {
+ Span prefix;
+ Namespace ns;
+
+ NamespaceData() {}
+
+ NamespaceData(Span const & thePrefix, Namespace theNs):
+ prefix(thePrefix), ns(theNs) {}
+ };
+
+ typedef std::vector< NamespaceData > NamespaceList;
+
+ struct ElementData {
+ Span name;
+ NamespaceList::size_type inheritedNamespaces;
+ Namespace defaultNamespace;
+
+ ElementData(
+ Span const & theName,
+ NamespaceList::size_type theInheritedNamespaces,
+ Namespace theDefaultNamespace):
+ name(theName), inheritedNamespaces(theInheritedNamespaces),
+ defaultNamespace(theDefaultNamespace)
+ {}
+ };
+
+ typedef std::stack< ElementData > ElementStack;
+
+ struct AttributeData {
+ char const * nameBegin;
+ char const * nameEnd;
+ char const * nameColon;
+ char const * valueBegin;
+ char const * valueEnd;
+
+ AttributeData(
+ char const * theNameBegin, char const * theNameEnd,
+ char const * theNameColon, char const * theValueBegin,
+ char const * theValueEnd):
+ nameBegin(theNameBegin), nameEnd(theNameEnd),
+ nameColon(theNameColon), valueBegin(theValueBegin),
+ valueEnd(theValueEnd)
+ {}
+ };
+
+ typedef std::vector< AttributeData > Attributes;
+
+ enum State {
+ STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG,
+ STATE_DONE };
+
+ rtl::OUString fileUrl_;
+ oslFileHandle fileHandle_;
+ sal_uInt64 fileSize_;
+ void * fileAddress_;
+ NamespaceList namespaces_;
+ ElementStack elements_;
+ char const * pos_;
+ char const * end_;
+ State state_;
+ Attributes attributes_;
+ Attributes::iterator currentAttribute_;
+ bool firstAttribute_;
+ Pad pad_;
+};
+
+}
+
+#endif
diff --git a/configmgr/util/cfgmgr.mxp.map b/configmgr/util/cfgmgr.mxp.map
deleted file mode 100644
index 2bf8e6c7f991..000000000000
--- a/configmgr/util/cfgmgr.mxp.map
+++ /dev/null
@@ -1,4 +0,0 @@
-# Global symbols
-_component_getImplementationEnvironment
-_component_writeInfo
-_component_getFactory
diff --git a/configmgr/util/configmgr.map b/configmgr/util/configmgr.map
deleted file mode 100644
index ad92fbe03e9f..000000000000
--- a/configmgr/util/configmgr.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CFGMGR_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/configmgr/util/configmgr2.uno.xml b/configmgr/util/configmgr2.uno.xml
deleted file mode 100644
index 8a7ac13f3114..000000000000
--- a/configmgr/util/configmgr2.uno.xml
+++ /dev/null
@@ -1,582 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>configmgr2</module-name>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ConfigurationProvider</name>
- <description>
-The configuration service provides access to a hierarchical database of configuration and preference data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.script.Converter </service-dependency>
- <service-dependency> com.sun.star.io.DataOutputStream </service-dependency>
- <type> com.sun.star.configuration.MissingBootstrapFileException </type>
- <type> com.sun.star.configuration.InvalidBootstrapFileException </type>
- <type> com.sun.star.configuration.InstallationIncompleteException </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.NamedValue </type>
- <type> com.sun.star.lang.Locale </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.script.XTypeConverter </type>
- <type> com.sun.star.util.XCancellable </type>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.AdministrationProvider</name>
- <description>
-The configuration service provides access to a hierarchical database of configuration and preference data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.AdministrationProvider </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.configuration.ConfigurationUpdateAccess </service-dependency>
- <service-dependency> com.sun.star.configuration.ConfigurationAccess </service-dependency>
- <service-dependency> com.sun.star.script.Converter </service-dependency>
- <type> com.sun.star.configuration.MissingBootstrapFileException </type>
- <type> com.sun.star.configuration.InvalidBootstrapFileException </type>
- <type> com.sun.star.configuration.InstallationIncompleteException </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.NamedValue </type>
- <type> com.sun.star.lang.Locale </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.script.XTypeConverter </type>
- <type> com.sun.star.util.XCancellable </type>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ConfigurationProviderWrapper</name>
- <description>
-Is a configuration provider that forwards its requests to a DefaultProvider.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.configuration.DefaultProvider </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.bootstrap.BootstrapContext</name>
- <description>Context containing configuration bootstrap data merged with environment settings.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.bootstrap.BootstrapContext </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.SingleBackendAdapter</name>
- <description>Backend using a SingleBackend for data access.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.SingleBackendAdapter </supported-service>
- <supported-service> com.sun.star.configuration.backend.OnlineBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.Backend </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LayerUpdateMerger</name>
- <description>Merges updates into layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LayerUpdateMerger </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.MergeImporter</name>
- <description>Importer for layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.MergeImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.Importer </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.CopyImporter</name>
- <description>Importer for layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.CopyImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.Importer </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.SchemaParser</name>
- <description>Parser for OOR Schema XML.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.SchemaParser </supported-service>
- <service-dependency> com.sun.star.xml.sax.Parser </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.LayerParser</name>
- <description>Parser for OOR Layer/Update XML.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.LayerParser </supported-service>
- <service-dependency> com.sun.star.xml.sax.Parser </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.LayerWriter</name>
- <description>Service for writing layer data to the OOR Layer/Update XML format.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.LayerWriter </supported-service>
- <service-dependency> com.sun.star.xml.sax.Writer </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalSingleBackend</name>
- <description>SingleBackend for accessing locally stored configuration data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSingleBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.SingleBackend </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalDataImporter</name>
- <description>Component for importing layer data from local files.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalDataImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.DataImporter </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalHierarchyBrowser</name>
- <description>Component for retrieving available componets from a local configuration data repository.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalHierarchyBrowser </supported-service>
- <supported-service> com.sun.star.configuration.backend.HierarchyBrowser </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.LocalSchemaSupplier</name>
- <description>Component for accessing locally stored schema files</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSchemaSupplier </supported-service>
- <supported-service> com.sun.star.configuration.backend.SchemaSupplier </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.LocalSingleStratum</name>
- <description>Component for accessing locally stored configuration data</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSingleStratum </supported-service>
- <supported-service> com.sun.star.configuration.backend.SingleLayerStratum </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.MultiStratumBackend</name>
- <description>Component for co-ordinating access to multiple storage backends</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.MultiStratumBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.Backend </supported-service>
- </component-description>
- <component-description>
- <author>Frank Schoenheit</author>
- <name> com.sun.star.comp.configuration.OConfigurationRegistry</name>
- <description>
-The configuration registry service is an adapter, that provides a SimpleRegistry interface to the configuration service.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service>com.sun.star.configuration.ConfigurationRegistry</supported-service>
- <supported-service>com.sun.star.registry.SimpleRegistry</supported-service>
- <service-dependency>com.sun.star.configuration.ConfigurationProvider</service-dependency>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.registry.XSimpleRegistry</type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.util.XFlushable </type>
- </component-description>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.beans.XExactName</type>
- <type>com.sun.star.beans.XHierarchicalPropertySet</type>
- <type>com.sun.star.beans.XFastPropertySet</type>
- <type>com.sun.star.beans.XMultiHierarchicalPropertySet</type>
- <type>com.sun.star.beans.XMultiPropertySet</type>
- <type>com.sun.star.beans.XProperty</type>
- <type>com.sun.star.beans.XPropertyWithState</type>
- <type>com.sun.star.beans.XPropertyState</type>
- <type>com.sun.star.beans.XMultiPropertyStates</type>
- <type>com.sun.star.beans.XPropertySet</type>
- <type>com.sun.star.beans.PropertyValue</type>
- <type>com.sun.star.beans.Property</type>
- <type>com.sun.star.beans.PropertyAttribute</type>
- <type>com.sun.star.configuration.XTemplateContainer</type>
- <type>com.sun.star.configuration.XTemplateInstance</type>
- <type>com.sun.star.configuration.backend.TemplateIdentifier</type>
- <type>com.sun.star.configuration.backend.SchemaAttribute</type>
- <type>com.sun.star.configuration.backend.NodeAttribute</type>
- <type>com.sun.star.configuration.backend.XSchemaHandler</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XUpdateHandler</type>
- <type>com.sun.star.configuration.backend.XUpdatableLayer</type>
- <type>com.sun.star.configuration.backend.XCompositeLayer</type>
- <type>com.sun.star.configuration.backend.XLayerImporter</type>
- <type>com.sun.star.configuration.backend.XBackend</type>
- <type>com.sun.star.configuration.backend.XBackendEntities</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.configuration.backend.XMultiLayerStratum</type>
- <type>com.sun.star.configuration.backend.XSchemaSupplier</type>
- <type>com.sun.star.configuration.backend.XSchema</type>
- <type>com.sun.star.configuration.backend.XLayer</type>
- <type>com.sun.star.configuration.backend.MalformedDataException</type>
- <type>com.sun.star.configuration.backend.BackendAccessException</type>
- <type>com.sun.star.configuration.backend.BackendSetupException</type>
- <type>com.sun.star.configuration.backend.AuthenticationFailedException</type>
- <type>com.sun.star.configuration.backend.InvalidAuthenticationMechanismException</type>
- <type>com.sun.star.configuration.backend.CannotConnectException</type>
- <type>com.sun.star.configuration.backend.InsufficientAccessRightsException</type>
- <type>com.sun.star.configuration.backend.ConnectionLostException</type>
- <type>com.sun.star.configuration.MissingBootstrapFileException</type>
- <type>com.sun.star.configuration.InvalidBootstrapFileException</type>
- <type>com.sun.star.configuration.InstallationIncompleteException</type>
- <type>com.sun.star.container.XNamed</type>
- <type>com.sun.star.container.XHierarchicalName</type>
- <type>com.sun.star.container.XChild</type>
- <type>com.sun.star.container.XNameAccess</type>
- <type>com.sun.star.container.XNameReplace</type>
- <type>com.sun.star.container.XNameContainer</type>
- <type>com.sun.star.container.XHierarchicalNameAccess</type>
- <type>com.sun.star.container.XElementAccess</type>
- <type>com.sun.star.container.XContainer</type>
- <type>com.sun.star.container.NoSuchElementException</type>
- <type>com.sun.star.io.XActiveDataSink</type>
- <type>com.sun.star.io.XActiveDataSource</type>
- <type>com.sun.star.io.XInputStream</type>
- <type>com.sun.star.io.XOutputStream</type>
- <type>com.sun.star.io.XDataInputStream</type>
- <type>com.sun.star.io.XDataOutputStream</type>
- <type>com.sun.star.io.UnexpectedEOFException</type>
- <type>com.sun.star.io.WrongFormatException</type>
- <type>com.sun.star.lang.XComponent</type>
- <type>com.sun.star.lang.XEventListener</type>
- <type>com.sun.star.lang.XInitialization</type>
- <type>com.sun.star.lang.XLocalizable</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XMultiServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.lang.XUnoTunnel</type>
- <type>com.sun.star.lang.EventObject</type>
- <type>com.sun.star.lang.ServiceNotRegisteredException</type>
- <type>com.sun.star.lang.IllegalArgumentException</type>
- <type>com.sun.star.lang.WrappedTargetException</type>
- <type>com.sun.star.lang.WrappedTargetRuntimeException</type>
- <type>com.sun.star.lang.DisposedException</type>
- <type>com.sun.star.script.XTypeConverter</type>
- <type>com.sun.star.script.FailReason</type>
- <type>com.sun.star.task.XJob</type>
- <type>com.sun.star.util.XCancellable</type>
- <type>com.sun.star.util.XChangesBatch</type>
- <type>com.sun.star.util.XChangesListener</type>
- <type>com.sun.star.util.XChangesNotifier</type>
- <type>com.sun.star.util.XFlushable</type>
- <type>com.sun.star.util.XStringEscape</type>
- <type>com.sun.star.util.XTimeStamped</type>
- <type>com.sun.star.util.Date</type>
- <type>com.sun.star.util.Time</type>
- <type>com.sun.star.util.DateTime</type>
- <type>com.sun.star.xml.sax.XAttributeList</type>
- <type>com.sun.star.xml.sax.XDocumentHandler</type>
- <type>com.sun.star.xml.sax.XExtendedDocumentHandler</type>
- <type>com.sun.star.xml.sax.XParser</type>
- <type>com.sun.star.xml.sax.SAXParseException</type>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/util/configmgrl.map b/configmgr/util/configmgrl.map
deleted file mode 100644
index ad92fbe03e9f..000000000000
--- a/configmgr/util/configmgrl.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CFGMGR_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/configmgr/util/exports.dxp b/configmgr/util/exports.dxp
deleted file mode 100644
index 9630d7e06768..000000000000
--- a/configmgr/util/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/util/makefile.mk b/configmgr/util/makefile.mk
deleted file mode 100644
index 056e033934d1..000000000000
--- a/configmgr/util/makefile.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-PRJNAME=configmgr
-TARGET=configmgr
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-DLLPRE =
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(CFGMGR_TARGET)$(CFGMGR_MAJOR).uno
-SHL1VERSIONMAP= $(TARGET).map
-
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(VOSLIB) \
- $(SALHELPERLIB) \
- $(SALLIB) \
- $(TOOLSLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-SHL1LIBS= $(SLB)$/registry.lib \
- $(SLB)$/treecache.lib \
- $(SLB)$/misc.lib \
- $(SLB)$/backend.lib \
- $(SLB)$/localbe.lib \
- $(SLB)$/xml.lib \
- $(SLB)$/treemgr.lib \
- $(SLB)$/api2.lib \
- $(SLB)$/api.lib \
- $(SLB)$/data.lib \
- $(SLB)$/cm.lib
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/workben/apitest/cfgadduser.cxx b/configmgr/workben/apitest/cfgadduser.cxx
deleted file mode 100644
index f75172479efb..000000000000
--- a/configmgr/workben/apitest/cfgadduser.cxx
+++ /dev/null
@@ -1,355 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include <comphelper/stl_types.hxx>
-#include <cppuhelper/extract.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <cppuhelper/servicefactory.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::container;
-
-#define ASCII_STRING(rtlOUString) ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr()
-
-//=============================================================================
-void explain(sal_Bool _bVerbose)
-{
- cout << "cfgadduser - adding users to a registry server\n";
- cout << "\nusage :\n";
- cout << "cfgadduser [-s <server> -p <port>] [-portal] [-r <registry>] [-a <sysaccount>]";
- cout << " [-h <homedirbase>] [-pwd] <user> [<user>]*\n";
- cout << "\nparameters\n";
- cout << " <server> - machine where the registry server is running\n";
- cout << " <port> - port the registry server is listening at\n";
- cout << " <registry> - registry file to use to instantiate services. Defaulted to\n";
- cout << " applicat.rdb\n";
- cout << " <sysaccount> - system account to use for the newly created user(s)\n";
- cout << " <homedirbase> - home directory base. The concret home dir of a user will\n";
- cout << " be built by appending the the user name to the base dir.\n";
- cout << " <user> - user name to add\n";
- cout << " -portal - specify that the program should connect to a running portal,\n";
- cout << " not directly to the registry server (you need a ";
-#ifdef WIN32
- cout << "portal.dll\n";
-#else
- cout << "libportal.so\n";
-#endif
- cout << " for this)\n";
- cout << " In this case, <server> and <port> specify the location where\n";
- cout << " StarPortal is running\n";
- cout << "\n";
- cout << "If no server is specified, the configuration proxy will try to bootstrap from\n";
- cout << "the initialization file (";
-#ifdef WIN32
- cout << "sregistry.ini";
-#else
- cout << "sregistryrc";
-#endif
- cout << ")\n\n";
- cout.flush();
-}
-
-//=============================================================================
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- sal_Char* pPort = NULL;
- sal_Char* pServer = NULL;
- sal_Char* pRegistry = NULL;
- sal_Char* pSysAccount = NULL;
- sal_Char* pHomeDirBase = NULL;
- sal_Bool bPortal = sal_False;
-
- ::std::vector< sal_Char* > aUsers;
-
- // collect some parameters
- sal_Char** pArgs = argv + 1;
- for (sal_Int32 i=1; i<argc; ++i, ++pArgs)
- {
- sal_Char* pCurArg = *pArgs;
- sal_Int32 nLen = strlen(pCurArg);
- sal_Bool bInvalidArg = sal_True;
- if (nLen && ('-' == *pCurArg))
- { // it's a switch
- sal_Char* pSwitch = pCurArg + 1;
- switch (nLen)
- {
- case 2:
- switch (*pSwitch)
- {
- case '?':
- explain(sal_True);
- return 1;
- case 'h':
- pHomeDirBase = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'a':
- pSysAccount = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'p':
- pPort = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 's':
- pServer = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'r':
- pRegistry = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- }
- break;
- case 7:
- if (0 == strncmp(pSwitch, "portal", 6))
- {
- bInvalidArg = sal_False;
- bPortal = sal_True;
- }
- break;
- }
- }
- else
- {
- if ((1 == nLen) && ('?' == *pCurArg))
- {
- explain(sal_True);
- return 1;
- }
- else
- {
- bInvalidArg = sal_False;
- aUsers.push_back(pCurArg);
- }
- }
- if (bInvalidArg)
- {
- explain(sal_False);
- return 1;
- }
- }
-
- if ((!pServer && pPort) || (!pPort && pServer))
- {
- explain(sal_False);
- return 1;
- }
-
- if (0 == aUsers.size())
- {
- explain(sal_False);
- return 1;
- }
-
- // refine some params
- ::rtl::OUString sHomeDirBase, sSystemAccountName;
- if (pHomeDirBase)
- {
- sHomeDirBase = ::rtl::OUString::createFromAscii(pHomeDirBase);
- if (!sHomeDirBase.getLength() || ('/' != sHomeDirBase.getStr()[sHomeDirBase.getLength() - 1]))
- sHomeDirBase += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- }
- if (pSysAccount)
- sSystemAccountName = ::rtl::OUString::createFromAscii(pSysAccount);
-
- try
- {
- ::rtl::OUString const sServiceRegistry = ::rtl::OUString::createFromAscii( pRegistry ? pRegistry : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = ::cppu::createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
-
- // collect the params for the config provider
- Sequence< Any > aProviderArgs(3 + (pServer ? 2 : 0));
- aProviderArgs[0] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("servertype")),
- 0,
- makeAny(::rtl::OUString::createFromAscii(bPortal ? "portal" : "remote")),
- PropertyState_DIRECT_VALUE
- ));
- aProviderArgs[1] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")),
- 0,
- makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Administrator"))),
- PropertyState_DIRECT_VALUE
- ));
- aProviderArgs[2] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password")),
- 0,
- makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unused"))),
- PropertyState_DIRECT_VALUE
- ));
- if (pServer)
- {
- aProviderArgs[3] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("server")),
- 0,
- makeAny(::rtl::OUString::createFromAscii(pServer)),
- PropertyState_DIRECT_VALUE
- ));
-
- sal_Int32 nPort = ::rtl::OUString::createFromAscii(pPort).toInt32();
- aProviderArgs[4] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("port")),
- 0,
- makeAny(nPort),
- PropertyState_DIRECT_VALUE
- ));
- }
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aProviderArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- Reference< XInterface > xIFace = xCfgProvider->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.UserAdministration"));
- if (!xIFace.is())
- {
- cerr << "Could not create the configuration provider !\n\n";
- return 4;
- }
-
- Reference< XChangesBatch > xUserChanges(xIFace, UNO_QUERY);
- Reference< XNameContainer > xUserContainer(xIFace, UNO_QUERY);
- Reference< XSingleServiceFactory> xUserFactory(xIFace, UNO_QUERY);
- if (!xUserChanges.is() || !xUserContainer.is() || !xUserFactory.is())
- {
- cerr << "the user admin access does not provide the necessary interfaces !\n\n";
- return 5;
- }
-
- cout << "going to add the users ..." << endl << endl;
- for ( ::std::vector< sal_Char* >::const_iterator aUserLoop = aUsers.begin();
- aUserLoop != aUsers.end();
- ++aUserLoop
- )
- {
- cout << *aUserLoop << " ... ";
- sal_Bool bHadLinebreak = sal_False;
- try
- {
- Reference< XInterface > xNewUser = xUserFactory->createInstance();
-
- // the user name as unicode string use more than once)
- ::rtl::OUString sUserName = ::rtl::OUString::createFromAscii(*aUserLoop);
-
- // the XNameContainer access to the Security node in the user profile data
- Reference< XNameReplace > xSecurityDataAccess;
- Reference< XNameAccess > xUserDataAccess(xNewUser, UNO_QUERY);
- if (xUserDataAccess.is())
- {
- Any aSecurity = xUserDataAccess->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Security")));
- ::cppu::extractInterface(xSecurityDataAccess, aSecurity);
- }
-
- if (!xSecurityDataAccess.is())
- throw Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The user administration service did not provide a valid user template.")), NULL);
-
- // set the home directory
- if (sHomeDirBase.getLength())
- {
- ::rtl::OUString sHomeDir(sHomeDirBase);
- sHomeDir += sUserName;
- xSecurityDataAccess->replaceByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HomeDirectory")), makeAny(sHomeDir));
- cout << "\n\thome dir : " << ASCII_STRING(sHomeDir) << " ... ";
- cout.flush();
- bHadLinebreak = sal_True;
- }
-
- if (sSystemAccountName.getLength())
- {
- xSecurityDataAccess->replaceByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemAccount")), makeAny(sSystemAccountName));
- cout << "\n\tsystem account: " << ASCII_STRING(sSystemAccountName) << " ... ";
- cout.flush();
- bHadLinebreak = sal_True;
- }
-
- xUserContainer->insertByName(sUserName, makeAny(xNewUser));
- xUserChanges->commitChanges();
- if (bHadLinebreak)
- cout << "\n";
- cout << "done.\n";
- cout.flush();
- }
- catch(Exception& e)
- {
- cout << "\n";
- if (!bHadLinebreak)
- cout << "\t";
- cerr << "unable to add the user named " << *aUserLoop << endl;
- if (!bHadLinebreak)
- cout << "\t";
- cerr << "(exception message: " << ::rtl::OString(e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US).getStr() << ")" << endl;
- }
- cout << "\n";
- }
- }
- catch(Exception& e)
- {
- cerr << "Caught exception: " << ASCII_STRING(e.Message) << endl;
- return 2;
- }
-
- return 0;
-}
diff --git a/configmgr/workben/apitest/cfgadmin.cxx b/configmgr/workben/apitest/cfgadmin.cxx
deleted file mode 100644
index f9caf7bf4289..000000000000
--- a/configmgr/workben/apitest/cfgadmin.cxx
+++ /dev/null
@@ -1,517 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-#include <osl/time.h>
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
- OString aTxt = input(_aDefault, _bIsAPassword ? '*' : 0);
-
- OUString sValue = OUString::createFromAscii(aTxt);
- return sValue;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- cout << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- cout << "\n[" << i << "] -\t" << aNames[i];
- cout << endl;
- }
- else
- cout << "BUG: XNameAccess not available";
- cout << endl;
-}
-// -----------------------------------------------------------------------------
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- cout << "\n[ P ] -\tParent";
- else
- cout << "BUG: Parent not available (no XChild)";
- cout << endl;
-}
-
-// -----------------------------------------------------------------------------
-void displayTree(Reference< XNameAccess > xIFace){
-
- write(Reference< XNameAccess >(xIFace));
-}
-
-
-// -----------------------------------------------------------------------------
-void displayGroups(Reference< XNameAccess > xGroupAccess)
-{
-
- cout << "Currently available groups !\n---------------------------------------------------------------" << endl;
- write(xGroupAccess);
-}
-
-// -----------------------------------------------------------------------------
-OUString insertGroup(Reference< XNameAccess > xGroupAccess)
-{
- OUString sGroup = enterValue(" Enter a new group to create: ", "", true);
-
- Reference< XSingleServiceFactory > xFactory(xGroupAccess, UNO_QUERY);
- Reference< XNameAccess > xNewGroup(xFactory->createInstance(), UNO_QUERY);
-
- cout << "Group data: !\n---------------------------------------------------------------" << endl;
- write(xNewGroup);
- Any aGroup;
- aGroup <<= xNewGroup;
- Reference< XNameContainer >(xGroupAccess, UNO_QUERY)->insertByName(sGroup, aGroup);
- return sGroup;
-}
-
-// -----------------------------------------------------------------------------
-void deleteGroup(Reference< XNameAccess > xGroupAccess, OUString sGroup)
-{
- if (!sGroup.getLength())
- sGroup = enterValue(" Enter a group to delete: ", "", true);
- cout << "deleting group !\n---------------------------------------------------------------" << endl;
- Reference< XNameContainer >(xGroupAccess, UNO_QUERY)->removeByName(sGroup);
-}
-
-// -----------------------------------------------------------------------------
-void displayUsers(Reference< XNameAccess > xUserAccess)
-{
- cout << "Currently available users !\n---------------------------------------------------------------" << endl;
- write(xUserAccess);
-}
-
-// -----------------------------------------------------------------------------
-OUString insertUser(Reference< XNameAccess > xUserAccess, OUString aGroup)
-{
- OUString sUser = enterValue(" Enter a new User to create: ", "", true);
- Reference< XSingleServiceFactory > xFactory(xUserAccess, UNO_QUERY);
-
- Sequence< Any > aArgs(1);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("group"), aGroup);
- Reference< XNameAccess > xNewUser(xFactory->createInstanceWithArguments(aArgs), UNO_QUERY);
-
- cout << "User data: !\n---------------------------------------------------------------" << endl;
- write(xNewUser);
-
- Any aValue;
- aValue <<= ASCII("MyCompany");
-
- // now do some updates for the user
- Reference< XHierarchicalPropertySet > xUpdate(xNewUser, UNO_QUERY);
- xUpdate->setHierarchicalPropertyValue(ASCII("Data/Company"),aValue);
-
- Any aUser;
- aUser <<= xNewUser;
- Reference< XNameContainer >(xUserAccess, UNO_QUERY)->insertByName(sUser, aUser);
-
- return sUser;
-}
-
-// -----------------------------------------------------------------------------
-void deleteUser(Reference< XNameAccess > xUserAccess, OUString sUser)
-{
- if (!sUser.getLength())
- sUser = enterValue(" Enter a User to delete: ", "", true);
- cout << "deleting User !\n---------------------------------------------------------------" << endl;
- Reference< XNameContainer >(xUserAccess, UNO_QUERY)->removeByName(sUser);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XNameAccess > beginChanges(Reference< XMultiServiceFactory > xFactory, OUString sPath, OUString& sUser)
-{
- if (!sUser.getLength())
- sUser = enterValue(" Enter a User: ", "", true);
-
- Sequence< Any > aArgs(2);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- aArgs[1] <<= configmgr::createPropertyValue(ASCII("nodepath"),sPath);
-
- cout << "starting update for node:" << sPath << endl;
-
- Reference< XNameAccess > xTree(xFactory->createInstanceWithArguments(OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs), UNO_QUERY);
-
- return xTree;
-}
-
-template <class Type>
-// -----------------------------------------------------------------------------
-void update(Reference< XInterface > xIFace, OUString sRelPath, Type sValue)
-{
- Reference< XHierarchicalPropertySet > xTree(xIFace, UNO_QUERY);
- Any aValue;
- aValue <<= sValue;
-
- cout << "updating node:" << sRelPath << endl;
- xTree->setHierarchicalPropertyValue(sRelPath, aValue);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XHierarchicalPropertySet > insertTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to insert: ", "", false);
-
- Reference< XSingleServiceFactory > xFactory(xIFace, UNO_QUERY);
- Reference< XHierarchicalPropertySet > xNewElement(xFactory->createInstance(), UNO_QUERY);
-
- cout << "inserting new tree element:" << aName << endl;
-
- Any aTree;
- aTree <<= xNewElement;
- Reference< XNameContainer >(xFactory, UNO_QUERY)->insertByName(aName, aTree);
-
- return xNewElement;
-}
-
-// -----------------------------------------------------------------------------
-void removeTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to remove: ", "", false);
-
- cout << "removing new tree element:" << aName << endl;
-
- Reference< XNameContainer >(xIFace, UNO_QUERY)->removeByName(aName);
-}
-
-// -----------------------------------------------------------------------------
-void commitChanges(Reference< XInterface > xIFace)
-{
- cout << "committing changes:" << endl;
-
- Reference< XChangesBatch > xChangesBatch(xIFace, UNO_QUERY);
- xChangesBatch->commitChanges();
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs = createSequence(OUString::createFromAscii("Administrator"), OUString());
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.AdministrationProvider"),
- aCPArgs),
- UNO_QUERY);
-
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- cout << "Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- Reference< XNameAccess > xUpdateAccess;
- Reference< XNameAccess > xGroupAccess(xCfgProvider->createInstance(OUString::createFromAscii("com.sun.star.configuration.GroupAccess")),UNO_QUERY);
- Reference< XNameAccess > xUserAccess(xCfgProvider->createInstance(OUString::createFromAscii("com.sun.star.configuration.UserAccess")),UNO_QUERY);
-
- displayGroups(xGroupAccess);
- displayUsers(xUserAccess);
-
-// create a group
- OUString sGroupName = insertGroup(xGroupAccess);
-// create a user
- OUString sUserName;
- sUserName = insertUser(xUserAccess, sGroupName);
-
-// now do updates for the user
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Inet"), sUserName);
-
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Port"), sal_Int32(12));
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Name"), OUString::createFromAscii("demo"));
- update(xUpdateAccess, OUString::createFromAscii("DNS/IP_Address"), OUString::createFromAscii("demo1"));
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Office.Common"), sUserName);
- update(xUpdateAccess, OUString::createFromAscii("_3D_Engine/Dithering"), sal_Bool(sal_False));
- commitChanges(xUpdateAccess);
-
-// now do updates with inserting and removing of nodes
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security/MountPoints"), sUserName);
- displayTree(xUpdateAccess);
-
- Reference< XHierarchicalPropertySet > xTree = insertTree(xUpdateAccess, OUString());
- update(xUpdateAccess, OUString::createFromAscii("InstallationDirectory/Directory"), OUString::createFromAscii("Test1"));
- removeTree(xUpdateAccess, OUString());
- commitChanges(xUpdateAccess);
-
-
-/* deleteUser(xUserAccess, sUserName);
- deleteGroup(xGroupAccess, sGroupName); */
-
- displayGroups(xGroupAccess);
- displayUsers(xUserAccess);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- return 1;
- }
-/*
- catch (...)
- {
- flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
-
-
-
diff --git a/configmgr/workben/apitest/cfgapi.cxx b/configmgr/workben/apitest/cfgapi.cxx
deleted file mode 100644
index 29399896e978..000000000000
--- a/configmgr/workben/apitest/cfgapi.cxx
+++ /dev/null
@@ -1,865 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-#ifdef LLA_PRIVAT_DEBUG
-static const sal_Char* s_pSourcePath = "l:/src625/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "l:/src625/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.ucb.Hierarchy"; // "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "";
-static const sal_Char* s_pUser = "";
-static const sal_Char* s_pPassword = "";
-#else
-static const sal_Char* s_pSourcePath = "g:/src/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "g:/src/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.Office.TypeDetection";
-static const sal_Char* s_pServerType = "setup";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-#endif
-
-
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sNormalized;
- sNormalized = sExecutable;
- if (1)
- {
- ::osl::Profile aProfile(sNormalized);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
-
- OUString sValue;
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- return sValue;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- loadDefaults();
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- OUString sServerType = enterValue("servertype: ", s_pServerType, false);
- cout << endl;
-
-
- rtl::OUString sUser;
-
- bool bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- cout << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- cout << endl;
-
- OUString sPasswd = enterValue("password: ", s_pPassword, true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- OUString sTimeout = ASCII("10000");
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), sTimeout);
-
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = enterValue("share path: ", s_pSourcePath, false);
- cout << endl;
- sUserPath = enterValue("user path : ", s_pUpdatePath, false);
- cout << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- sal_Int32 nCount = aCPArgs.getLength() - 1;
- Any *pAny = &aCPArgs[nCount];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
-
-
-
- char aPath[300] = "/";
- int nStart = sizeof( "/" ) - 1;
-
- cout << "---------------------------------------------------------------\n Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aArgs;
- aArgs = createSequence(sUser, ASCII(""));
-
- OUString sPath = enterValue("nodepath: ", s_pRootNode, false);
- cout << endl;
-
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- if (!bLocal)
- {
- OUString sLocale = enterValue("locale : ", s_pLocale, false);
- cout << endl;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-/*
-#else
- OUString aStr = ASCII("String");
- sal_Int32 nDepth = 10;
- Sequence< Any > aArgs(2);
-
- aArgs[0] <<= aStr;
- aArgs[1] <<= nDepth;
-#endif
-*/
- Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
- cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
-
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
- showSequence(aSeq);
-
- test_read_access(xIFace, xCfgProvider);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-/*
- catch (...)
- {
- flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- cout << "Accessing Node: " << xAccessName->getHierarchicalName();
- else
- cout << "BUG: XHierarchicalName not available";
- cout << endl;
-}
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- cout << "Node is named: " << xAccess->getName();
- else
- cout << "BUG: XNamed not available";
- cout << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- cout << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- cout << "\n[" << i << "] -\t" << aNames[i];
- cout << endl;
- }
- else
- cout << "BUG: XNameAccess not available";
- cout << endl;
-}
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- cout << "\n[ P ] -\tParent";
- else
- cout << "BUG: Parent not available (no XChild)";
- cout << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-bool ask(Reference< XInterface >& xIface, Reference<XMultiServiceFactory> &);
-
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
- using com::sun::star::uno::UNO_QUERY;
- do
- {
- cout << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- write(xAccess);
- write(xChild);
- }
- while (ask(xIface, xMSF));
-}
-
-bool ask(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
- cout << "\n[ Q ] -> <Quit>";
- cout << "\n[ S ] -> <SetValue> ";
- cout << endl;
-
- cout << "\n:> " << flush;
- char buf[200] = {0};
- try
- {
- bool bHandled = false;
- bool bInserted = false;
-
- if (cin.getline(buf,sizeof buf))
- {
- Reference< XInterface > xNext;
- if ((buf[0] == 'q' || buf[0] == 'Q') && (0 == buf[1]))
- {
- return false;
- }
- else if (buf[0] == 0)
- {
- return true;
- }
- else if((buf[0] == 0 || buf[0] == 'o' || buf[0] == 'O') && (0 == buf[1]))
- {
-/*
- cout << "work Offline" << endl;
- Reference<com::sun::star::configuration::XConfigurationSync> xSync(xMSF, UNO_QUERY);
-
- Sequence< Any > aArgs2(5);
- sal_Int32 n=0;
- aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Setup"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Common"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Java"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Writer"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.ucb.Hierarchy"));
- xSync->offline(aArgs2);
- bHandled = true;
-*/
- }
- else if((buf[0] == 0 || buf[0] == 's' || buf[0] == 'S') && (0 == buf[1]))
- {
- // Replace a Value
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
-
- cout << "SetMode, insert a Number" << endl;
- cin.getline(buf,sizeof buf);
- bInserted = true;
- }
-
- else if ((buf[0] == 'p' || buf[0] == 'P') && (0 == buf[1]))
- {
- Reference< XChild > xChild(xIface, UNO_QUERY);
- if (xChild.is())
- xNext = xChild->getParent();
- bHandled = true;
- }
-
- if (bHandled == false)
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- unsigned int n = unsigned(atoi(buf));
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ? ( xDeepAccess.is() ? xDeepAccess->getByHierarchicalName(aName) : Any())
- : ( xAccess. is() ? xAccess-> getByName(aName) : Any() );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE: bValue = false; break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- cout << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- cout << "NULL (error!!)";
- else if (*pVal)
- cout << "'TRUE'";
- else
- cout << "'FALSE'";
-
- cout << endl;
- }
- break;
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- cout << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- cout << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- cout << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << double(aValue);
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_DOUBLE:
- {
- double aValue;
- cout << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_STRING:
- {
- OUString aValue;
- cout << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- cout << "\"" << aValue << "\"";
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_SEQUENCE:
- {
- cout << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- cout << "Real type is Sequence<" << sType << ">" << endl;
- bValueOk = true;
- }
- break;
- case TypeClass_VOID:
- cout << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- cout << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
- if (bValue)
- {
- if (bInserted)
- {
- if (aElement.getValueTypeClass() == TypeClass_BOOLEAN ||
- aElement.getValueTypeClass() == TypeClass_VOID)
- {
- cout << "Set Value (Type=BOOL) to :";
- cout.flush();
- cin.getline(buf,sizeof buf);
- OUString aInput = OUString::createFromAscii(buf);
- sal_Bool bValue = false;
- if (aInput.equalsIgnoreAsciiCase(ASCII("true")))
- bValue = true;
-
- OUString aStr = ASCII("false");
- Any aValueAny;
- aValueAny <<= bValue;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValueAny);
- commit();
- }
- bInserted = false;
- }
- else if (aElement.getValueTypeClass() == TypeClass_STRING)
- {
- cout << "set value (type = string) to : ";
- cout.flush();
- cin.getline(buf,sizeof buf);
- Any aValue;
- aValue <<= buf;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValue);
- commit();
- }
- bInserted = false;
- }
- else
- {
- cout << "Sorry, only BOOLEAN Values can changed today." << endl;
- }
- }
- prompt_and_wait();
- return bValueOk ? true : false;
- }
-
- if (aElement >>= xNext)
- cout << "Got an Interface for '" << aName << "'" << endl;
- else
- cout << "Error: Cannot get an Interface for '" << aName << "'" << endl;
- }
- else
- {
- cout << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
-
- }
- if (xNext.is())
- {
- xIface = xNext;
- return true;
- }
- cout << "Error: could not obtain the requested Object " << endl;
- }
- else
- {
- cout << "Input Error " << endl;
- return true;
- }
- }
- catch (Exception& e)
- {
- cout << "An Exception occurred: " << e.Message << endl;
-
- }
- catch (...)
- {
- cout << "An UNKNOWN Exception occurred !" << endl;
- }
-
- prompt_and_wait();
- return true;
-}
diff --git a/configmgr/workben/apitest/cfgapi_timetest.cxx b/configmgr/workben/apitest/cfgapi_timetest.cxx
deleted file mode 100644
index 2d295991a754..000000000000
--- a/configmgr/workben/apitest/cfgapi_timetest.cxx
+++ /dev/null
@@ -1,957 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <vector>
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-bool m_bInteractive = false;
-
-#define COUT if(m_bInteractive) cout
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- COUT << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-
-// -----------------------------------------------------------------------------
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- if (m_bInteractive)
- {
- COUT << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-static const sal_Char* s_pSourcePath = "f:/office60_623/share/config/registry";
-static const sal_Char* s_pUpdatePath = "f:/office60_623/user/config/registry";
-static const sal_Char* s_pRootNode = "org.openoffice.Office.Common";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-
-std::vector<rtl::OString> m_sNodes;
-
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sSystem;
- if (osl_File_E_None == osl_getSystemPathFromFileURL(sExecutable.pData, &sSystem.pData))
- {
- ::osl::Profile aProfile(sExecutable);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
-
- static ::rtl::OString sNodeSection("nodes");
- static ::rtl::OString sCount("count");
- rtl::OUString sCountValue;
- sCountValue <<= aProfile.readString(sNodeSection, sCount, "0");
- sal_Int32 nCount = sCountValue.toInt32();
- for (sal_Int32 i=0;i<nCount;i++)
- {
- ::rtl::OString sNodeName("node");
- sNodeName += OString::valueOf(i);
- ::rtl::OString sNode = aProfile.readString(sNodeSection, sNodeName, "");
- m_sNodes.push_back(sNode);
- }
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- COUT << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- COUT << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- COUT << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- COUT << ch;
- }
- else
- {
- COUT << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- COUT << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- COUT << _aStr;
- cout.flush();
-
- OUString sValue;
- if (m_bInteractive)
- {
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- }
- else
- {
- sValue <<= _aDefault;
- }
- return sValue;
-}
-
-
-
-void ask_for_a_node_and_test_it(const Reference< XMultiServiceFactory > &xCfgProvider,
- const OUString& sUser, const OUString &sPasswd,
- const OUString& sPath, bool bLocal, const OUString &sLocale);
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // COUT << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // COUT << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // COUT << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // COUT << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- loadDefaults();
-
- m_bInteractive = false;
- //if (argc > 1)
- //{
- // OString aParam(argv[1]);
- // if (aParam.equals("ask"))
- // {
- // m_bInteractive = true;
- // }
- //}
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- COUT << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- OUString sServerType = enterValue("servertype: ", s_pServerType, false);
- COUT << endl;
-
-
- rtl::OUString sUser, sPasswd;
-
- bool bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- COUT << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- COUT << endl;
-
- sPasswd = enterValue("password: ", s_pPassword, true);
- COUT << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- long nTimeout = 10000;
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), nTimeout);
-
- long nPort = 9205;
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("port"), nPort);
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = enterValue("share path: ", s_pSourcePath, false);
- COUT << endl;
- sUserPath = enterValue("user path : ", s_pUpdatePath, false);
- COUT << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- Any* pAny;
- pAny = &aCPArgs[aCPArgs.getLength() - 1];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- cout << "---------------------------------------------------------------\n Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- OUString sPath;
- sPath <<= s_pRootNode;
- OUString sLocale;
- sLocale <<= s_pLocale;
-
- if (m_bInteractive)
- {
- sPath = enterValue("nodepath: ", s_pRootNode, false);
- COUT << endl;
- if (bLocal)
- {
- sLocale = enterValue("locale : ", s_pLocale, false);
- COUT << endl;
- }
- ask_for_a_node_and_test_it(xCfgProvider, sUser, sPasswd, sPath, bLocal, sLocale);
- }
- else
- {
- sUser <<= "";
- for(std::vector<OString>::const_iterator it = m_sNodes.begin();
- it != m_sNodes.end();
- ++it)
- {
- OUString sPath;
- sPath <<= *it;
- if (sPath.getLength() > 0)
- ask_for_a_node_and_test_it(xCfgProvider, sUser, sPasswd, sPath, bLocal, sLocale);
- }
- }
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- return 1;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-void ask_for_a_node_and_test_it(const Reference< XMultiServiceFactory > &xCfgProvider,
- const OUString& sUser, const OUString &sPasswd,
- const OUString& sPath, bool bLocal, const OUString &sLocale)
-{
- try
- {
- Sequence< Any > aArgs;
- aArgs = createSequence(sUser, sPasswd);
-
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- if (!bLocal)
- {
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-
- Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
- cout << "Configuration Read/Write Access created for :" << sPath << endl;
-
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
- showSequence(aSeq);
-
- test_read_access(xIFace, xCfgProvider);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- {
- COUT << "Accessing Node: " << xAccessName->getHierarchicalName() << endl;
- }
- else
- {
- cerr << "BUG: XHierarchicalName not available" << endl;
- }
-}
-// -----------------------------------------------------------------------------
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- {
- COUT << "Node is named: " << xAccess->getName() << endl;
- }
- else
- cerr << "BUG: XNamed not available" << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- COUT << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- {
- COUT << "\n[" << i << "] -\t" << aNames[i];
- }
- COUT << endl;
- }
- else
- cerr << "BUG: XNameAccess not available" << endl;
-}
-// -----------------------------------------------------------------------------
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- {
- COUT << "\n[ P ] -\tParent" << endl;
- }
- else
- cerr << "BUG: Parent not available (no XChild)" << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-bool ask(Reference< XInterface >& xIface, const Reference<XMultiServiceFactory> &);
-
-void test_read_access(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF)
-{
- using com::sun::star::uno::UNO_QUERY;
- do
- {
- COUT << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- write(xAccess);
- write(xChild);
-
- if (!m_bInteractive) break;
- }
- while (ask(xIface, xMSF));
-}
-
-bool ask(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF)
-{
- COUT << "\n[ Q ] -> <Quit>";
- COUT << "\n[ S ] -> <SetValue> ";
- COUT << endl;
-
- COUT << "\n:> " << flush;
- char buf[200] = {0};
- try
- {
- bool bHandled = false;
- bool bInserted = false;
-
- if (cin.getline(buf,sizeof buf))
- {
- Reference< XInterface > xNext;
- if ((buf[0] == 'q' || buf[0] == 'Q') && (0 == buf[1]))
- {
- return false;
- }
- else if (buf[0] == 0)
- {
- return true;
- }
- else if((buf[0] == 0 || buf[0] == 'o' || buf[0] == 'O') && (0 == buf[1]))
- {
-/*
- COUT << "work Offline" << endl;
- Reference<com::sun::star::configuration::XConfigurationSync> xSync(xMSF, UNO_QUERY);
-
- Sequence< Any > aArgs2(5);
- sal_Int32 n=0;
- aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Setup"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Common"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Java"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Writer"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.ucb.Hierarchy"));
- xSync->offline(aArgs2);
- bHandled = true;
-*/
- }
- else if((buf[0] == 0 || buf[0] == 's' || buf[0] == 'S') && (0 == buf[1]))
- {
- // Replace a Value
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
-
- COUT << "SetMode, insert a Number" << endl;
- cin.getline(buf,sizeof buf);
- bInserted = true;
- }
-
- else if ((buf[0] == 'p' || buf[0] == 'P') && (0 == buf[1]))
- {
- Reference< XChild > xChild(xIface, UNO_QUERY);
- if (xChild.is())
- xNext = xChild->getParent();
- bHandled = true;
- }
-
- if (bHandled == false)
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- unsigned int n = unsigned(atoi(buf));
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ? ( xDeepAccess.is() ? xDeepAccess->getByHierarchicalName(aName) : Any())
- : ( xAccess. is() ? xAccess-> getByName(aName) : Any() );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE: bValue = false; break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- COUT << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- {
- COUT << "NULL (error!!)";
- }
- else if (*pVal)
- {
- COUT << "'TRUE'";
- }
- else
- {
- COUT << "'FALSE'";
- }
- COUT << endl;
- }
- break;
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- COUT << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- COUT << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- COUT << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << double(aValue);
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_DOUBLE:
- {
- double aValue;
- COUT << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_STRING:
- {
- OUString aValue;
- COUT << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << "\"" << aValue << "\"";
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_SEQUENCE:
- {
- COUT << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- COUT << "Real type is Sequence<" << sType << ">" << endl;
- bValueOk = true;
- }
- break;
- case TypeClass_VOID:
- COUT << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- cerr << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
- if (bValue)
- {
- if (bInserted)
- {
- if (aElement.getValueTypeClass() == TypeClass_BOOLEAN ||
- aElement.getValueTypeClass() == TypeClass_VOID)
- {
- COUT << "Set Value (Type=BOOL) to :";
- cout.flush();
- cin.getline(buf,sizeof buf);
- OUString aInput = OUString::createFromAscii(buf);
- sal_Bool bValue = false;
-
- Any aValueAny;
- if (aInput.equalsIgnoreAsciiCase(ASCII("true")))
- {
- bValue = true;
- aValueAny <<= bValue;
- }
- else if (aInput.equalsIgnoreAsciiCase(ASCII("false")))
- {
- bValue = false;
- aValueAny <<= bValue;
- }
- else if (aInput.equalsIgnoreAsciiCase(ASCII("null")))
- {
- }
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValueAny);
- commit();
- }
- bInserted = false;
- }
- else if (aElement.getValueTypeClass() == TypeClass_STRING)
- {
- COUT << "set value (type = string) to : ";
- cout.flush();
- cin.getline(buf,sizeof buf);
- Any aValue;
- aValue <<= buf;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValue);
- commit();
- }
- bInserted = false;
- }
- else
- {
- cerr << "Sorry, only BOOLEAN Values can changed today." << endl;
- }
- }
- prompt_and_wait();
- return bValueOk ? true : false;
- }
-
- if (aElement >>= xNext)
- {
- COUT << "Got an Interface for '" << aName << "'" << endl;
- }
- else
- cerr << "Error: Cannot get an Interface for '" << aName << "'" << endl;
- }
- else
- {
- cerr << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
-
- }
- if (xNext.is())
- {
- xIface = xNext;
- return true;
- }
- cerr << "Error: could not obtain the requested Object " << endl;
- }
- else
- {
- COUT << "Input Error " << endl;
- return true;
- }
- }
- catch (Exception& e)
- {
- cerr << "An Exception occurred: " << e.Message << endl;
-
- }
- catch (...)
- {
- cerr << "An UNKNOWN Exception occurred !" << endl;
- }
-
- prompt_and_wait();
- return true;
-}
diff --git a/configmgr/workben/apitest/cfgregistry.cxx b/configmgr/workben/apitest/cfgregistry.cxx
deleted file mode 100644
index e2a81bbfb9f2..000000000000
--- a/configmgr/workben/apitest/cfgregistry.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <memory.h>
-#include <stdio.h>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _CPPUHELPER_EXTRACT_HXX_
-#include <cppuhelper/extract.hxx>
-#endif
-#include <vos/conditn.hxx>
-#include <osl/diagnose.h>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::registry;
-using namespace ::vos;
-using namespace ::cppu;
-//using namespace ::configmgr;
-
-//=============================================================================
-//= a dirty littly class for printing ascii characters
-//=============================================================================
-class OAsciiOutput
-{
-protected:
- sal_Char* m_pCharacters;
-
-public:
- OAsciiOutput(const ::rtl::OUString& _rUnicodeChars);
- ~OAsciiOutput() { delete m_pCharacters; }
-
- const sal_Char* getCharacters() const { return m_pCharacters; }
-};
-
-//-----------------------------------------------------------------------------
-OAsciiOutput::OAsciiOutput(const ::rtl::OUString& _rUnicodeChars)
-{
- sal_Int32 nLen = _rUnicodeChars.getLength();
- m_pCharacters = new sal_Char[nLen + 1];
- sal_Char* pFillPtr = m_pCharacters;
- const sal_Unicode* pSourcePtr = _rUnicodeChars.getStr();
-#if OSL_DEBUG_LEVEL > 1
- sal_Bool bAsserted = sal_False;
-#endif
- for (sal_Int32 i=0; i<nLen; ++i, ++pFillPtr, ++pSourcePtr)
- {
- OSL_ENSURE(bAsserted || !(bAsserted = (*pSourcePtr >= 0x80)),
- "OAsciiOutput::OAsciiOutput : non-ascii character found !");
- *pFillPtr = *reinterpret_cast<const sal_Char*>(pSourcePtr);
- }
- *pFillPtr = 0;
-}
-
-#define ASCII_STRING(rtlOUString) OAsciiOutput(rtlOUString).getCharacters()
-#define UNI_STRING(asciiString) ::rtl::OUString::createFromAscii(asciiString)
-
-//=============================================================================
-//=============================================================================
-
-#if (defined UNX) || (defined OS2)
-void main( int argc, char * argv[] )
-#else
-void _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- ::rtl::OUString::createFromAscii("l:\\bin.a\\applicat.rdb"),
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- fprintf(stdout, "could not create the service factory !\n\n");
- return;
- }
-
- try
- {
- Reference< XSimpleRegistry > xConfigurationRegistry;
- printf("instantiating the configuration registry access\n\r");
- xConfigurationRegistry = xConfigurationRegistry.query(
- xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationRegistry"))
- );
-
- const sal_Char* pLayoutNode = "com.sun.star.Inet";
- printf("opening the registry access to %s\n\r", pLayoutNode);
- xConfigurationRegistry->open(UNI_STRING(pLayoutNode), sal_False, sal_False);
-
- printf("retrieving the root key, enumerating elements\n\r");
- Reference< XRegistryKey > xRoot = xConfigurationRegistry->getRootKey();
- Sequence< ::rtl::OUString > aKeyNames = xRoot->getKeyNames();
- const ::rtl::OUString* pKeyNames = aKeyNames.getConstArray();
- for (sal_Int32 i=0; i<aKeyNames.getLength(); ++i, ++pKeyNames)
- printf("\t%i\t%s\n\r", i, ASCII_STRING(*pKeyNames));
-
- const sal_Char* pUpdateKey = "Proxy/NoProxy";
- printf("retrieving the key for %s\n\r", pUpdateKey);
- Reference< XRegistryKey > xTabStopsKey = xRoot->openKey(UNI_STRING(pUpdateKey));
-
-/* xTabStopsKey->createKey(UNI_STRING("blupp"));
-
- Sequence< ::rtl::OUString > sLanguages = xTabStopsKey->getStringListValue();
- sLanguages.realloc(sLanguages.getLength() + 1);
- sLanguages[sLanguages.getLength() - 1] = UNI_STRING("ru");
- xTabStopsKey->setStringListValue(sLanguages);
-*/
-
- ::rtl::OUString sTest = xTabStopsKey->getStringValue();
- xTabStopsKey->setStringValue(UNI_STRING("blimp"));
-
- printf("flushing the changes\n\r");
- Reference< XFlushable > xCommit(xConfigurationRegistry, UNO_QUERY);
- xCommit->flush();
- }
- catch(RuntimeException& e)
- {
- printf("\n\r\n\rcaught an RuntimeException :\n\r");
- printf(" exception message : %s\n\r", ASCII_STRING(e.Message));
- return;
- }
- catch(Exception& e)
- {
- printf("\n\r\n\rcaught an Exception :\n\r");
- printf(" exception message : %s\n\r", ASCII_STRING(e.Message));
- return;
- }
-}
diff --git a/configmgr/workben/apitest/cfgupdate.cxx b/configmgr/workben/apitest/cfgupdate.cxx
deleted file mode 100644
index e76789ca10a7..000000000000
--- a/configmgr/workben/apitest/cfgupdate.cxx
+++ /dev/null
@@ -1,432 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <osl/time.h>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
- OString aTxt = input(_aDefault, _bIsAPassword ? '*' : 0);
-
- OUString sValue = OUString::createFromAscii(aTxt);
- return sValue;
-}
-
-// -----------------------------------------------------------------------------
-Reference< XNameAccess > beginChanges(Reference< XMultiServiceFactory > xFactory, OUString sPath)
-{
- Sequence< Any > aArgs(1);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("nodepath"),sPath);
-
- cout << "starting update for node:" << sPath << endl;
-
- Reference< XNameAccess > xTree(xFactory->createInstanceWithArguments(OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs), UNO_QUERY);
-
- return xTree;
-}
-
-template <class Type>
-// -----------------------------------------------------------------------------
-void update(Reference< XInterface > xIFace, OUString sRelPath, Type sValue)
-{
- Reference< XHierarchicalPropertySet > xTree(xIFace, UNO_QUERY);
- Any aValue;
- aValue <<= sValue;
-
- cout << "updating node:" << sRelPath << endl;
- xTree->setHierarchicalPropertyValue(sRelPath, aValue);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XHierarchicalPropertySet > insertTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to insert: ", "", false);
-
- Reference< XSingleServiceFactory > xFactory(xIFace, UNO_QUERY);
- Reference< XHierarchicalPropertySet > xNewElement(xFactory->createInstance(), UNO_QUERY);
-
- cout << "inserting new tree element:" << aName << endl;
-
- Any aTree;
- aTree <<= xNewElement;
- Reference< XNameContainer >(xFactory, UNO_QUERY)->insertByName(aName, aTree);
-
- return xNewElement;
-}
-
-// -----------------------------------------------------------------------------
-void removeTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to remove: ", "", false);
-
- cout << "removing new tree element:" << aName << endl;
-
- Reference< XNameContainer >(xIFace, UNO_QUERY)->removeByName(aName);
-}
-
-// -----------------------------------------------------------------------------
-void commitChanges(Reference< XInterface > xIFace)
-{
- cout << "committing changes:" << endl;
-
- Reference< XChangesBatch > xChangesBatch(xIFace, UNO_QUERY);
- xChangesBatch->commitChanges();
-}
-
-// -----------------------------------------------------------------------------
-void displayTree(Reference< XNameAccess > xIFace, sal_Int32 nLevel)
-{
- const char* pTab = " ";
- Sequence<OUString> aNames( xIFace->getElementNames() );
- for (int i = 0; i < aNames.getLength(); ++i)
- {
- Any aElement = xIFace->getByName(aNames[i]);
- Reference< XNameAccess > xAccess;
- Reference< XSingleServiceFactory > xFactory;
- aElement >>= xFactory;
- aElement >>= xAccess;
-
- cout << endl;
- for (int j = 0; j < nLevel; j++)
- cout << " ";
-
- if (xAccess.is())
- {
- OUString sType;
- if (xFactory.is())
- sType = OUString::createFromAscii(" type = 'set' " );
-
- cout << "<" << aNames[i] << sType << ">";
- displayTree(xAccess, nLevel + 1);
- cout << endl << "</" << aNames[i] << ">";
- }
- else
- cout << "<" << aNames[i] << "/>";
-
- }
- ::flush(cout);
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- /*OUString sServerType = enterValue("Enter Servertype: ", "remote", false);
- cout << endl;*/
-
-
- rtl::OUString sFilePath;
- rtl::OUString sPort;
- rtl::OUString sUser;
-
- sUser = enterValue("Enter User: ", "user1", false);
- cout << endl;
-
- OUString sPasswd;// = enterValue("Enter Password: ", "", true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- Reference< XNameAccess > xUpdateAccess;
-
-// now do updates for the user
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security"));
- displayTree(xUpdateAccess, 0);
-
- update(xUpdateAccess, OUString::createFromAscii("_3D_Engine/Dithering"), sal_Bool(sal_False));
-
-/* xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Inet"));
-
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Port"), sal_Int32(11));
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Name"), OUString::createFromAscii("Test3"));
- update(xUpdateAccess, OUString::createFromAscii("DNS/IP_Address"), OUString::createFromAscii("Test4"));
-*/
- commitChanges(xUpdateAccess);
-
-// now do updates with inserting and removing of nodes
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security/MountPoints"));
- displayTree(xUpdateAccess, 0);
-
- Reference< XHierarchicalPropertySet > xTree = insertTree(xUpdateAccess, OUString());
- update(xUpdateAccess, OUString::createFromAscii("InstallationDirectory/Directory"), OUString::createFromAscii("Test1"));
- removeTree(xUpdateAccess, OUString());
- commitChanges(xUpdateAccess);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-/*
- catch (...)
- {
- ::flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
diff --git a/configmgr/workben/apitest/makefile.mk b/configmgr/workben/apitest/makefile.mk
deleted file mode 100644
index fb14df415c23..000000000000
--- a/configmgr/workben/apitest/makefile.mk
+++ /dev/null
@@ -1,124 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=cfgapi
-TARGET2=cfgreg
-TARGET3=cfgadduser
-TARGET4=cfgadmin
-TARGET5=cfgupdate
-TARGET6=cfgapi_timetest
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB)
-
-# ... cfgapi ..............................
-APP1STDLIBS = $(APPSTDLIBS)
-
-APP1STDLIBS+=$(STDLIBCPP)
-
-APP1TARGET= $(TARGET)
-APP1OBJS= \
- $(SLO)$/cfgapi.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgapi_timetest ..............................
-APP6STDLIBS = $(APPSTDLIBS)
-
-APP6STDLIBS+=$(STDLIBCPP)
-
-APP6TARGET= $(TARGET6)
-APP6OBJS= \
- $(SLO)$/cfgapi_timetest.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgreg ..............................
-APP2STDLIBS = $(APPSTDLIBS)
-
-APP2STDLIBS+=$(STDLIBCPP)
-
-APP2TARGET= $(TARGET2)
-APP2OBJS= \
- $(SLO)$/cfgregistry.obj \
-
-# ... cfgadduser ..............................
-APP3STDLIBS = $(APPSTDLIBS)
-
-APP3STDLIBS+=$(STDLIBCPP)
-
-APP3TARGET= $(TARGET3)
-APP3OBJS= \
- $(SLO)$/cfgadduser.obj \
-
-# ... cfgadmin ..............................
-APP4STDLIBS = $(APPSTDLIBS)
-
-APP4STDLIBS+=$(STDLIBCPP)
-
-APP4TARGET= $(TARGET4)
-APP4OBJS= \
- $(SLO)$/cfgadmin.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgupdate ..............................
-APP5STDLIBS = $(APPSTDLIBS)
-
-APP5STDLIBS+=$(STDLIBCPP)
-
-APP5TARGET= $(TARGET5)
-APP5OBJS= \
- $(SLO)$/cfgupdate.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/apitest/sregistry b/configmgr/workben/apitest/sregistry
deleted file mode 100644
index f4f353181f25..000000000000
--- a/configmgr/workben/apitest/sregistry
+++ /dev/null
@@ -1,8 +0,0 @@
-[configuration]
-servertype=remote
-[RemoteRegistry]
-Server=munch-11072:100
-Timeout=2500
-[LocalRegistry]
-rootpath="G:\Configuration"
-
diff --git a/configmgr/workben/local_io/cfgfile.cxx b/configmgr/workben/local_io/cfgfile.cxx
deleted file mode 100644
index a91cc512aa62..000000000000
--- a/configmgr/workben/local_io/cfgfile.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ main ------------------------------------
-// -----------------------------------------------------------------------------
-
-/*
- OUString operator+(const OUString &a, const OUString &b)
- {
- OUString c = a;
- c += b;
- return c;
- }
-*/
-
-namespace configmgr
-{
- void simpleMappingTest();
-
- void importTest();
- void exportTest();
-
- void hierarchyTest();
- //void simpleTest();
- void speedTest();
- void stringTest();
- void classTest();
- void hash_test();
- void testRefs();
- void ConfigName();
-
- void oslTest();
-}
-
-
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
- int _cdecl main( int argc, char * argv[] )
-#endif
-{
-
-// configmgr::hierarchyTest();
-
-
-// configmgr::importTest();
-// configmgr::exportTest();
-// configmgr::speedTest();
-// configmgr::simpleTest();
-
-// configmgr::simpleMappingTest();
-// configmgr::stringTest();
-// configmgr::classTest();
-
-// configmgr::hash_test();
-
- // configmgr::testRefs();
- // configmgr::ConfigName();
-
- configmgr::oslTest();
- return 0;
-}
-
-
diff --git a/configmgr/workben/local_io/cfglocal.cxx b/configmgr/workben/local_io/cfglocal.cxx
deleted file mode 100644
index 10530b0ba48d..000000000000
--- a/configmgr/workben/local_io/cfglocal.cxx
+++ /dev/null
@@ -1,620 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <memory.h>
-#include <string.h>
-#include <stdio.h>
-#include <vos/socket.hxx>
-#include "attributes.hxx"
-
-#ifndef _CONFIGMGR_SESSION_REMOTESESSION_HXX_
-#include "remotesession.hxx"
-#endif
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <vos/conditn.hxx>
-
-#include <osl/time.h>
-
-#include "localsession.hxx"
-#include "confname.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::xml;
-using namespace ::vos;
-using namespace ::cppu;
-using namespace ::configmgr;
-using namespace rtl;
-
-// #define USE_LAYOUT_NODE
-
-//=============================================================================
-//= a dirty littly class for printing ascii characters
-//=============================================================================
-class OAsciiOutput
-{
-protected:
- sal_Char* m_pCharacters;
-
-public:
- OAsciiOutput(const ::rtl::OUString& _rUnicodeChars);
- ~OAsciiOutput() { delete m_pCharacters; }
-
- const sal_Char* getCharacters() const { return m_pCharacters; }
-};
-
-//-----------------------------------------------------------------------------
-OAsciiOutput::OAsciiOutput(const ::rtl::OUString& _rUnicodeChars)
-{
- sal_Int32 nLen = _rUnicodeChars.getLength();
- m_pCharacters = new sal_Char[nLen + 1];
- sal_Char* pFillPtr = m_pCharacters;
- const sal_Unicode* pSourcePtr = _rUnicodeChars.getStr();
-#ifdef DBG_UTIL
- sal_Bool bAsserted = sal_False;
-#endif
- for (sal_Int32 i=0; i<nLen; ++i, ++pFillPtr, ++pSourcePtr)
- {
- OSL_ENSURE(bAsserted || !(bAsserted = (*pSourcePtr >= 0x80)),
- "OAsciiOutput::OAsciiOutput : non-ascii character found !");
- *pFillPtr = *reinterpret_cast<const sal_Char*>(pSourcePtr);
- }
- *pFillPtr = 0;
-}
-
-#define ASCII_STRING(rtlOUString) OAsciiOutput(rtlOUString).getCharacters()
-#define UNI_STRING(salCharPtr) ::rtl::OUString::createFromAscii(salCharPtr)
-
-//=============================================================================
-//= OOpenNodeCallback
-//=============================================================================
-typedef ::cppu::WeakImplHelper1< sax::XDocumentHandler > OOpenNodeCallback_Base;
-class OOpenNodeCallback : public IOpenObjectCallback, public OOpenNodeCallback_Base
-{
-protected:
- OUString m_sNodeId;
- ::vos::OCondition& m_rFinishCondition;
-
- enum ACTION { STARTELEMENT, CHARACTERS, ENDELEMENT };
- ACTION m_eLastAction;
- sal_Int32 m_nLevel;
- sal_Bool m_bCloseStartTag;
-
-protected:
- ~OOpenNodeCallback()
- {
- }
-
-public:
- OOpenNodeCallback(::vos::OCondition& _rFinishCond) : m_rFinishCondition(_rFinishCond), m_nLevel(0), m_eLastAction(ENDELEMENT), m_bCloseStartTag(sal_False) { }
-
- OUString getNodeId() const { return m_sNodeId; }
-
- // IOpenObjectCallback
- virtual void gotObjectId(const OUString &aName);
-
- // IDataRequestCallback
- virtual Reference< sax::XDocumentHandler > getDataReader() { return static_cast< sax::XDocumentHandler* >(this); }
-
- // IRequestCallback
- virtual void acknowledged(sal_Int32 _nTransId);
- virtual void failed(sal_Int32 _nErrorCode);
- virtual void done(const StatusInfo& _rStatus);
-
- // IInterface
- virtual void SAL_CALL acquire( ) throw (::com::sun::star::uno::RuntimeException) { OOpenNodeCallback_Base::acquire(); }
- virtual void SAL_CALL release( ) throw (::com::sun::star::uno::RuntimeException) { OOpenNodeCallback_Base::release(); }
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument( ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL endDocument( ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const Reference< sax::XAttributeList >& xAttribs ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL setDocumentLocator( const Reference< sax::XLocator >& xLocator ) throw(sax::SAXException, RuntimeException) { }
-};
-
-//.............................................................................
-inline void linefeed()
-{
- // printf("\n");
-}
-
-//.............................................................................
-void printTabs(sal_Int32 _nCount)
-{
- sal_Char* pBuffer = new sal_Char[2 * _nCount + 1];
- memset(pBuffer, ' ', 2 * _nCount);
- pBuffer[2 * _nCount] = 0;
- // printf(pBuffer);
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::startElement( const ::rtl::OUString& _rName, const Reference< sax::XAttributeList >& xAttribs ) throw(sax::SAXException, RuntimeException)
-{
- switch (m_eLastAction)
- {
- case STARTELEMENT:
- if (m_bCloseStartTag)
- {
- // printf(">");
- }
-
- m_bCloseStartTag = sal_False;
- // no break
- case CHARACTERS:
- case ENDELEMENT:
- linefeed();
- printTabs(m_nLevel);
- break;
- }
- m_eLastAction = STARTELEMENT;
- ++m_nLevel;
- // printf("<%s", ASCII_STRING(_rName));
- m_bCloseStartTag = sal_True;
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::endElement( const ::rtl::OUString& _rName ) throw(sax::SAXException, RuntimeException)
-{
- --m_nLevel;
- switch (m_eLastAction)
- {
- case STARTELEMENT:
- if (m_bCloseStartTag)
- {
- // printf("/>");
- }
-
- m_bCloseStartTag = sal_False;
- break;
- case ENDELEMENT:
- linefeed();
- printTabs(m_nLevel);
- // dont break
- case CHARACTERS:
- // printf("</%s>", ASCII_STRING(_rName));
- break;
- }
- m_eLastAction = ENDELEMENT;
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::characters( const ::rtl::OUString& _rChars ) throw(sax::SAXException, RuntimeException)
-{
- if (STARTELEMENT == m_eLastAction)
- {
- if (m_bCloseStartTag && _rChars.trim().getLength())
- {
- // printf(">");
- m_bCloseStartTag = sal_False;
- }
- }
- if (_rChars.trim().getLength() != 0)
- {
- // printf("%s", ASCII_STRING(_rChars));
- m_eLastAction = CHARACTERS;
- }
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::gotObjectId(const OUString &_nId)
-{
- m_sNodeId = _nId;
- // printf("object id %i\n", m_nNodeId);
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::acknowledged(sal_Int32 _nTransId)
-{
- // printf("acknowledged, transaction id : %i\n", _nTransId);
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::failed(sal_Int32 _nErrorCode)
-{
- // printf("failed because of a connection error (%i)\n", _nErrorCode);
- m_rFinishCondition.set();
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::done(const StatusInfo& _rStatus)
-{
- if (_rStatus.nCode)
- {
- printf("\n\ndone, but had an error : %s\n", ASCII_STRING(_rStatus.sMessage));
- }
- else
- {
- // printf("\n\nsuccessfully done\n", ASCII_STRING(_rStatus.sMessage));
- }
-
- m_rFinishCondition.set();
-}
-
-//=============================================================================
-//= ONodeUpdater
-//=============================================================================
-class ONodeUpdater : public IDOMNodeDataProvider
-{
- sal_Bool m_bWriterLevel;
- sal_Bool m_bAdd;
-public:
- ONodeUpdater(sal_Bool _bStartAtWriterLevel, sal_Bool bAdd) : m_bWriterLevel(_bStartAtWriterLevel), m_bAdd(bAdd) { }
-
- virtual void writeNodeData(const Reference< sax::XDocumentHandler >& _rHandler);
-};
-
-//-----------------------------------------------------------------------------
-void ONodeUpdater::writeNodeData(const Reference< sax::XDocumentHandler >& _rHandler)
-{
- AttributeListImpl *pAttr = new AttributeListImpl;
- Reference< sax::XAttributeList > xEmptyAttrList = pAttr;
-
- pAttr = new AttributeListImpl;
- pAttr->addAttribute(UNI_STRING("type"),UNI_STRING("CDATA"),UNI_STRING("string"));
- Reference< sax::XAttributeList > xStringAttrList = pAttr;
-
- if (m_bWriterLevel)
- _rHandler->startElement(UNI_STRING("Writer"), xEmptyAttrList);
-#ifdef USE_LAYOUT_NODE
- _rHandler->startElement(UNI_STRING("Layout"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("TabStops"), xEmptyAttrList);
- if (m_bAdd)
- _rHandler->characters(UNI_STRING("0.90"));
- else
- _rHandler->characters(UNI_STRING("99.99"));
-
- _rHandler->endElement(UNI_STRING("TabStops"));
- _rHandler->endElement(UNI_STRING("Layout"));
-#else
- // _rHandler->startElement(UNI_STRING("com.sun.star.office.Setup"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("Modules"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("StandFonts"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("Standard"), xStringAttrList);
- _rHandler->startElement(UNI_STRING("value"), xEmptyAttrList);
- if (m_bAdd)
- _rHandler->characters(UNI_STRING("Arial"));
- else
- _rHandler->characters(UNI_STRING("Courier"));
-
- _rHandler->endElement(UNI_STRING("value"));
- _rHandler->endElement(UNI_STRING("Standard"));
- _rHandler->endElement(UNI_STRING("StandFonts"));
- _rHandler->endElement(UNI_STRING("Modules"));
- // _rHandler->endElement(UNI_STRING("com.sun.star.office.Setup"));
-
- _rHandler->ignorableWhitespace(OUString());
-#endif
- if (m_bWriterLevel)
- _rHandler->endElement(UNI_STRING("Writer"));
-}
-
-//=============================================================================
-//= OSessionListener
-//=============================================================================
-class OSessionListener : public ISessionListener
-{
-protected:
- oslInterlockedCount m_refCount;
-
-public:
- // ISessionListener
- virtual void nodeUpdated(const ::rtl::OUString& _rNodePath);
- virtual void nodeDeleted(const ::rtl::OUString& _rNodePath);
- virtual void nodeAdded(const ::rtl::OUString& _rNodePath);
-
- // IInterface
- virtual void SAL_CALL acquire( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL release( ) throw (::com::sun::star::uno::RuntimeException);
-};
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeUpdated(const ::rtl::OUString& _rNodePath)
-{
- // printf("[listener] : a node was updated, node path : %s\n", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeDeleted(const ::rtl::OUString& _rNodePath)
-{
- // printf("[listener] : a node was deleted, node path : %s\n", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeAdded(const ::rtl::OUString& _rNodePath)
-{
- // printf("\n[listener] : a node was added, node path : %s", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OSessionListener::acquire( ) throw (::com::sun::star::uno::RuntimeException)
-{
- osl_incrementInterlockedCount(&m_refCount);
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OSessionListener::release( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if (!osl_decrementInterlockedCount(&m_refCount))
- delete this;
-}
-
-//=============================================================================
-//=============================================================================
-
-//=============================================================================
-static ::rtl::OUString sHost;
-static sal_Int32 nPort;
-static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
-//=============================================================================
-sal_Bool collectArgs(int argc, char * argv[])
-{
- if (argc > 1)
- {
- sal_Char* pConnectTo = argv[1];
- sal_Char* pSeparator = strchr(pConnectTo, ':');
- if (pSeparator && (0 != *(pSeparator + 1)))
- {
- sHost = ::rtl::OUString(pConnectTo, pSeparator - pConnectTo, RTL_TEXTENCODING_ASCII_US);
- nPort = ::rtl::OUString::createFromAscii(pSeparator + 1).toInt32();
-
- if (argc > 2)
- sRegistry = ::rtl::OUString::createFromAscii(argv[2]);
- return sal_True;
- }
- }
-
- printf("cfgclient - registry server client test ...\n\r\n\r");
- printf("usage :\n\r");
- printf(" cfgclient <server>:<port> [<registry file>]\n\r\n\r");
- printf(" <server> : machine to connect to\n\r");
- printf(" <port> : port to connect to\n\r");
- printf(" <registry file> : (optional) registry to bootstrap from. defaulted to \"applicat.rdb\"\n\r\n\r");
- return sal_False;
-}
-
-//=============================================================================
-
-#if (defined UNX) || (defined OS2)
-void main( int argc, char * argv[] )
-#else
-void _cdecl main( int argc, char * argv[] )
-#endif
-{
- Reference< XMultiServiceFactory > xORB;
- try
- {
- xORB = createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (Exception& e)
- {
- printf("could not bootstrap the services from %s\n\r", ASCII_STRING(sRegistry));
- printf(" (error message : %s)", ASCII_STRING(e.Message));
- }
-
- if (!xORB.is())
- {
- fprintf(stdout, "could not create the service factory !");
- return;
- }
-
- ORef< OSessionListener > xListener = new OSessionListener;
- {
-/*
- ORemoteSession aSession(xORB);
- // --------- connect ----------
- sal_Bool bSuccess = aSession.connect(sHost, nPort, &aTimeout);
- if (!bSuccess)
- {
- printf("could not connect to the server (error : %i) ...", aSession.getConnectionError());
- return;
- }
-*/
-
- void testSession(const Reference< XMultiServiceFactory > &xORB, bool bPrint);
-
- for (int i=0;i<100;i++)
- {
- TimeValue aStartTime, aEndTime;
- osl_getSystemTime(&aStartTime);
- testSession(xORB, false);
- osl_getSystemTime(&aEndTime);
-
- sal_Int32 nSeconds = aEndTime.Seconds - aStartTime.Seconds;
- sal_Int32 nNanoSec = aEndTime.Nanosec - aStartTime.Nanosec;
- if (nNanoSec < 0)
- {
- nNanoSec = 1000000000 - nNanoSec;
- nSeconds++;
- }
-
- cout << "Time: " << nSeconds << ". " << nNanoSec << endl;
- }
- }
-}
-
-void testSession(const Reference< XMultiServiceFactory > &xORB, bool bPrint)
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
-
- // create it .. and connect
- LocalSession aSession(xORB);
-
- // --------- openSession ----------
-
- OUString aRootPath = OUString::createFromAscii("f:/local/SRC598/configmgr/workben/local_io");
- // f:/local/SRC595/configmgr/workben/local_io);
- aSession.open(aRootPath);
-
- if (aSession.isOpen())
- {
- if (bPrint) printf("\nopened the session ...");
- }
- else
- {
- printf("\ncould not open the session ... exiting\n\n");
- return;
- }
-
- // aSession.setListener(xListener.getBodyPtr());
-
- OCondition aWaitForSomething;
- aWaitForSomething.reset();
-
- // --------- openNode ----------
- char* pWriterNode = "com.sun.star.Setup/Modules";
- if (bPrint) printf("\nsending an openNode request for %s ...\n", pWriterNode);
- ORef< OOpenNodeCallback > xOpenCallback = new OOpenNodeCallback(aWaitForSomething);
- aSession.openNode(UNI_STRING(pWriterNode), 2, xOpenCallback.getBodyPtr());
-
- aTimeout.Seconds = 30;
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- OUString sOpenedNode = xOpenCallback->getNodeId();
-
-// aSession.getNode(UNI_STRING("com.sun.star.Spreadsheet"), NULL);
-//
-// // --------- getNode (1) ----------
-//#ifdef USE_LAYOUT_NODE
-// char* pLayoutNode = "com.sun.star.office.Setup/Modules";
-//#else
- char* pLayoutNode = "com.sun.star.Setup/Modules";
-//#endif
-// printf("\nsending an getNode request for %s ...\n", pLayoutNode);
-// aWaitForSomething.reset();
-// aSession.getNode(UNI_STRING(pLayoutNode), new OOpenNodeCallback(aWaitForSomething));
-//
-// switch (aWaitForSomething.wait(&aTimeout))
-// {
-// case ICondition::result_error:
-// printf("error while waiting for the callback ... exiting\n\n");
-// return;
-// case ICondition::result_timeout:
-// printf("timed out ... exiting\n\n");
-// return;
-// }
-
- // --------- addNode ----------
- if (bPrint) printf("\n\naddNode ....");
- ONodeUpdater aAddTabstops(sal_False, true); // true = WRITER LEVEL
- aWaitForSomething.reset();
- aSession.addNode(sOpenedNode, UNI_STRING(pLayoutNode), &aAddTabstops, new OOpenNodeCallback(aWaitForSomething));
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- // --------- updateNode ----------
- if (bPrint) printf("\n\nokay, let's try an update ....\n");
-
- ONodeUpdater aUpdateWriter(sal_False, false);
- aWaitForSomething.reset();
- aSession.updateNode(sOpenedNode, UNI_STRING(pLayoutNode), &aUpdateWriter, new OOpenNodeCallback(aWaitForSomething));
-
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- // --------- deleteNode ----------
- char* pLayoutNode2 = "com.sun.star.Setup/Modules/StandFonts";
-
- if (bPrint) printf("\n\ndeleteNode ....");
- aWaitForSomething.reset();
- aSession.deleteNode(sOpenedNode, UNI_STRING(pLayoutNode2), new OOpenNodeCallback(aWaitForSomething));
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
-/*
- // --------- startListening ----------
- printf("\n\nadding a listener for the Layout node\n");
- Sequence< ::rtl::OUString > aNodesToListen(1);
- aNodesToListen[0] = UNI_STRING(pLayoutNode);
- aSession.startListening(aNodesToListen, NULL);
-
- printf("waiting 10 seconds ....\n\n");
- aWaitForSomething.reset();
- aTimeout.Seconds = 10;
- aWaitForSomething.wait(&aTimeout);
-*/
- // --------- getNode (2) ----------
-// printf("\ndoing a new getNode for the Layout node ...\n");
-// aWaitForSomething.reset();
-// aSession.getNode(UNI_STRING(pLayoutNode), new OOpenNodeCallback(aWaitForSomething));
-// switch (aWaitForSomething.wait(&aTimeout))
-// {
-// case ICondition::result_error:
-// printf("error while waiting for the callback ... exiting\n\n");
-// return;
-// case ICondition::result_timeout:
-// printf("timed out ... exiting\n\n");
-// return;
-// }
-
- aSession.closeNode(sOpenedNode, NULL);
- aSession.close(NULL);
-
-}
-
diff --git a/configmgr/workben/local_io/com.sun.star.office.Setup.xml b/configmgr/workben/local_io/com.sun.star.office.Setup.xml
deleted file mode 100644
index 4018ab3b8d5d..000000000000
--- a/configmgr/workben/local_io/com.sun.star.office.Setup.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<com.sun.star.office.Setup>
- <Language>
- <Language_ID Type="string"><value>1033</value></Language_ID>
- </Language>
- <Modules>
- <SCalc Type="boolean">
- <value>true</value>
- </SCalc>
- <SChart Type="boolean">
- <value>true</value>
- </SChart>
- <SDraw Type="boolean">
- <value>true</value>
- </SDraw>
- <SImage Type="boolean">
- <value>true</value>
- </SImage>
- <SImpress Type="boolean">
- <value>true</value>
- </SImpress>
- <SMath Type="boolean">
- <value>true</value>
- </SMath>
- <SWriter Type="boolean">
- <value>true</value>
- </SWriter>
- </Modules>
-</com.sun.star.office.Setup> \ No newline at end of file
diff --git a/configmgr/workben/local_io/filetest.cxx b/configmgr/workben/local_io/filetest.cxx
deleted file mode 100644
index 0a8038e3ae29..000000000000
--- a/configmgr/workben/local_io/filetest.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <iostream>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-
-using ::rtl::OUString;
-using ::osl::File;
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII(x) OUString::createFromAscii(x)
-
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ main ------------------------------------
-// -----------------------------------------------------------------------------
-
-/*
-OUString operator+(const OUString &a, const OUString &b)
-{
- OUString c = a;
- c += b;
- return c;
-}
-*/
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- OUString aPath = ASCII("f:/local/SRC598/configmgr/workben/local_io");
- OUString aFilename = ASCII("com.sun.star.office.Setup");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- sal_uInt64 nBytesRead;
- Sequence< sal_Int8 > aBufferSeq(2000);
- sal_Int8 *pBuff = aBufferSeq.getArray();
- aFile.read(pBuff, 2000, nBytesRead);
-
- aFile.close();
- return 0;
-}
diff --git a/configmgr/workben/local_io/makefile.mk b/configmgr/workben/local_io/makefile.mk
deleted file mode 100644
index 4e3e2f7d2f40..000000000000
--- a/configmgr/workben/local_io/makefile.mk
+++ /dev/null
@@ -1,110 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=cfgfile
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(UNOTOOLSLIB) \
- $(CPPUHELPERLIB) \
-
-
-# ... FileTests .....................................................
-APP1STDLIBS = $(APPSTDLIBS) \
- $(STDLIBCPP) \
-
-APP1STDLIBS+=$(STDLIBCPP)
-
-APP1TARGET= $(TARGET)
-
-APP1OBJS= \
- $(SLO)$/cfgfile.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/simpletest.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/confname.obj \
-
-# $(SLO)$/xmlexport.obj \
-# $(SLO)$/xmlimport.obj \
-
-# $(SLO)$/xmltreebuilder.obj \
-# $(SLO)$/cmtree.obj \
-# $(SLO)$/cmtreemodel.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/changes.obj \
-# $(SLO)$/xmlformater.obj \
-# $(SLO)$/attributes.obj \
-# $(SLO)$/tracer.obj \
-
-
-# ... common for all test executables ..............................
-# APP2STDLIBS = $(APPSTDLIBS)
-#
-# APP2STDLIBS+=$(STDLIBCPP)
-#
-# APP2TARGET= cfglocal
-# APP2OBJS= \
-# $(SLO)$/cfglocal.obj \
-# $(SLO)$/receivethread.obj \
-# $(SLO)$/redirector.obj \
-# $(SLO)$/socketstream.obj \
-# $(SLO)$/attributes.obj \
-# $(SLO)$/localsession.obj \
-# $(SLO)$/saxtools.obj \
-# $(SLO)$/mergeupdates.obj \
-# $(SLO)$/oslstream.obj \
-# $(SLO)$/configsession.obj \
-# $(SLO)$/confname.obj \
-# $(SLO)$/sessionstream.obj \
-# $(SLO)$/filehelper.obj \
-# $(SLO)$/tracer.obj \
-# $(SLO)$/updatedom.obj \
-# $(SLO)$/strconverter.obj \
-# $(SLO)$/strimpl.obj \
-#
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/local_io/org.openoffice.test.xml b/configmgr/workben/local_io/org.openoffice.test.xml
deleted file mode 100644
index ff8e37be411c..000000000000
--- a/configmgr/workben/local_io/org.openoffice.test.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<org.openoffice.test
-xmlns="http://openoffice.org/2000/registry/components/org.openoffice.Inet"
-xmlns:cfg="http://openoffice.org/2000/registry/instance"
-xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xml:lang="en-US">
-
-<!-- long -->
- <Long cfg:type="long">100000000000000</Long>
- <LongList cfg:type="long" cfg:derivedBy="list">1 2 3
-
- 4 5
-
-
-
-
- 6 7 8 9</LongList>
- <LongList2 cfg:type="long" cfg:derivedBy="list" cfg:separator=".">1.2.3.4.5.6.7.8.9</LongList2>
-
-<!-- double -->
- <DoubleWithDot cfg:type="double">.787564</DoubleWithDot>
- <EuroDM cfg:type="double">1.95583</EuroDM>
- <ZeroDotZeroZeroOne cfg:type="double">0.001</ZeroDotZeroZeroOne>
- <ZeroDotOne cfg:type="double">0.1</ZeroDotOne>
- <NZeroDotOne cfg:type="double">-0.1</NZeroDotOne>
-
-<!-- binary -->
- <Binary cfg:type="binary" cfg:nullable="true" xsi:null="true"/>
- <Binary2 cfg:type="binary" xsi:null="true"/>
- <Binary3 cfg:type="binary" >010203040506070809</Binary3>
- <Binary4 cfg:type="binary" cfg:nullable="true">000102030405060708090a</Binary4>
-
-<!-- Strings -->
- <NullString cfg:type="string" xsi:null="true"/>
- <String cfg:type="string">Identifier</String>
- <StringList cfg:type="string" cfg:derivedBy="list">file:/ private:explorer private:help private:newmenu private:schedule private:searchfolder private:user</StringList>
- <List cfg:type="string" cfg:derivedBy="list">NULL</List>
- <PathAutoCorrect cfg:type="string" cfg:separator=":" cfg:derivedBy="list">$(inst)/share/autocorr:$(user)/autocorr</PathAutoCorrect>
- <List2 cfg:type="string" cfg:derivedBy="list" cfg:separator="stupid" >NULLstupidFIRSTstupidSECONDstupid</List2>
- <SeparatorKiller cfg:type="string" cfg:derivedBy="list" cfg:separator="." > .,.;.:.#.|.a._.!.$.%./.(.)=.?.+.*.#.~.'.\.{.}._</SeparatorKiller>
-
-<!-- localized -->
- <LocaleString cfg:type="string" cfg:localized="true">
- <cfg:value xml:lang="en-US">This is a string</cfg:value>
- <cfg:value xml:lang="de-DE">Dies ist ein String</cfg:value>
- </LocaleString>
-
-<!-- boolean -->
- <BoolFalse cfg:type="boolean">false</BoolFalse>
- <BoolTrue cfg:type="boolean">true</BoolTrue>
- <BoolList cfg:type="boolean" cfg:derivedBy="list">true true false</BoolList>
- <BoolNULL cfg:type="boolean" xsi:null="true"/>
-
-<!-- int -->
- <Integer cfg:type="int">3</Integer>
- <IntegerNullWithXsi cfg:type="int" xsi:null="true">10</IntegerNullWithXsi>
- <IntegerNull cfg:type="int"/>
-
- <IntList cfg:type="int" cfg:derivedBy="list">1 2 3 4 5 6 7 8 224 226 222 223 5</IntList>
-
-<!-- short -->
- <Short cfg:type="short">100</Short>
-
- <Inner>
- <Inner2>
- <IntList cfg:type="int" cfg:derivedBy="list">224 226 222 223 5</IntList>
- </Inner2>
- </Inner>
-
-</org.openoffice.test>
diff --git a/configmgr/workben/local_io/simpletest.cxx b/configmgr/workben/local_io/simpletest.cxx
deleted file mode 100644
index ffe4741d7d2c..000000000000
--- a/configmgr/workben/local_io/simpletest.cxx
+++ /dev/null
@@ -1,758 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <memory>
-#include <vector>
-#include <stack>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HDL_
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HDL_
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HDL_
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataImporter.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XInputStream.hpp>
-#endif
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <vos/thread.hxx>
-
-#include <vos/pipe.hxx>
-#include <osl/diagnose.h>
-#include "oslstream.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <osl/conditn.hxx>
-
-#include "xmltreebuilder.hxx"
-
-#include "dataimport.hxx"
-
-#include "createpropertyvalue.hxx"
-#include "strdecl.hxx"
-
-#include "confname.hxx"
-
-#include "FileHelper.hxx"
-
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace uno = com::sun::star::uno;
-namespace lang = com::sun::star::lang;
-namespace io = com::sun::star::io;
-namespace sax = com::sun::star::xml::sax;
-namespace script = com::sun::star::script;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::io;
-using namespace rtl;
-using namespace osl;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#ifndef ASCII
-#define ASCII(x) OUString::createFromAscii(x)
-#endif
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- a Class ----------------------------------
-// -----------------------------------------------------------------------------
-// <Name a="xyz" b="bar">
-
-//==========================================================================
-//= Visitors
-//==========================================================================
-
-
-namespace configmgr
-{
-
- class XMLSimpleDocHandler : public ::cppu::WeakImplHelper1<sax::XDocumentHandler>
- {
- // uno::Reference< sax::XDocumentHandler > m_xWriter; // the service object for writing XML code
-
- sal_Int32 m_nElementDepth;
- sal_Int32 m_nIgnoreLevel;
- public:
- XMLSimpleDocHandler::XMLSimpleDocHandler()
- {}
-
-
- // DECLARE_UNO3_DEFAULTS(XMLReadFilter, CmDocumentHandler_BASE);
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw (sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL endDocument(void)
- throw(sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL startElement(const rtl::OUString& aName,
- const uno::Reference< sax::XAttributeList > &_xAttrList)
- throw(sax::SAXException, uno::RuntimeException)
- {
- sal_Int16 nAttrCount = _xAttrList.is() ? _xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString aParamName( _xAttrList->getNameByIndex( i ) );
- OUString aParamValue( _xAttrList->getValueByIndex( i ) );
- volatile int dummy = 0;
- }
- }
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw(sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
- virtual void SAL_CALL setDocumentLocator(const uno::Reference< sax::XLocator > &xLocator)
- throw(sax::SAXException, uno::RuntimeException)
- {}
- };
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Test ------------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
- void simpleTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("e:/temp/Test");
- OUString aFilename = ASCII("calc");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- uno::Reference<io::XInputStream> xInputStream =
- new configmgr::OSLInputStreamWrapper(aFile);
-
- // connect stream to input stream to the parser
- InputSource aInputSource;
- Reference<XInputStream> xPipeInput( xInputStream, UNO_QUERY );
- aInputSource.aInputStream = xPipeInput;
-
- Reference< sax::XParser > xParser;
- xParser = Reference< sax::XParser > (
- xMSF->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser")), UNO_QUERY);
-
- XMLSimpleDocHandler *pTest = new XMLSimpleDocHandler();
-
- // get filter
- Reference<XDocumentHandler> xFilter = pTest;
-
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
- // parse
- sal_Int16 nRet = 0;
- OUString sError;
- try
- {
- xParser->parseStream( aInputSource );
- }
- catch( SAXParseException &e )
- {
- OUString sLine = OUString::valueOf(e.LineNumber);
- OUString aStr = ASCII("SAXParseException occured in ");
- sError = aStr + ASCII(" Line: (") + sLine + ASCII(")");
-
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 3;
- }
- catch( SAXException &e )
- {
- sError = e.Message;
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 4;
- }
- catch( IOException &e )
- {
- sError = e.Message;
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 5;
- }
- }
-
-
-#include <osl/time.h>
-#include <rtl/string.hxx>
-
-class TimeTest
-{
- TimeValue m_aStartTime, m_aEndTime;
- bool m_bStarted;
-public:
- TimeTest()
- :m_bStarted(false)
- {
- }
-
- void start()
- {
- m_bStarted = true;
- osl_getSystemTime(&m_aStartTime);
- }
- void stop()
- {
- osl_getSystemTime(&m_aEndTime);
- OSL_ENSURE(m_bStarted, "Not Started.");
- m_bStarted = false;
- }
- void showTime(const rtl::OString & aWhatStr)
- {
- OSL_ENSURE(!m_bStarted, "Not Stopped.");
-
- sal_Int32 nSeconds = m_aEndTime.Seconds - m_aStartTime.Seconds;
- sal_Int32 nNanoSec = m_aEndTime.Nanosec - m_aStartTime.Nanosec;
- if (nNanoSec < 0)
- {
- nNanoSec = 1000000000 - nNanoSec;
- nSeconds++;
- }
- rtl::OString aStr = "Time for ";
- aStr += aWhatStr;
- aStr += " : ";
- aStr += rtl::OString::valueOf(nSeconds);
- aStr += ".";
- aStr += rtl::OString::valueOf(nNanoSec);
-
- cout << aStr.getStr() << endl;
- }
-
-};
-
-// -----------------------------------------------------------------------------
-// -------------------------------- Mapping Test --------------------------------
-// -----------------------------------------------------------------------------
-// Simple Map created with a stl::vector
-
-typedef ::std::pair< rtl::OUString, rtl::OUString > Assoc;
-// typedef ::std::set<Assoc, ltNode> MappingTable;
-typedef std::vector<Assoc> MappingTable;
-
-rtl::OUString mapTo(const rtl::OUString& aFrom, bool bToNew)
-{
- static MappingTable aMap;
- if (aMap.empty())
- {
- // Fill Map old, new
-
- aMap.push_back(Assoc(ASCII("value"), TAG_VALUE));
- aMap.push_back(Assoc(ASCII("type"), ATTR_TYPE));
- aMap.push_back(Assoc(ASCII("instance"), ATTR_INSTANCE));
- }
- if (bToNew)
- {
- // check, if we should convert first to second
- for (std::vector<Assoc>::const_iterator it = aMap.begin();it != aMap.end();++it)
- {
- if ((*it).first.equals(aFrom))
- return (*it).second;
- }
- }
- else
- {
- // check if we should convert second to first
- for (std::vector<Assoc>::const_iterator it = aMap.begin();it != aMap.end();++it)
- {
- if ((*it).second.equals(aFrom))
- return (*it).first;
- }
- }
-
- // do nothing!
- return aFrom;
-}
-// -----------------------------------------------------------------------------
-void simpleMappingTest()
-{
- OUString aValue = ASCII("value");
- OUString aNew;
-
- aNew = mapTo(aValue, true); // true for ToNew
- aNew = mapTo(aNew, false);
- aNew = mapTo(aNew, false);
-
- volatile int dummy = 0;
-}
-
-// -----------------------------------------------------------------------------
- void speedTest()
- {
- // check speed of:
- // ASCII("value")
- // TAG_VALUE
- // ...
-
- sal_Int32 nCount = 1000 * 1000 * 100;
- sal_Int32 n;
-
- cout << "Starting Timetest" << endl;
- TimeTest tt;
- tt.start();
- for(n=0;n<nCount;n++)
- {
- }
- tt.stop();
- tt.showTime("Leere Schleife: ");
-
-
- nCount = 1000 * 1000 * 5;
- rtl::OUString aStr;
-
- tt.start();
- for(n=0;n<nCount;n++)
- {
- aStr = ASCII("value");
- }
- tt.stop();
- tt.showTime("ASCII() ");
-
-
- OUString aValue = ASCII("value");
- tt.start();
- for(n=0;n<nCount;n++)
- {
- aStr = TAG_VALUE;
- }
- tt.stop();
- tt.showTime("TAG_VALUE: ");
-
- }
-
-OUString changeToComSunStarPath(const OUString &aPath)
-{
- static OUString aOO = ASCII("org.OpenOffice");
- static OUString aCSS = ASCII("com.sun.star");
- OUString aNewPath;
-
- // compare
- if (aPath.compareTo( aOO, aOO.getLength() ) == 0)
- {
- aNewPath = aCSS;
- aNewPath += aPath.copy(aOO.getLength());
- return aNewPath;
- }
- return aPath;
-}
-
-void stringTest2()
-{
- OUString aPath = ASCII("org.OpenOffice.Setup/blah/blub");
-
- OUString aNewPath = changeToComSunStarPath(aPath);
- volatile int dummy = 0;
-}
-
-/*
-
-class A
-{
-public:
- static void run() {
- cout << "This is A::run();" << endl;
- }
-
-};
-
-class B : public A
-{
-public:
-
- static void run() {
- cout << "This is B::run();" << endl;
- }
-};
-
-void classTest()
-{
- A a;
- B b;
- B::run();
-}
-*/
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Map ------------------------------------
-// -----------------------------------------------------------------------------
-struct ltstr
-{
- bool operator()(const rtl::OUString &s1, const rtl::OUString &s2) const
- {
- return s1.compareTo(s2) < 0 ? true : false;
- }
-};
-
-void stringTest()
-{
- map<const OUString, int, ltstr> months;
-
- months[ASCII("january")] = 31;
- months[ASCII("february")] = 28;
- months[ASCII("march")] = 31;
- months[ASCII("april")] = 30;
- months[ASCII("may")] = 31;
- months[ASCII("june")] = 30;
- months[ASCII("july")] = 31;
- months[ASCII("august")] = 31;
- months[ASCII("september")] = 30;
- months[ASCII("october")] = 31;
- months[ASCII("november")] = 30;
- months[ASCII("december")] = 31;
-
- cout << "june -> " << months[ASCII("june")] << endl;
- map<const OUString, int, ltstr>::iterator cur = months.find(ASCII("april"));
- // map<const OUString, int, ltstr>::iterator prev = cur;
- map<const OUString, int, ltstr>::iterator next = cur;
- // ++next;
- // --prev;
- // cout << "Previous (in alphabetical order) is " << (*prev).first << endl;
- for(int i=0;i<12;i++)
- {
- cout << "Next (in alphabetical order) is " << (*next).first << " days " << (*next).second << endl;
- ++next;
- }
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- HashMap ----------------------------------
-// -----------------------------------------------------------------------------
-#include <hash_map>
-
-
-namespace test {
-
-struct eqstr
-{
- bool operator()(const rtl::OUString &s1, const rtl::OUString &s2) const
- {
- return s1.equals(s2) == sal_True ? true : false;
- }
-};
-
-struct hash_oustring
-{
- // This hash funktion is a copy of hash<char*> from SGI-STL
- size_t operator()(const rtl::OUString &_s) const
- {
- sal_Int64 nStrLen = _s.getLength();
- const sal_Unicode *pStr = _s.getStr();
- unsigned long h = 0;
- for (sal_Int64 i=0;i<nStrLen; ++i)
- h = 5*h + *pStr++;
-
- return size_t(h);
- }
-};
-
-void hash_test()
-{
- hash_map<const rtl::OUString, rtl::OUString, hash_oustring, eqstr> months;
-
- rtl::OUString sJanuary = ASCII("january");
- months[sJanuary] = ASCII("31");
- months[ASCII("february")] = ASCII("28");
- months[ASCII("march")] = ASCII("31");
- months[ASCII("april")] = ASCII("30");
- months[ASCII("may")] = ASCII("31");
- months[ASCII("june")] = ASCII("30");
- months[ASCII("july")] = ASCII("31");
- months[ASCII("august")] = ASCII("31");
- months[ASCII("september")] = ASCII("30");
- months[ASCII("october")] = ASCII("31");
- months[ASCII("november")] = ASCII("30");
- months[ASCII("december")] = ASCII("31");
-
- cout << "september -> " << months[ASCII("september")] << endl;
- cout << "april -> " << months[ASCII("april")] << endl;
- cout << "june -> " << months[ASCII("june")] << endl;
- cout << "november -> " << months[ASCII("november")] << endl;
-}
-}
-
-
-// -----------------------------------------------------------------------------
-// Fri Nov 10 15:10:45 2000
-// -----------------------------------------------------------------------------
-
-#include <vos/ref.hxx>
-
-class Options : public vos::OReference
-{
- int m_aValue;
-public:
- int getValue() {return m_aValue;}
- void setValue(int _aValue) {m_aValue = _aValue;}
-
-
-};
-
-class A
-{
- vos::ORef<Options> m_aOptions;
-public:
-
- vos::ORef<Options> getOptions() {return m_aOptions;}
- void setOptions(vos::ORef<Options>& _aOptions) {
- m_aOptions = _aOptions;
- }
-};
-
-void testRefs()
-{
- vos::ORef<Options> aO = new Options;
- aO->setValue(10);
-
- A a,b;
- a.setOptions(aO);
- b.setOptions(aO);
- cout << "Options from a : " << a.getOptions()->getValue() << endl;
- cout << "Options from b : " << b.getOptions()->getValue() << endl;
-
- aO->setValue(20);
- cout << "Options from a : " << a.getOptions()->getValue() << endl;
- cout << "Options from b : " << b.getOptions()->getValue() << endl;
-}
-
-
-
-void ConfigName()
-{
- // OUString aSubtreePath = ASCII("/org.openoffice.office.common/path/blah/blub");
- OUString aSubtreePath = ASCII("/org.openoffice.office.common");
- ConfigurationName aName(aSubtreePath);
- OUString a = aName.localName();
- OUString b = aName.fullName();
- OUString c = aName.moduleName();
- ConfigurationName aParentName(aName.getParentName());
- OUString d = aParentName.fullName();
-
-
- {
- ConfigurationName aName( ASCII("/" ));
-
- std::stack< rtl::OUString, std::vector<rtl::OUString> > m_aStringStack;
-
- if (aName.localName().getLength() != 0)
- {
- for (ConfigurationName::Iterator it = aName.begin();
- it != aName.end();
- ++it)
- {
- rtl::OUString aName = *it;
- m_aStringStack.push(aName);
- // m_xHandler->startElement(*it, rList);
- volatile int dummy = 0;
- }
- }
-
- // bBack = writeChanges();
-
- while(!m_aStringStack.empty())
- {
- OUString aName = m_aStringStack.top();
- m_aStringStack.pop();
- }
- }
-}
-
-void ConfigName2()
-{
- OUString aSubtreePath = ASCII("/org.openoffice.office.common/path/blah/blub");
- ConfigurationName aName(aSubtreePath);
- ConfigurationName aParent = aName.getParentName();
-
- for (ConfigurationName::Iterator it = aName.begin();
- it != aName.end();
- ++it)
- {
- rtl::OUString aName = *it;
- volatile int dummy = 0;
- }
-}
-
-// -----------------------------------------------------------------------------
-inline void operator <<= (rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (rtl::OUString& _rUnicodeString, const rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString)
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US);
-}
-
-// -----------------------------------------------------------------------------
-bool isBTimeGreaterATime(TimeValue const& A, TimeValue const& B)
-{
- if (B.Seconds > A.Seconds) return true;
- if (B.Nanosec > A.Nanosec) return true;
-
- // lower or equal
- return false;
-}
-
-// -----------------------------------------------------------------------------
-
-void oslTest()
-{
-
- OUString aDirectory(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/file.out.1")));
- TimeValue a = FileHelper::getFileModificationStamp(aDirectory);
-
- OUString aDirectory2(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/file.out.2")));
- TimeValue b = FileHelper::getFileModificationStamp(aDirectory2);
-
- if (isBTimeGreaterATime(a,b))
- {
- OSL_ENSURE(false, "FileB ist neuer als FileA");
- }
-
-
-/*
- OUString aDirectory(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/dies")));
- osl::FileBase::RC eError = osl::Directory::create(aDirectory);
- if (eError != osl::FileBase::E_None)
- {
- OUString aUStr = FileHelper::createOSLErrorString(eError);
- OString aStr;
- aStr <<= aUStr;
- OSL_ENSURE(false, aStr.getStr());
- }
-*/
-}
-
-} // namespace configmgr
diff --git a/configmgr/workben/local_io/xmlexport.cxx b/configmgr/workben/local_io/xmlexport.cxx
deleted file mode 100644
index 3312f6ffb1ff..000000000000
--- a/configmgr/workben/local_io/xmlexport.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include<iostream>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-/*
-#include <cppuhelper/implbase1.hxx>
-*/
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataExporter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XOutputStream.hpp>
-#endif
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-#include <osl/diagnose.h>
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include "oslstream.hxx"
-#include "attributes.hxx"
-#include "typeconverter.hxx"
-#include "xmlformater.hxx"
-#include "filehelper.hxx"
-
-
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-#include "createpropertyvalue.hxx"
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace io = com::sun::star::io;
- namespace sax = com::sun::star::xml::sax;
- namespace beans = com::sun::star::beans;
-
- using ::rtl::OUString;
- using ::osl::File;
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII(x) OUString::createFromAscii(x)
-
-// -----------------------------------------------------------------------------
- class Listener : public ::cppu::WeakImplHelper1<io::XDataTransferEventListener>
- {
- virtual void SAL_CALL disposing( const lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE(0, "disposing");
- }
-
-
- virtual void SAL_CALL finished( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "finished");
- }
-
- virtual void SAL_CALL cancelled( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "cancelled");
- }
- };
-
- class Component: public ::cppu::WeakImplHelper1<lang::XComponent>
- {
- virtual void SAL_CALL dispose( )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "dispose");
-
- }
- virtual void SAL_CALL addEventListener( const uno::Reference< lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "addEventListener");
- }
- virtual void SAL_CALL removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "removeEventListener");
- }
- };
-
-
-
-
-
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
-
-
-
-
-
-
-
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- void exportTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("l:/SRC601/configmgr/workben/local_io");
- OUString sFilename = ASCII("exported_config");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + sFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- FileHelper::tryToRemoveFile(aURL);
-
- rtl::OUString sError;
-
- // File oeffnen
- File aFile(aURL);
- osl::FileBase::RC eError = aFile.open(OpenFlag_Write | OpenFlag_Create);
-
- if (eError != osl_File_E_None)
- {
- sError = ASCII("XMLExportTest:");
- rtl::OString aStr = rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0, aStr.getStr());
- return;
- }
-
- // create an outputstream
- uno::Reference<io::XOutputStream> xOutputStream = new configmgr::OSLOutputStreamWrapper(aFile);
-
- // Listener & Component
- uno::Reference<io::XDataTransferEventListener> rListener = new Listener();
- uno::Reference<lang::XComponent> rComponent = new Component();
-
-
- OUString sPath = ASCII("com.sun.star.ucb.Hierarchy");
-
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> aConverter;
- aConverter = aConverter.query(xMSF->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- // prepare parameters for DataExport
- Sequence< uno::Any > aArgs(4);
- aArgs[0] <<= createPropertyValue(ASCII("PackageName"), sFilename);
- aArgs[1] <<= createPropertyValue(ASCII("Path"), sPath); // multiple occur possible
- aArgs[2] <<= createPropertyValue(ASCII("TypeConverter"), aConverter); // optional
- aArgs[3] <<= createPropertyValue(ASCII("Path"), ASCII("com.sun.star.office.Setup")); // multiple occur possible
-
- // important: createInstanceWithArguments will throw an IllegalArgumentException() if
- // parameters are wrong...
- Reference< XInterface > xDataExport = xMSF->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.DataExport"),
- aArgs);
-
- uno::Reference<io::XDataExporter> rExporter(xDataExport, UNO_QUERY);
-
- // Export Data
- rExporter->exportData(xOutputStream, rComponent, rListener);
- }
-
-} // namespace configmgr
diff --git a/configmgr/workben/local_io/xmlimport.cxx b/configmgr/workben/local_io/xmlimport.cxx
deleted file mode 100644
index e1d2a6ebb823..000000000000
--- a/configmgr/workben/local_io/xmlimport.cxx
+++ /dev/null
@@ -1,469 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <memory>
-#include <vector>
-#include <stack>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HDL_
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HDL_
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HDL_
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataImporter.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XInputStream.hpp>
-#endif
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <vos/thread.hxx>
-
-#include <vos/pipe.hxx>
-#include <osl/diagnose.h>
-#include "oslstream.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <osl/conditn.hxx>
-
-#include "xmltreebuilder.hxx"
-
-#include "dataimport.hxx"
-
-#include "createpropertyvalue.hxx"
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace uno = com::sun::star::uno;
-namespace lang = com::sun::star::lang;
-namespace io = com::sun::star::io;
-namespace sax = com::sun::star::xml::sax;
-namespace script = com::sun::star::script;
-
-using ::rtl::OUString;
-using ::osl::File;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#ifndef ASCII
-#define ASCII(x) OUString::createFromAscii(x)
-#endif
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- a Class ----------------------------------
-// -----------------------------------------------------------------------------
-// <Name a="xyz" b="bar">
-
-//==========================================================================
-//= Visitors
-//==========================================================================
-
-
-// -----------------------------------------------------------------------------
-class Listener : public ::cppu::WeakImplHelper1<io::XDataTransferEventListener>
-{
- osl::Condition m_aCondition;
-public:
- Listener()
- {
- m_aCondition.reset(); // will block
- }
-
- virtual void SAL_CALL disposing( const lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE(0, "disposing");
- m_aCondition.set(); // will not block
- }
-
- virtual void SAL_CALL finished( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "finished");
- m_aCondition.set(); // will not block
- }
-
- virtual void SAL_CALL cancelled( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "cancelled");
- m_aCondition.set(); // will not block
- }
-public:
- void wait()
- {
- m_aCondition.wait();
- }
-};
-
-class Component: public ::cppu::WeakImplHelper1<lang::XComponent>
-{
- virtual void SAL_CALL dispose( )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "dispose");
-
- }
- virtual void SAL_CALL addEventListener( const uno::Reference< lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "addEventListener");
- }
- virtual void SAL_CALL removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "removeEventListener");
- }
-};
-
-
-
-namespace configmgr
-{
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Test ------------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
- void importTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("l:/SRC601/configmgr/workben/local_io");
- OUString aFilename = ASCII("hierarchy");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- // sal_uInt64 nBytesRead;
- // uno::Sequence< sal_Int8 > aBufferSeq(2000);
- // sal_Int8 *pBuff = aBufferSeq.getArray();
- // aFile.read(pBuff, 2000, nBytesRead);
- //
- // aFile.close();
-
- uno::Reference<io::XInputStream> xInputStream = new configmgr::OSLInputStreamWrapper(aFile);
-
- uno::Reference <uno::XInterface> xPump = xMSF->createInstance( L"com.sun.star.io.Pump" );
- OSL_ENSURE(xPump.is(), "there is no pump");
-
- uno::Reference<io::XActiveDataSink> xPumpSink(xPump, uno::UNO_QUERY);
- xPumpSink->setInputStream(xInputStream);
-
- uno::Reference<io::XActiveDataSource> xPumpSource(xPump, uno::UNO_QUERY);
-
- Listener *pListener = new Listener();
- uno::Reference<io::XDataTransferEventListener> rListener = pListener;
- uno::Reference<lang::XComponent> rComponent = new Component();
-
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> aConverter;
- aConverter = aConverter.query(xMSF->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- Sequence< uno::Any > aArgs(1); // optional arg.
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("TypeConverter"), aConverter);
-
- Reference< XInterface > xDataImport = xMSF->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.DataImport"),
- aArgs);
-
- if (xDataImport.is())
- {
- uno::Reference<io::XDataImporter> rImporter(xDataImport, UNO_QUERY);
-
- // Import Data
- rImporter->importData(xPumpSource, rComponent, rListener);
-
- // lets pump
- uno::Reference<io::XActiveDataControl> xControl(xPump, uno::UNO_QUERY);
- xControl->start();
-
- // TEST:
- // rImporter->cancel();
-
- // pImporter->wait();
- // Wait until the listener send ready
- pListener->wait();
- }
- return;
- }
-
-// -----------------------------------------------------------------------------
-// -------------------------------- Import Test --------------------------------
-// -----------------------------------------------------------------------------
-
- // ----------- TEST ReadAccess -----------
- void showSequence(const Sequence<OUString> &aSeq);
-
-void hierarchyTest()
-{
-
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
-
- Reference< XMultiServiceFactory > xCfgProvider( xMSF->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")),
- UNO_QUERY);
-
- if (!xCfgProvider.is())
- {
- OSL_ENSURE(0, "No Configuration Provider");
- }
-
- OUString sPath = ASCII("com.sun.star.ucb.Hierarchy");
-
- Sequence< Any > aArgs(1);
- aArgs[0] <<= sPath;
-
- Reference< XInterface > xCfgUpdt = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
-
- Reference< XNameAccess > xNameAccess(xCfgUpdt, UNO_QUERY);
-
- // which Names are exist?
- showSequence(xNameAccess->getElementNames());
-
- OUString aNamePath = ASCII("Root");
- if (xNameAccess->hasByName(aNamePath))
- {
- Any aAny;
- aAny = xNameAccess->getByName(aNamePath);
- TypeClass aTypeClass = aAny.getValueTypeClass();
- if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
- {
- Reference< XInterface > xInterface;
- aAny >>= xInterface;
- Reference< XNameAccess > xNameAccess2(xInterface, UNO_QUERY);
- if (xNameAccess.is())
- {
- Sequence<OUString> aSeq = xNameAccess2->getElementNames();
- showSequence(aSeq);
-
- // insert a new set
-/*
- Reference<XHierarchicalName> xHierarchical(xNameAccess, UNO_QUERY);
- OUString aHierachicalName = xHierarchical->getHierarchicalName();
-
- Sequence< Any > aArgs(2);
- aArgs[0] <<= aHierachicalName;
- sal_Int32 nLevels=1;
- aArgs[1] <<= nLevels;
-
- Reference< XInterface > xCfgNewUpdt = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
-*/
- Reference< lang::XSingleServiceFactory > xChildFactory(xNameAccess2, UNO_QUERY);
- if (xChildFactory.is())
- {
- Reference< XInterface > xChild = xChildFactory->createInstance();
- if (xChild.is())
- {
- Reference<XNameAccess> xObjectOnTheMedow(xChild, UNO_QUERY);
-
-
-
-
- // which Names are exist?
- showSequence(xObjectOnTheMedow->getElementNames());
-
- OUString aChildren = ASCII("Children");
- if (xObjectOnTheMedow->hasByName(aChildren))
- {
- Any aAny;
- aAny = xObjectOnTheMedow->getByName(aChildren);
- TypeClass aTypeClass = aAny.getValueTypeClass();
- if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
- {
- Reference< XInterface > xInterface;
- aAny >>= xInterface;
- Reference< XNameAccess > xChildFromOOM(xInterface, UNO_QUERY);
-
- if (xChildFromOOM.is())
- {
- // insert a new Object in the new Object
-
- Reference< lang::XSingleServiceFactory > xChildFactory(xChildFromOOM, UNO_QUERY);
- if (xChildFactory.is())
- {
- Reference< XInterface > xChild = xChildFactory->createInstance();
- if (xChild.is())
- {
- Reference<XNameContainer> xNameContainer(xChildFromOOM, UNO_QUERY);
- if (xNameContainer.is())
- {
- xNameContainer->insertByName(ASCII("Test2"), makeAny(xChild));
- }
- }
- }
- }
- }
- }
-
-
- Reference<XNameContainer> xNameContainer(xNameAccess2, UNO_QUERY);
- if (xNameContainer.is())
- {
- xNameContainer->insertByName(ASCII("Test"), makeAny(xObjectOnTheMedow));
- }
- }
-
- // commit changes
- Reference< XChangesBatch > xChangesBatch(xCfgUpdt, UNO_QUERY);
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
- }
-
- Sequence<OUString> aSeq2 = xNameAccess2->getElementNames();
- showSequence(aSeq2);
-
-/*
- OUString *pStr = aSeq.getArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- Any aAny;
- aAny = xNameAccess->getByName(aStr);
- TypeClass aTypeClass = aAny.getValueTypeClass();
-
- Reference< XNameReplace > xNameReplace(xNameAccess, UNO_QUERY);
-
- Any aNewAny;
- sal_Bool bValue = false;
- aNewAny <<= bValue;
- xNameReplace->replaceByName(aStr, aNewAny);
-
- volatile int dummy = 0;
- }
-*/
- }
- }
- volatile int dummy = 0;
- }
-}
-
-// ------------------------------ Helperfunctions ------------------------------
-
- void showSequence(const Sequence<OUString> &aSeq)
- {
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- aArray += aStr + ASCII(", ");
- }
- volatile int dummy = 0;
- }
-
-} // namespace configmgr
diff --git a/configmgr/workben/logger/exports.dxp b/configmgr/workben/logger/exports.dxp
deleted file mode 100644
index 9630d7e06768..000000000000
--- a/configmgr/workben/logger/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/workben/logger/loggerdfn.cxx b/configmgr/workben/logger/loggerdfn.cxx
deleted file mode 100644
index 32f2d53e4a8a..000000000000
--- a/configmgr/workben/logger/loggerdfn.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simplelogger.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <rtl/ustrbuf.hxx>
-
-namespace cssuno = com::sun::star::uno;
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-//==============================================================================
-
-static cssuno::Reference<cssuno::XInterface> SAL_CALL
- createSimpleLogger( const cssuno::Reference<cssuno::XComponentContext>& aContext)
-{
- return * new logger::SimpleLogger(aContext,"configuration.log") ;
-}
-//==============================================================================
-
-// adapted from the corresponding cppuhelper function
-static sal_Bool component_writeInfoHelper_withSingleton(
- void *pServiceManager, void *pRegistryKey ,
- const cppu::ImplementationEntry entries[],
- char const * const singletons[])
-{
- using namespace com::sun::star::registry;
- using rtl::OUString;
-
- sal_Bool bRet = sal_False;
- try
- {
- if( pRegistryKey )
- {
- for( sal_Int32 i = 0; entries[i].create ; i ++ )
- {
- rtl::OUStringBuffer buf( 124 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/") );
- buf.append( entries[i].getImplementationName() );
- buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( "/UNO/SERVICES" ) );
- cssuno::Reference< XRegistryKey > xNewKey(
- static_cast< XRegistryKey * >( pRegistryKey )->createKey( buf.makeStringAndClear() ) );
-
- cssuno::Sequence< OUString > const seq = entries[i].getSupportedServiceNames();
- for ( sal_Int32 nPos = 0 ; nPos < seq.getLength(); nPos ++ )
- xNewKey->createKey( seq[nPos] );
-
- if (singletons[i])
- {
- rtl::OUStringBuffer buf( 124 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/") );
- buf.append( entries[i].getImplementationName() );
- buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( "/UNO/SINGLETONS/" ) );
- buf.appendAscii(singletons[i]);
- cssuno::Reference< XRegistryKey > xNewKey(
- static_cast< XRegistryKey * >( pRegistryKey )->createKey( buf.makeStringAndClear() ) );
-
- xNewKey->setStringValue(entries[i].getImplementationName());
- }
- }
- bRet = sal_True;
- }
- }
- catch ( InvalidRegistryException & )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- catch ( cssuno::Exception & )
- {
- OSL_ENSURE( sal_False, "### Unexpected UNO Exception!" );
- }
- return bRet;
-}
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createSimpleLogger,
- logger::SimpleLogger::getImplementationName_static,
- logger::SimpleLogger::getSupportedServiceNames_static,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL }
-} ;
-static const char * const kSingleton_names[] =
-{
- "com.sun.star.configuration.theLogger",
- NULL
-};
-
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **aEnvironment) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *aServiceManager,
- void *aRegistryKey) {
- return component_writeInfoHelper_withSingleton( aServiceManager,
- aRegistryKey,
- kImplementations_entries,
- kSingleton_names) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/configmgr/workben/logger/makefile.mk b/configmgr/workben/logger/makefile.mk
deleted file mode 100644
index 569326914ba2..000000000000
--- a/configmgr/workben/logger/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=simplelogger
-ENABLE_EXCEPTIONS=TRUE
-
-# Version
-SYSMGR_MAJOR=1
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/simplelogger.obj \
- $(SLO)$/loggerdfn.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET)$(SYSMGR_MAJOR).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: Simple Logger
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/workben/logger/simplelogger.cxx b/configmgr/workben/logger/simplelogger.cxx
deleted file mode 100644
index a6064f813e34..000000000000
--- a/configmgr/workben/logger/simplelogger.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simplelogger.hxx"
-#include <com/sun/star/util/logging/LogLevel.hpp>
-
-#include <osl/thread.h>
-#include <stdlib.h> // for getenv
-
-namespace logger
-{
-
- namespace LogLevel = com::sun::star::util::logging::LogLevel;
-
-//==============================================================================
-static rtl::OString level2str(sal_Int32 nLevel)
-{
- return rtl::OString::valueOf(nLevel);
-}
-
-sal_Int32 str2level(rtl::OString const & str)
-{
- return str.toInt32();
-}
-
-//------------------------------------------------------------------------------
-SimpleLogger::SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name)
-: mContext(xContext)
-, mName( OUString::createFromAscii(name) )
-, mOutput(stderr)
-, mLevel(LogLevel::INFO)
-{
- if (char const * fname = getenv("CFG_LOGFILE"))
- {
- mOutput = fopen(fname,"a+");
- OSL_ENSURE(mOutput,"ERROR: could not open logfile\n");
- }
-
- if (char const * level = getenv("CFG_LOGLEVEL"))
- {
- mLevel = str2level(level);
- }
-}
-//------------------------------------------------------------------------------
-SimpleLogger::~SimpleLogger()
-{
-}
-//------------------------------------------------------------------------------
-uno::Reference< logging::XLogger > SAL_CALL
- SimpleLogger::getLogger( const OUString& name )
- throw (uno::RuntimeException)
-{
- if (name == mName) return this;
-
- // try whatever
- uno::Reference< logging::XLogger > xNamedLogger;
- if (mContext.is())
- {
- OUString const singleton(RTL_CONSTASCII_USTRINGPARAM("/singletons/"));
- mContext->getValueByName(singleton.concat(name)) >>= xNamedLogger;
- }
- return xNamedLogger;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL SimpleLogger::getLevel( ) throw (uno::RuntimeException)
-{
- return mLevel;
-}
-
-//------------------------------------------------------------------------------
-OUString SAL_CALL SimpleLogger::getName( ) throw (uno::RuntimeException)
-{
- return mName;
-}
-
-//------------------------------------------------------------------------------
-sal_Bool SAL_CALL SimpleLogger::isLoggable( sal_Int32 level ) throw (uno::RuntimeException)
-{
- return mOutput && level >= mLevel;
-}
-
-//------------------------------------------------------------------------------
-#define OU2OUT( ustr ) ( rtl::OUStringToOString( ustr, enc ).getStr() )
-
-void SAL_CALL SimpleLogger::logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg )
- throw (uno::RuntimeException)
-{
- rtl_TextEncoding enc = osl_getThreadTextEncoding();
- if (mOutput && level > mLevel)
- {
- fprintf( mOutput, "%s {%s.%s}: [%s] %s\n", OU2OUT(mName),
- OU2OUT(sourceClass) , OU2OUT(sourceMethod),
- level2str(level).getStr(), OU2OUT(msg) );
- }
-}
-
-//------------------------------------------------------------------------------
-
-OUString SAL_CALL SimpleLogger::getImplementationName_static()
-{
- static const char kImplementationName[] = "com.sun.star.comp.configmgr.logging.SimpleLogger";
-
- return OUString(RTL_CONSTASCII_USTRINGPARAM(kImplementationName)) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SimpleLogger::getImplementationName()
- throw (uno::RuntimeException)
-{
- return getImplementationName_static() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL SimpleLogger::getSupportedServiceNames_static()
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.logging.SimpleLogger")) ;
- aServices[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.logging.Logger")) ;
-
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL SimpleLogger::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getSupportedServiceNames_static();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL SimpleLogger::getSupportedServiceNames()
- throw (uno::RuntimeException)
-{
- return getSupportedServiceNames_static() ;
-}
-//------------------------------------------------------------------------------
-
-
-} // namespace logger
diff --git a/configmgr/workben/logger/simplelogger.hxx b/configmgr/workben/logger/simplelogger.hxx
deleted file mode 100644
index 81cfeb70a1ef..000000000000
--- a/configmgr/workben/logger/simplelogger.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef CONFIGMGR_SIMPLELOGGER_HXX_
-#define CONFIGMGR_SIMPLELOGGER_HXX_
-
-#include "simplelogger.hxx"
-#include <com/sun/star/util/logging/XLogger.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-#include <stdio.h>
-
-namespace logger {
-
-namespace uno = com::sun::star::uno ;
-namespace lang = com::sun::star::lang ;
-namespace logging = com::sun::star::util::logging ;
-using rtl::OUString;
-
-typedef cppu::WeakImplHelper2< logging::XLogger,
- lang::XServiceInfo> LoggerBase ;
-
-
-/**
- Class implementing the Logger service
- */
-class SimpleLogger : public LoggerBase
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name) ;
-
- /** Destructor */
- ~SimpleLogger() ;
-
- // XLogger
- virtual uno::Reference< logging::XLogger > SAL_CALL
- getLogger( const OUString& name )
- throw (uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL getLevel( ) throw (uno::RuntimeException);
- virtual OUString SAL_CALL getName( ) throw (uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLoggable( sal_Int32 level ) throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg )
- throw (uno::RuntimeException);
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const OUString& aServiceName)
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static OUString SAL_CALL getImplementationName_static() ;
- /**
- Provides the list of supported services.
-
- @return list of service names
- */
- static uno::Sequence<OUString> SAL_CALL getSupportedServiceNames_static() ;
-
-private:
- /** Component Context */
- uno::Reference<uno::XComponentContext> mContext ;
- OUString mName;
- FILE * mOutput;
- sal_Int32 mLevel;
-} ;
-
-} // namespace logger
-
-#endif
diff --git a/configmgr/workben/memory/logmechanism.hxx b/configmgr/workben/memory/logmechanism.hxx
deleted file mode 100644
index a2f6e4ec6f48..000000000000
--- a/configmgr/workben/memory/logmechanism.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-
-//*****************************************************************************************************************
-// generic macros for logging
-//*****************************************************************************************************************
-
-#ifdef ENABLE_LOGMECHANISM
-
- //_____________________________________________________________________________________________________________
- // includes
- //_____________________________________________________________________________________________________________
-
- #ifndef _RTL_STRING_HXX_
- #include <rtl/string.hxx>
- #endif
-
- #include <stdio.h>
-
- /*_____________________________________________________________________________________________________________
- WRITE_LOGFILE( SFILENAME, STEXT )
-
- Log any information in file. We append any information at file and don't clear it anymore.
- ( Use new scope in macro to declare pFile more then on time in same "parentscope"!
- Don't control pFile before access! What will you doing if its not valid? Log an error ...
- An error and an error is an error ... )
-
- Attention: You must use "%s" and STEXT as parameter ... because otherwise encoded strings (they include e.g. %...)
- are handled wrong.
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT ) \
- { \
- ::rtl::OString _swriteLogfileFileName ( SFILENAME ); \
- ::rtl::OString _swriteLogfileText ( STEXT ); \
- FILE* pFile = fopen( _swriteLogfileFileName.getStr(), "a" ); \
- fprintf( pFile, "%s", _swriteLogfileText.getStr() ); \
- fclose ( pFile ); \
- }
-
- /*_____________________________________________________________________________________________________________
- LOGTYPE
-
- For other debug macros we need information about the output mode. If user forget to set this information we
- do it for him. Valid values are: LOGTYPE_FILECONTINUE
- LOGTYPE_FILEEXIT
- LOGTYPE_MESSAGEBOX
- The normal case is LOGTYPE_MESSAGEBOX to show assertions in normal manner!
- _____________________________________________________________________________________________________________*/
-
- #define LOGTYPE_MESSAGEBOX 1
- #define LOGTYPE_FILECONTINUE 2
- #define LOGTYPE_FILEEXIT 3
-
- #ifndef LOGTYPE
- #define LOGTYPE \
- LOGTYPE_MESSAGEBOX
- #endif
-
-#else // #ifdef ENABLE_LOGMECHANISM
-
- /*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macro empty!
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT )
- #undef LOGTYPE
-
-#endif // #ifdef ENABLE_LOGMECHANISM
-
-//*****************************************************************************************************************
-// end of file
-//*****************************************************************************************************************
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
diff --git a/configmgr/workben/memory/main.cxx b/configmgr/workben/memory/main.cxx
deleted file mode 100644
index 4ec86cca7d4a..000000000000
--- a/configmgr/workben/memory/main.cxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <iostream>
-using namespace std;
-
-#define ENABLE_MEMORYMEASURE
-#define ENABLE_LOGMECHANISM
-
-// If you wish to enable this memory measure macros ... you need "windows.h"
-// But it's not agood idea to include it in your header!!! Because it's not compatible to VCL header .-(
-// So you must include it here ... in cxx, where you whish to use it.
-#ifdef ENABLE_MEMORYMEASURE
- #define VCL_NEED_BASETSD
- #include <tools/presys.h>
- #include <windows.h>
- #include <tools/postsys.h>
- #undef VCL_NEED_BASETSD
-#endif
-#include "memorymeasure.hxx"
-
-#include "logmechanism.hxx"
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
-
- START_MEMORYMEASURE( aMemoryInfo );
-
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "first start" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "1" );
-
- sal_Char* pTest = new sal_Char[1000 * 1000 * 50];
- sal_Char* pTest1 = new sal_Char[1000 * 1000 * 50];
- sal_Char* pTest2 = new sal_Char[1000 * 1000 * 50];
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "2" );
-
- LOG_MEMORYMEASURE( "FirstTest_of_memusage", "Values of memory access for standard filters.", aMemoryInfo );
-
- return 0;
-}
-
diff --git a/configmgr/workben/memory/makefile.mk b/configmgr/workben/memory/makefile.mk
deleted file mode 100644
index c93193121de7..000000000000
--- a/configmgr/workben/memory/makefile.mk
+++ /dev/null
@@ -1,255 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=memorytest
-TARGET2=memorytesthack
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
-
-# ... cfgapi ..............................
-# APP1STDLIBS = $(APPSTDLIBS)
-#
-# APP1STDLIBS+=$(STDLIBCPP)
-#
-# APP1TARGET= $(TARGET)
-# APP1OBJS= \
-# $(SLO)$/cfgapi2.obj \
-# $(SLO)$/strimpl.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/simpletypehelper.obj \
-# $(SLO)$/memory.obj \
-
-# ... cfgapi ..............................
-APP2STDLIBS = $(APPSTDLIBS)
-
-APP2STDLIBS+= $(STDLIBCPP)
-
-# CFLAGS+=-DWITHOUTAPI
-
-APP2TARGET= $(TARGET2)
-APP2OBJS= \
- $(SLO)$/memorytests.obj \
- $(SLO)$/testmodules.obj \
- $(SLO)$/treeload.obj \
- $(SLO)$/accessimpl.obj \
- $(SLO)$/adminproviderimpl.obj \
- $(SLO)$/apiaccessobj.obj \
- $(SLO)$/apifactory.obj \
- $(SLO)$/apifactoryimpl.obj \
- $(SLO)$/apinodeaccess.obj \
- $(SLO)$/apinodeupdate.obj \
- $(SLO)$/apinotifierimpl.obj \
- $(SLO)$/apiserviceinfo.obj \
- $(SLO)$/apitreeaccess.obj \
- $(SLO)$/apitreeimplobj.obj \
- $(SLO)$/attributelist.obj \
- $(SLO)$/attributeparser.obj \
- $(SLO)$/binarybasereader.obj \
- $(SLO)$/binarydecide.obj \
- $(SLO)$/binaryreader.obj \
- $(SLO)$/binarywritehandler.obj \
- $(SLO)$/binarywriter.obj \
- $(SLO)$/bootstrap.obj \
- $(SLO)$/broadcaster.obj \
- $(SLO)$/cachewritescheduler.obj \
- $(SLO)$/changes.obj \
- $(SLO)$/cmtree.obj \
- $(SLO)$/cmtreemodel.obj \
- $(SLO)$/collectchanges.obj \
- $(SLO)$/committer.obj \
- $(SLO)$/confeventhelpers.obj \
- $(SLO)$/confevents.obj \
- $(SLO)$/configexcept.obj \
- $(SLO)$/configgroup.obj \
- $(SLO)$/confignotifier.obj \
- $(SLO)$/configpath.obj \
- $(SLO)$/configsession.obj \
- $(SLO)$/configset.obj \
- $(SLO)$/confname.obj \
- $(SLO)$/confprovider2.obj \
- $(SLO)$/confproviderimpl2.obj \
- $(SLO)$/confsvccomponent.obj \
- $(SLO)$/disposetimer.obj \
- $(SLO)$/elementaccess.obj \
- $(SLO)$/elementimpl.obj \
- $(SLO)$/encodename.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/generatecache.obj \
- $(SLO)$/groupaccess.obj \
- $(SLO)$/groupimpl.obj \
- $(SLO)$/groupobjects.obj \
- $(SLO)$/groupupdate.obj \
- $(SLO)$/invalidatetree.obj \
- $(SLO)$/listenercontainer.obj \
- $(SLO)$/loader.obj \
- $(SLO)$/localizednodebuilder.obj \
- $(SLO)$/localizedtreeactions.obj \
- $(SLO)$/localsession.obj \
- $(SLO)$/matchlocale.obj \
- $(SLO)$/mergechange.obj \
- $(SLO)$/namehelper.obj \
- $(SLO)$/nodechange.obj \
- $(SLO)$/nodechangeimpl.obj \
- $(SLO)$/nodechangeinfo.obj \
- $(SLO)$/nodefactory.obj \
- $(SLO)$/nodeimpl.obj \
- $(SLO)$/nodeimplobj.obj \
- $(SLO)$/noderef.obj \
- $(SLO)$/notifycallback.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/pathhelper.obj \
- $(SLO)$/portalstream.obj \
- $(SLO)$/propertiesfilterednotifier.obj \
- $(SLO)$/propertyinfohelper.obj \
- $(SLO)$/propertysetaccess.obj \
- $(SLO)$/propsetaccessimpl.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/providerfactory.obj \
- $(SLO)$/providerimpl.obj \
- $(SLO)$/receivethread.obj \
- $(SLO)$/redirector.obj \
- $(SLO)$/remotesession.obj \
- $(SLO)$/roottree.obj \
- $(SLO)$/saxadapter.obj \
- $(SLO)$/saxtools.obj \
- $(SLO)$/sessionfactory.obj \
- $(SLO)$/sessionstream.obj \
- $(SLO)$/setaccess.obj \
- $(SLO)$/setnodeimpl.obj \
- $(SLO)$/setobjects.obj \
- $(SLO)$/setupdate.obj \
- $(SLO)$/simpletypehelper.obj \
- $(SLO)$/socketstream.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/synchronize.obj \
- $(SLO)$/template.obj \
- $(SLO)$/templateimpl.obj \
- $(SLO)$/timestamp.obj \
- $(SLO)$/tracer.obj \
- $(SLO)$/translatechanges.obj \
- $(SLO)$/treeactions.obj \
- $(SLO)$/treebuildercallback.obj \
- $(SLO)$/treecache.obj \
- $(SLO)$/treedata.obj \
- $(SLO)$/treeimpl.obj \
- $(SLO)$/treeiterators.obj \
- $(SLO)$/treenodefactory.obj \
- $(SLO)$/trivialbufferedfile.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/updatehandler.obj \
- $(SLO)$/updateimpl.obj \
- $(SLO)$/updatetree.obj \
- $(SLO)$/userimpl.obj \
- $(SLO)$/valueconverter.obj \
- $(SLO)$/valuehandler.obj \
- $(SLO)$/valuenodebuilder.obj \
- $(SLO)$/writesubtreeasbinaryhandler.obj \
- $(SLO)$/xmlformater.obj \
- $(SLO)$/xmltreebuilder.obj \
- $(SLO)$/valuemembernode.obj \
- $(SLO)$/anypair.obj \
-
-# $(SLO)$/memory.obj \
-
-
-# $(SLO)$/strimpl.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/simpletypehelper.obj \
-# $(SLO)$/memory.obj \
-# $(SLO)$/loadwithtreemanager.obj \
-# $(SLO)$/localsession.obj \
-# $(SLO)$/configsession.obj \
-# $(SLO)$/confname.obj \
-# $(SLO)$/tracer.obj \
-# $(SLO)$/generatecache.obj \
-# $(SLO)$/treeactions.obj \
-# $(SLO)$/cmtreemodel.obj \
-# $(SLO)$/cmtree.obj \
-# $(SLO)$/xmltreebuilder.obj \
-# $(SLO)$/xmlformater.obj \
-# $(SLO)$/binaryreader.obj \
-# $(SLO)$/binarybasereader.obj \
-# $(SLO)$/binarywriter.obj \
-# $(SLO)$/binarywritehandler.obj \
-# $(SLO)$/binarydecide.obj \
-# $(SLO)$/writesubtreeasbinaryhandler.obj \
-# $(SLO)$/oslstream.obj \
-# $(SLO)$/pathhelper.obj \
-# $(SLO)$/treecache.obj \
-# $(SLO)$/updatetree.obj \
-# $(SLO)$/attributeparser.obj \
-# $(SLO)$/updatehandler.obj \
-# $(SLO)$/synchronize.obj \
-# $(SLO)$/filehelper.obj \
-# $(SLO)$/mergechange.obj \
-# $(SLO)$/providerimpl.obj \
-# $(SLO)$/bootstrap.obj \
-# $(SLO)$/matchlocale.obj \
-# $(SLO)$/changes.obj \
-# $(SLO)$/configexcept.obj \
-# $(SLO)$/valuehandler.obj \
-# $(SLO)$/treenodefactory.obj \
-# $(SLO)$/attributelist.obj \
-# $(SLO)$/namehelper.obj \
-# $(SLO)$/localizedtreeactions.obj \
-# $(SLO)$/trivialbufferedfile.obj \
-# $(SLO)$/cachewritescheduler.obj \
-# $(SLO)$/disposetimer.obj \
-# $(SLO)$/noderef.obj \
-# $(SLO)$/treedata.obj \
-# $(SLO)$/confevents.obj \
-# $(SLO)$/treebuildercallback.obj \
-# $(SLO)$/loader.obj \
-# $(SLO)$/apifactoryimpl.obj \
-# $(SLO)$/apitreeimplobj.obj \
-
-# $(SLO)$/.obj \
-
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/memory/memorymeasure.hxx b/configmgr/workben/memory/memorymeasure.hxx
deleted file mode 100644
index 90bb777e27d8..000000000000
--- a/configmgr/workben/memory/memorymeasure.hxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
-
-// *************************************************************************************************************
-// special macros for time measures
-// 1) LOGFILE_MEMORYMEASURE used it to define log file for this operations (default will be set automaticly)
-// 2) MAKE_MEMORY_SNAPSHOT make snapshot of currently set memory informations of OS
-// 3) LOG_MEMORYMEASURE write measured time to logfile
-// *************************************************************************************************************
-
-#ifdef ENABLE_MEMORYMEASURE
-
-#if !defined( WIN ) && !defined( WNT )
-#error "Macros to measure memory access not available under platforms different from windows!"
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
-
-#include <rtl/strbuf.hxx>
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-
-/*_____________________________________________________________________________________________________________
- LOGFILE_MEMORYMEASURE
-
- For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
- _____________________________________________________________________________________________________________*/
-
-#ifndef LOGFILE_MEMORYMEASURE
-#define LOGFILE_MEMORYMEASURE "memorymeasure.log"
-#endif
-
-/*_____________________________________________________________________________________________________________
- class MemoryMeasure
-
- We use this baseclass to collect all snapshots in one object and analyze this information at one point.
- Macros of this file are used to enable using of this class by special compile-parameter only!
- _____________________________________________________________________________________________________________*/
-
-class _DBGMemoryMeasure
-{
- //---------------------------------------------------------------------------------------------------------
-private:
- struct _MemoryInfo
- {
- MEMORYSTATUS aStatus ;
- ::rtl::OString sComment ;
- };
-
- //---------------------------------------------------------------------------------------------------------
-public:
- //_____________________________________________________________________________________________________
- inline _DBGMemoryMeasure()
- {
- makeSnapshot("Initializing Data");
- }
- //_____________________________________________________________________________________________________
- inline _DBGMemoryMeasure(const ::rtl::OString& sComment)
- {
- makeSnapshot(sComment);
- }
-
- //_____________________________________________________________________________________________________
- // clear used container!
- inline ~_DBGMemoryMeasure()
- {
- ::std::vector< _MemoryInfo >().swap( m_lSnapshots );
- }
-
- //_____________________________________________________________________________________________________
- inline void makeSnapshot( const ::rtl::OString& sComment )
- {
- _MemoryInfo aInfo;
- aInfo.sComment = sComment;
- GlobalMemoryStatus ( &(aInfo.aStatus) );
- m_lSnapshots.push_back( aInfo );
- }
-
- //_____________________________________________________________________________________________________
- inline ::rtl::OString getLog()
- {
- ::rtl::OStringBuffer sBuffer( 10000 );
-
- if( m_lSnapshots.size() > 0 )
- {
- // Write informations to return buffer
- ::std::vector< _MemoryInfo >::const_iterator pItem1;
- ::std::vector< _MemoryInfo >::const_iterator pItem2;
-
- pItem1 = m_lSnapshots.begin();
- pItem2 = pItem1;
- ++pItem2;
-
- while( pItem1!=m_lSnapshots.end() )
- {
- sBuffer.append( "snap [ " );
- sBuffer.append( pItem1->sComment );
- sBuffer.append( " ]\n\tavail phys\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailPhys );
- sBuffer.append( "\n\tavail page\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailPageFile );
- sBuffer.append( "\n\tavail virt\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailVirtual );
-
- if( pItem1 == m_lSnapshots.begin() )
- {
- sBuffer.append( "\n\t[initial values]\n\n" );
- }
- else if( pItem2 != m_lSnapshots.end() )
- {
- sBuffer.append( "\n\tdifference\t=\t[ " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailPhys - pItem1->aStatus.dwAvailPhys ) );
- sBuffer.append( ", " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailPageFile - pItem1->aStatus.dwAvailPageFile ) );
- sBuffer.append( ", " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailVirtual - pItem1->aStatus.dwAvailVirtual ) );
- sBuffer.append( " ]\n\n" );
- }
- else
- {
- sBuffer.append( "\n\t[final values]\n\n" );
- }
- if( pItem1!=m_lSnapshots.end() ) ++pItem1;
- if( pItem2!=m_lSnapshots.end() ) ++pItem2;
- }
- // clear current list ... make it empty for further snapshots!
- ::std::vector< _MemoryInfo >().swap( m_lSnapshots );
- }
-
- return sBuffer.makeStringAndClear();
- }
-
- //---------------------------------------------------------------------------------------------------------
-private:
- ::std::vector< _MemoryInfo > m_lSnapshots;
-};
-
-/*_____________________________________________________________________________________________________________
- START_MEMORY_MEASURE
-
- Create new object to measure memory access.
- _____________________________________________________________________________________________________________*/
-
-#define START_MEMORYMEASURE( AOBJECT ) \
- _DBGMemoryMeasure AOBJECT;
-
-#define START_MEMORYMEASURE_FOR( AOBJECT, SCOMMENT ) \
- _DBGMemoryMeasure AOBJECT( SCOMMENT );
-
- /*_____________________________________________________________________________________________________________
- MAKE_MEMORY_SNAPSHOT
-
- Make snapshot of currently set memory informations of OS.
- see _DBGMemoryMeasure for further informations
- _____________________________________________________________________________________________________________*/
-
-#define MAKE_MEMORY_SNAPSHOT( AOBJECT, SCOMMENT ) \
- AOBJECT.makeSnapshot( SCOMMENT );
-
- /*_____________________________________________________________________________________________________________
- LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT )
-
- Write measured values to logfile.
- _____________________________________________________________________________________________________________*/
-
-#define LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT ) \
- { \
- ::rtl::OStringBuffer _sBuffer( 256 ); \
- _sBuffer.append( SOPERATION ); \
- _sBuffer.append( "\n" ); \
- _sBuffer.append( SCOMMENT ); \
- _sBuffer.append( "\n\n" ); \
- _sBuffer.append( AOBJECT.getLog() ); \
- WRITE_LOGFILE( LOGFILE_MEMORYMEASURE, _sBuffer.makeStringAndClear() ) \
- }
-
-#else // #ifdef ENABLE_MEMORYMEASURE
-
-/*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macros empty!
- _____________________________________________________________________________________________________________*/
-
-#undef LOGFILE_MEMORYMEASURE
-#define START_MEMORYMEASURE( AOBJECT )
-#define MAKE_MEMORY_SNAPSHOT( AOBJECT, SCOMMENT )
-#define LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT )
-
-#endif // #ifdef ENABLE_MEMORYMEASURE
-
-//*****************************************************************************************************************
-// end of file
-//*****************************************************************************************************************
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
diff --git a/configmgr/workben/memory/memorytests.cxx b/configmgr/workben/memory/memorytests.cxx
deleted file mode 100644
index 70a712a584f9..000000000000
--- a/configmgr/workben/memory/memorytests.cxx
+++ /dev/null
@@ -1,1241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-#include <vector>
-#include "treeload.hxx"
-
-#include <fstream>
-
-#define ENABLE_MEMORYMEASURE
-#define ENABLE_LOGMECHANISM
-
-// If you wish to enable this memory measure macros ... you need "windows.h"
-// But it's not agood idea to include it in your header!!! Because it's not compatible to VCL header .-(
-// So you must include it here ... in cxx, where you whish to use it.
-#ifdef ENABLE_MEMORYMEASURE
- #define VCL_NEED_BASETSD
- #include <tools/presys.h>
- #include <windows.h>
- #include <tools/postsys.h>
- #undef VCL_NEED_BASETSD
-#endif
-#include "memorymeasure.hxx"
-
-#include "logmechanism.hxx"
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include <conio.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-#include "testmodules.hxx"
-
-#include "valuenode.hxx"
-
-namespace configmgr
-{
-
-using namespace std;
-
-namespace css = com::sun::star;
-namespace uno = css::uno;
-namespace lang = css::lang;
-
-using namespace uno;
-using namespace lang;
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (::rtl::OString& _rAsciiString, ::rtl::OUString const& _rUnicodeString )
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString, RTL_TEXTENCODING_ASCII_US).getStr();
-}
-
-// -----------------------------------------------------------------------------
-
-rtl::OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return rtl::OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
-
- rtl::OUString sValue;
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- return sValue;
-}
-//=============================================================================
-
-uno::Reference< lang::XMultiServiceFactory > getORB();
-// -----------------------------------------------------------------------------
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-#ifdef LLA_PRIVAT_DEBUG
-// static const sal_Char* s_pSourcePath = "//./l|/src632/configmgr/workben/local_io/share";
-// static const sal_Char* s_pUpdatePath = "//./l|/src632/configmgr/workben/local_io/user";
-static const sal_Char* s_pSourcePath = "file:///f:/office60_633/share/config/registry";
-static const sal_Char* s_pUpdatePath = "file:///f:/office60_633/user/config/registry";
-static const sal_Char* s_pRootNode = "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "";
-static const sal_Char* s_pUser = "";
-static const sal_Char* s_pPassword = "";
-#else
-static const sal_Char* s_pSourcePath = "file:///g:/src/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "file:///g:/src/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-#endif
-
-static bool m_bChange = false;
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sNormalized;
- sNormalized = sExecutable;
- if (1) // osl_File_E_None == osl_normalizePath(sExecutable.pData, &sNormalized.pData))
- {
- ::osl::Profile aProfile(sNormalized);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-// -----------------------------------------------------------------------------
-
-void test_configuration_provider(uno::Reference<lang::XMultiServiceFactory> _xCfgProvider,
- rtl::OUString const& _sUser, bool _bLocal, sal_Int32 _nCount);
-
-
-// -----------------------------------------------------------------------------
-
-uno::Reference<lang::XMultiServiceFactory>
-getProvider(
- uno::Reference< lang::XMultiServiceFactory > _xServiceRegistry,
- rtl::OUString const& _sServerType,
- rtl::OUString const& _sSharePath, rtl::OUString const& _sUserPath,
- bool &_bLocal)
-{
- try
- {
- Sequence< Any > aCPArgs;
-
- OUString sServerType = _sServerType; // enterValue("servertype: ", s_pServerType, false);
-
- rtl::OUString sUser;
-
- _bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!_bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- cout << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- cout << endl;
-
- OUString sPasswd = enterValue("password: ", s_pPassword, true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- OUString sTimeout = ASCII("10000");
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), sTimeout);
-
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = _sSharePath;// enterValue("share path: ", s_pSourcePath, false);
- // cout << endl;
- sUserPath = _sUserPath; // enterValue("user path : ", s_pUpdatePath, false);
- // cout << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- sal_Int32 nCount = aCPArgs.getLength() - 1;
- Any *pAny = &aCPArgs[nCount];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- _xServiceRegistry->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 0;
- }
-// -----------------------------------------------------------------------------
- return xCfgProvider;
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 m_nCount = 0;
-
-void test(uno::Reference<lang::XMultiServiceFactory> _xORB, rtl::OUString const& _sSharePath,
- rtl::OUString const& _sUserPath)
-{
-
- rtl::OUString sUser;
- bool bLocal;
- cout << ++m_nCount << ". start test with new provider\n";
- {
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** API Test Execution ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Erzeuge Provider" );
-
- uno::Reference<lang::XMultiServiceFactory>xCfgProvider =
- getProvider(_xORB, ASCII("local"), _sSharePath, _sUserPath,
- bLocal);
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Habe Provider, starte Test" );
-
- test_configuration_provider(xCfgProvider, sUser, bLocal, 0); // xml
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Test gelaufen, starte erneut" );
-
- test_configuration_provider(xCfgProvider, sUser, bLocal, 0); // xml
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Test gelaufen, entsorge Provider" );
-
- uno::Reference<lang::XComponent>xComponent(xCfgProvider,UNO_QUERY);
- xComponent->dispose();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Provider disposed" );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test 2-----------------------------", "- Test memory traces.", aMemoryInfo );
- }
-
- cout << "finish provider test\n";
-
- // Test Version 1 and 3, it MUST be equal
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-static rtl::OUString makeFileURL(OUString const& sMaybeURL)
-{
- rtl::OUString const fileURLStart(RTL_CONSTASCII_USTRINGPARAM("file:/"));
-
- if ( 0 != fileURLStart.compareTo(sMaybeURL, fileURLStart.getLength()) )
- {
- OUString sURL;
- if (!osl_getFileURLFromSystemPath(sMaybeURL.pData, &sURL.pData))
- return sURL;
- }
-
- return sMaybeURL;
-}
-// -----------------------------------------------------------------------------
-static rtl::OUString makeSystemPath(OUString const& sMaybeURL)
-{
- rtl::OUString const fileURLStart(RTL_CONSTASCII_USTRINGPARAM("file:/"));
-
- if ( 0 == fileURLStart.compareTo(sMaybeURL, fileURLStart.getLength()) )
- {
- OUString sSysPath;
- if (!osl_getSystemPathFromFileURL(sMaybeURL.pData, &sSysPath.pData))
- return sSysPath;
- }
-
- return sMaybeURL;
-}
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-int main( int argc, char * argv[] )
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- sal_Int32 nSizeISubtree = sizeof(ISubtree);
- sal_Int32 nSizeINode = sizeof(INode);
- sal_Int32 nSizeIValueNode = sizeof(ValueNode);
- {
- loadDefaults();
-
- Reference< XMultiServiceFactory > xORB = getORB();
-
- rtl::OUString sSharePath = makeSystemPath(enterValue("share path: ", s_pSourcePath, false));
- cout << endl;
- rtl::OUString sUserPath = makeSystemPath(enterValue("user path : ", s_pUpdatePath, false));
- cout << endl;
-
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.test"));
-
- // char* pMem = new char[1000 * 1000 * 10];
- // showMemoryStatistic();
-
-// test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Views"));
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** API Test Main ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "starte test !" );
-
- test(xORB, sSharePath, sUserPath);
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "tests beendet !" );
-
- // stop the programm clear.
- Reference< XComponent > xComponent(xORB, UNO_QUERY);
- xComponent->dispose();
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ORB disposed." );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test-------------------------------", "Outer memory traces.", aMemoryInfo );
- }
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- {
- // cout << "Accessing Node: " << xAccessName->getHierarchicalName();
- }
- else
- {
- // cout << "BUG: XHierarchicalName not available";
- }
- // cout << endl;
-}
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- {
- // cout << "Node is named: " << xAccess->getName();
- }
- else
- {
- // cout << "BUG: XNamed not available";
- }
- // cout << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void fillAllNames(Reference<XNameAccess >& xAccess, Sequence<OUString>& _aSeq)
-{
- if (xAccess.is())
- {
- _aSeq = Sequence <OUString>(xAccess->getElementNames());
-
- // cout << "Element Names: (" << _aSeq.getLength() << ")";
- // for (int i = 0; i < _aSeq.getLength(); ++i)
- // cout << "\n[" << i << "] -\t" << _aSeq[i];
- //cout << endl;
- }
- else
- {
- // cout << "BUG: XNameAccess not available";
- }
- // cout << endl;
-}
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- {
- // cout << "\n[ P ] -\tParent";
- }
- else
- {
- // cout << "BUG: Parent not available (no XChild)";
- }
- // cout << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-// -----------------------------------------------------------------------------
-Reference< XInterface > readaccess(uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface > const& xIface,
- rtl::OString const& buf,
- ostream& outStream)
-{
- Reference< XInterface > xNext;
- try
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- int n = atoi(buf);
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (0 <= n && n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ?
- ( xDeepAccess.is() ?
- xDeepAccess->getByHierarchicalName(aName) : Any()
- ) :
- ( xAccess.is() ?
- xAccess->getByName(aName) : Any()
- );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE:
- bValue = false;
- if (aElement >>= xNext)
- {
- outStream << "Group: " << aName << endl;
- }
- else
- {
- outStream << "ERROR: can't get the interface" << endl;
- }
- break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- outStream << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- outStream << "NULL (error!!)";
- else if (*pVal)
- outStream << "'TRUE'";
- else
- outStream << "'FALSE'";
-
- outStream << endl;
-
- // tryToChange(xAccess, aName, pVal);
- break;
- }
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- outStream << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
-
- break;
- }
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- outStream << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- outStream << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << double(aValue);
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_DOUBLE:
- {
- double aValue;
- outStream << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_STRING:
- {
- OUString aValue;
- outStream << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << "\"" << aValue << "\"";
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_SEQUENCE:
- {
- outStream << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- outStream << "UNO type is " << aElement.getValueType().getTypeName() << endl;
- outStream << "Real type is Sequence<" << sType << ">" << endl;
- // outSequence(aElement, aTypeS, outStream);
- bValueOk = true;
- break;
- }
- case TypeClass_VOID:
- outStream << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- outStream << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
-
- }
- else
- {
- outStream << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
- }
- catch (Exception& e)
- {
- outStream << "An Exception occurred: " << e.Message << endl;
- }
- catch (...)
- {
- outStream << "An UNKNOWN Exception occurred !" << endl;
- }
-
- return xNext;
-}
-
-
-
-
-// -----------------------------------------------------------------------------
-void test_read_access( uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface >& xIface,
- ofstream & out)
-{
- Sequence<OUString> aAllNames;
-
- using com::sun::star::uno::UNO_QUERY;
-
- // cout << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- fillAllNames(xAccess, aAllNames);
- write(xChild);
-
- for (sal_Int32 i=0;i<aAllNames.getLength();i++)
- {
- OString aValue;
- aValue <<= aAllNames[i];
- uno::Reference<uno::XInterface> xFace = readaccess(xMSF, xIface, aValue, out);
- if (xFace.is())
- {
- test_read_access(xMSF, xFace, out);
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-void test_read_access( uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface >& xIface,
- rtl::OString aFilename)
-{
- ofstream out(aFilename.getStr());
- test_read_access(xMSF, xIface, out);
-}
-
-// -----------------------------------------------------------------------------
-void test_configuration_provider(uno::Reference<lang::XMultiServiceFactory> _xCfgProvider,
- rtl::OUString const& _sUser, bool _bLocal,
- sal_Int32 _nCount)
-{
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** Configuration Provider Loop Test ***" );
- START_MEMORYMEASURE_FOR( aInnerMemoryInfo, "*** Configuration Provider Module Details ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- std::vector< Reference< XInterface > > aLoadedModules;
- aLoadedModules.reserve(configtest::s_nTestModules);
-
- Sequence< Any > aArgs;
- aArgs = createSequence(_sUser, ASCII(""));
-
- if (!_bLocal)
- {
- OUString sLocale = enterValue("locale : ", s_pLocale, false);
- cout << endl;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-
-#if 0
- sal_Bool bLazyWrite = true;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("lazywrite"), bLazyWrite);
-#else
- sal_Bool bNoCache = true;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nocache"), bNoCache);
-#endif
-
- sal_Int32 nPathIdx = aArgs.getLength();
- aArgs.realloc(nPathIdx + 1);
-
- const OString sInnerInfoText("- - - Loading module: ");
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- - - Before Loading Modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Prepared Arguments - Lade Module" );
-
- for (char const * const * ppTestModule = configtest::s_aTestModules; *ppTestModule; ++ppTestModule)
- {
- OUString sPath = OUString::createFromAscii(*ppTestModule);
- cout << "\t" << ++_nCount << ". test with node: " << sPath << endl;
-
- aArgs[nPathIdx] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerInfoText.concat(*ppTestModule) );
- Reference< XInterface > xIFace = _xCfgProvider->createInstanceWithArguments(
- /* OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"), */
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
- aArgs);
- // cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
-
- aLoadedModules.push_back(xIFace);
- /*
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = _xCfgProvider->getAvailableServiceNames();
-
- OString sPath;
- sPath <<= _sPath;
-
- OString aFilename = "c:\\temp\\fileout_";
- aFilename += sPath;
- aFilename += OString::valueOf(_nCount);
- aFilename += ".txt";
- test_read_access(_xCfgProvider, xIFace, aFilename);
- */
- }
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- - - Done Loading modules" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Alle Module geladen" );
-
- aLoadedModules.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Module released" );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test 3 -----------------------------", "- - Provider memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- API Memory Test 4 -----------------------------", "- - - Module memory traces.", aInnerMemoryInfo );
-
-}
-
-
-// -----------------------------------------------------------------------------
-// ----------------------------------- Main 2 -----------------------------------
-// -----------------------------------------------------------------------------
-
-int requestTest( int argc, char * argv[] )
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- sal_Int32 nSizeISubtree = sizeof(ISubtree);
- sal_Int32 nSizeINode = sizeof(INode);
- sal_Int32 nSizeIValueNode = sizeof(ValueNode);
- {
- loadDefaults();
-
- Reference< XMultiServiceFactory > xORB = getORB();
-
- rtl::OUString sSharePath = makeFileURL(enterValue("share path: ", s_pSourcePath, false));
- cout << endl;
- rtl::OUString sUserPath = makeFileURL(enterValue("user path : ", s_pUpdatePath, false));
- cout << endl;
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** Request Tree Test ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "create tree manager" );
-
- OTreeLoad aTreeLoad(xORB, sSharePath, sUserPath);
- sal_Int32 nIdx = 0;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "created tree manager" );
-
- OString const sInnerInfoText("- Loading module: ");
-
- START_MEMORYMEASURE_FOR( aInnerMemoryInfo, "*** Request Tree Test Details ***" );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- before loading modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "request subtrees" );
-
- for (char const * const * ppRequestModule = configtest::s_aTestModules; *ppRequestModule; ++ppRequestModule)
- {
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerInfoText.concat(*ppRequestModule) );
- aTreeLoad.requestSubtree( OUString::createFromAscii(*ppRequestModule));
- }
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- loaded all modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "release subtrees" );
-
- for (char const * const * ppReleaseModule = configtest::s_aTestModules; *ppReleaseModule; ++ppReleaseModule)
- aTreeLoad.releaseSubtree( OUString::createFromAscii(*ppReleaseModule));
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig." );
- LOG_MEMORYMEASURE( "---------------- Request Memory Test ---------------------------", "Direct Cache Access memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- Request Memory Detail -------------------------", "Module request memory traces.", aInnerMemoryInfo );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// --------------------------------- Trust Test ---------------------------------
-// -----------------------------------------------------------------------------
-
-int trust( int argc, char * argv[] )
-{
- Reference< XMultiServiceFactory > xORB = getORB();
-
- std::vector<char*> aMemHolder;
- aMemHolder.reserve(1024);
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "Allocator check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- sal_Int32 const total_alloc = 8 * 1024 * 1024;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "get 8 MB" );
-
- char* pChar = new char[total_alloc];
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free 8 MB" );
-
- delete [] pChar;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "deleted 8 MB" );
-
- sal_Int32 const chunk = 8 * 1024;
- sal_Int32 const alloc_count = total_alloc/chunk;
-
- sal_Int32 const msg_count = 16;
- sal_Int32 const loop_count = alloc_count/msg_count;
- sal_Int32 const loop_allocation = loop_count * chunk;
-
- OString const sPieces = OString::valueOf(alloc_count).concat(" pieces");
- OString const sInnerMessage = OString("Allocating ").concat(OString::valueOf(loop_count))
- .concat(" chunks [").concat(OString::valueOf(loop_allocation)).concat(" Bytes].");
-
- START_MEMORYMEASURE( aInnerMemoryInfo );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, OString("get 8 MB as ").concat(sPieces) );
-
- for (sal_Int32 i=0;i<alloc_count/loop_count;i++)
- {
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerMessage );
- for (sal_Int32 j=0;j<loop_count;j++)
- {
-
- pChar = new char[8 * 1024];
- aMemHolder.push_back(pChar);
- }
- }
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "last allocation done" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free pieces" );
-
- pChar = NULL;
- for (std::vector<char*>::iterator it = aMemHolder.begin();
- it != aMemHolder.end();
- it++)
- {
- pChar = *it;
- delete []pChar;
- }
- aMemHolder.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, OString("get another 8 MB as ").concat(sPieces) );
-
-
- for (sal_Int32 j=0;j<alloc_count;j++)
- {
- pChar = new char[8 * 1024];
- aMemHolder.push_back(pChar);
- }
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free second set of pieces" );
-
- pChar = NULL;
- for (std::vector<char*>::iterator jt = aMemHolder.begin();
- jt != aMemHolder.end();
- jt++)
- {
- pChar = *jt;
- delete []pChar;
- }
- aMemHolder.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig." );
- LOG_MEMORYMEASURE( "---------------- Trust Memory Test ----------------------------", "Cross-checked memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- Small Allocation Loop ------------------------", "Allocation Loop Detail memory traces.", aInnerMemoryInfo );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-static uno::Reference< lang::XMultiServiceFactory > g_xORB;
-static void createORB(char const* pRegistry)
-{
- if (!g_xORB.is())
- try
- {
- rtl::OUString const sServiceRegistry = OUString::createFromAscii(pRegistry);
-
- g_xORB = createRegistryServiceFactory( sServiceRegistry, ::rtl::OUString() );
-
- }
- catch (uno::Exception &e)
- {
- cerr << "Exception creating the service factory: " << e.Message << "\n";
- }
- else
- cerr << "Trying to recreate the service factory\n";
-
- if (!g_xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory '" << pRegistry << "' !\n";
- exit(-2);
- }
-}
-uno::Reference< lang::XMultiServiceFactory > getORB()
-{
- if (!g_xORB.is())
- {
- createORB( "applicat.rdb" );
- }
- return g_xORB;
-}
-// -----------------------------------------------------------------------------
-
-
-} // namespace configmgr
-// -----------------------------------------------------------------------------
-void usage()
-{
- cerr << "Wrong or missing parameters.\nUsage:\n"
- "\tmemorytest [-r <registry.rdb>] (all | trust | request | api)+ [clear] [(+<module>|-<module>)+]\n";
-
- exit(-1);
-}
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Main ------------------------------------
-// -----------------------------------------------------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- if (argc > 1 && !::rtl_str_compare(argv[1], "-r" ) )
- {
- if (!argv[2]) usage();
-
- configmgr::createORB(argv[2]);
-
- argv += 2;
- argc -= 2;
- }
- configmgr::getORB(); // ensures there is one
-
- enum TestSelect { TEST_TRUST = 01, TEST_REQUEST = 02, TEST_API = 04, TEST_ALL = 07 };
-
- unsigned nSelect = 0;
- while (argc >= 1 && argv[1] != NULL)
- {
- if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "trust" ) ) nSelect |= TEST_TRUST;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "request") ) nSelect |= TEST_REQUEST;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "api" ) ) nSelect |= TEST_API;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "all" ) ) nSelect |= TEST_ALL;
- else break;
-
- // here we found a known selector, so look on
- ++argv;
- --argc;
- }
-
- if (nSelect == 0) usage();
-
-//--------------------
-#define DO_TEST( test, func ) \
- if (nSelect & TEST_##test) \
- { \
- char const * const test_name = #test; \
- if (int nRet = func(argc, argv)) \
- cerr << "Test: " << test_name << " returned with error code " << nRet << endl; \
- else \
- cerr << "Test: " << test_name << " finished without error !\n" ; \
- } else // to allow a semicolon
-//--------------------
-
- DO_TEST( TRUST , configmgr::trust );
- DO_TEST( REQUEST , configmgr::requestTest );
- DO_TEST( API , configmgr::main );
-
- return 0;
-}
-
diff --git a/configmgr/workben/memory/testmodules.cxx b/configmgr/workben/memory/testmodules.cxx
deleted file mode 100644
index 2967a962c56a..000000000000
--- a/configmgr/workben/memory/testmodules.cxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "testmodules.hxx"
-
-
-namespace configtest
-{
- #if 0 // more modules
- +"org.openoffice.Office.Common",
- +"org.openoffice.Office.Linguistic",
- x"org.openoffice.Office.TypeDetection",
- x"org.openoffice.Setup",
- -"org.openoffice.UserProfile",
- +"org.openoffice.Inet",
- -"org.openoffice.Office.Calc",
- -"org.openoffice.Office.Chart",
- -"org.openoffice.Office.DataAccess",
- -"org.openoffice.Office.Draw",
- -"org.openoffice.Office.Impress",
- -"org.openoffice.Office.Java",
- -"org.openoffice.Office.Labels",
- -"org.openoffice.Office.Math",
- +"org.openoffice.Office.Views",
- +"org.openoffice.Office.Writer",
- +"org.openoffice.Office.WriterWeb",
- +"org.openoffice.ucb.Configuration",
- -"org.openoffice.ucb.Hierarchy",
- x"org.openoffice.ucb.Store",
- #endif
-
- char const * const s_aTestModules[] =
- {
- "org.openoffice.Office.Common",
- "org.openoffice.Setup/CJK/Enable",
- "org.openoffice.Setup/Office/Modules",
- "org.openoffice.Inet",
- "org.openoffice.Office.Views",
- "org.openoffice.Setup/Product",
- "org.openoffice.ucb.Configuration",
- "org.openoffice.ucb.Store/ContentProperties",
- "org.openoffice.Office.TypeDetection",
- "org.openoffice.Office.Writer",
- "org.openoffice.Office.WriterWeb",
- "org.openoffice.Office.Linguistic",
- NULL // end marker
- };
- unsigned int const s_nTestModules = sizeof s_aTestModules/sizeof 0[s_aTestModules];
-
- std::vector<char const *> listTestModules(int argc, char* argv[])
- {
- std::vector<char const *> aModuleList( s_aTestModules, s_aTestModules + s_nTestModules);
- return aModuleList;
- }
-}
-
-
diff --git a/configmgr/workben/memory/treeload.cxx b/configmgr/workben/memory/treeload.cxx
deleted file mode 100644
index 11ce7c40a6b9..000000000000
--- a/configmgr/workben/memory/treeload.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <localsession.hxx>
-#include <treecache.hxx>
-#include <options.hxx>
-#include <rtl/ustring.hxx>
-#include "treeload.hxx"
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-// -----------------------------------------------------------------------------
-// ------------------------- requestSubtree without API -------------------------
-// -----------------------------------------------------------------------------
-
- OTreeLoad::OTreeLoad(uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider,
- rtl::OUString const& _sSourceDirectory, rtl::OUString const& _sUpdateDirectory) throw (uno::Exception)
- :m_xServiceProvider(_xServiceProvider)
-{
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> xConverter;
- xConverter = xConverter.query(m_xServiceProvider->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- m_xDefaultOptions = new OOptions(xConverter);
- m_xDefaultOptions->setNoCache(true);
-
- // create it .. and connect
- std::auto_ptr<LocalSession> pLocal( new LocalSession(m_xServiceProvider) );
- sal_Bool bOpen = pLocal->open(_sSourceDirectory, _sUpdateDirectory);
-
- IConfigSession* pConfigSession = pLocal.release();
-
- m_pTreeMgr = new TreeManager(pConfigSession, m_xDefaultOptions);
-}
-// -----------------------------------------------------------------------------
-ISubtree* OTreeLoad::requestSubtree( OUString const& aSubtreePath) throw (uno::Exception)
-{
- return m_pTreeMgr->requestSubtree(aSubtreePath, m_xDefaultOptions, /* MinLevel */ -1);
-}
-// -----------------------------------------------------------------------------
-void OTreeLoad::releaseSubtree( OUString const& aSubtreePath) throw (uno::Exception)
-{
- m_pTreeMgr->releaseSubtree(aSubtreePath, m_xDefaultOptions);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/workben/memory/treeload.hxx b/configmgr/workben/memory/treeload.hxx
deleted file mode 100644
index 088c5d24d4cc..000000000000
--- a/configmgr/workben/memory/treeload.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef CONFIGMGR_TREELOAD_HXX
-#define CONFIGMGR_TREELOAD_HXX
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#ifndef _CONFIGMGR_LOCAL_LOCAL_HXX_
-#include <localsession.hxx>
-#endif
-
-#ifndef _CONFIGMGR_TREECACHE_HXX_
-#include <treecache.hxx>
-#endif
-#include <options.hxx>
-#include <rtl/ustring.hxx>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-// -----------------------------------------------------------------------------
-class OTreeLoad
-{
- // LocalSession* m_pLocalSession; // in TreeMgr
- TreeManager* m_pTreeMgr;
- ::vos::ORef<OOptions> m_xDefaultOptions;
- uno::Reference<lang::XMultiServiceFactory> m_xServiceProvider;
-
-public:
-
- OTreeLoad(uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider,
- rtl::OUString const& _sSourceDirectory, rtl::OUString const& _sUpdateDirectory);
-
- ISubtree* requestSubtree(rtl::OUString const& aSubtreePath);
- void releaseSubtree(rtl::OUString const& aSubtreePath);
-};
-
-} // namespace
-
-#endif
diff --git a/configure.in b/configure.in
index be384fb3adc3..d3e5a0757435 100644
--- a/configure.in
+++ b/configure.in
@@ -183,10 +183,8 @@ AC_ARG_ENABLE(dbgutil,
Independent from --enable-debug
],,)
AC_ARG_ENABLE(crashdump,
-[[ --enable-crashdump[=yes|TRUE|STATIC|no]
- Enable (disable) the crashdump feature code.
- [default=no]
-]],,enable_crashdump=no)
+[ --enable-crashdump Enable the crashdump feature code.
+],,)
AC_ARG_ENABLE(cl-standard,
[ --enable-cl-standard For Microsoft C/C++ compiler users, use non-optimizing
standard compiler. ( This just disavles optimization
@@ -1047,23 +1045,13 @@ dnl ===================================================================
dnl Set the ENABLE_CRASHDUMP variable.
dnl ===================================================================
AC_MSG_CHECKING([whether to enable crashdump feature])
-if test "$enable_crashdump" = "yes" -o "$enable_crashdump" = "TRUE"; then
+if test "$enable_crashdump" = "yes"; then
ENABLE_CRASHDUMP="TRUE"
- AC_MSG_RESULT([yes])
BUILD_TYPE="$BUILD_TYPE CRASHREP"
+ AC_MSG_RESULT([yes])
else
- if test "$enable_crashdump" = "STATIC"; then
- ENABLE_CRASHDUMP="STATIC"
- AC_MSG_RESULT([yes, STATIC])
- BUILD_TYPE="$BUILD_TYPE CRASHREP"
- else
- if test "$enable_crashdump" = "" -o "$enable_crashdump" = "no"; then
- ENABLE_CRASHDUMP=""
- AC_MSG_RESULT([no])
- else
- AC_MSG_ERROR([--enable-crashdump only accepts yes, no, TRUE or STATIC as parameter.])
- fi
- fi
+ ENABLE_CRASHDUMP=""
+ AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_CRASHDUMP)
diff --git a/connectivity/prj/d.lst b/connectivity/prj/d.lst
index 8b5aaa1c60eb..e116ee5740ac 100644
--- a/connectivity/prj/d.lst
+++ b/connectivity/prj/d.lst
@@ -28,6 +28,6 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess
..\%__SRC%\inc\sqlbison.hxx %_DEST%\inc%_EXT%\connectivity\sqlbison.hxx
..\inc\connectivity\sdbcx\*.hxx %_DEST%\inc%_EXT%\connectivity\sdbcx\*.hxx
#..\version.mk %_DEST%\inc%_EXT%\connectivity\version.mk
-..\%__SRC%\misc\lang\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
+..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
diff --git a/connectivity/util/langfilter.xsl b/connectivity/util/langfilter.xsl
deleted file mode 100755
index 76cfcff20ac6..000000000000
--- a/connectivity/util/langfilter.xsl
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oor="http://openoffice.org/2001/registry">
-<xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8"/>
-<xsl:param name="lang"/>
-<xsl:template match="*">
- <xsl:if test="count(.//*[@xml:lang=$lang])&gt;0">
- <xsl:copy>
- <xsl:apply-templates select="*|@*"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="@*">
- <xsl:copy>
- <xsl:apply-templates select="*|@*"/>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match="value">
- <xsl:if test="@xml:lang=$lang">
- <xsl:copy>
- <xsl:apply-templates select="@*|text()"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="text()">
- <xsl:if test="../@xml:lang=$lang">
- <xsl:copy>
- <xsl:apply-templates select="@*|text()"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-
-</xsl:stylesheet>
-
diff --git a/connectivity/util/makefile.mk b/connectivity/util/makefile.mk
index 45d80fc049ff..d92fe00bba24 100755
--- a/connectivity/util/makefile.mk
+++ b/connectivity/util/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,75 +23,40 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ = ..
-TARGET = connectivity
+PRJ = ..
PRJNAME = connectivity
+TARGET = connectivity
-# -----------------------------------------------------------------------------
-# include global settings
-# -----------------------------------------------------------------------------
-
-.INCLUDE : settings.mk
-
-DIR_FILTERCFGOUT := $(MISC)$/drivers
-DIR_LANGPACK := $(DIR_FILTERCFGOUT)
-.IF "$(WITH_LANG)"!=""
-DIR_LANG_SOURCE := $(MISC)$/merge
-.ELSE
-DIR_LANG_SOURCE := $(MISC)$/registry$/data
-.ENDIF
-DRIVER_MERGE_XCU := $(shell -@$(FIND) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess -name "*.xcu")
-DRIVER_MERGE_DEST = $(MISC)/lang/{$(DRIVER_MERGE_XCU:f)}
-REALFILTERPACKAGES_FILTERS_UI_LANGPACKS = \
- $(foreach,i,$(alllangiso) $(foreach,j,$(DRIVER_MERGE_XCU) $(DIR_LANGPACK)$/$i$/org$/openoffice$/Office$/DataAccess$/$(j:f)))
-
-.INCLUDE: target.mk
+.INCLUDE : settings.mk
+.INCLUDE : target.mk
-PACKLANG := $(XSLTPROC) --nonet
-PACKLANG_IN :=
-PACKLANG_PARAM := --stringparam
-PACKLANG_XSL :=
-
-$(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS) :
- @echo ===================================================================
- @echo Building language package for driver $(@:b:s/Filter_//)
- @echo ===================================================================
- +-$(MKDIRHIER) $(@:d)
- $(PACKLANG) $(PACKLANG_PARAM) lang $(@:d:d:d:d:d:d:d:d:d:d:b) $(PACKLANG_XSL) langfilter.xsl $(PACKLANG_IN) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess$/$(@:f) > $@
+# For any given platform, for each driver .xcu (in $(MY_XCUS)) built on that
+# platform (in $(MISC)/registry/data/org/openoffice/Office/DataAccess) there are
+# corresponding language-specific .xcu files (in
+# $(MISC)/registry/res/%/org/openoffice/Office/DataAccess). For each language,
+# all language-specific .xcu files for that language are assembled into
+# $(BIN)$/fcfg_drivers_%.zip. To meet the requirements of dmake percent rules,
+# the first item from $(MY_XCUS) is arbitrarily taken to be the main
+# prerequisite while all the items from $(MY_XCUS) are made into indirect
+# prerequisites (harmlessly doubling the first item).
-$(MISC)$/$(TARGET)_delzip :
- -$(RM) $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip
+MY_XCUS := \
+ $(shell cd $(MISC)/registry/data/org/openoffice/Office/DataAccess && \
+ ls *.xcu)
-$(BIN)$/fcfg_drivers_{$(alllangiso)}.zip : $(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS)
- cd $(DIR_FILTERCFGOUT)$/$(@:b:s/fcfg_drivers_//) && zip -ru ..$/..$/..$/bin$/fcfg_drivers_$(@:b:s/fcfg_drivers_//).zip org/*
-.IF "$(USE_SHELL)"!="4nt"
- $(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
+.IF "$(MY_XCUS)" != ""
-ALLTAR: \
- $(MISC)$/$(TARGET)_delzip \
- $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip \
- $(MISC)/lastlang.mk
+ALLTAR : $(BIN)/fcfg_drivers_{$(alllangiso)}.zip
-.IF "$(DRIVER_MERGE_DEST)"!=""
-.INCLUDE .IGNORE : $(MISC)/lastlang.mk
+$(BIN)/fcfg_drivers_{$(alllangiso)}.zip : \
+ $(MISC)/registry/res/$$(@:b:s/fcfg_drivers_//)/org/openoffice/Office/DataAccess/{$(MY_XCUS)}
-ALLTAR : \
- $(DRIVER_MERGE_DEST)
-
-.IF "$(LAST_LANGS)"!="$(WITH_LANG)"
-DO_PHONY=.PHONY
-.ENDIF # "$(LAST_LANG)"!="$(WITH_LANG)"
-
-$(MISC)/lang/%.xcu $(DO_PHONY) : $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess/%.xcu
- @@-$(MKDIRHIER) $(@:d:d)
- $(COPY) $< $@
-
-.ENDIF # "$(DRIVER_MERGE_DEST)"!=""
-
-$(MISC)/lastlang.mk $(DO_PHONY) :
- $(RM) $@
- echo LAST_LANGS=$(WITH_LANG) > $@
+$(BIN)/fcfg_drivers_%.zip : \
+ $(MISC)/registry/res/%/org/openoffice/Office/DataAccess/$(MY_XCUS:1)
+ zip -j $@ \
+ $(foreach,i,$(MY_XCUS) \
+ $(MISC)/registry/res/$*/org/openoffice/Office/DataAccess/$i)
+.ENDIF
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
index 7b7657fc79ed..344203e38762 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
@@ -275,10 +275,12 @@ static uno::TypeDescription getAcquireMethod(void)
typelib_TypeDescriptionReference * type_XInterface =
* typelib_static_type_getByTypeClass(typelib_TypeClass_INTERFACE);
- typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0;
- TYPELIB_DANGER_GET ((typelib_TypeDescription **)&pTXInterfaceDescr, type_XInterface);
- uno::TypeDescription acquire(pTXInterfaceDescr->ppAllMembers[1]);
- TYPELIB_DANGER_RELEASE((typelib_TypeDescription *)pTXInterfaceDescr);
+ typelib_TypeDescription * pTXInterfaceDescr = 0;
+ TYPELIB_DANGER_GET (&pTXInterfaceDescr, type_XInterface);
+ uno::TypeDescription acquire(
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ pTXInterfaceDescr)->ppAllMembers[1]);
+ TYPELIB_DANGER_RELEASE(pTXInterfaceDescr);
return acquire;
}
@@ -288,10 +290,12 @@ static uno::TypeDescription getReleaseMethod(void)
typelib_TypeDescriptionReference * type_XInterface =
* typelib_static_type_getByTypeClass(typelib_TypeClass_INTERFACE);
- typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0;
- TYPELIB_DANGER_GET ((typelib_TypeDescription **)&pTXInterfaceDescr, type_XInterface);
- uno::TypeDescription release(pTXInterfaceDescr->ppAllMembers[2]);
- TYPELIB_DANGER_RELEASE((typelib_TypeDescription *)pTXInterfaceDescr);
+ typelib_TypeDescription * pTXInterfaceDescr = 0;
+ TYPELIB_DANGER_GET (&pTXInterfaceDescr, type_XInterface);
+ uno::TypeDescription release(
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ pTXInterfaceDescr)->ppAllMembers[2]);
+ TYPELIB_DANGER_RELEASE(pTXInterfaceDescr);
return release;
}
diff --git a/cpputools/source/regcomplazy/regcomplazy.cxx b/cpputools/source/regcomplazy/regcomplazy.cxx
index 367ac02510e5..13c09c8d1c94 100755
--- a/cpputools/source/regcomplazy/regcomplazy.cxx
+++ b/cpputools/source/regcomplazy/regcomplazy.cxx
@@ -46,16 +46,11 @@ using namespace ::rtl;
typedef ::std::vector< ::rtl::OString > OSVector;
-typedef ::std::pair< ::rtl::OString, OSVector > DataPair;
-
-typedef ::std::vector< DataPair > DataVector;
-
struct CompDescriptor {
OString sImplementationName;
OString sComponentName;
OString sLoaderName;
OSVector vSupportedServices;
- DataVector vData;
};
typedef ::std::vector< CompDescriptor > CDescrVector;
@@ -144,28 +139,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
OString sToken(sTmp);
if (sTmp.pData->buffer[sTmp.getLength()-1] == '\x0D')
sToken = sTmp.copy(0, sTmp.getLength()-1);
-
- if (sToken.indexOf("[Data]") >= 0) {
- do {
- OString sTmp2 = sDescr.getToken(0, '\x0A', nTokenIndex);
- OString sToken2(sTmp2);
- if (sTmp2.pData->buffer[sTmp2.getLength()-1] == '\x0D')
- sToken2 = sTmp2.copy(0, sTmp2.getLength()-1);
-
- if ((sToken2.getLength() > 0) && (sToken2.pData->buffer[0] != '[')) {
- OString dataKey(sToken2.copy(0, sToken2.indexOf('=')));
- OString sValues(sToken2.copy(sToken2.indexOf('=')+1));
- sal_Int32 nVIndex = 0;
- OSVector vValues;
- do {
- OString sValue = sValues.getToken(0, ';', nVIndex);
- vValues.push_back(sValue);
- } while (nVIndex >= 0 );
- descr.vData.push_back(DataPair(dataKey, vValues));
- } else
- break;
- } while (nTokenIndex >= 0 );
- }
if ( sToken.indexOf("[ComponentDescriptor]") >= 0) {
if (bFirst)
bFirst = false;
@@ -244,41 +217,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
subKey.setValue(OUString(), RG_VALUETYPE_STRING,
(sal_Char*)sCompName.getStr(), sCompName.getLength()+1);
- if ((*comp_iter).vData.size() > 0) {
- usKeyName = OUSTR("DATA");
- RegistryKey dataKey, valueKey;
- key.createKey(usKeyName, dataKey);
-
- DataVector::const_iterator data_iter = ((*comp_iter).vData).begin();
- do {
- OUString sDataKey(OSToOUS((*data_iter).first));
- dataKey.createKey(sDataKey, valueKey);
-
- OSVector::const_iterator value_iter = ((*data_iter).second).begin();
- int vlen = (*data_iter).second.size();
- sal_Char** pValueList = (sal_Char**)rtl_allocateZeroMemory(
- vlen * sizeof(sal_Char*));
- int i = 0;
- do {
- pValueList[i] = (sal_Char*)rtl_allocateZeroMemory(
- (*value_iter).getLength()+1 * sizeof(sal_Char));
- rtl_copyMemory(pValueList[i], (sal_Char*)(*value_iter).getStr(),
- (*value_iter).getLength()+1);
- i++;
- value_iter++;
- } while (value_iter != (*data_iter).second.end());
-
- valueKey.setStringListValue(OUString(), pValueList, vlen);
-
- // free memory
- for (i=0; i<vlen; i++)
- rtl_freeMemory(pValueList[i]);
- rtl_freeMemory(pValueList);
-
- data_iter++;
- } while (data_iter != (*comp_iter).vData.end());
- }
-
usKeyName = OUSTR("UNO/SERVICES");
key.createKey(usKeyName, subKey);
diff --git a/crashrep/prj/build.lst b/crashrep/prj/build.lst
index 3315b843ed8d..ef1c85cc1c62 100755
--- a/crashrep/prj/build.lst
+++ b/crashrep/prj/build.lst
@@ -1,6 +1,5 @@
cr crashrep : l10n sal sysui SO:tools shell NULL
cr crashrep usr1 - all cr_mkout NULL
-cr crashrep\scripts nmake - all cr_suscript NULL
cr crashrep\source\all nmake - all cr_sresource NULL
cr crashrep\source\unx nmake - u cr_sunx NULL
cr crashrep\source\win32 nmake - n cr_swin32 cr_sresource NULL
diff --git a/crashrep/scripts/crash_report.sh b/crashrep/source/unx/crash_report.sh
index 62c4bde5d578..62c4bde5d578 100755
--- a/crashrep/scripts/crash_report.sh
+++ b/crashrep/source/unx/crash_report.sh
diff --git a/crashrep/source/unx/interface.cxx b/crashrep/source/unx/interface.cxx
deleted file mode 100755
index 4ea18931bf49..000000000000
--- a/crashrep/source/unx/interface.cxx
+++ /dev/null
@@ -1,715 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <interface.hxx>
-#include <iostream.h>
-
-using namespace std;
-
-/*
- * WizardPage
- */
-WizardPage::~WizardPage()
-{
-}
-
-/*
- * WizardDialog
- */
-
-WizardDialog::WizardDialog()
-{
- m_pStatusDialog = NULL;
- m_pTopLevel = gtk_window_new( GTK_WINDOW_TOPLEVEL );
- gtk_window_set_title( GTK_WINDOW(m_pTopLevel), StringResource::get( "%WELCOME_CAPTION%" ) );
-
- m_pVBox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( m_pVBox );
- gtk_container_add( GTK_CONTAINER(m_pTopLevel), m_pVBox );
-
- m_pViewPort = gtk_viewport_new( NULL, NULL );
- gtk_widget_show( m_pViewPort );
-
- // set wizard title style
- gtk_widget_ensure_style( m_pViewPort );
- GtkStyle* pStyle = gtk_style_copy( gtk_widget_get_style( m_pViewPort ) );
- for( int i = 0; i < 5; i++ )
- {
- pStyle->bg[i] = pStyle->white;
- pStyle->text[i] = pStyle->black;
- pStyle->bg_gc[i] = pStyle->white_gc;
- pStyle->text_gc[i] = pStyle->black_gc;
- }
- gint nFontSize = pango_font_description_get_size( pStyle->font_desc );
- nFontSize = nFontSize * 3 / 2;
- pango_font_description_set_size( pStyle->font_desc, nFontSize );
- gtk_widget_set_style( m_pViewPort, pStyle );
- gtk_viewport_set_shadow_type( GTK_VIEWPORT(m_pViewPort), GTK_SHADOW_NONE );
- gtk_box_pack_start( GTK_BOX(m_pVBox), m_pViewPort, FALSE, FALSE, 0 );
-
- m_pWizardTitle = gtk_label_new( "Wizard" ); // to be replaced by resp. page titles
- gtk_widget_show( m_pWizardTitle );
- gtk_label_set_justify( GTK_LABEL(m_pWizardTitle), GTK_JUSTIFY_LEFT );
- gtk_misc_set_alignment( GTK_MISC(m_pWizardTitle), 0, 1 );
- gtk_misc_set_padding( GTK_MISC(m_pWizardTitle), 10, 10 );
- gtk_widget_set_style( m_pWizardTitle, pStyle );
- gtk_container_add( GTK_CONTAINER(m_pViewPort), m_pWizardTitle );
-
- // prepare the area for the single pages
- m_pPageArea = gtk_vbox_new( FALSE, 1);
- gtk_widget_show( m_pPageArea );
- gtk_box_pack_start( GTK_BOX(m_pVBox), m_pPageArea, TRUE, TRUE, 0 );
-
- m_pSeparator = gtk_hseparator_new();
- gtk_widget_show( m_pSeparator );
- gtk_box_pack_start( GTK_BOX(m_pVBox), m_pSeparator, FALSE, FALSE, 0 );
-
- m_pButtonBox = gtk_hbutton_box_new();
- gtk_widget_show( m_pButtonBox );
- gtk_box_pack_start( GTK_BOX(m_pVBox), m_pButtonBox, FALSE, FALSE, 0 );
- gtk_button_box_set_layout( GTK_BUTTON_BOX(m_pButtonBox), GTK_BUTTONBOX_END );
- gtk_button_box_set_spacing( GTK_BUTTON_BOX(m_pButtonBox), 0 );
-
- m_pBackButton = gtk_button_new_with_mnemonic( StringResource::get( "%BACK_BUTTON%" ) );
- gtk_widget_show( m_pBackButton );
- gtk_container_add( GTK_CONTAINER(m_pButtonBox), m_pBackButton );
- gtk_container_set_border_width( GTK_CONTAINER(m_pBackButton), 5 );
- GTK_WIDGET_SET_FLAGS( m_pBackButton, GTK_CAN_DEFAULT );
-
- m_pNextButton = gtk_button_new_with_mnemonic( StringResource::get( "%NEXT_BUTTON%" ) );
- gtk_widget_show( m_pNextButton );
- gtk_container_add( GTK_CONTAINER(m_pButtonBox), m_pNextButton );
- gtk_container_set_border_width( GTK_CONTAINER(m_pNextButton), 5 );
- GTK_WIDGET_SET_FLAGS( m_pNextButton, GTK_CAN_DEFAULT );
-
- m_pSendButton = gtk_button_new_with_mnemonic( StringResource::get( "%SEND_BUTTON%" ) );
- gtk_widget_show( m_pSendButton );
- gtk_container_add( GTK_CONTAINER(m_pButtonBox), m_pSendButton );
- gtk_container_set_border_width( GTK_CONTAINER(m_pSendButton), 5 );
- GTK_WIDGET_SET_FLAGS( m_pSendButton, GTK_CAN_DEFAULT );
-
- m_pCancelButton = gtk_button_new_with_mnemonic( StringResource::get( "%DONOT_SEND_BUTTON%" ) );
- gtk_widget_show( m_pCancelButton );
- gtk_container_add( GTK_CONTAINER(m_pButtonBox), m_pCancelButton );
- gtk_container_set_border_width( GTK_CONTAINER(m_pCancelButton), 5 );
- GTK_WIDGET_SET_FLAGS( m_pCancelButton, GTK_CAN_DEFAULT );
-
- gtk_signal_connect( GTK_OBJECT(m_pTopLevel), "delete-event", G_CALLBACK(gtk_main_quit), NULL );
- gtk_signal_connect( GTK_OBJECT(m_pCancelButton), "clicked", G_CALLBACK(gtk_main_quit), NULL );
- gtk_signal_connect( GTK_OBJECT(m_pNextButton), "clicked", G_CALLBACK(button_clicked), this );
- gtk_signal_connect( GTK_OBJECT(m_pBackButton), "clicked", G_CALLBACK(button_clicked), this );
- gtk_signal_connect( GTK_OBJECT(m_pSendButton), "clicked", G_CALLBACK(button_clicked), this );
- gtk_widget_set_sensitive( m_pSendButton, FALSE );
-
- m_nCurrentPage = -1;
-}
-
-WizardDialog::~WizardDialog()
-{
- int nPages = m_aPages.size();
- while( nPages-- )
- delete m_aPages[nPages];
-}
-
-void WizardDialog::show_messagebox( const std::string& rMessage )
-{
- GtkWidget* messagebox = NULL;
- GtkMessageType eType = GTK_MESSAGE_ERROR;
-
- messagebox = gtk_message_dialog_new( NULL,
- (GtkDialogFlags)0,
- eType,
- GTK_BUTTONS_OK,
- rMessage.c_str(),
- NULL
- );
-
- gtk_dialog_run( GTK_DIALOG(messagebox) );
- gtk_widget_destroy( GTK_WIDGET(messagebox) );
-}
-
-
-
-// bInProgress: true=sending, false=finished
-gint WizardDialog::show_sendingstatus( bool bInProgress )
-{
- m_pStatusDialog = gtk_dialog_new_with_buttons( StringResource::get( "%SENDING_REPORT_HEADER%" ),
- getTopLevel(),
- GTK_DIALOG_MODAL,
- bInProgress ? GTK_STOCK_CANCEL : GTK_STOCK_OK,
- bInProgress ? GTK_RESPONSE_REJECT : GTK_RESPONSE_OK,
- NULL );
-
- gtk_window_set_default_size( GTK_WINDOW(m_pStatusDialog), 350, 130 );
-
- GtkWidget *pLabel = gtk_label_new( bInProgress ? StringResource::get( "%SENDING_REPORT_STATUS%" ) :
- StringResource::get( "%SENDING_REPORT_STATUS_FINISHED%" ) );
- gtk_widget_show( pLabel );
- gtk_label_set_justify( GTK_LABEL(pLabel), GTK_JUSTIFY_CENTER);
- gtk_misc_set_alignment( GTK_MISC(pLabel), 0, 0 );
-
- gtk_container_add( GTK_CONTAINER(GTK_DIALOG(m_pStatusDialog)->vbox), pLabel );
-
- gint ret = gtk_dialog_run( GTK_DIALOG(m_pStatusDialog) );
- gtk_widget_destroy( m_pStatusDialog );
- m_pStatusDialog = NULL;
-
- return ret;
-}
-
-void WizardDialog::hide_sendingstatus()
-{
- if( m_pStatusDialog )
- {
- gtk_dialog_response( GTK_DIALOG(m_pStatusDialog), GTK_RESPONSE_OK );
-
- XEvent event;
-
- memset( &event, 0, sizeof(event) );
-
- event.xexpose.type = Expose;
- event.xexpose.display = GDK_DISPLAY();
- event.xexpose.window = GDK_WINDOW_XWINDOW( m_pStatusDialog->window );
- event.xexpose.width = event.xexpose.height = 10;
-
- XSendEvent(
- GDK_DISPLAY(),
- GDK_WINDOW_XWINDOW( m_pStatusDialog->window ),
- True,
- ExposureMask,
- &event );
-
- XFlush( GDK_DISPLAY() );
- }
-}
-
-
-gint WizardDialog::button_clicked( GtkWidget* pButton, WizardDialog* pThis )
-{
- if( pButton == pThis->m_pNextButton )
- pThis->nextPage();
- else if( pButton == pThis->m_pBackButton )
- pThis->lastPage();
- else if( pButton == pThis->m_pSendButton )
- {
- if( pThis->m_nCurrentPage != -1 )
- pThis->m_aPages[pThis->m_nCurrentPage]->update();
-
- if( send_crash_report( pThis, pThis->getSettings() ) )
- gtk_main_quit();
- }
-
- return 0;
-}
-
-void WizardDialog::insertPage( WizardPage* pPage )
-{
- m_aPages.push_back( pPage );
- if( m_nCurrentPage == -1 )
- {
- m_nCurrentPage = 0;
- gtk_label_set_text( GTK_LABEL(m_pWizardTitle), pPage->getTitle() );
- gtk_box_pack_start( GTK_BOX(m_pPageArea), pPage->getContents(), TRUE, TRUE, 0 );
- gtk_widget_set_sensitive( m_pNextButton, FALSE );
- gtk_widget_set_sensitive( m_pBackButton, FALSE );
- }
- else
- {
- gtk_widget_set_sensitive( m_pNextButton, TRUE );
- }
-}
-
-void WizardDialog::nextPage()
-{
- if( m_aPages.empty() || m_nCurrentPage >= (int)m_aPages.size()-1 )
- return;
-
- m_aPages[m_nCurrentPage]->update();
-
- gtk_container_remove( GTK_CONTAINER(m_pPageArea), m_aPages[m_nCurrentPage]->getContents() );
- m_nCurrentPage++;
- gtk_label_set_text( GTK_LABEL(m_pWizardTitle), m_aPages[m_nCurrentPage]->getTitle() );
- gtk_box_pack_start( GTK_BOX(m_pPageArea), m_aPages[m_nCurrentPage]->getContents(), TRUE, TRUE, 0 );
-
- if( m_nCurrentPage == (int)m_aPages.size()-1 )
- {
- gtk_widget_set_sensitive( m_pNextButton, FALSE );
- gtk_widget_set_sensitive( m_pSendButton, TRUE );
- }
- if( m_aPages.size() > 1 )
- gtk_widget_set_sensitive( m_pBackButton, TRUE );
-}
-
-void WizardDialog::lastPage()
-{
- if( m_aPages.empty() || m_nCurrentPage <= 0 )
- return;
-
- m_aPages[m_nCurrentPage]->update();
-
- gtk_container_remove( GTK_CONTAINER(m_pPageArea), m_aPages[m_nCurrentPage]->getContents() );
- m_nCurrentPage--;
- gtk_label_set_text( GTK_LABEL(m_pWizardTitle), m_aPages[m_nCurrentPage]->getTitle() );
- gtk_box_pack_start( GTK_BOX(m_pPageArea), m_aPages[m_nCurrentPage]->getContents(), TRUE, TRUE, 0 );
-
- if( m_nCurrentPage == 0 )
- gtk_widget_set_sensitive( m_pBackButton, FALSE );
- if( m_aPages.size() > 1 )
- gtk_widget_set_sensitive( m_pNextButton, TRUE );
-}
-
-void WizardDialog::show( bool bShow )
-{
- if( bShow )
- gtk_widget_show( m_pTopLevel );
- else
- gtk_widget_hide( m_pTopLevel );
-}
-
-/*
- * MainPage
- */
-
-MainPage::MainPage( WizardDialog* pParent ) : WizardPage( pParent )
-{
- hash_map< string, string >& rSettings = m_pDialog->getSettings();
- m_aWizardTitle = StringResource::get( "%REPORT_HEADER%" );
-
- m_pPageContents = gtk_vbox_new( FALSE, 0 );
- gtk_widget_show( m_pPageContents );
-
- m_pInfo = gtk_label_new( StringResource::get( "%REPORT_BODY%" ) );
- gtk_widget_show( m_pInfo );
- gtk_label_set_line_wrap( GTK_LABEL(m_pInfo), TRUE );
- gtk_label_set_justify( GTK_LABEL(m_pInfo), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pInfo), 0, 1 );
- gtk_misc_set_padding( GTK_MISC(m_pInfo ), 5, 5);
- gtk_box_pack_start( GTK_BOX(m_pPageContents), m_pInfo, FALSE, FALSE, 0 );
-
- m_pHBox = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( m_pHBox );
- gtk_box_pack_start( GTK_BOX(m_pPageContents), m_pHBox, TRUE, TRUE, 0 );
-
- m_pLeftColumn = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( m_pLeftColumn );
- gtk_container_set_border_width( GTK_CONTAINER(m_pLeftColumn), 5 );
- gtk_box_pack_start( GTK_BOX(m_pHBox), m_pLeftColumn, TRUE, TRUE, 0 );
-
- m_pRightColumn = gtk_vbutton_box_new();
- gtk_widget_show( m_pRightColumn );
- gtk_button_box_set_layout( GTK_BUTTON_BOX(m_pRightColumn), GTK_BUTTONBOX_END );
- gtk_box_pack_start( GTK_BOX(m_pHBox), m_pRightColumn, FALSE, FALSE, 0 );
-
- m_pEditLabel = gtk_label_new_with_mnemonic( StringResource::get( "%ENTER_TITLE%" ) );
- gtk_widget_show( m_pEditLabel );
- gtk_label_set_justify( GTK_LABEL(m_pEditLabel), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pEditLabel), 0, 1 );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pEditLabel, FALSE, FALSE, 0 );
-
- m_pEdit = gtk_entry_new();
- gtk_widget_show( m_pEdit );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pEdit, FALSE, FALSE, 0 );
-
- gtk_label_set_mnemonic_widget( GTK_LABEL(m_pEditLabel), m_pEdit );
-
- hash_map<string, string>::iterator aIter;
- aIter = rSettings.find( "TITLE" );
- if( aIter != rSettings.end() )
- gtk_entry_set_text( GTK_ENTRY(m_pEdit), aIter->second.c_str() );
-
- m_pEntryVBox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( m_pEntryVBox );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pEntryVBox, TRUE, TRUE, 0 );
-
- m_pEntryLabel = gtk_label_new_with_mnemonic( StringResource::get( "%ENTER_DESCRIPTION%" ) );
- gtk_widget_show( m_pEntryLabel );
- gtk_label_set_justify( GTK_LABEL(m_pEntryLabel), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pEntryLabel), 0, 1 );
- gtk_box_pack_start( GTK_BOX(m_pEntryVBox), m_pEntryLabel, FALSE, FALSE, 0 );
-
- m_pScrolledEntry = gtk_scrolled_window_new( NULL, NULL );
- gtk_widget_show( m_pScrolledEntry );
- gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(m_pScrolledEntry), GTK_SHADOW_IN );
- gtk_box_pack_start( GTK_BOX(m_pEntryVBox), m_pScrolledEntry, TRUE, TRUE, 0 );
-
- m_pEntry = gtk_text_view_new();
- gtk_widget_show( m_pEntry );
- gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(m_pEntry), GTK_WRAP_WORD );
- gtk_container_add( GTK_CONTAINER(m_pScrolledEntry), m_pEntry );
-
- aIter = rSettings.find( "DESCRIPTION" );
- if( aIter != rSettings.end() )
- {
- GtkTextBuffer* pBuffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_pEntry) );
- gtk_text_buffer_set_text( pBuffer, aIter->second.c_str(), -1 );
- }
-
-
- gtk_label_set_mnemonic_widget( GTK_LABEL(m_pEntryLabel), m_pEntry );
-
- m_pDetails = gtk_button_new_with_mnemonic( StringResource::get( "%SHOW_REPORT_BUTTON%" ) );
- gtk_widget_show(m_pDetails);
- gtk_container_set_border_width( GTK_CONTAINER(m_pDetails), 5 );
- gtk_container_add( GTK_CONTAINER(m_pRightColumn), m_pDetails );
-
- m_pOptions = gtk_button_new_with_mnemonic( StringResource::get( "%OPTIONS_BUTTON%" ) );
- gtk_widget_show(m_pOptions);
- gtk_container_set_border_width( GTK_CONTAINER(m_pOptions), 5 );
- gtk_container_add( GTK_CONTAINER(m_pRightColumn), m_pOptions );
-
- // check env var for save button
- const char *szUserType = getenv( "STAROFFICE_USERTYPE" );
- if( szUserType && *szUserType )
- {
- m_pSave = gtk_button_new_with_mnemonic( StringResource::get( "%SAVE_REPORT_BUTTON%" ) );
- gtk_widget_show(m_pSave);
- gtk_container_set_border_width( GTK_CONTAINER(m_pSave), 5 );
- gtk_container_add( GTK_CONTAINER(m_pRightColumn), m_pSave );
- }
- else
- m_pSave = NULL;
-
-
- m_pCheck = gtk_check_button_new_with_mnemonic( StringResource::get( "%ALLOW_CONTACT%" ) );
- gtk_widget_show( m_pCheck );
- gtk_container_set_border_width( GTK_CONTAINER(m_pCheck), 5 );
- //gtk_box_pack_start( GTK_BOX(m_pPageContents), m_pCheck, FALSE, FALSE, 5 );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pCheck, FALSE, FALSE, 5 );
-
- aIter = rSettings.find( "CONTACT" );
- if( aIter != rSettings.end() )
- {
- const char *str = aIter->second.c_str();
- if( str && !strcasecmp(str, "true") )
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_pCheck), TRUE );
- }
-
- m_pAddressLabel = gtk_label_new_with_mnemonic( StringResource::get( "%ENTER_EMAIL%" ) );
- gtk_widget_show( m_pAddressLabel );
- gtk_label_set_justify( GTK_LABEL(m_pAddressLabel), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pAddressLabel), 0, 1 );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pAddressLabel, FALSE, FALSE, 5 );
-
- m_pAddress = gtk_entry_new();
- gtk_widget_show( m_pAddress );
- gtk_box_pack_start( GTK_BOX(m_pLeftColumn), m_pAddress, FALSE, FALSE, 5 );
-
- aIter = rSettings.find( "EMAIL" );
- if( aIter != rSettings.end() )
- gtk_entry_set_text( GTK_ENTRY(m_pAddress), aIter->second.c_str() );
-
- gtk_signal_connect( GTK_OBJECT(m_pDetails), "clicked", G_CALLBACK(button_clicked), this );
- gtk_signal_connect( GTK_OBJECT(m_pOptions), "clicked", G_CALLBACK(button_clicked), this );
- if(m_pSave) // optional
- gtk_signal_connect( GTK_OBJECT(m_pSave), "clicked", G_CALLBACK(button_clicked), this );
-
- gtk_signal_connect( GTK_OBJECT(m_pCheck), "toggled", G_CALLBACK(button_toggled), this );
- button_toggled( m_pCheck, this );
-
- g_object_ref( G_OBJECT(m_pPageContents) );
-}
-
-MainPage::~MainPage()
-{
- g_object_unref( G_OBJECT(m_pPageContents) );
-}
-
-void MainPage::update()
-{
- hash_map< string, string >& rSettings = m_pDialog->getSettings();
-
- GtkTextIter start, end;
- GtkTextBuffer* pTextBuffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_pEntry) );
- gtk_text_buffer_get_bounds( pTextBuffer, &start, &end );
- rSettings[ "DESCRIPTION" ] = gtk_text_buffer_get_text( pTextBuffer, &start, &end, 1 );
- rSettings[ "TITLE" ] = gtk_entry_get_text( GTK_ENTRY(m_pEdit) );
- rSettings[ "CONTACT" ] = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(m_pCheck) ) ? "true" : "false";
- rSettings[ "EMAIL" ] = gtk_entry_get_text( GTK_ENTRY(m_pAddress) );
-}
-
-gint MainPage::button_toggled( GtkWidget* pButton, MainPage* pThis )
-{
- if ( GTK_TOGGLE_BUTTON (pThis->m_pCheck)->active )
- {
- gtk_widget_set_sensitive( pThis->m_pAddressLabel, TRUE);
- gtk_widget_set_sensitive( pThis->m_pAddress, TRUE);
- }
- else
- {
- gtk_widget_set_sensitive( pThis->m_pAddressLabel, FALSE);
- gtk_widget_set_sensitive( pThis->m_pAddress, FALSE);
- }
- return 0;
-}
-
-gint MainPage::button_clicked( GtkWidget* pButton, MainPage* pThis )
-{
- if( pButton == pThis->m_pSave )
- {
- GtkWidget* pFile = gtk_file_selection_new( StringResource::get( "%SAVE_REPORT_TITLE%" ) );
- gint nRet = gtk_dialog_run( GTK_DIALOG(pFile) );
- if( nRet == GTK_RESPONSE_OK )
- {
- string aFile = gtk_file_selection_get_filename( GTK_FILE_SELECTION(pFile) );
- pThis->update();
- if( save_crash_report( aFile, pThis->m_pDialog->getSettings() ) )
- {
- // gtk_main_quit();
- }
- }
- gtk_widget_destroy( pFile );
- }
- else if( pButton == pThis->m_pDetails )
- {
- pThis->update();
-
- GtkWidget* pDialog = gtk_dialog_new_with_buttons( StringResource::get( "%REPORT_CAPTION%" ),
- pThis->m_pDialog->getTopLevel(),
- GTK_DIALOG_MODAL,
- GTK_STOCK_OK,
- GTK_RESPONSE_OK,
- NULL );
-
- gtk_window_set_default_size( GTK_WINDOW(pDialog), 500, 300 );
- GtkWidget* pScroll = gtk_scrolled_window_new( NULL, NULL );
- gtk_widget_show( pScroll );
- gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(pScroll), GTK_SHADOW_IN );
- gtk_container_add( GTK_CONTAINER(GTK_DIALOG(pDialog)->vbox), pScroll );
-
- string aText = crash_get_details( pThis->m_pDialog->getSettings() );
- GtkWidget* pView = gtk_text_view_new();
- gtk_widget_show( pView );
- gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(pView), GTK_WRAP_WORD );
- gtk_text_view_set_editable( GTK_TEXT_VIEW(pView), FALSE );
- GtkTextBuffer* pBuffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(pView) );
- gtk_text_buffer_set_text( pBuffer, aText.data(), aText.size() );
- gtk_container_add( GTK_CONTAINER(pScroll), pView );
-
- gtk_dialog_run( GTK_DIALOG(pDialog) );
- gtk_widget_destroy( pDialog );
- }
- else if( pButton == pThis->m_pOptions )
- {
- OptionsDialog aOptions( pThis->m_pDialog->getTopLevel(), pThis->m_pDialog->getSettings() );
- //pThis->m_pDialog->show_sendingstatus( true );
- //pThis->m_pDialog->show_sendingstatus( false );
- //sleep(5);
- //pThis->m_pDialog->hide_sendingstatus();
- }
-
- return 0;
-}
-
-/*
- * OptionsDialog (Proxy-Settings)
- */
-
-OptionsDialog::OptionsDialog( GtkWindow *pParent ,hash_map< string, string >& rSettings )
-{
- m_pDialog = gtk_dialog_new_with_buttons( StringResource::get( "%OPTIONS_TITLE%" ),
- pParent,
- GTK_DIALOG_MODAL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- NULL );
-
- gtk_window_set_default_size( GTK_WINDOW(m_pDialog), 500, 300 );
-
- m_pPage = gtk_vbox_new( FALSE, 0 );
- m_pLeftColumn = gtk_vbox_new( FALSE, 5 );
-
- gtk_widget_show( m_pPage );
- gtk_widget_show( m_pLeftColumn );
-
- gtk_container_add( GTK_CONTAINER(GTK_DIALOG(m_pDialog)->vbox), m_pPage );
-
- gtk_container_set_border_width( GTK_CONTAINER(m_pLeftColumn), 5 );
- gtk_box_pack_start( GTK_BOX(m_pPage), m_pLeftColumn, FALSE, FALSE, 5 );
-
- // frame for proxy settings
- m_pFrame = gtk_frame_new(StringResource::get( "%PROXY_SETTINGS_HEADER%" ));
- gtk_frame_set_shadow_type( GTK_FRAME(m_pFrame), GTK_SHADOW_ETCHED_IN );
- gtk_widget_show(m_pFrame);
- gtk_box_pack_start(GTK_BOX (m_pLeftColumn), m_pFrame, TRUE, TRUE, 0);
-
- m_pVBox = gtk_vbox_new( FALSE, 0 );
- gtk_widget_show( m_pVBox );
- gtk_container_add( GTK_CONTAINER( m_pFrame ), m_pVBox );
-
- // the radio buttons
- m_pDirect = gtk_radio_button_new_with_mnemonic( NULL,
- StringResource::get( "%PROXY_SETTINGS_DIRECT%" ) );
- gtk_widget_show(m_pDirect);
- gtk_box_pack_start(GTK_BOX (m_pVBox), m_pDirect, FALSE, FALSE, 0);
-
- m_pManual = gtk_radio_button_new_with_mnemonic( gtk_radio_button_group( GTK_RADIO_BUTTON(m_pDirect) ),
- StringResource::get( "%PROXY_SETTINGS_MANUAL%" ) );
- gtk_widget_show(m_pManual);
- gtk_box_pack_start(GTK_BOX (m_pVBox), m_pManual, FALSE, FALSE, 0);
-
- hash_map<string, string>::iterator aIter;
- const char *str = NULL;
- aIter = rSettings.find( "USEPROXY" );
- if( aIter != rSettings.end() )
- str = aIter->second.c_str();
- if( str && !strcasecmp(str, "true") )
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_pManual), TRUE );
- else
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_pDirect), TRUE );
-
- // the server and port edit controls
- m_pHBox = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( m_pHBox );
- gtk_box_pack_start(GTK_BOX (m_pVBox), m_pHBox, FALSE, FALSE, 10);
-
- m_pVBoxServer = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( m_pVBoxServer );
- gtk_box_pack_start(GTK_BOX (m_pHBox), m_pVBoxServer, TRUE, TRUE, 10);
-
- m_pVBoxPort = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( m_pVBoxPort );
- gtk_box_pack_start(GTK_BOX (m_pHBox), m_pVBoxPort, FALSE, FALSE, 10);
-
- m_pServerLabel = gtk_label_new_with_mnemonic( StringResource::get( "%PROXY_SETTINGS_ADDRESS%" ) );
- gtk_widget_show( m_pServerLabel );
- gtk_label_set_justify( GTK_LABEL(m_pServerLabel), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pServerLabel), 0, 1 );
- gtk_box_pack_start( GTK_BOX(m_pVBoxServer), m_pServerLabel, FALSE, FALSE, 0 );
-
- m_pServer = gtk_entry_new();
- gtk_widget_show( m_pServer );
- gtk_box_pack_start( GTK_BOX(m_pVBoxServer), m_pServer, FALSE, FALSE, 0 );
- gtk_label_set_mnemonic_widget( GTK_LABEL(m_pServerLabel), m_pServer );
- aIter = rSettings.find( "SERVER" );
- if( aIter != rSettings.end() )
- gtk_entry_set_text( GTK_ENTRY(m_pServer), aIter->second.c_str() );
-
- m_pPortLabel = gtk_label_new_with_mnemonic( StringResource::get( "%PROXY_SETTINGS_PORT%" ) );
- gtk_widget_show( m_pPortLabel );
- gtk_label_set_justify( GTK_LABEL(m_pPortLabel), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pPortLabel), 0, 1 );
- gtk_box_pack_start( GTK_BOX(m_pVBoxPort), m_pPortLabel, FALSE, FALSE, 0 );
-
- m_pPort = gtk_entry_new();
- gtk_widget_show( m_pPort );
- gtk_box_pack_start( GTK_BOX(m_pVBoxPort), m_pPort, FALSE, FALSE, 0 );
- gtk_label_set_mnemonic_widget( GTK_LABEL(m_pPortLabel), m_pPort );
- aIter = rSettings.find( "PORT" );
- if( aIter != rSettings.end() )
- gtk_entry_set_text( GTK_ENTRY(m_pPort), aIter->second.c_str() );
-
- // help text
- m_pNote = gtk_label_new( StringResource::get( "%PROXY_SETTINGS_DESCRIPTION%" ) );
- gtk_widget_show( m_pNote );
- gtk_label_set_justify( GTK_LABEL(m_pNote), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pNote), 0, 1 );
- gtk_box_pack_start(GTK_BOX (m_pLeftColumn), m_pNote, FALSE, FALSE, 5);
- gtk_label_set_line_wrap (GTK_LABEL (m_pNote), TRUE);
-
-
- gtk_signal_connect( GTK_OBJECT(m_pDirect), "toggled", G_CALLBACK(button_toggled), this );
- gtk_signal_connect( GTK_OBJECT(m_pManual), "toggled", G_CALLBACK(button_toggled), this );
-
- button_toggled( m_pDirect, this );
-
- if( gtk_dialog_run( GTK_DIALOG(m_pDialog) ) == GTK_RESPONSE_OK )
- {
- rSettings[ "SERVER" ] = getServer();
- rSettings[ "PORT" ] = getPort();
- rSettings[ "USEPROXY" ] = getUseProxy();
- }
- g_object_ref( G_OBJECT(m_pDialog) );
-}
-
-OptionsDialog::~OptionsDialog()
-{
- gtk_widget_destroy( m_pDialog );
- g_object_unref( G_OBJECT(m_pDialog) );
-}
-
-gint OptionsDialog::button_toggled( GtkWidget* pButton, OptionsDialog* pThis )
-{
- if ( GTK_TOGGLE_BUTTON (pThis->m_pManual)->active )
- {
- gtk_widget_set_sensitive( pThis->m_pServerLabel, TRUE);
- gtk_widget_set_sensitive( pThis->m_pServer, TRUE);
- gtk_widget_set_sensitive( pThis->m_pPortLabel, TRUE);
- gtk_widget_set_sensitive( pThis->m_pPort, TRUE);
- }
- else
- {
- gtk_widget_set_sensitive( pThis->m_pServerLabel, FALSE);
- gtk_widget_set_sensitive( pThis->m_pServer, FALSE);
- gtk_widget_set_sensitive( pThis->m_pPortLabel, FALSE);
- gtk_widget_set_sensitive( pThis->m_pPort, FALSE);
- }
-
- return 0;
-}
-
-string OptionsDialog::getUseProxy()
-{
- return gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(m_pDirect) ) ? "false" : "true";
-}
-string OptionsDialog::getServer()
-{
- return gtk_entry_get_text( GTK_ENTRY(m_pServer) );
-}
-string OptionsDialog::getPort()
-{
- return gtk_entry_get_text( GTK_ENTRY(m_pPort) );
-}
-
-/*
- * WelcomePage
- */
-WelcomePage::WelcomePage( WizardDialog* pParent ) : WizardPage( pParent )
-{
- m_aWizardTitle = StringResource::get( "%WELCOME_HEADER%" );
-
- string aBody = StringResource::get( "%WELCOME_BODY1%" );
- aBody += StringResource::get( "%WELCOME_BODY2%" );
- aBody += StringResource::get( "%WELCOME_BODY3%" );
- aBody += "\n\n";
- aBody += StringResource::get( "%PRIVACY_URL%" );
- m_pPageContents = gtk_label_new( aBody.c_str() );
- gtk_widget_show( m_pPageContents );
- gtk_label_set_line_wrap( GTK_LABEL(m_pPageContents), TRUE );
- gtk_label_set_justify( GTK_LABEL(m_pPageContents), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment( GTK_MISC(m_pPageContents), 0, 1 );
- gtk_misc_set_padding( GTK_MISC(m_pPageContents ), 5, 5);
-
- g_object_ref( G_OBJECT(m_pPageContents) );
-}
-
-WelcomePage::~WelcomePage()
-{
- g_object_unref( G_OBJECT(m_pPageContents) );
-}
-
-void WelcomePage::update()
-{
-}
diff --git a/crashrep/source/unx/interface.hxx b/crashrep/source/unx/interface.hxx
deleted file mode 100755
index a8d4fb5d0b65..000000000000
--- a/crashrep/source/unx/interface.hxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-
-#include <X11/Xlib.h>
-
-#include <hash_map>
-#include <vector>
-#include <string>
-
-class WizardDialog;
-
-// returns success, on true application will quit
-bool save_crash_report( const std::string& rFileName, const std::hash_map< std::string, std::string >& rSettings );
-// returns success, on true application will quit
-bool send_crash_report( WizardDialog *pDialog, const std::hash_map< std::string, std::string >& rSettings );
-// must return a valid UTF8 string containing the message that will be sent
-std::string crash_get_details( const std::hash_map< std::string, std::string >& rSettings );
-
-class StringResource
-{
-public:
- static void init( int argc, char** argv );
- static const char* get( const char* pKey );
-};
-
-class WizardPage
-{
-protected:
- std::string m_aWizardTitle;
- GtkWidget* m_pPageContents;
- WizardDialog* m_pDialog;
-public:
- WizardPage( WizardDialog* pDialog ) : m_pDialog( pDialog ) {}
- virtual ~WizardPage();
-
- const char* getTitle() const { return m_aWizardTitle.c_str(); }
- GtkWidget* getContents() const { return m_pPageContents; }
-
- virtual void update() = 0;
-};
-
-class WizardDialog
-{
- std::vector< WizardPage* > m_aPages;
- int m_nCurrentPage;
-
- GtkWidget* m_pTopLevel;
- GtkWidget* m_pVBox;
- GtkWidget* m_pViewPort;
- GtkWidget* m_pWizardTitle;
- GtkWidget* m_pPageArea;
- GtkWidget* m_pSeparator;
- GtkWidget* m_pButtonBox;
- GtkWidget* m_pBackButton;
- GtkWidget* m_pNextButton;
- GtkWidget* m_pSendButton;
- GtkWidget* m_pCancelButton;
-
- GtkWidget* m_pStatusDialog;
-
- std::hash_map< std::string, std::string > m_aSettings;
-
- static gint button_clicked( GtkWidget* pButton, WizardDialog* pThis );
-
- void nextPage();
- void lastPage();
-public:
- WizardDialog();
- ~WizardDialog();
-
- // takes ownership of page
- void insertPage( WizardPage* pPage );
-
- void show( bool bShow = true );
- void show_messagebox( const std::string& rMessage );
- gint show_sendingstatus( bool bInProgress );
- void hide_sendingstatus();
-
- std::hash_map< std::string, std::string >& getSettings() { return m_aSettings; }
- GtkWindow* getTopLevel() const { return GTK_WINDOW(m_pTopLevel); }
-};
-
-class MainPage : public WizardPage
-{
- GtkWidget* m_pInfo;
- GtkWidget* m_pEditLabel;
- GtkWidget* m_pEdit;
- GtkWidget* m_pEntryLabel;
- GtkWidget* m_pEntryVBox;
- GtkWidget* m_pScrolledEntry;
- GtkWidget* m_pEntry;
- GtkWidget* m_pHBox;
- GtkWidget* m_pRightColumn;
- GtkWidget* m_pLeftColumn;
- GtkWidget* m_pDetails;
- GtkWidget* m_pSave;
- GtkWidget* m_pCheck;
- GtkWidget* m_pOptions;
- GtkWidget* m_pAddressLabel;
- GtkWidget* m_pAddress;
-
- static gint button_clicked( GtkWidget* pButton, MainPage* pThis );
- static gint button_toggled( GtkWidget* pButton, MainPage* pThis );
-
-public:
- MainPage( WizardDialog* );
- virtual ~MainPage();
-
- virtual void update();
-};
-
-class WelcomePage : public WizardPage
-{
-public:
- WelcomePage( WizardDialog* );
- virtual ~WelcomePage();
-
- virtual void update();
-};
-
-class OptionsDialog
-{
- GtkWidget* m_pDialog;
- GtkWidget* m_pPage;
- GtkWidget* m_pLeftColumn;
- GtkWidget* m_pFrame;
- GtkWidget* m_pDirect;
- GtkWidget* m_pManual;
- GtkWidget* m_pServerLabel;
- GtkWidget* m_pServer;
- GtkWidget* m_pColon;
- GtkWidget* m_pPortLabel;
- GtkWidget* m_pPort;
- GtkWidget* m_pNote;
- GtkWidget* m_pOkButton;
- GtkWidget* m_pCancelButton;
- GtkWidget* m_pButtonBox;
- GtkWidget* m_pVBox;
- GtkWidget* m_pHBox;
- GtkWidget* m_pVBoxServer;
- GtkWidget* m_pVBoxPort;
-
- static gint button_toggled( GtkWidget* pButton, OptionsDialog* pThis );
-
-public:
- OptionsDialog( GtkWindow* pParent,
- std::hash_map< std::string, std::string >& rSettings );
- virtual ~OptionsDialog();
-
- std::string getUseProxy();
- std::string getServer();
- std::string getPort();
-
-};
diff --git a/crashrep/source/unx/makefile.mk b/crashrep/source/unx/makefile.mk
index 906184e194e4..fb0465d329fc 100755
--- a/crashrep/source/unx/makefile.mk
+++ b/crashrep/source/unx/makefile.mk
@@ -56,9 +56,6 @@ APP1TARGET=$(TARGET)
APP1OBJS=$(OBJFILES)
APP1RPATH=BRAND
-.IF "$(OS)" != "MACOSX"
-APP1STDLIBS=$(DYNAMIC) -lXext -lX11
-.ENDIF
.IF "$(OS)" != "FREEBSD" && "$(OS)" != "MACOSX" && "$(OS)"!="NETBSD"
APP1STDLIBS+=-ldl -lnsl
.ENDIF
@@ -66,6 +63,8 @@ APP1STDLIBS+=-ldl -lnsl
APP1STDLIBS+=-lsocket
.ENDIF
+UNIXTEXT = $(MISC)/crash_report.sh
+
.ENDIF # "$(ENABLE_CRASHDUMP)" != "" || "$(PRODUCT)" == ""
# --- Targets ------------------------------------------------------
diff --git a/crashrep/source/unx/res.cxx b/crashrep/source/unx/res.cxx
deleted file mode 100755
index d9d5bc08484f..000000000000
--- a/crashrep/source/unx/res.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <interface.hxx>
-#include <cstdio>
-#include <hash_map>
-#include <string>
-
-using namespace std;
-
-static hash_map< string, string >* pStringResources = NULL;
-
-static string getResFileName( const char* progname )
-{
- string aRet = progname;
- size_t pos = aRet.rfind( '/' );
- // FIXME: search PATH if necessary
- OSL_ASSERT( pos != string::npos );
- aRet.erase( pos );
- aRet.append( "/resource/crash_dump.res" );
-
- return aRet;
-}
-
-static void filterString( string& rString )
-{
- static const char* pProductName = getenv( "PRODUCTNAME" );
- static int nProductLen = pProductName ? strlen( pProductName ) : 0;
- static const char* pProductVersion = getenv( "PRODUCTVERSION" );
- static int nVersionLen = pProductVersion ? strlen( pProductVersion ) : 0;
-
- // fill in eventually escaped characters
- string::size_type pos = 0;
- while( (pos = rString.find( '\\' ) ) != string::npos )
- {
- char cRep = 0;
- switch( rString[pos+1] )
- {
- case 't': cRep = '\t';break;
- case 'n': cRep = '\n';break;
- case 'r': cRep = '\r';break;
- case 'f': cRep = '\f';break;
- default: cRep = rString[pos+1];
- }
- if( cRep )
- rString.replace( pos, 2, &cRep, 1 );
- }
- while( (pos = rString.find( '~' ) ) != string::npos )
- {
- // replace mnemonic marker
- rString.replace( pos, 1, "_", 1 );
- }
- while( (pos = rString.find( "%PRODUCTNAME%" ) ) != string::npos )
- {
- rString.replace( pos, 13, pProductName ? pProductName : "OpenOffice" );
- }
- while( (pos = rString.find( "%PRODUCTVERSION%" ) ) != string::npos )
- {
- rString.replace( pos, 16, pProductVersion ? pProductVersion : "" );
- }
- // remove whitespace at end
- pos = rString.find_last_not_of( "\r\n\t\f " );
- if( pos != string::npos )
- rString.erase( pos+1 );
-}
-
-void StringResource::init( int argc, char** argv )
-{
- pStringResources = new hash_map< string, string >();
-
- string aResFile = getResFileName( argv[0] );
-
- FILE* fp = fopen( aResFile.c_str(), "r" );
- if( fp )
- {
- char buf[4096];
- string aKey;
- string aValue;
- while( ! feof( fp ) )
- {
- if( ! fgets( buf, sizeof(buf), fp ) )
- break;
-
- char* pEq = strchr( buf, '=' );
- if( ! pEq || *(pEq+1) == 0 ) // invalid line
- continue;
- aKey = string(buf, pEq-buf);
- aValue = pEq+1;
- while( (aValue.empty() || aValue[ aValue.size()-1 ] != '\n') && ! feof( fp ) )
- {
- if( fgets( buf, sizeof( buf ), fp ) )
- aValue.append( buf );
- }
- filterString( aValue );
- (*pStringResources)[aKey] = aValue;
- }
- fclose( fp );
- }
-}
-
-const char* StringResource::get( const char* pKey )
-{
- hash_map< string, string >::const_iterator it = pStringResources->find( pKey );
- return (it == pStringResources->end()) ? "" : it->second.c_str();
-}
-
diff --git a/crashrep/source/unx/res/unxcrashres.cxx b/crashrep/source/unx/res/unxcrashres.cxx
deleted file mode 100755
index 606ebe407449..000000000000
--- a/crashrep/source/unx/res/unxcrashres.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/#include <tools/config.hxx>
-#include <rtl/string.hxx>
-#include <osl/thread.h>
-
-#include <hash_map>
-#include <string>
-#include <cstdio>
-#include <cerrno>
-
-using namespace std;
-using namespace rtl;
-
-void filterValue( ByteString& rValue, const OString& rGroup, const ByteString& rKey )
-{
- USHORT nStartPos = rValue.Search( '"' );
- USHORT nStopPos = rValue.SearchBackward( '"' );
- if( nStartPos == STRING_NOTFOUND || nStopPos == STRING_NOTFOUND )
- {
- fprintf( stderr, "Error: invalid key in [%s] in key \"%s\"\n",
- rGroup.getStr(),
- rKey.GetBuffer() );
- exit( 1 );
- }
- rValue.Erase( nStopPos );
- rValue.Erase( 0, nStartPos+1 );
-}
-
-int main( int argc, char** argv )
-{
- if( argc != 3 )
- {
- fprintf( stderr, "USAGE: unxcrashres <in_lng_file> <out_file_prefix>\n" );
- exit( 1 );
- }
-
- ByteString tmp_argv1( argv[1] );
- Config aConfig( String( tmp_argv1, osl_getThreadTextEncoding() ) );
- hash_map< ByteString, hash_map< OString, OString, OStringHash >, OStringHash > aFiles;
-
- for( USHORT i = 0; i < aConfig.GetGroupCount(); i++ )
- {
- aConfig.SetGroup( aConfig.GetGroupName( i ) );
- OString aGroup = aConfig.GetGroupName( i );
- USHORT nKeys = aConfig.GetKeyCount();
- for( USHORT n = 0; n < nKeys; n++ )
- {
- ByteString aKey = aConfig.GetKeyName( n );
- ByteString aValue = aConfig.ReadKey( aKey );
- // tailor key
- filterValue( aValue, aGroup, aKey );
-
- aFiles[aKey][aGroup] = ByteString( aValue );
- }
- }
-
- for( hash_map< ByteString, hash_map< OString, OString, OStringHash >, OStringHash >::const_iterator lang_it = aFiles.begin(); lang_it != aFiles.end(); ++lang_it )
- {
- ByteString aFile( argv[2] );
- aFile.Append( '.' );
- aFile.Append( lang_it->first );
- FILE* fp = fopen( aFile.GetBuffer(), "w" );
- if( ! fp )
- {
- fprintf( stderr, "Error: could not open \"%s\" for writing: %s\n",
- aFile.GetBuffer(), strerror( errno ) );
- exit(1);
- }
- for( hash_map< OString, OString, OStringHash >::const_iterator line_it = lang_it->second.begin(); line_it != lang_it->second.end(); ++line_it )
- {
- fprintf( fp, "%s=%s\n", line_it->first.getStr(), line_it->second.getStr() );
- }
- fclose( fp );
- }
-
- return 0;
-}
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index d313b86c79ec..70ef2d682941 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -619,9 +619,17 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
aDocTypeLB.SelectEntryPos(0);
FilterHdl_Impl(&aDocTypeLB);
}
- catch(Exception& )
+ catch(Exception& e)
{
- DBG_ERROR("exception in FilterFactory access");
+ (void) e;
+ DBG_ERROR(
+ rtl::OUStringToOString(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "exception in FilterFactory access: ")) +
+ e.Message),
+ RTL_TEXTENCODING_UTF8).
+ getStr());
}
pImpl->bInitialized = sal_True;
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index d9213aed12d6..9253b4e82bc7 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg NULL
+dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 0d985d61e1c5..546a6f0ad13c 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -243,7 +243,7 @@ namespace desktop {
return UserInstall::E_InvalidBaseinstall;
// create the user directory
- FileBase::RC rc = Directory::create(aUserPath);
+ FileBase::RC rc = Directory::createPath(aUserPath);
if ((rc != FileBase::E_None) && (rc != FileBase::E_EXIST)) return UserInstall::E_Creation;
// copy data from shared data directory of base installation
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 70fede4cd2f1..796918202a52 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -67,14 +67,6 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
m_pExtMgrDialog( NULL ),
m_pUpdReqDialog( NULL )
{
- if ( dp_misc::office_is_running() )
- {
- m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY );
- if ( m_xDesktop.is() )
- m_xDesktop->addTerminateListener( this );
- }
-
m_sPackageManagers.realloc(2);
m_sPackageManagers[0] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("user") );
m_sPackageManagers[1] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("shared") );;
@@ -110,6 +102,16 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
}
catch ( uno::Exception& )
{}
+
+ if ( dp_misc::office_is_running() )
+ {
+ // the registration should be done after the construction has been ended
+ // otherwise an exception prevents object creation, but it is registered as a listener
+ m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY );
+ if ( m_xDesktop.is() )
+ m_xDesktop->addTerminateListener( this );
+ }
}
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index 412535e00e80..f11f87ad56cd 100644
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -80,7 +80,8 @@ SHL1STDLIBS = \
$(SVLLIB) \
$(UNOTOOLSLIB) \
$(DEPLOYMENTMISCLIB) \
- $(HELPLINKERLIB)
+ $(HELPLINKERLIB) \
+ $(CONFIGMGRLIB)
SHL1DEPN =
SHL1IMPLIB = i$(TARGET)
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 06afd14e4581..165efbaeca5a 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -311,18 +311,6 @@ 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);
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index f84e71bca0a9..e6781e2a1746 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -122,7 +122,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XComponentContext> m_xRemoteContext;
enum reg {
- REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED
+ REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED
} m_registered;
Reference<loader::XImplementationLoader> getComponentInfo(
@@ -144,6 +144,10 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
const Reference<registry::XSimpleRegistry> getRDB() const;
+ //Provides the read-only registry (e.g. not the one based on the duplicated
+ //rdb files
+ const Reference<registry::XSimpleRegistry> getRDB_RO() const;
+
public:
inline ComponentPackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -221,9 +225,22 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString m_commonRDB;
OUString m_nativeRDB;
+
+ //URLs of the read-only rdbs (e.g. not the ones of the duplicated files)
+ OUString m_commonRDB_RO;
+ OUString m_nativeRDB_RO;
+
+ //These rdbs are for writing new service entries. The rdb files are copies
+ //which are created when services are added or removed.
Reference<registry::XSimpleRegistry> m_xCommonRDB;
Reference<registry::XSimpleRegistry> m_xNativeRDB;
+ //These rdbs are created on the read-only rdbs which are already used
+ //by UNO since the startup of the current session.
+ Reference<registry::XSimpleRegistry> m_xCommonRDB_RO;
+ Reference<registry::XSimpleRegistry> m_xNativeRDB_RO;
+
+
void unorc_verify_init( Reference<XCommandEnvironment> const & xCmdEnv );
void unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv );
@@ -252,6 +269,9 @@ public:
//Will be called from ComponentPackageImpl
void initServiceRdbFiles();
+
+ //Creates the READ ONLY registries (m_xCommonRDB_RO,m_xNativeRDB_RO)
+ void initServiceRdbFiles_RO();
};
//______________________________________________________________________________
@@ -259,12 +279,12 @@ const Reference<registry::XSimpleRegistry>
BackendImpl::ComponentPackageImpl::getRDB() const
{
BackendImpl * that = getMyBackend();
+
//Late "initialization" of the services rdb files
//This is to prevent problems when running several
//instances of OOo with root rights in parallel. This
//would otherwise cause problems when copying the rdbs.
- //Now this code is only performed if isRegistered or processPackage
- //is called.
+ //See http://qa.openoffice.org/issues/show_bug.cgi?id=99257
{
const ::osl::MutexGuard guard( getMutex() );
if (!that->bSwitchedRdbFiles)
@@ -273,7 +293,6 @@ BackendImpl::ComponentPackageImpl::getRDB() const
that->initServiceRdbFiles();
}
}
-
if (m_loader.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.SharedLibrary") ))
return that->m_xNativeRDB;
@@ -281,6 +300,19 @@ BackendImpl::ComponentPackageImpl::getRDB() const
return that->m_xCommonRDB;
}
+//Returns the read only RDB.
+const Reference<registry::XSimpleRegistry>
+BackendImpl::ComponentPackageImpl::getRDB_RO() const
+{
+ BackendImpl * that = getMyBackend();
+
+ if (m_loader.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.SharedLibrary") ))
+ return that->m_xNativeRDB_RO;
+ else
+ return that->m_xCommonRDB_RO;
+}
+
BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
@@ -342,20 +374,22 @@ void BackendImpl::disposing()
void BackendImpl::initServiceRdbFiles()
{
const Reference<XCommandEnvironment> xCmdEnv;
- if (! m_readOnly) {
+ if (! m_readOnly)
+ {
::ucbhelper::Content cacheDir( getCachePath(), xCmdEnv );
::ucbhelper::Content oldRDB;
// switch common rdb:
- if (m_commonRDB.getLength() > 0)
+ if (m_commonRDB_RO.getLength() > 0)
+ {
create_ucb_content(
- &oldRDB, makeURL( getCachePath(), m_commonRDB ),
- xCmdEnv, false /* no throw */ );
- m_commonRDB = m_commonRDB.equalsAsciiL(
+ &oldRDB, makeURL( getCachePath(), m_commonRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
+ m_commonRDB = m_commonRDB_RO.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("common.rdb") )
- ? OUSTR("common_.rdb") : OUSTR("common.rdb");
+ ? OUSTR("common_.rdb") : OUSTR("common.rdb");
if (oldRDB.get().is())
{
-
if (! cacheDir.transferContent(
oldRDB, ::ucbhelper::InsertOperation_COPY,
m_commonRDB, NameClash::OVERWRITE ))
@@ -367,13 +401,15 @@ void BackendImpl::initServiceRdbFiles()
oldRDB = ::ucbhelper::Content();
}
// switch native rdb:
- if (m_nativeRDB.getLength() > 0)
+ if (m_nativeRDB_RO.getLength() > 0)
+ {
create_ucb_content(
- &oldRDB, makeURL( getCachePath(), m_nativeRDB ),
- xCmdEnv, false /* no throw */ );
+ &oldRDB, makeURL(getCachePath(), m_nativeRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
const OUString plt_rdb( getPlatformString() + OUSTR(".rdb") );
const OUString plt_rdb_( getPlatformString() + OUSTR("_.rdb") );
- m_nativeRDB = m_nativeRDB.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
+ m_nativeRDB = m_nativeRDB_RO.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
if (oldRDB.get().is())
{
if (! cacheDir.transferContent(
@@ -411,6 +447,37 @@ void BackendImpl::initServiceRdbFiles()
}
}
+void BackendImpl::initServiceRdbFiles_RO()
+{
+ const Reference<XCommandEnvironment> xCmdEnv;
+
+ // common rdb for java, native rdb for shared lib components
+ if (m_commonRDB_RO.getLength() > 0)
+ {
+ m_xCommonRDB_RO.set(
+ m_xComponentContext->getServiceManager()
+ ->createInstanceWithContext(
+ OUSTR("com.sun.star.registry.SimpleRegistry"),
+ m_xComponentContext), UNO_QUERY_THROW);
+ m_xCommonRDB_RO->open(
+ makeURL(expandUnoRcUrl(getCachePath()), m_commonRDB_RO),
+ sal_True, //read-only
+ sal_True); // create data source if necessary
+ }
+ if (m_nativeRDB_RO.getLength() > 0)
+ {
+ m_xNativeRDB_RO.set(
+ m_xComponentContext->getServiceManager()
+ ->createInstanceWithContext(
+ OUSTR("com.sun.star.registry.SimpleRegistry"),
+ m_xComponentContext), UNO_QUERY_THROW);
+ m_xNativeRDB_RO->open(
+ makeURL(expandUnoRcUrl(getCachePath()), m_nativeRDB_RO),
+ sal_True, //read-only
+ sal_True); // create data source if necessary
+ }
+}
+
//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
@@ -489,7 +556,12 @@ BackendImpl::BackendImpl(
}
else
{
+ //do this before initServiceRdbFiles_RO, because it determines
+ //m_commonRDB and m_nativeRDB
unorc_verify_init( xCmdEnv );
+
+ initServiceRdbFiles_RO();
+
}
}
@@ -684,7 +756,7 @@ void BackendImpl::unorc_verify_init(
sal_Int32 start = sizeof ("UNO_SERVICES=?$ORIGIN/") - 1;
sal_Int32 sep = line.indexOf( ' ', start );
OSL_ASSERT( sep > 0 );
- m_commonRDB = line.copy( start, sep - start );
+ m_commonRDB_RO = line.copy( start, sep - start );
}
// native rc:
@@ -694,7 +766,7 @@ void BackendImpl::unorc_verify_init(
xCmdEnv, false /* no throw */ )) {
if (readLine( &line, OUSTR("UNO_SERVICES="), ucb_content,
RTL_TEXTENCODING_UTF8 )) {
- m_nativeRDB = line.copy(
+ m_nativeRDB_RO = line.copy(
sizeof ("UNO_SERVICES=?$ORIGIN/") - 1 );
}
}
@@ -760,12 +832,19 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
}
buf.append(LF);
}
- if (m_commonRDB.getLength() > 0 || m_nativeRDB.getLength() > 0)
+
+ // If we duplicated the common or native rdb then we must use those urls
+ //otherwise we use those of the original files. That is, m_commonRDB_RO and
+ //m_nativeRDB_RO;
+ OUString sCommonRDB(m_commonRDB.getLength() > 0 ? m_commonRDB : m_commonRDB_RO);
+ OUString sNativeRDB(m_nativeRDB.getLength() > 0 ? m_nativeRDB : m_nativeRDB_RO);
+
+ if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0)
{
buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
buf.append( ::rtl::OUStringToOString(
- m_commonRDB, RTL_TEXTENCODING_ASCII_US ) );
- if (m_nativeRDB.getLength() > 0)
+ sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+ if (sNativeRDB.getLength() > 0)
{
buf.append( RTL_CONSTASCII_STRINGPARAM(
" ${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
@@ -775,7 +854,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
::rtl::OStringBuffer buf2;
buf2.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
buf2.append( ::rtl::OUStringToOString(
- m_nativeRDB, RTL_TEXTENCODING_ASCII_US ) );
+ sNativeRDB, RTL_TEXTENCODING_ASCII_US ) );
buf2.append(LF);
const Reference<io::XInputStream> xData(
@@ -1023,7 +1102,8 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
if (m_registered == REG_UNINIT)
{
m_registered = REG_NOT_REGISTERED;
- const Reference<registry::XSimpleRegistry> xRDB( getRDB() );
+ bool bAmbiguousComponentName = false;
+ const Reference<registry::XSimpleRegistry> xRDB( getRDB_RO() );
if (xRDB.is())
{
// lookup rdb for location URL:
@@ -1043,21 +1123,51 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
pImplNames[ pos ] + OUSTR("/UNO/LOCATION") );
const Reference<registry::XRegistryKey> xKey(
xRootKey->openKey(key) );
- if (xKey.is() && xKey->isValid()) {
+ if (xKey.is() && xKey->isValid())
+ {
const OUString location( xKey->getAsciiValue() );
if (location.equalsIgnoreAsciiCase( getURL() ))
+ {
break;
+ }
+ else
+ {
+ //try to match only the file name
+ OUString thisUrl(getURL());
+ OUString thisFileName(thisUrl.copy(thisUrl.lastIndexOf('/')));
+
+ OUString locationFileName(location.copy(location.lastIndexOf('/')));
+ if (locationFileName.equalsIgnoreAsciiCase(thisFileName))
+ bAmbiguousComponentName = true;
+ }
}
}
if (pos >= 0)
m_registered = REG_REGISTERED;
+ else if (bAmbiguousComponentName)
+ m_registered = REG_MAYBE_REGISTERED;
}
}
+
+ //Different extensions can use the same service implementations. Then the extensions
+ //which was installed last will overwrite the one from the other extension. That is
+ //the registry will contain the path (the location) of the library or jar of the
+ //second extension. In this case isRegistered called for the lib of the first extension
+ //would return "not registered". That would mean that during uninstallation
+ //XPackage::registerPackage is not called, because it just was not registered. This is,
+ //however, necessary for jar files. Registering and unregistering update
+ //uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
+ //Therefore, we will return always "is ambiguous" if the path of this component cannot
+ //be found in the registry and if there is another path and both have the same file name (but
+ //the rest of the path is different).
+ //If the caller cannot precisely determine that this package was registered, then it must
+ //call registerPackage.
+ sal_Bool bAmbiguous = m_registered == REG_VOID // REG_VOID == we are in the progress of unregistration
+ || m_registered == REG_MAYBE_REGISTERED;
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>(
- m_registered == REG_REGISTERED,
- m_registered == REG_VOID /* IsAmbiguous */ ) );
+ m_registered == REG_REGISTERED, bAmbiguous) );
}
//______________________________________________________________________________
@@ -1068,6 +1178,8 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
Reference<XCommandEnvironment> const & xCmdEnv )
{
BackendImpl * that = getMyBackend();
+
+
const bool java = m_loader.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") );
const OUString url( getURL() );
@@ -1076,9 +1188,6 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
if (doRegisterPackage)
{
- if (isJavaTypelib)
- that->addToUnoRc( java, url, xCmdEnv );
-
if (! m_xRemoteContext.is()) {
m_xRemoteContext.set(
that->getObject( url ), UNO_QUERY );
@@ -1096,7 +1205,12 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
m_xRemoteContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.registry.ImplementationRegistration"),
m_xRemoteContext ), UNO_QUERY_THROW );
+
xImplReg->registerImplementation( m_loader, url, xServicesRDB );
+ //only write to unorc if registration was successful.
+ //It may fail if there is no suitable java.
+ if (isJavaTypelib)
+ that->addToUnoRc( java, url, xCmdEnv );
t_stringlist implNames;
t_stringpairvec singletons;
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index df64402f5192..460ba5e9fed0 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+//TODO: Large parts of this file were copied from dp_component.cxx; those parts
+// should be consolidated.
+
#include "dp_configuration.hrc"
#include "dp_backend.h"
#include "dp_persmap.h"
@@ -38,16 +41,18 @@
#include "rtl/uri.hxx"
#include "rtl/memory.h"
#include "osl/file.hxx"
+#include "cppuhelper/exc_hlp.hxx"
#include "ucbhelper/content.hxx"
#include "comphelper/anytostring.hxx"
#include "comphelper/servicedecl.hxx"
+#include "configmgr/update.hxx"
#include "xmlscript/xml_helper.hxx"
#include "svl/inettype.hxx"
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/io/XActiveDataSink.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/util/XRefreshable.hpp"
-#include "com/sun/star/configuration/backend/XLayerImporter.hpp"
+#include <list>
#include <memory>
@@ -62,6 +67,8 @@ namespace backend {
namespace configuration {
namespace {
+typedef ::std::list<OUString> t_stringlist;
+
//==============================================================================
class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
{
@@ -95,27 +102,39 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
};
friend class PackageImpl;
- Reference< ::com::sun::star::configuration::backend::XLayerImporter >
- m_xMergeImporter;
- OUString m_configLayer;
+ t_stringlist m_xcs_files;
+ t_stringlist m_xcu_files;
+ t_stringlist & getFiles( bool xcs ) {
+ return xcs ? m_xcs_files : m_xcu_files;
+ }
+
+ bool m_configmgrini_inited;
+ bool m_configmgrini_modified;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
Reference<XCommandEnvironment> const & xCmdEnv );
- void xcu_merge_in( OUString const & url,
- Reference< XCommandEnvironment > const & xCmdEnv );
- void xcs_merge_in( OUString const & url,
- Reference< XCommandEnvironment > const & xCmdEnv );
::std::auto_ptr<PersistentMap> m_registeredPackages;
- OUString const & getConfigLayer();
- Reference<util::XRefreshable> m_defaultProvider;
+ // for backwards compatibility
+
+ virtual void SAL_CALL disposing();
const Reference<deployment::XPackageTypeInfo> m_xConfDataTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xConfSchemaTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
+ void configmgrini_verify_init(
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ void configmgrini_flush( Reference<XCommandEnvironment> const & xCmdEnv );
+
+ bool addToConfigmgrIni( bool isSchema, OUString const & url,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ bool removeFromConfigmgrIni( bool isSchema, OUString const & url,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ bool hasInConfigmgrIni( bool isSchema, OUString const & url );
+
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
@@ -123,17 +142,36 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+
+ using PackageRegistryBackend::disposing;
};
//______________________________________________________________________________
+void BackendImpl::disposing()
+{
+ try {
+ configmgrini_flush( Reference<XCommandEnvironment>() );
+
+ PackageRegistryBackend::disposing();
+ }
+ catch (RuntimeException &) {
+ throw;
+ }
+ catch (Exception &) {
+ Any exc( ::cppu::getCaughtException() );
+ throw lang::WrappedTargetRuntimeException(
+ OUSTR("caught unexpected exception while disposing..."),
+ static_cast<OWeakObject *>(this), exc );
+ }
+}
+
+//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext )
: PackageRegistryBackend( args, xComponentContext ),
- m_defaultProvider( xComponentContext->getValueByName(
- OUSTR("/singletons/com.sun.star."
- "configuration.theDefaultProvider") ),
- UNO_QUERY ),
+ m_configmgrini_inited( false ),
+ m_configmgrini_modified( false ),
m_xConfDataTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.configuration-data"),
@@ -151,19 +189,17 @@ BackendImpl::BackendImpl(
m_typeInfos[ 0 ] = m_xConfDataTypeInfo;
m_typeInfos[ 1 ] = m_xConfSchemaTypeInfo;
- OSL_ASSERT( m_defaultProvider.is() );
+ const Reference<XCommandEnvironment> xCmdEnv;
if (transientMode()) {
- m_registeredPackages.reset( new PersistentMap );
+ //TODO
}
else {
+ configmgrini_verify_init( xCmdEnv );
m_registeredPackages.reset(
new PersistentMap(
makeURL( getCachePath(), OUSTR("registered_packages.db") ),
m_readOnly ) );
- if (! m_readOnly)
- create_folder( 0, getConfigLayer(),
- Reference<XCommandEnvironment>() );
}
}
@@ -236,103 +272,253 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
+//##############################################################################
+
//______________________________________________________________________________
-OUString const & BackendImpl::getConfigLayer()
+void BackendImpl::configmgrini_verify_init(
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
- if (m_configLayer.getLength() == 0)
+ if (transientMode())
+ return;
+ const ::osl::MutexGuard guard( getMutex() );
+ if (! m_configmgrini_inited)
{
- OUString path(
- makeURL( expandUnoRcUrl( getCachePath() ), OUSTR("registry") ) );
- ::osl::FileBase::RC rc = ::osl::File::getAbsoluteFileURL(
- OUString(), path, m_configLayer );
- if (rc != ::osl::FileBase::E_None)
- throw RuntimeException(
- OUSTR("making file URL absolute failed: ") + path,
- static_cast<OWeakObject *>(this) );
+ // common rc:
+ ::ucbhelper::Content ucb_content;
+ if (create_ucb_content(
+ &ucb_content,
+ makeURL( getCachePath(), OUSTR("configmgr.ini") ),
+ xCmdEnv, false /* no throw */ ))
+ {
+ OUString line;
+ if (readLine( &line, OUSTR("SCHEMA="), ucb_content,
+ RTL_TEXTENCODING_UTF8 ))
+ {
+ sal_Int32 index = sizeof ("SCHEMA=") - 1;
+ do {
+ OUString token( line.getToken( 0, ' ', index ).trim() );
+ if (token.getLength() > 0) {
+ // cleanup, check if existing:
+ if (create_ucb_content(
+ 0, expandUnoRcTerm(token), xCmdEnv,
+ false /* no throw */ )) {
+ m_xcs_files.push_back( token );
+ }
+ else
+ OSL_ENSURE(
+ 0, "### invalid SCHEMA entry!" );
+ }
+ }
+ while (index >= 0);
+ }
+ if (readLine( &line, OUSTR("DATA="), ucb_content,
+ RTL_TEXTENCODING_UTF8 )) {
+ sal_Int32 index = sizeof ("DATA=") - 1;
+ do {
+ OUString token( line.getToken( 0, ' ', index ).trim() );
+ if (token.getLength() > 0) {
+ if (token[ 0 ] == '?')
+ token = token.copy( 1 );
+ // cleanup, check if existing:
+ if (create_ucb_content(
+ 0, expandUnoRcTerm(token),
+ xCmdEnv, false /* no throw */ )) {
+ m_xcu_files.push_back( token );
+ }
+ else
+ OSL_ENSURE( 0, "### invalid DATA entry!" );
+ }
+ }
+ while (index >= 0);
+ }
+ }
+ m_configmgrini_modified = false;
+ m_configmgrini_inited = true;
}
- return m_configLayer;
}
-//==============================================================================
-class SchemaFileRoot : public ::dp_misc::XmlRootElement
+//______________________________________________________________________________
+void BackendImpl::configmgrini_flush(
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
-public:
- OUString m_name;
- OUString m_package;
-
- inline SchemaFileRoot()
- : XmlRootElement( OUSTR("http://openoffice.org/2001/registry"),
- OUSTR("component-schema") )
- {}
-
- // XRoot
- virtual Reference< xml::input::XElement > SAL_CALL startRootElement(
- sal_Int32 uid, OUString const & localname,
- Reference< xml::input::XAttributes > const & xAttributes )
- throw (xml::sax::SAXException, RuntimeException);
-};
+ if (transientMode())
+ return;
+ if (!m_configmgrini_inited || !m_configmgrini_modified)
+ return;
+
+ ::rtl::OStringBuffer buf;
+ // UNO_USER_PACKAGES_CACHE, UNO_SHARED_PACKAGES_CACHE have to be resolved
+ // locally:
+ if (m_eContext == CONTEXT_USER) {
+ buf.append( RTL_CONSTASCII_STRINGPARAM(
+ "UNO_USER_PACKAGES_CACHE=$ORIGIN/../..") );
+ }
+ else if (m_eContext == CONTEXT_SHARED) {
+ buf.append( RTL_CONSTASCII_STRINGPARAM(
+ "UNO_SHARED_PACKAGES_CACHE=$ORIGIN/../..") );
+ }
+ else
+ OSL_ASSERT(0);
+ buf.append(LF);
+
+ if (! m_xcs_files.empty())
+ {
+ t_stringlist::const_iterator iPos( m_xcs_files.begin() );
+ t_stringlist::const_iterator const iEnd( m_xcs_files.end() );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("SCHEMA=") );
+ while (iPos != iEnd) {
+ // encoded ASCII file-urls:
+ const ::rtl::OString item(
+ ::rtl::OUStringToOString( *iPos, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( item );
+ ++iPos;
+ if (iPos != iEnd)
+ buf.append( ' ' );
+ }
+ buf.append(LF);
+ }
+ if (! m_xcu_files.empty())
+ {
+ t_stringlist::const_iterator iPos( m_xcu_files.begin() );
+ t_stringlist::const_iterator const iEnd( m_xcu_files.end() );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("DATA=") );
+ while (iPos != iEnd) {
+ // encoded ASCII file-urls:
+ const ::rtl::OString item(
+ ::rtl::OUStringToOString( *iPos, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( item );
+ ++iPos;
+ if (iPos != iEnd)
+ buf.append( ' ' );
+ }
+ buf.append(LF);
+ }
+
+ // write configmgr.ini:
+ const Reference<io::XInputStream> xData(
+ ::xmlscript::createInputStream(
+ ::rtl::ByteSequence(
+ reinterpret_cast<sal_Int8 const *>(buf.getStr()),
+ buf.getLength() ) ) );
+ ::ucbhelper::Content ucb_content(
+ makeURL( getCachePath(), OUSTR("configmgr.ini") ), xCmdEnv );
+ ucb_content.writeStream( xData, true /* replace existing */ );
+
+ m_configmgrini_modified = false;
+}
+
+//------------------------------------------------------------------------------
+inline OUString makeRcTerm( OUString const & url )
+{
+ OSL_ASSERT( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ "vnd.sun.star.expand:") ) );
+ if (url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:") )) {
+ // cut protocol:
+ OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) );
+ // decode uric class chars:
+ rcterm = ::rtl::Uri::decode(
+ rcterm, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ return rcterm;
+ }
+ else
+ return url;
+}
//______________________________________________________________________________
-Reference< xml::input::XElement > SchemaFileRoot::startRootElement(
- sal_Int32 uid, OUString const & localname,
- Reference< xml::input::XAttributes > const & xAttributes )
- throw (xml::sax::SAXException, RuntimeException)
+bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_,
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
- // check root element:
- XmlRootElement::startRootElement( uid, localname, xAttributes );
-
- // "name" attribute
- m_name = xAttributes->getValueByUidName( getUid(), OUSTR("name") );
- if (m_name.getLength() == 0)
- throw xml::sax::SAXException(
- OUSTR("missing schema name attribute!"),
- static_cast< OWeakObject * >(this), Any() );
-
- // "package" attribute
- m_package = xAttributes->getValueByUidName( getUid(), OUSTR("package") );
- if (m_package.getLength() == 0)
- throw xml::sax::SAXException(
- OUSTR("missing schema package attribute!"),
- static_cast<OWeakObject *>(this), Any() );
-
- // don't go deeper...
- return Reference<xml::input::XElement>();
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ configmgrini_verify_init( xCmdEnv );
+ t_stringlist & rSet = getFiles(isSchema);
+ if (::std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
+ rSet.push_front( rcterm ); // prepend to list, thus overriding
+ // write immediately:
+ m_configmgrini_modified = true;
+ configmgrini_flush( xCmdEnv );
+ return true;
+ }
+ else
+ return false;
}
//______________________________________________________________________________
-void BackendImpl::xcs_merge_in(
- OUString const & url,
+bool BackendImpl::removeFromConfigmgrIni(
+ bool isSchema, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- // parse out schema package:
- SchemaFileRoot * root = new SchemaFileRoot;
- Reference<xml::input::XRoot> xRoot( root );
- ::ucbhelper::Content ucb_content( url, xCmdEnv );
- xml_parse( xRoot, ucb_content, getComponentContext() );
-
- OUString dest_folder(
- makeURL( getConfigLayer(), OUSTR("schema/") + ::rtl::Uri::encode(
- root->m_package, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ).replace( '.', '/' ) ) );
- OUString title( root->m_name + OUSTR(".xcs") );
- OUString dest_url( makeURL( dest_folder, ::rtl::Uri::encode(
- title, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ) ) );
- // assure dest folder is existing:
- ::ucbhelper::Content ucb_dest_folder;
- create_folder( &ucb_dest_folder, dest_folder, xCmdEnv );
- if (! ucb_dest_folder.transferContent(
- ::ucbhelper::Content( url, xCmdEnv ),
- ::ucbhelper::InsertOperation_COPY,
- title, NameClash::OVERWRITE ))
- throw RuntimeException(
- OUSTR("::ucb::Content::transferContent() failed!"), 0 );
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ configmgrini_verify_init( xCmdEnv );
+ t_stringlist & rSet = getFiles(isSchema);
+ t_stringlist::iterator i(std::find(rSet.begin(), rSet.end(), rcterm));
+ if (i == rSet.end() && !isSchema) { //TODO: see replaceOrigin()
+ i = std::find(
+ rSet.begin(), rSet.end(),
+ rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
+ }
+ if (i == rSet.end()) {
+ return false;
+ }
+ rSet.erase(i);
+ // write immediately:
+ m_configmgrini_modified = true;
+ configmgrini_flush( xCmdEnv );
+ return true;
+}
+
+//______________________________________________________________________________
+bool BackendImpl::hasInConfigmgrIni(
+ bool isSchema, OUString const & url_ )
+{
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ t_stringlist const & rSet = getFiles(isSchema);
+ return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end()
+ || (!isSchema && //TODO: see replaceOrigin()
+ ::std::find(
+ rSet.begin(), rSet.end(),
+ rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod"))) !=
+ rSet.end());
}
//##############################################################################
+// Package
+//______________________________________________________________________________
+BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
+{
+ BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
+ if (NULL == pBackend)
+ {
+ //May throw a DisposedException
+ check();
+ //We should never get here...
+ throw RuntimeException(
+ OUSTR("Failed to get the BackendImpl"),
+ static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
+ }
+ return pBackend;
+}
+
+beans::Optional< beans::Ambiguous<sal_Bool> >
+BackendImpl::PackageImpl::isRegistered_(
+ ::osl::ResettableMutexGuard &,
+ ::rtl::Reference<AbortChannel> const &,
+ Reference<XCommandEnvironment> const & )
+{
+ BackendImpl * that = getMyBackend();
+ rtl::OUString url(getURL());
+ return beans::Optional< beans::Ambiguous<sal_Bool> >(
+ true /* IsPresent */,
+ beans::Ambiguous<sal_Bool>(
+ that->hasInConfigmgrIni( m_isSchema, url ) ||
+ that->m_registeredPackages->has(
+ rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 ) ),
+ false /* IsAmbiguous */ ) );
+}
+
//------------------------------------------------------------------------------
OUString encodeForXml( OUString const & text )
{
@@ -367,7 +553,7 @@ OUString encodeForXml( OUString const & text )
}
//______________________________________________________________________________
-void BackendImpl::xcu_merge_in(
+OUString replaceOrigin(
OUString const & url, Reference< XCommandEnvironment > const & xCmdEnv )
{
// looking for %origin%:
@@ -434,199 +620,70 @@ void BackendImpl::xcu_merge_in(
rtl_copyMemory( filtered.getArray() + write_pos, pAdd, nAdd );
write_pos += nAdd;
}
- if (use_filtered && write_pos < filtered.getLength())
+ if (!use_filtered)
+ return url;
+ if (write_pos < filtered.getLength())
filtered.realloc( write_pos );
-
- Reference<XComponentContext> const & xContext = getComponentContext();
- if (! m_xMergeImporter.is()) {
- m_xMergeImporter.set(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.configuration.backend.MergeImporter"),
- xContext ), UNO_QUERY_THROW );
- }
-
- Reference< ::com::sun::star::configuration::backend::XLayer > xLayer(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.configuration.backend.xml.LayerParser"),
- xContext ), UNO_QUERY_THROW );
-
- Reference< io::XActiveDataSink > xActiveDataSink( xLayer, UNO_QUERY_THROW );
- if (use_filtered)
- xActiveDataSink->setInputStream( ::xmlscript::createInputStream(
- filtered ) );
- else
- ucb_content.openStream( xActiveDataSink );
-
- if (transientMode())
- m_xMergeImporter->importLayer( xLayer );
- else
- m_xMergeImporter->importLayerForEntity( xLayer, getConfigLayer() );
-}
-
-//##############################################################################
-
-// Package
-//______________________________________________________________________________
-BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
-{
- BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
- if (NULL == pBackend)
- {
- //May throw a DisposedException
- check();
- //We should never get here...
- throw RuntimeException(
- OUSTR("Failed to get the BackendImpl"),
- static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
- }
- return pBackend;
-}
-
-beans::Optional< beans::Ambiguous<sal_Bool> >
-BackendImpl::PackageImpl::isRegistered_(
- ::osl::ResettableMutexGuard &,
- ::rtl::Reference<AbortChannel> const &,
- Reference<XCommandEnvironment> const & )
-{
- BackendImpl * that = getMyBackend();
- return beans::Optional< beans::Ambiguous<sal_Bool> >(
- true /* IsPresent */,
- beans::Ambiguous<sal_Bool>(
- that->m_registeredPackages->has(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) ),
- false /* IsAmbiguous */ ) );
+ rtl::OUString newUrl(url + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
+ //TODO: unique name
+ ucbhelper::Content(newUrl, xCmdEnv).writeStream(
+ xmlscript::createInputStream(filtered), true);
+ return newUrl;
}
//______________________________________________________________________________
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
- ::rtl::Reference<AbortChannel> const & abortChannel,
+ ::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
BackendImpl * that = getMyBackend();
+ OUString url( getURL() );
+
if (doRegisterPackage)
{
if (m_isSchema)
{
- OSL_ENSURE( ! that->transientMode(),
- "### schema cannot be deployed transiently!" );
- if (! that->transientMode()) {
- that->xcs_merge_in( m_url, xCmdEnv );
- that->m_registeredPackages->put(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8),
- rtl::OString(
- RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.configuration-schema" ) ) );
- }
+ configmgr::update::insertExtensionXcsFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
}
else
{
- that->xcu_merge_in( m_url, xCmdEnv );
- that->m_registeredPackages->put(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ),
- rtl::OString(
- RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.configuration-data" ) ) );
+ url = replaceOrigin(url, xCmdEnv);
+ configmgr::update::insertExtensionXcuFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
}
+
+ that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
}
else // revoke
{
- OSL_ASSERT(
- that->m_registeredPackages->has(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) ) );
- t_string2string_map entries( that->m_registeredPackages->getEntries() );
- t_string2string_map::const_iterator iPos( entries.begin() );
- t_string2string_map::const_iterator const iEnd( entries.end() );
-
- if (m_isSchema)
- {
- if (! that->transientMode())
+ if (!that->removeFromConfigmgrIni(m_isSchema, url, xCmdEnv)) {
+ t_string2string_map entries(
+ that->m_registeredPackages->getEntries());
+ for (t_string2string_map::iterator i(entries.begin());
+ i != entries.end(); ++i)
{
- ::ucbhelper::Content ucbSaveLayer(
- makeURL( that->getConfigLayer(), OUSTR("schema") ),
- xCmdEnv );
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("schema.bak") ) );
- try {
- for ( ; iPos != iEnd; ++iPos )
- {
- checkAborted( abortChannel );
- if (iPos->second == "vnd.sun.star.configuration-schema")
- {
- OUString url(
- rtl::OStringToOUString(
- iPos->first, RTL_TEXTENCODING_UTF8 ) );
- if (!url.equals( m_url )) {
- that->xcs_merge_in( url, xCmdEnv );
- }
- }
+ rtl::OUString url2(
+ rtl::OStringToOUString(i->first, RTL_TEXTENCODING_UTF8));
+ if (url2 != url) {
+ bool schema = i->second.equalsIgnoreAsciiCase(
+ "vnd.sun.star.configuration-schema");
+ if (!schema) {
+ url2 = replaceOrigin(url2, xCmdEnv);
}
+ that->addToConfigmgrIni(schema, url2, xCmdEnv);
}
- catch (RuntimeException &) {
- throw;
- }
- catch (Exception &) {
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("schema") ) );
- throw;
- }
- that->m_registeredPackages->erase(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) );
- ucbSaveLayer.executeCommand(
- OUSTR("delete"), Any( true /* delete physically */ ) );
+ that->m_registeredPackages->erase(i->first);
}
- }
- else // data
- {
- if (! that->transientMode())
- {
- ::ucbhelper::Content ucbSaveLayer(
- makeURL( that->getConfigLayer(), OUSTR("data") ),
- xCmdEnv );
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("data.bak") ) );
- try {
- for ( ; iPos != iEnd; ++iPos )
- {
- checkAborted( abortChannel );
- if (iPos->second == "vnd.sun.star.configuration-data") {
- OUString url(
- rtl::OStringToOUString(
- iPos->first, RTL_TEXTENCODING_UTF8 ) );
- if (!url.equals( m_url )) {
- that->xcu_merge_in( url, xCmdEnv );
- }
- }
- }
- }
- catch (RuntimeException &) {
- throw;
- }
- catch (Exception &) {
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("data") ) );
- throw;
- }
- that->m_registeredPackages->erase(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) );
- ucbSaveLayer.executeCommand(
+ ::ucbhelper::Content(
+ makeURL( that->getCachePath(), OUSTR("registry") ),
+ xCmdEnv ).executeCommand(
OUSTR("delete"), Any( true /* delete physically */ ) );
- }
}
- }
- if (!m_isSchema && getMyBackend()->m_defaultProvider.is()) {
- // temp workaround for config bug:
- try {
- getMyBackend()->m_defaultProvider->refresh();
- }
- catch (lang::WrappedTargetRuntimeException & exc) {
- (void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
- ::comphelper::anyToString(exc.TargetException),
- RTL_TEXTENCODING_UTF8 ).getStr() );
- }
+ //TODO: revoking at runtime, possible, sensible?
}
}
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 0c5e8117b07d..c06b30be1669 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -134,7 +134,7 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
{
::osl::ResettableMutexGuard guard( getMutex() );
check();
- t_string2weakref::const_iterator const iFind( m_bound.find( url ) );
+ t_string2ref::const_iterator const iFind( m_bound.find( url ) );
if (iFind != m_bound.end()) {
Reference<deployment::XPackage> xPackage( iFind->second );
if (xPackage.is())
@@ -166,8 +166,8 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
}
guard.reset();
- ::std::pair< t_string2weakref::iterator, bool > insertion(
- m_bound.insert( t_string2weakref::value_type( url, xNewPackage ) ) );
+ ::std::pair< t_string2ref::iterator, bool > insertion(
+ m_bound.insert( t_string2ref::value_type( url, xNewPackage ) ) );
if (insertion.second)
{ // first insertion
OSL_ASSERT( Reference<XInterface>(insertion.first->second)
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index c3bf83505ee2..fe52c8ffc7e3 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -244,11 +244,17 @@ class PackageRegistryBackend
: protected ::dp_misc::MutexHolder, public t_BackendBase
{
::rtl::OUString m_cachePath;
-
+ //The map held originally WeakReferences. The map entries are removed in the disposing
+ //function, which is called when the XPackages are destructed or they are
+ //explicitely disposed. The latter happens, for example, when a extension is
+ //removed (see dp_manager.cxx). However, because of how the help systems work, now
+ // XPackageManager::getDeployedPackages is called often. This results in a lot
+ //of bindPackage calls which are costly. Therefore we keep hard references in
+ //the map now.
typedef ::std::hash_map<
- ::rtl::OUString, css::uno::WeakReference<css::deployment::XPackage>,
- ::rtl::OUStringHash > t_string2weakref;
- t_string2weakref m_bound;
+ ::rtl::OUString, css::uno::Reference<css::deployment::XPackage>,
+ ::rtl::OUStringHash > t_string2ref;
+ t_string2ref m_bound;
protected:
css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 70a7ed72304a..cfe5be59dad0 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -443,12 +443,19 @@ BackendImpl::PackageImpl::isRegistered_(
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
beans::Optional< beans::Ambiguous<sal_Bool> > option(
xPackage->isRegistered( xSubAbortChannel, xCmdEnv ) );
+
+ //present = true if at least one bundle item has this value.
+ //reg = true if all bundle items have an option value (option.IsPresent == 1)
+ //and all have value of true (option.Value.Value == true)
+ //If not, then the bundle has the status of not registered and ambiguous.
if (option.IsPresent)
{
beans::Ambiguous<sal_Bool> const & status = option.Value;
if (present)
{
+ //we never come here in the first iteration
if (reg != (status.Value != sal_False)) {
+
ambig = true;
reg = false;
break;
@@ -456,6 +463,7 @@ BackendImpl::PackageImpl::isRegistered_(
}
else
{
+ //we always come here in the first iteration
reg = status.Value;
present = true;
}
diff --git a/desktop/source/pagein/makefile.mk b/desktop/source/pagein/makefile.mk
index c50dc43fe55b..01452a858e66 100644
--- a/desktop/source/pagein/makefile.mk
+++ b/desktop/source/pagein/makefile.mk
@@ -119,7 +119,7 @@ $(MISC)$/$(TARGET)-common : makefile.mk
@-echo $(DLLPRE)package2$(DLLPOST) >> $@
@-echo $(DLLPRE)ucpfile1$(DLLPOST) >> $@
@-echo $(DLLPRE)ucb1$(DLLPOST) >> $@
- @-echo configmgr2$(UNODLLPOST) >> $@
+ @-echo $(DLLPRE)configmgr$(DLLPOST) >> $@
#
@-echo $(DLLPRE)dtrans$(DLLPOST) >> $@
@-echo $(DLLPRE)vclplug_gen$(DFTDLLPOST) >> $@
diff --git a/extensions/source/config/ldap/componentdef.cxx b/extensions/source/config/ldap/componentdef.cxx
index 986866939466..0fd917d2ff9e 100644
--- a/extensions/source/config/ldap/componentdef.cxx
+++ b/extensions/source/config/ldap/componentdef.cxx
@@ -28,14 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_extensions.hxx"
-#ifndef EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILE_HXX_
#include "ldapuserprofilebe.hxx"
-#endif //CONFIGMGR_BACKEND_LDAPUSERPROFILE_HXX_
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <rtl/ustrbuf.hxx>
using namespace extensions::config::ldap ;
@@ -70,49 +64,8 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
extern "C" sal_Bool SAL_CALL component_writeInfo(void *aServiceManager,
void *aRegistryKey) {
- using namespace ::com::sun::star::registry;
- if (aRegistryKey)
- {
-
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> xFactory
- (reinterpret_cast<lang::XMultiServiceFactory*> (aServiceManager),
- uno::UNO_QUERY);
-
- rtl::OUStringBuffer aImplKeyName;
- aImplKeyName.appendAscii("/");
- aImplKeyName.append(LdapUserProfileBe::getLdapUserProfileBeName());
-
- rtl::OUString aMainKeyName(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
-
- uno::Reference<XRegistryKey> xNewImplKey(
- reinterpret_cast<XRegistryKey*>
- (aRegistryKey)->createKey(aImplKeyName.makeStringAndClear()));
-
- uno::Reference<XRegistryKey> xNewKey(
- xNewImplKey->createKey(aMainKeyName));
-
- //Now register associated service names
- uno::Sequence<rtl::OUString> sServiceNames =
- LdapUserProfileBe::getLdapUserProfileBeServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- {
- xNewKey->createKey(sServiceNames[i]);
- }
- //Now register associated org.openoffice.UserProfile component
- //that this backend supports under xNewImplKey
- uno::Reference<XRegistryKey> xComponentKey(
- xNewImplKey->createKey(rtl::OUString::createFromAscii
- ("/DATA/SupportedComponents")));
-
- uno::Sequence<rtl::OUString> aComponentList(1);
- aComponentList[0]= rtl::OUString::createFromAscii
- ("org.openoffice.UserProfile");
-
- xComponentKey->setAsciiListValue(aComponentList);
- return sal_True;
- }
- return sal_False;
+ return cppu::component_writeInfoHelper(
+ aServiceManager, aRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx
index 8e049df2d660..c518dc37e94c 100644
--- a/extensions/source/config/ldap/ldapaccess.cxx
+++ b/extensions/source/config/ldap/ldapaccess.cxx
@@ -30,7 +30,6 @@
#include "ldapaccess.hxx"
-#include "ldapuserprof.hxx"
#include <rtl/ustrbuf.hxx>
#include <rtl/strbuf.hxx>
@@ -46,6 +45,8 @@ t_ldap_init LdapConnection::s_p_init = NULL;
t_ldap_msgfree LdapConnection::s_p_msgfree = NULL;
t_ldap_get_dn LdapConnection::s_p_get_dn = NULL;
t_ldap_first_entry LdapConnection::s_p_first_entry = NULL;
+t_ldap_first_attribute LdapConnection::s_p_first_attribute = NULL;
+t_ldap_next_attribute LdapConnection::s_p_next_attribute = NULL;
t_ldap_search_s LdapConnection::s_p_search_s = NULL;
t_ldap_value_free LdapConnection::s_p_value_free = NULL;
t_ldap_get_values LdapConnection::s_p_get_values = NULL;
@@ -188,12 +189,12 @@ void LdapConnection::initConnection()
}
}
//------------------------------------------------------------------------------
- void LdapConnection::getUserProfile(const rtl::OUString& aUser,
- const LdapUserProfileMap& aUserProfileMap,
- LdapUserProfile& aUserProfile)
+ void LdapConnection::getUserProfile(
+ const rtl::OUString& aUser, LdapData * data)
throw (lang::IllegalArgumentException,
ldap::LdapConnectionException, ldap::LdapGenericException)
- {
+{
+ OSL_ASSERT(data != 0);
if (!isValid()) { connectSimple(); }
rtl::OString aUserDn =findUserDn( rtl::OUStringToOString(aUser, RTL_TEXTENCODING_ASCII_US));
@@ -203,18 +204,26 @@ void LdapConnection::initConnection()
aUserDn,
LDAP_SCOPE_BASE,
"(objectclass=*)",
- const_cast<sal_Char **>(aUserProfileMap.getLdapAttributes()),
+ 0,
0, // Attributes + values
&result.msg) ;
checkLdapReturnCode("getUserProfile", retCode,mConnection) ;
-
- aUserProfileMap.ldapToUserProfile(mConnection,
- result.msg,
- aUserProfile) ;
-
- }
+ void * ptr;
+ char * attr = (*s_p_first_attribute)(mConnection, result.msg, &ptr);
+ while (attr != 0) {
+ char ** values = (*s_p_get_values)(mConnection, result.msg, attr);
+ if (values != 0) {
+ data->insert(
+ LdapData::value_type(
+ rtl::OStringToOUString(attr, RTL_TEXTENCODING_ASCII_US),
+ rtl::OStringToOUString(*values, RTL_TEXTENCODING_UTF8)));
+ (*s_p_value_free)(values);
+ }
+ attr = (*s_p_next_attribute)(mConnection, result.msg, ptr);
+ }
+}
//------------------------------------------------------------------------------
rtl::OString LdapConnection::findUserDn(const rtl::OString& aUser)
throw (lang::IllegalArgumentException,
@@ -264,47 +273,6 @@ void LdapConnection::initConnection()
return userDn ;
}
-//------------------------------------------------------------------------------
-rtl::OString LdapConnection::getSingleAttribute(
- const rtl::OString& aDn,
- const rtl::OString& aAttribute)
- throw (ldap::LdapConnectionException, ldap::LdapGenericException)
-{
- if (!isValid()) { connectSimple(); }
- const sal_Char *attributes [2] ;
- rtl::OString value ;
-
- attributes [0] = aAttribute ;
- attributes [1] = 0 ;
- LdapMessageHolder result ;
- LdapErrCode retCode = (*s_p_search_s)(mConnection,
- aDn,
- LDAP_SCOPE_BASE,
- "(objectclass=*)",
- const_cast<sal_Char **>(attributes),
- 0, // Attributes + values
- &result.msg) ;
-
- if (retCode == LDAP_NO_SUCH_OBJECT)
- {
- return value ;
- }
- checkLdapReturnCode("GetSingleAttribute", retCode, mConnection) ;
- LDAPMessage *entry = (*s_p_first_entry)(mConnection, result.msg) ;
-
- if (entry != NULL)
- {
- sal_Char **values = (*s_p_get_values)(mConnection, entry,
- aAttribute) ;
-
- if (values != NULL)
- {
- if (*values != NULL) { value = *values ; }
- (*s_p_value_free)(values) ;
- }
- }
- return value ;
-}
extern "C" { static void SAL_CALL thisModule() {} }
void LdapConnection::loadModule()
@@ -336,6 +304,8 @@ void LdapConnection::loadModule()
s_p_msgfree = (t_ldap_msgfree)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_msgfree").pData));
s_p_get_dn = (t_ldap_get_dn)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_get_dn").pData));
s_p_first_entry = (t_ldap_first_entry)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_first_entry").pData));
+ s_p_first_attribute = (t_ldap_first_attribute)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_first_attribute").pData));
+ s_p_next_attribute = (t_ldap_next_attribute)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_next_attribute").pData));
s_p_search_s = (t_ldap_search_s)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_search_s").pData));
s_p_value_free = (t_ldap_value_free)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_value_free").pData));
s_p_get_values = (t_ldap_get_values)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_get_values").pData));
diff --git a/extensions/source/config/ldap/ldapaccess.hxx b/extensions/source/config/ldap/ldapaccess.hxx
index d5f4e0606864..b2ea7970952e 100644
--- a/extensions/source/config/ldap/ldapaccess.hxx
+++ b/extensions/source/config/ldap/ldapaccess.hxx
@@ -28,6 +28,10 @@
#ifndef EXTENSIONS_CONFIG_LDAP_LDAPACCESS_HXX_
#define EXTENSIONS_CONFIG_LDAP_LDAPACCESS_HXX_
+#include "sal/config.h"
+
+#include <map>
+
#include "wrapldapinclude.hxx"
#include <com/sun/star/ldap/LdapGenericException.hpp>
@@ -54,6 +58,8 @@ typedef LDAP_API(LDAP *) (LDAP_CALL *t_ldap_init)( const char *defhost, int defp
typedef LDAP_API(int) (LDAP_CALL *t_ldap_msgfree)( LDAPMessage *lm );
typedef LDAP_API(char *) (LDAP_CALL *t_ldap_get_dn)( LDAP *ld, LDAPMessage *entry );
typedef LDAP_API(LDAPMessage *) (LDAP_CALL *t_ldap_first_entry)( LDAP *ld, LDAPMessage *chain );
+typedef LDAP_API(char *) (LDAP_CALL *t_ldap_first_attribute)( LDAP *ld, LDAPMessage *entry, void **ptr );
+typedef LDAP_API(char *) (LDAP_CALL *t_ldap_next_attribute)( LDAP *ld, LDAPMessage *entry, void *ptr );
typedef LDAP_API(int) (LDAP_CALL *t_ldap_search_s)( LDAP *ld, const char *base, int scope, const char *filter, char **attrs, int attrsonly, LDAPMessage **res );
typedef LDAP_API(void) (LDAP_CALL *t_ldap_value_free)( char **vals );
typedef LDAP_API(char **) (LDAP_CALL *t_ldap_get_values)( LDAP *ld, LDAPMessage *entry, const char *target );
@@ -76,10 +82,10 @@ struct LdapDefinition
rtl::OString mUserObjectClass;
/** User Entity Unique Attribute */
rtl::OString mUserUniqueAttr;
- /** Mapping File */
- rtl::OString mMapping;
} ;
+typedef std::map< rtl::OUString, rtl::OUString > LdapData; // key/value pairs
+
/** Class encapulating all LDAP functionality */
class LdapConnection
{
@@ -95,36 +101,19 @@ public:
throw (ldap::LdapConnectionException,
ldap::LdapGenericException);
- /** query connection status */
- bool isConnected() const { return isValid(); }
-
/**
Gets LdapUserProfile from LDAP repository for specified user
@param aUser name of logged on user
@param aUserProfileMap Map containing LDAP->00o mapping
- @param aUserProfile struct for holding OOo values
+ @param aUserProfile struct for holding OOo values
@throws com::sun::star::ldap::LdapGenericException
if an LDAP error occurs.
*/
- void getUserProfile(const rtl::OUString& aUser,
- const LdapUserProfileMap& aUserProfileMap,
- LdapUserProfile& aUserProfile)
+ void getUserProfile(const rtl::OUString& aUser, LdapData * data)
throw (lang::IllegalArgumentException,
ldap::LdapConnectionException,
ldap::LdapGenericException);
- /**
- Retrieves a single attribute from a single entry.
- @param aDn entry DN
- @param aAttribute attribute name
-
- @throws com::sun::star::ldap::LdapGenericException
- if an LDAP error occurs.
- */
- rtl::OString getSingleAttribute(const rtl::OString& aDn,
- const rtl::OString& aAttribute)
- throw (ldap::LdapConnectionException,
- ldap::LdapGenericException);
/** finds DN of user
@return DN of User
@@ -137,8 +126,6 @@ public:
void loadModule();
static t_ldap_err2string s_p_err2string;
- static t_ldap_value_free s_p_value_free;
- static t_ldap_get_values s_p_get_values;
private:
void initConnection()
@@ -159,6 +146,8 @@ private:
LdapDefinition mLdapDefinition;
static oslModule s_Ldap_Module;
+ static t_ldap_value_free s_p_value_free;
+ static t_ldap_get_values s_p_get_values;
static t_ldap_unbind_s s_p_unbind_s;
static t_ldap_simple_bind_s s_p_simple_bind_s;
static t_ldap_set_option s_p_set_option;
@@ -166,6 +155,8 @@ private:
static t_ldap_msgfree s_p_msgfree;
static t_ldap_get_dn s_p_get_dn;
static t_ldap_first_entry s_p_first_entry;
+ static t_ldap_first_attribute s_p_first_attribute;
+ static t_ldap_next_attribute s_p_next_attribute;
static t_ldap_search_s s_p_search_s;
static t_ldap_memfree s_p_memfree;
diff --git a/extensions/source/config/ldap/ldapbe2.uno.xml b/extensions/source/config/ldap/ldapbe2.uno.xml
deleted file mode 100644
index e365e20f48aa..000000000000
--- a/extensions/source/config/ldap/ldapbe2.uno.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-c<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice/DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>ldapbe2.uno</module-name>
- <component-description>
- <author>Sarah Smith</author>
- <name>com.sun.star.comp.configuration.backend.LdapUserProfileBe</name>
- <description>The LdapUserProfileBe accesses User Profile settings form a configured LDAP repository</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>C++</language>
- <status value="final"/>
- <supported-service>com.sun.star.configuration.backend.LdapUserProfileBe</supported-service>
- <supported-service>com.sun.star.configuration.backend.PlatformBackend</supported-service>
- <supported-service>com.sun.star.configuration.backend.SingleLayerStratum</supported-service>
- <service-dependency>com.sun.star.configuration.backend.LayerDescriber</service-dependency>
- <type>com.sun.star.configuration.CannotLoadConfigurationException</type>
- <type>com.sun.star.configuration.backend.BackendAccessException</type>
- <type>com.sun.star.configuration.backend.XLayer</type>
- <type>com.sun.star.configuration.backend.XUpdateHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.lang.IllegalArgumentException</type>
- <type>com.sun.star.lang.XInitialization</type>
- <type>com.sun.star.lang.XMultiServiceFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.uno.Any</type>
- <type>com.sun.star.uno.Sequence</type>
- </component-description>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/extensions/source/config/ldap/ldapuserprof.cxx b/extensions/source/config/ldap/ldapuserprof.cxx
deleted file mode 100644
index a75a1b0d1447..000000000000
--- a/extensions/source/config/ldap/ldapuserprof.cxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_extensions.hxx"
-#include "ldapuserprof.hxx"
-#include "ldapaccess.hxx"
-namespace extensions { namespace config { namespace ldap {
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-/**
- Finds the next line in a buffer and returns it, along with a
- modified version of the buffer with the line removed.
-
- @param aString string to extract the next line from
- @param aLine next line
- @return sal_True if a line has been extracted, sal_False otherwise
- */
-static sal_Bool getNextLine(rtl::OString& aString,
- rtl::OString& aLine)
-{
- aString = aString.trim() ;
- const sal_Char *currentChar = aString ;
- const sal_Char *endChar = currentChar + aString.getLength() ;
- sal_Int32 lineThreshold = 0 ;
-
- while (currentChar < endChar &&
- *currentChar != '\r' && *currentChar != '\n') { ++ currentChar ; }
- lineThreshold = currentChar - static_cast<const sal_Char *>(aString) ;
- if (lineThreshold == 0) { return sal_False ; }
- aLine = aString.copy(0, lineThreshold) ;
- aString = aString.copy(lineThreshold) ;
- return sal_True ;
-}
-//------------------------------------------------------------------------------
-
-LdapUserProfileMap::~LdapUserProfileMap(void)
-{
- // No need to delete the contents of the mAttributes array,
- // since they refer to rtl::OStrings stored in the mLdapAttributes
- // array.
- if (mAttributes != NULL)
- {
- delete [] mAttributes ;
- }
-}
-//------------------------------------------------------------------------------
-
-void LdapUserProfileMap::source(const rtl::OString& aMap)
-{
- if (mAttributes != NULL)
- {
- delete [] mAttributes ; mAttributes = NULL ;
- mMapping.clear() ;
- }
- rtl::OString currentLine ;
- rtl::OString buffer = aMap ;
- std::set<rtl::OString> attributes ;
- rtl::OString prefix ;
-
- // First, parse the buffer to find all the mapping definitions.
- // While we're at it, we collect the list of unique LDAP attributes
- // involved in the mapping.
- while (getNextLine(buffer, currentLine))
- {
- addNewMapping(currentLine, attributes, prefix) ;
- }
- // Now we use the list of attributes to build mAttributes
- mAttributes = new const sal_Char * [attributes.size() + 1] ;
- std::set<rtl::OString>::const_iterator attribute ;
- sal_Int32 i = 0 ;
-
- for (attribute = attributes.begin() ;
- attribute != attributes.end() ; ++ attribute)
- {
- mAttributes [i ++] = static_cast<const sal_Char *>(*attribute) ;
- }
- mAttributes [i] = NULL ;
-}
-//------------------------------------------------------------------------------
-
-void LdapUserProfileMap::ldapToUserProfile(LDAP *aConnection,
- LDAPMessage *aEntry,
- LdapUserProfile& aProfile) const
-{
- if (aEntry == NULL) { return ; }
- // Ensure return value has proper size
- aProfile.mProfile.resize(mMapping.size()) ;
- sal_Char **values = NULL ;
-
- for (sal_uInt32 i = 0 ; i < mMapping.size() ; ++ i)
- {
- aProfile.mProfile [i].mAttribute = rtl::OStringToOUString(
- mMapping [i].mProfileElement,
- RTL_TEXTENCODING_ASCII_US);
- rtl::OUString debugStr = aProfile.mProfile [i].mAttribute;
-
- for (sal_uInt32 j = 0 ;
- j < mMapping [i].mLdapAttributes.size() ; ++ j)
- {
- values = (*LdapConnection::s_p_get_values)(aConnection, aEntry,
- mMapping [i].mLdapAttributes [j]) ;
-
- if (values != NULL)
- {
- aProfile.mProfile[i].mValue = rtl::OStringToOUString(
- *values, RTL_TEXTENCODING_UTF8);
- (*LdapConnection::s_p_value_free)(values);
- break;
- }
- }
- }
-}
-//------------------------------------------------------------------------------
-void LdapUserProfileMap::addNewMapping(const rtl::OString& aLine,
- std::set<rtl::OString>& aLdapAttributes,
- rtl::OString& aPrefix)
-{
- if (aLine.getStr() [0] == '#') { return ; }
- sal_Int32 prefixLength = aPrefix.getLength() ;
-
- if (prefixLength == 0)
- {
- sal_Int32 firstSlash = aLine.indexOf('/') ;
-
- if (firstSlash == -1) { return ; }
- sal_Int32 secondSlash = aLine.indexOf('/', firstSlash + 1) ;
-
- if (secondSlash == -1){ return; }
-
-
- mComponentName =
- rtl::OUString::createFromAscii(aLine.copy(0, firstSlash)) ;
- mGroupName =
- rtl::OUString::createFromAscii(aLine.copy(firstSlash + 1,
- secondSlash - firstSlash - 1)) ;
- aPrefix = aLine.copy(0, secondSlash + 1) ;
- prefixLength = secondSlash + 1 ;
-
- }
- else if (aLine.compareTo(aPrefix, prefixLength) != 0)
- {
- return ;
- }
- mMapping.push_back(Mapping()) ;
- if (!mMapping.back().parse(aLine.copy(prefixLength)))
- {
- mMapping.pop_back() ;
- }
- else
- {
- const std::vector<rtl::OString>& attributes =
- mMapping.back().mLdapAttributes ;
- std::vector<rtl::OString>::const_iterator ldapAttribute ;
-
- for (ldapAttribute = attributes.begin() ;
- ldapAttribute != attributes.end() ; ++ ldapAttribute)
- {
- aLdapAttributes.insert(*ldapAttribute) ;
- }
- }
-}
-//------------------------------------------------------------------------------
-
-static sal_Char kMappingSeparator = '=' ;
-static sal_Char kLdapMapSeparator = ',' ;
-
-sal_Bool LdapUserProfileMap::Mapping::parse(const rtl::OString& aLine)
-{
- sal_Int32 index = aLine.indexOf(kMappingSeparator) ;
-
- if (index == -1)
- {
- // Imparsable line
- return sal_False ;
- }
- sal_Int32 oldIndex = index + 1 ;
-
- mProfileElement = aLine.copy(0, index).trim() ;
- mLdapAttributes.clear() ;
- index = aLine.indexOf(kLdapMapSeparator, oldIndex) ;
- while (index != -1)
- {
- mLdapAttributes.push_back(
- aLine.copy(oldIndex, index - oldIndex).trim()) ;
- oldIndex = index + 1 ;
- index = aLine.indexOf(kLdapMapSeparator, oldIndex) ;
- }
- rtl::OString endOfLine = aLine.copy(oldIndex).trim() ;
-
- if (endOfLine.getLength() > 0)
- {
- mLdapAttributes.push_back(endOfLine) ;
- }
- return sal_True ;
-}
-//------------------------------------------------------------------------------
-
-} } } // extensiond.config.ldap
-
diff --git a/extensions/source/config/ldap/ldapuserprof.hxx b/extensions/source/config/ldap/ldapuserprof.hxx
deleted file mode 100644
index 36b9d671ea02..000000000000
--- a/extensions/source/config/ldap/ldapuserprof.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef EXTENSIONS_CONFIG_LDAP_LDAPUSERPROF_HXX_
-#define EXTENSIONS_CONFIG_LDAP_LDAPUSERPROF_HXX_
-
-#include "wrapldapinclude.hxx"
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-
-#ifndef VECTOR_INCLUDED
-#define VECTOR_INCLUDED
-#include <vector>
-#endif // VECTOR_INCLUDED
-
-#ifndef SET_INCLUDED
-#define SET_INCLUDED
-#include <set>
-#endif // SET_INCLUDED
-
-
-namespace extensions { namespace config { namespace ldap {
-
-/** Struct containing the data associated to a UserProfile */
-struct LdapUserProfile {
- /** Struct defining an entry in the profile */
- struct ProfileEntry {
- rtl::OUString mAttribute ;
- rtl::OUString mValue ;
- } ;
- /** List of attribute/value pairs */
- std::vector<ProfileEntry> mProfile ;
-
- typedef std::vector<ProfileEntry>::const_iterator Iterator;
-} ;
-
-/** Provider of UserProfile mapping services */
-class LdapUserProfileMap
-{
- public :
- /** Default constructor, doesn't do much. */
- LdapUserProfileMap() : mAttributes(NULL) {}
- /** Destructor */
- ~LdapUserProfileMap() ;
-
- /**
- Fills the map using a string description of the mapping.
- Each possible UserProfile attribute is mapped to a list
- of LDAP attributes, in order of priority.
- The entry is formatted as:
- <UP Attribute>=<LDAP Attr1>,...,<LDAP AttrN>
-
- @param aMap string description of the mapping
- */
- void source(const rtl::OString& aMap) ;
- /**
- Returns an array of all the LDAP attribute names that may
- be relevant for UserProfile mapping.
-
- @return array of LDAP attribute names
- */
- const sal_Char **getLdapAttributes(void) const { return mAttributes ; }
- /**
- Returns the component name that holds the data
- when presented to the outside.
-
- @return component name
- */
- const rtl::OUString& getComponentName(void) const {
- return mComponentName ;
- }
- /**
- Returns the group name that holds the data when
- presented to the outside world.
-
- @return group name
- */
- const rtl::OUString& getGroupName(void) const {
- return mGroupName ;
- }
- /**
- Struct defining the mapping between UserProfile attributes
- and LDAP ones. It also serves as a crude "schema" of the
- UserProfile component, as the list of profile elements
- is the list of properties in the component and the presence
- or absence of LDAP mapping indicates whether the property
- should be made writable or kept read-only.
- */
- struct Mapping {
- /** Name of the UserProfile element */
- rtl::OString mProfileElement ;
- /** Corresponding LDAP attributes in order of priority */
- std::vector<rtl::OString> mLdapAttributes ;
-
- /** Utility to fill the mapping from a <Prof>=<Ldap1>;...;<LdapN>
- description */
- sal_Bool parse(const rtl::OString& aDescription) ;
- } ;
-
-
- /**
- Maps an LDAP entry to a UserProfile.
-
- @param aConnection LDAP connection to the repository
- @param aEntry entry containing the data
- @param aProfile user profile struct to fill up
- */
- void ldapToUserProfile(LDAP *aConnection,
- LDAPMessage *aEntry,
- LdapUserProfile& aProfile) const ;
-
- private :
- /** Contains the mapping entries */
- std::vector<Mapping> mMapping ;
- /** Contains the LDAP attributes used in a NULL terminated array */
- const sal_Char **mAttributes ;
- /** User profile component name */
- rtl::OUString mComponentName ;
- /** User profile storage group name */
- rtl::OUString mGroupName ;
-
- /**
- Adds a new mapping entry to the list, and collects the
- LDAP attributes involved in the mapping.
-
- @param aMappingDescription string describing the mapping
- @param aLdapAttributes collection of LDAP attributes
- @param aPrefix common prefix to the attributes
- containing the component and group
- name, used for validation
- */
- void addNewMapping(const rtl::OString& aMappingDescription,
- std::set<rtl::OString>& aLdapAttributes,
- rtl::OString& aPrefix) ;
-} ;
-
-} } } // extensions.config.ldap
-
-#endif // EXTENSIONS_CONFIG_LDAP_LDAPUSERPROF_HXX_
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx
index 9466dfb1371f..5826188c564d 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.cxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_extensions.hxx"
+#include "ldapaccess.hxx"
#include "ldapuserprofilebe.hxx"
-#include "ldapuserprofilelayer.hxx"
#include <osl/file.hxx>
#include <osl/module.hxx>
#include <osl/process.h>
@@ -40,63 +40,18 @@
#include <rtl/instance.hxx>
#endif
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/Optional.hpp>
#include <osl/security.hxx>
//==============================================================================
namespace extensions { namespace config { namespace ldap {
-
-static void checkIOError(
- osl::File::RC aErrorCode,
- const rtl::OUString& aFileUrl)
-{
- switch (aErrorCode)
- {
- case osl::File::E_None: // got it
- {
-
- }
- break;
- default:
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LdapUserProfileBe: Cannot Read Meta-Configuration file:");
- sMsg.append(aFileUrl);
- throw backend::BackendSetupException(sMsg.makeStringAndClear(),
- NULL, uno::Any());
- }
- }
-}
-
-//------------------------------------------------------------------------------
-#if 0
-static rtl::OUString getCurrentModuleDirectory() // URL excluding terminating slash
-{
- rtl::OUString aFileURL;
- if ( !osl::Module::getUrlFromAddress((void*)&getCurrentModuleDirectory,aFileURL) )
- {
- OSL_TRACE(false, "Cannot locate current module - using executable instead");
-
- OSL_VERIFY(osl_Process_E_None == osl_getExecutableFile(&aFileURL.pData));
- }
-
- OSL_ENSURE(0 < aFileURL.lastIndexOf('/'), "Cannot find directory for module URL");
-
- return aFileURL.copy(0, aFileURL.lastIndexOf('/') );
-}
-#endif
-//------------------------------------------------------------------------------
LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContext>& xContext)
-// throw (backend::BackendAccessException, backend::BackendSetupException, RuntimeException)
: LdapProfileMutexHolder(),
- BackendBase(mMutex),
- mFactory(xContext->getServiceManager(),uno::UNO_QUERY_THROW),
- mContext(xContext),
- mLdapSource( new LdapUserProfileSource ),
- mLoggedOnUser(),
- mUserDN()
+ BackendBase(mMutex)
{
LdapDefinition aDefinition;
+ rtl::OUString loggedOnUser;
// This whole rigmarole is to prevent an infinite recursion where reading
// the configuration for the backend would create another instance of the
@@ -113,16 +68,20 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex
try
{
bReentrantCall = true ;
- if (! readLdapConfiguration(aDefinition) )
+ if (!readLdapConfiguration(
+ css::uno::Reference< css::lang::XMultiServiceFactory >(
+ xContext->getServiceManager(),
+ css::uno::UNO_QUERY_THROW),
+ &aDefinition, &loggedOnUser))
{
- throw backend::BackendSetupException(
+ throw css::uno::RuntimeException(
rtl::OUString::createFromAscii("LdapUserProfileBe- LDAP not configured"),
- NULL, uno::Any());
+ NULL);
}
bReentrantCall = false ;
}
- catch (uno::Exception&)
+ catch (...)
{
bReentrantCall = false;
throw;
@@ -130,34 +89,10 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex
}
}
- try
- {
- mLdapSource->mConnection.loadModule();
- mLdapSource->mConnection.connectSimple(aDefinition);
- //Set the UserDN
- mUserDN = mLdapSource->mConnection.findUserDn(
- rtl::OUStringToOString(mLoggedOnUser, RTL_TEXTENCODING_ASCII_US));
- }
- catch (lang::IllegalArgumentException& exception)
- {
- throw backend::BackendSetupException(exception.Message, NULL,
- uno::makeAny(exception)) ;
- }
- catch (ldap::LdapConnectionException& exception)
- {
- throw backend::CannotConnectException(exception.Message, NULL,
- uno::makeAny(exception)) ;
- }
- catch(ldap::LdapGenericException& exception)
- {
- mapGenericException(exception) ;
- }
-
- initializeMappingTable(
- rtl::OStringToOUString(aDefinition.mMapping,
- RTL_TEXTENCODING_ASCII_US));
-
- OSL_POSTCOND(mLdapSource->mConnection.isConnected(),"Erroneously constructed a LdapUserProfileBackend without a LDAP connection");
+ LdapConnection connection;
+ connection.loadModule();
+ connection.connectSimple(aDefinition);
+ connection.getUserProfile(loggedOnUser, &data_);
}
//------------------------------------------------------------------------------
LdapUserProfileBe::~LdapUserProfileBe()
@@ -165,129 +100,11 @@ LdapUserProfileBe::~LdapUserProfileBe()
}
//------------------------------------------------------------------------------
-void LdapUserProfileBe::initializeMappingTable(const rtl::OUString& aFileMapName)
-{
- rtl::OUString aMappingFileUrl = getMappingFileUrl(aFileMapName );
-
- osl::File aFile (aMappingFileUrl);
- checkIOError( aFile.open(OpenFlag_Read), aMappingFileUrl);
-
- sal_uInt64 nFileLength = 0;
- checkIOError( aFile.getSize(nFileLength), aMappingFileUrl);
-
- sal_uInt32 nDataLength = sal_uInt32(nFileLength);
- if (nDataLength != nFileLength)
- {
- throw backend::BackendSetupException(rtl::OUString::createFromAscii
- ("LdapUserProfileBe - can not read entire Mapping File: too big"),
- NULL, uno::Any());
- }
-
- struct RawBuffer
- {
- RawBuffer(sal_Size size) : data(rtl_allocateMemory(size)) {}
- ~RawBuffer() { rtl_freeMemory(data); }
-
- void * data;
- };
- RawBuffer buffer( nDataLength );
-
- sal_uInt64 nRead = 0;
- osl::File::RC result = aFile.read (static_cast<sal_uInt8*>(buffer.data), nDataLength, nRead);
- if (result != osl::File::E_None)
- {
- checkIOError( result, aMappingFileUrl );
- OSL_ASSERT(!"unreached");
- }
-
- if (nRead != nDataLength)
- {
- throw backend::BackendSetupException(rtl::OUString::createFromAscii
- ("LdapUserProfileBe - can not read entire Mapping File"),
- NULL, uno::Any());
- }
-
- rtl::OString aStrBuffer ( static_cast<char*>(buffer.data), sal_uInt32(nDataLength) );
- mLdapSource->mProfileMap.source(aStrBuffer);
-
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kMappingFileSuffix(RTL_CONSTASCII_USTRINGPARAM(
- "-attr.map"));
-
-static const rtl::OUString kMappingUrl(
- RTL_CONSTASCII_USTRINGPARAM("/modules/com.sun.star.configuration/bootstrap/LdapMappingUrl"));
-
-
-static const sal_Unicode kPathSeparator = '/' ;
-static const rtl::OUString kBootstrapContextSingletonName(
- RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/com.sun.star.configuration.bootstrap.theBootstrapContext"));
-
-rtl::OUString LdapUserProfileBe::getMappingFileUrl(const rtl::OUString& aFileMapName) const
-{
- uno::Any aContext = mContext->getValueByName(kBootstrapContextSingletonName);
- uno::Reference<uno::XComponentContext> aBootStrapContext;
-
- rtl::OUString aFileUrl;
- if (aContext >>= aBootStrapContext)
- aBootStrapContext->getValueByName(kMappingUrl) >>= aFileUrl;
-
- if (aFileUrl.getLength() == 0 )
- {
-#if 0
- static const rtl::OUString kMappingDirectory(RTL_CONSTASCII_USTRINGPARAM( "/share/registry/ldap"));
-
- rtl::OUString aModuleUrl = getCurrentModuleDirectory();
- sal_Int32 nIndex = aModuleUrl.lastIndexOf('/');
- if (nIndex == 0)
- {
- throw backend::BackendSetupException(rtl::OUString::createFromAscii
- ("LdapUserProfileBe - can not access Mapping File"),
- NULL, uno::Any());
- }
- rtl::OUString aMappingFileUrl = aModuleUrl.copy(0, nIndex);
- aMappingFileUrl += kMappingDirectory;
- aFileUrl = aMappingFileUrl;
-#else
- throw backend::BackendSetupException(rtl::OUString::createFromAscii
- ("LdapUserProfileBe - can not locate Mapping File"),
- NULL, uno::Any());
-#endif
- }
-
- rtl::OUStringBuffer sFileBuffer(aFileUrl);
- sFileBuffer.append(kPathSeparator);
- sFileBuffer.append (aFileMapName);
- sFileBuffer.append(kMappingFileSuffix);
- return sFileBuffer.makeStringAndClear();
-}
-//------------------------------------------------------------------------------
-void LdapUserProfileBe::mapGenericException(ldap::LdapGenericException& aException)
- throw (backend::InsufficientAccessRightsException,
- backend::ConnectionLostException,
- backend::BackendAccessException)
-{
- switch (aException.ErrorCode)
- {
- case LDAP_INSUFFICIENT_ACCESS:
- throw backend::InsufficientAccessRightsException(aException.Message,
- NULL, uno::makeAny(aException)) ;
-
- case LDAP_SERVER_DOWN:
- case LDAP_CONNECT_ERROR:
- throw backend::ConnectionLostException(aException.Message, NULL,
- uno::makeAny(aException)) ;
- default:
- throw backend::BackendAccessException(aException.Message, NULL,
- uno::makeAny(aException)) ;
- }
-}
-//------------------------------------------------------------------------------
-
-bool LdapUserProfileBe::readLdapConfiguration(LdapDefinition& aDefinition)
+bool LdapUserProfileBe::readLdapConfiguration(
+ css::uno::Reference< css::lang::XMultiServiceFactory > const & factory,
+ LdapDefinition * definition, rtl::OUString * loggedOnUser)
{
+ OSL_ASSERT(factory.is() && definition != 0 && loggedOnUser != 0);
const rtl::OUString kConfigurationProviderService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")) ;
const rtl::OUString kReadOnlyViewService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")) ;
const rtl::OUString kComponent( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.LDAP/UserDirectory"));
@@ -299,14 +116,12 @@ bool LdapUserProfileBe::readLdapConfiguration(LdapDefinition& aDefinition)
const rtl::OUString kPassword(RTL_CONSTASCII_USTRINGPARAM("SearchPassword"));
const rtl::OUString kUserObjectClass(RTL_CONSTASCII_USTRINGPARAM("UserObjectClass"));
const rtl::OUString kUserUniqueAttr(RTL_CONSTASCII_USTRINGPARAM("UserUniqueAttribute"));
- const rtl::OUString kMapping(RTL_CONSTASCII_USTRINGPARAM("Mapping"));
- const rtl::OString kDefaultMappingFile("oo-ldap");
uno::Reference< XInterface > xIface;
try
{
uno::Reference< lang::XMultiServiceFactory > xCfgProvider(
- mFactory->createInstance(kConfigurationProviderService),
+ factory->createInstance(kConfigurationProviderService),
uno::UNO_QUERY);
OSL_ENSURE(xCfgProvider.is(),"LdapUserProfileBe: could not create the configuration provider");
if (!xCfgProvider.is())
@@ -324,26 +139,23 @@ bool LdapUserProfileBe::readLdapConfiguration(LdapDefinition& aDefinition)
uno::Reference<container::XNameAccess > xChildAccess(xIface, uno::UNO_QUERY_THROW);
- if (!getLdapStringParam(xChildAccess, kServer, aDefinition.mServer))
+ if (!getLdapStringParam(xChildAccess, kServer, definition->mServer))
return false;
- if (!getLdapStringParam(xChildAccess, kBaseDN, aDefinition.mBaseDN))
+ if (!getLdapStringParam(xChildAccess, kBaseDN, definition->mBaseDN))
return false;
- aDefinition.mPort=0;
- xChildAccess->getByName(kPort) >>= aDefinition.mPort ;
- if (aDefinition.mPort == 0)
+ definition->mPort=0;
+ xChildAccess->getByName(kPort) >>= definition->mPort ;
+ if (definition->mPort == 0)
return false;
- if (!getLdapStringParam(xAccess, kUserObjectClass, aDefinition.mUserObjectClass))
+ if (!getLdapStringParam(xAccess, kUserObjectClass, definition->mUserObjectClass))
return false;
- if (!getLdapStringParam(xAccess, kUserUniqueAttr, aDefinition.mUserUniqueAttr))
+ if (!getLdapStringParam(xAccess, kUserUniqueAttr, definition->mUserUniqueAttr))
return false;
- getLdapStringParam(xAccess, kUser, aDefinition.mAnonUser);
- getLdapStringParam(xAccess, kPassword, aDefinition.mAnonCredentials);
-
- if (!getLdapStringParam(xAccess, kMapping, aDefinition.mMapping))
- aDefinition.mMapping = kDefaultMappingFile;
+ getLdapStringParam(xAccess, kUser, definition->mAnonUser);
+ getLdapStringParam(xAccess, kPassword, definition->mAnonCredentials);
}
catch (uno::Exception & e)
{
@@ -353,15 +165,15 @@ bool LdapUserProfileBe::readLdapConfiguration(LdapDefinition& aDefinition)
}
osl::Security aSecurityContext;
- if (!aSecurityContext.getUserName(mLoggedOnUser))
+ if (!aSecurityContext.getUserName(*loggedOnUser))
OSL_TRACE("LdapUserProfileBackend - could not get Logged on user from system");
- sal_Int32 nIndex = mLoggedOnUser.indexOf('/');
+ sal_Int32 nIndex = loggedOnUser->indexOf('/');
if (nIndex > 0)
- mLoggedOnUser = mLoggedOnUser.copy(nIndex+1);
+ *loggedOnUser = loggedOnUser->copy(nIndex+1);
//Remember to remove
- OSL_TRACE("Logged on user is %s", rtl::OUStringToOString(mLoggedOnUser,RTL_TEXTENCODING_ASCII_US).getStr());
+ OSL_TRACE("Logged on user is %s", rtl::OUStringToOString(*loggedOnUser,RTL_TEXTENCODING_ASCII_US).getStr());
return true;
}
@@ -379,35 +191,48 @@ bool LdapUserProfileBe::getLdapStringParam(
return aServerParameter.getLength() != 0;
}
//------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL LdapUserProfileBe::getLayer(
- const rtl::OUString& /*aComponent*/, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,uno::RuntimeException)
+void LdapUserProfileBe::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- OSL_PRECOND(mLdapSource->mConnection.isConnected(), "LdapUserProfileBackend invoked without a connection");
- if (!mLdapSource->mConnection.isConnected())
- return NULL;
-
- const rtl::OString kModificationAttribute = "modifyTimeStamp";
-
- rtl::OString aTimeStamp = mLdapSource->mConnection.
- getSingleAttribute( mUserDN, kModificationAttribute);
-
- return new LdapUserProfileLayer(
- mFactory, mLoggedOnUser, mLdapSource,
- rtl::OStringToOUString(aTimeStamp, RTL_TEXTENCODING_ASCII_US));
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-LdapUserProfileBe::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException,uno::RuntimeException)
+css::uno::Any LdapUserProfileBe::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- throw lang::NoSupportException(
- rtl::OUString::createFromAscii(
- "LdapUserProfileBe: No Update Operation allowed, Read Only access"),
- *this) ;
+ for (sal_Int32 i = 0;;) {
+ sal_Int32 j = PropertyName.indexOf(',', i);
+ if (j == -1) {
+ j = PropertyName.getLength();
+ }
+ if (j == i) {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
+ LdapData::iterator k(data_.find(PropertyName.copy(i, j - i)));
+ if (k != data_.end()) {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(k->second)));
+ }
+ if (j == PropertyName.getLength()) {
+ break;
+ }
+ i = j + 1;
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
}
+
//------------------------------------------------------------------------------
rtl::OUString SAL_CALL LdapUserProfileBe::getLdapUserProfileBeName(void) {
return rtl::OUString::createFromAscii("com.sun.star.comp.configuration.backend.LdapUserProfileBe") ;
@@ -423,10 +248,8 @@ rtl::OUString SAL_CALL LdapUserProfileBe::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL LdapUserProfileBe::getLdapUserProfileBeServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServices(2) ;
+ uno::Sequence<rtl::OUString> aServices(1) ;
aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LdapUserProfileBe")) ;
- aServices[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
return aServices ;
}
//------------------------------------------------------------------------------
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.hxx b/extensions/source/config/ldap/ldapuserprofilebe.hxx
index 240a7b364e24..f19e9e275a55 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.hxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.hxx
@@ -28,41 +28,33 @@
#ifndef EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_
#define EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_
-#include "ldapuserprof.hxx"
-#include "ldapaccess.hxx"
-#include "ldapuserprofilelayer.hxx"
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <cppuhelper/compbase2.hxx>
+#include "ldapaccess.hxx"
-#define CONTEXT_ITEM_PREFIX_ "/modules/com.sun.star.configuration/bootstrap/"
namespace extensions { namespace config { namespace ldap {
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace ldap= css::ldap ;
-namespace backend = css::configuration::backend ;
namespace container = css::container;
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
+struct LdapDefinition;
+
+typedef cppu::WeakComponentImplHelper2<css::beans::XPropertySet,
lang::XServiceInfo> BackendBase ;
struct LdapProfileMutexHolder { osl::Mutex mMutex; };
/**
Implements the PlatformBackend service, a specialization of the
- SingleLayerStratum service for retreiving LDAP user profile
+ XPropertySet service for retreiving LDAP user profile
configuration settings from a LDAP repsoitory.
*/
class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
@@ -70,7 +62,6 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
public :
LdapUserProfileBe(const uno::Reference<uno::XComponentContext>& xContext);
- // throw(backend::BackendAccessException, backend::BackendSetupException, RuntimeException);
~LdapUserProfileBe(void) ;
// XServiceInfo
@@ -86,19 +77,57 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
getSupportedServiceNames( )
throw (uno::RuntimeException) ;
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
/**
Provides the implementation name.
@return implementation name
@@ -112,35 +141,16 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
getLdapUserProfileBeServiceNames(void) ;
private:
- /** Build OO/LDAP attribute mapping table */
- void initializeMappingTable (const rtl::OUString& aFileMapName);
/** Check if LDAP is configured */
- bool readLdapConfiguration(LdapDefinition& aDefinition);
+ bool readLdapConfiguration(
+ uno::Reference<lang::XMultiServiceFactory> const & factory,
+ LdapDefinition * definition, rtl::OUString * loggedOnUser);
bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess,
const rtl::OUString& aLdapSetting,
rtl::OString& aServerParameter);
- void mapGenericException(ldap::LdapGenericException& aException)
- throw (backend::InsufficientAccessRightsException,
- backend::ConnectionLostException,
- backend::BackendAccessException);
- /** Connect to LDAP server */
- void connectToLdapServer(const LdapDefinition& aDefinition );
- /** Get URL of OO-to-LDAP Mapping File */
- rtl::OUString getMappingFileUrl(const rtl::OUString& aFileMapName) const;
-
- /** Service Factory object */
- uno::Reference<lang::XMultiServiceFactory> mFactory;
- /** Component Context */
- uno::Reference<uno::XComponentContext> mContext ;
- /** Object for LDAP functionality */
- LdapUserProfileSourceRef mLdapSource;
- /**Currently logged in user */
- rtl::OUString mLoggedOnUser ;
- /** DN of currently logged in user */
- rtl::OString mUserDN;
-
+ LdapData data_;
} ;
//------------------------------------------------------------------------------
}}}
diff --git a/extensions/source/config/ldap/ldapuserprofilelayer.cxx b/extensions/source/config/ldap/ldapuserprofilelayer.cxx
deleted file mode 100644
index 9c9afbe8989c..000000000000
--- a/extensions/source/config/ldap/ldapuserprofilelayer.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_extensions.hxx"
-#include "ldapuserprofilelayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
-// on windows this is defined indirectly by <ldap.h>
-#undef OPTIONAL
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-//==============================================================================
-namespace extensions { namespace config { namespace ldap {
-
-static const sal_Unicode kPathSeparator = '/' ;
-
-static
-uno::Reference<backend::XLayerContentDescriber>
- newLayerDescriber(const uno::Reference<lang::XMultiServiceFactory>& xFactory)
-{
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
-
- rtl::OUString const k_sLayerDescriberService (
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- LayerDescriber xResult(xFactory->createInstance(k_sLayerDescriberService), uno::UNO_QUERY_THROW);
- return xResult;
-}
-//------------------------------------------------------------------------------
-
-void LdapUserProfileSource::getUserProfile(const rtl::OUString & aUser, LdapUserProfile & aProfile)
-{
- mConnection.getUserProfile(aUser,
- mProfileMap,
- aProfile);
-}
-
-rtl::OUString LdapUserProfileSource::getComponentName() const
-{
- return mProfileMap.getComponentName();
-}
-
-rtl::OUString LdapUserProfileSource::getConfigurationBasePath() const
-{
- rtl::OUStringBuffer sComponentNameBuffer(mProfileMap.getComponentName());
- sComponentNameBuffer.append(kPathSeparator);
- sComponentNameBuffer.append (mProfileMap.getGroupName());
- sComponentNameBuffer.append(kPathSeparator);
-
- return sComponentNameBuffer.makeStringAndClear();
-}
-//------------------------------------------------------------------------------
-
-struct LdapUserProfileLayer::ProfileData
-{
- LdapUserProfile mProfile;
- rtl::OUString mBasePath;
-
- explicit ProfileData(LdapUserProfileSource & aSource, const rtl::OUString & aUser)
- {
- aSource.getUserProfile(aUser, mProfile);
- mBasePath = aSource.getConfigurationBasePath();
- }
-};
-//------------------------------------------------------------------------------
-
-LdapUserProfileLayer::LdapUserProfileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aUser,
- const LdapUserProfileSourceRef & aUserProfileSource,
- const rtl::OUString& aTimestamp)
-: mLayerDescriber( newLayerDescriber(xFactory) )
-, mSource( aUserProfileSource )
-, mUser(aUser)
-, mTimestamp(aTimestamp)
-, mProfile( 0 )
-{
- OSL_ASSERT(mSource.is());
-}
-
-//------------------------------------------------------------------------------
-LdapUserProfileLayer::~LdapUserProfileLayer()
-{
- delete mProfile;
-}
-//------------------------------------------------------------------------------
-
-#define PROPNAME( name ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( name ) )
-#define PROPTYPE( type ) getCppuType( static_cast< type const *>( 0 ) )
-
-const sal_Int32 LAYER_PROPERTY_URL = 1;
-
-cppu::IPropertyArrayHelper * SAL_CALL LdapUserProfileLayer::newInfoHelper()
-{
- using com::sun::star::beans::Property;
- using namespace com::sun::star::beans::PropertyAttribute;
-
- Property properties[] =
- {
- Property(PROPNAME("URL"), LAYER_PROPERTY_URL, PROPTYPE(rtl::OUString), READONLY)
- };
-
- return new cppu::OPropertyArrayHelper(properties, sizeof(properties)/sizeof(properties[0]));
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LdapUserProfileLayer::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const
-{
- switch (nHandle)
- {
- case LAYER_PROPERTY_URL:
- {
- rtl::OUStringBuffer aURL;
- aURL.appendAscii("ldap-user-profile:");
- aURL.append(mUser);
- aURL.append(sal_Unicode('@'));
- if (mSource.is())
- aURL.append(mSource->getComponentName());
- else
- aURL.appendAscii("<NULL>");
-
- rValue <<= aURL.makeStringAndClear();
- }
- break;
-
- default:
- OSL_ENSURE(false, "Error: trying to get an UNKNOWN property");
- break;
- }
-}
-//------------------------------------------------------------------------------
-
-bool LdapUserProfileLayer::readProfile()
-{
- if (mSource.is())
- try
- {
- OSL_ASSERT(!mProfile);
- mProfile = new ProfileData(*mSource,mUser);
-
- mSource.clear();
- }
- catch (ldap::LdapConnectionException & e)
- {
- // without existing Ldap Connection we should never have gotten a timestamp
- OSL_ENSURE(false, "Unexpected: Have Ldap Backedn Layer but no vaild LDAP connection ?!");
- throw backend::ConnectionLostException(e.Message, *this, uno::makeAny(e) );
- }
- catch (ldap::LdapGenericException & e)
- {
- throw backend::BackendAccessException(e.Message, *this, uno::makeAny(e) );
- }
- OSL_ASSERT( !mSource.is() );
- OSL_ASSERT( mProfile != 0 );
- return mProfile != 0;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LdapUserProfileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- std::vector<backend::PropertyInfo> aPropList;
-#ifdef SUPPRESS_BACKEND_ERRORS
- try
-#endif
- if ( readProfile() )
- {
- // initialize PropInfo members that are the same for all settings
- const rtl::OUString k_sTypeString(RTL_CONSTASCII_USTRINGPARAM("string"));
-
- backend::PropertyInfo aPropInfo;
- aPropInfo.Type = k_sTypeString;
- aPropInfo.Protected = sal_False;
-
- LdapUserProfile * pProfile = &mProfile->mProfile;
- aPropList.reserve(pProfile->mProfile.size());
-
- for (LdapUserProfile::Iterator entry = pProfile->mProfile.begin() ;
- entry != pProfile->mProfile.end() ; ++ entry)
- {
- if (entry->mAttribute.getLength()==0) { continue ; }
- if (entry->mValue.getLength()==0) { continue ; }
-
- aPropInfo.Name = mProfile->mBasePath + entry->mAttribute;
- aPropInfo.Value <<= entry->mValue;
-
- aPropList.push_back(aPropInfo);
- }
- }
-#ifdef SUPPRESS_BACKEND_ERRORS
- catch (uno::Exception & e)
- {
- OSL_TRACE("LDAP Backend - Reading data from LDAP failed: %s\n",
- rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- }
-#endif
-
- if ( !aPropList.empty())
- {
- //Describe UserProfileLayer (the list of properties) to the XHandler
- //Object using com.sun.star.comp.backend.LayerContentDescriber Service
- uno::Sequence<backend::PropertyInfo> aPropInfoList(&aPropList.front(),aPropList.size());
-
- mLayerDescriber->describeLayer(xHandler, aPropInfoList);
- }
- // else { check handler not NULL; xHandler->startLayer(); xHandler->endLayer(); }
-}
-//------------------------------------------------------------------------------
-}}}
-//------------------------------------------------------------------------------
-
diff --git a/extensions/source/config/ldap/ldapuserprofilelayer.hxx b/extensions/source/config/ldap/ldapuserprofilelayer.hxx
deleted file mode 100644
index c87bccc02d38..000000000000
--- a/extensions/source/config/ldap/ldapuserprofilelayer.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef EXTENSIONS_CONFIG_LDAP_LADPUSERPROFILELAYER_HXX_
-#define EXTENSIONS_CONFIG_LDAP_LADPUSERPROFILELAYER_HXX_
-
-#include "ldapuserprof.hxx"
-#include "ldapaccess.hxx"
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include <rtl/ref.hxx>
-
-
-namespace extensions { namespace config { namespace ldap {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-//------------------------------------------------------------------------------
-struct LdapUserProfileSource : public salhelper::SimpleReferenceObject
-{
- LdapConnection mConnection;
- LdapUserProfileMap mProfileMap;
-
- rtl::OUString getComponentName() const;
- rtl::OUString getConfigurationBasePath() const;
- void getUserProfile(rtl::OUString const & aUser, LdapUserProfile & aProfile);
-};
-typedef rtl::Reference< LdapUserProfileSource > LdapUserProfileSourceRef;
-//------------------------------------------------------------------------------
-
-/**
- Implementation of the XLayer interfaces for LdapUserProfileBe.
- Class reads UserProfile setting form LDAP.
- The timestamp indicates the last modification time
- */
- class LdapUserProfileLayer : public cppu::ImplInheritanceHelper2<
- apihelper::ReadOnlyPropertySetHelper,
- backend::XLayer,
- util::XTimeStamped>
-{
- public :
- /** Constructor */
- LdapUserProfileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aUser,
- const LdapUserProfileSourceRef & aUserProfileSource,
- const rtl::OUString& aTimestamp);
- // throw (uno::RuntimeException
-
- /** Destructor */
- ~LdapUserProfileLayer();
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException)
- { return mTimestamp; }
-
- protected:
- // PropertySetHelper
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper();
-
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const;
- private :
- struct ProfileData;
- bool readProfile();
-
- uno::Reference<backend::XLayerContentDescriber> mLayerDescriber;
- LdapUserProfileSourceRef mSource;
- rtl::OUString mUser;
- rtl::OUString mTimestamp;
- ProfileData * mProfile;
- private:
- using cppu::OPropertySetHelper::getFastPropertyValue;
- } ;
-}}}
-#endif // EXTENSIONS_CONFIG_LDAP_LADPUSERPROFILELAYER_HXX_
diff --git a/extensions/source/config/ldap/makefile.mk b/extensions/source/config/ldap/makefile.mk
index 58fea69cd309..a27cb39b6225 100644
--- a/extensions/source/config/ldap/makefile.mk
+++ b/extensions/source/config/ldap/makefile.mk
@@ -27,7 +27,6 @@
PRJ=..$/..$/..
-PRJINC=$(PRJ)$/source
PRJNAME=extensions
TARGET=ldapbe
ENABLE_EXCEPTIONS=TRUE
@@ -64,10 +63,7 @@ SOLARINC+= $(LDAPSDKINCLUDES)
SLOFILES=\
$(SLO)$/ldapuserprofilebe.obj \
- $(SLO)$/ldapuserprof.obj \
$(SLO)$/ldapaccess.obj \
- $(SLO)$/ldapuserprofilelayer.obj \
- $(SLO)$/propertysethelper.obj \
$(SLO)$/componentdef.obj
LIB1TARGET=$(SLB)$/_$(TARGET).lib
diff --git a/extensions/source/config/ldap/propertysethelper.cxx b/extensions/source/config/ldap/propertysethelper.cxx
deleted file mode 100644
index 6bdf17ccf0e8..000000000000
--- a/extensions/source/config/ldap/propertysethelper.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_extensions.hxx"
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/lang/XTypeProvider.hpp>
-
-#include <cppuhelper/typeprovider.hxx>
-
-//..........................................................................
-namespace extensions {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-PropertySetHelper::PropertySetHelper()
-: BroadcasterBase()
-, cppu::OWeakObject()
-, cppu::OPropertySetHelper( BroadcasterBase::getBroadcastHelper() )
-, m_pHelper(0)
-{
-}
-
-//..........................................................................
-PropertySetHelper::~PropertySetHelper()
-{
- delete m_pHelper;
-}
-
-//..........................................................................
-// XInterface
-uno::Any SAL_CALL PropertySetHelper::queryInterface( uno::Type const & rType ) throw (uno::RuntimeException)
-{
- uno::Any aResult = cppu::OPropertySetHelper::queryInterface(rType);
- if (!aResult.hasValue())
- aResult = OWeakObject::queryInterface(rType);
- return aResult;
-}
-
-void SAL_CALL PropertySetHelper::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL PropertySetHelper::release() throw ()
-{
- if (m_refCount == 1)
- this->disposing();
-
- OWeakObject::release();
-}
-
-//..........................................................................
-// XTypeProvider
-uno::Sequence< uno::Type > SAL_CALL PropertySetHelper::getTypes() throw (uno::RuntimeException)
-{
- // could be static instance
- cppu::OTypeCollection aTypes(
- ::getCppuType( static_cast< uno::Reference< beans::XPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XMultiPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XFastPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< lang::XTypeProvider > const * >(0) ) );
-
- return aTypes.getTypes();
-}
-
-//..........................................................................
-// cppu::OPropertySetHelper
-uno::Reference< beans::XPropertySetInfo > SAL_CALL PropertySetHelper::getPropertySetInfo( )
- throw (uno::RuntimeException)
-{
- return createPropertySetInfo(getInfoHelper());
-}
-
-//..........................................................................
-cppu::IPropertyArrayHelper & SAL_CALL PropertySetHelper::getInfoHelper()
-{
- osl::MutexGuard aGuard( getBroadcastMutex() );
- if (!m_pHelper)
- m_pHelper = newInfoHelper();
-
- OSL_ENSURE(m_pHelper,"Derived class did not create new PropertyInfoHelper");
- if (!m_pHelper)
- throw uno::RuntimeException(rtl::OUString::createFromAscii("No PropertyArrayHelper available"),*this);
-
- return *m_pHelper;
-}
-
-//..........................................................................
-sal_Bool SAL_CALL PropertySetHelper::convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue, sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException)
-{
- this->getFastPropertyValue(rOldValue, nHandle);
- rConvertedValue = rValue;
- return rValue.isExtractableTo( rOldValue.getValueType() );
-}
-
-//..........................................................................
-void SAL_CALL ReadOnlyPropertySetHelper::setFastPropertyValue_NoBroadcast(
- sal_Int32 /*nHandle*/, const uno::Any& /*rValue*/ )
- throw (uno::Exception)
-{
- OSL_ENSURE(false, "Attempt to set value in read-only property set");
- throw beans::PropertyVetoException(rtl::OUString::createFromAscii("Attempt to set value in Read-Only property set"),*this);
-}
-
-//..........................................................................
-sal_Bool SAL_CALL ReadOnlyPropertySetHelper::convertFastPropertyValue(
- uno::Any & /*rConvertedValue*/, uno::Any & /*rOldValue*/, sal_Int32 /*nHandle*/, const uno::Any& /*rValue*/ )
- throw (lang::IllegalArgumentException)
-{
- OSL_ENSURE(false, "Attempt to convert value in read-only property set");
- return false;
-}
-//..........................................................................
-//..........................................................................
- } // namespace apihelper
-} // namespace extensions
-//..........................................................................
-
-
diff --git a/extensions/source/config/ldap/propertysethelper.hxx b/extensions/source/config/ldap/propertysethelper.hxx
deleted file mode 100644
index 1a6dd9867d06..000000000000
--- a/extensions/source/config/ldap/propertysethelper.hxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef EXTENSIONS_MISC_PROPERTYSETHELPER_HXX
-#define EXTENSIONS_MISC_PROPERTYSETHELPER_HXX
-
-#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/weak.hxx>
-
-//..........................................................................
-namespace extensions {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-class BroadcasterBase
-{
- osl::Mutex m_aMutex;
- cppu::OBroadcastHelper m_aBroadcastHelper;
-
-protected:
- BroadcasterBase() : m_aMutex(), m_aBroadcastHelper(m_aMutex) {}
- ~BroadcasterBase() {}
-
- osl::Mutex & getBroadcastMutex() { return m_aMutex; }
- cppu::OBroadcastHelper & getBroadcastHelper() { return m_aBroadcastHelper; }
-};
-
-//..........................................................................
-
-class PropertySetHelper : protected BroadcasterBase // must be first
- , public cppu::OWeakObject
- , public cppu::OPropertySetHelper // not copyable
-{
-public:
- PropertySetHelper();
- ~PropertySetHelper();
-
- // XInterface
- virtual uno::Any SAL_CALL queryInterface( uno::Type const & rType ) throw (uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
- // XTypeProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes() throw (uno::RuntimeException);
-
- // to be provided by derived classes
- // virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (uno::RuntimeException) = 0;
-
- // XPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
- getPropertySetInfo( ) throw (uno::RuntimeException);
-
-
-protected:
-// new methods still to be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
-// cppu::OPropertySetHelper interface
-#if 0 // these methods still must be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception) = 0;
-
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const = 0;
-#endif
- virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // default implementation: does not do any conversion
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue,
- sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException);
-private:
- cppu::IPropertyArrayHelper * m_pHelper;
-};
-//..........................................................................
-
-class ReadOnlyPropertySetHelper : public PropertySetHelper
-{
-public:
- ReadOnlyPropertySetHelper() {}
- ~ReadOnlyPropertySetHelper() {}
-
-protected:
-#if 0 // these methods still must be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const = 0;
-#endif
- // default implementation: rejects any attempt to set a value
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception);
-
- // default implementation: rejects any attempt to do a conversion
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue,
- sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException);
-};
-//..........................................................................
- } // namespace apihelper
-} // namespace extensions
-//..........................................................................
-
-#endif
-
-
diff --git a/extensions/source/oooimprovement/Jobs.xcu b/extensions/source/oooimprovement/Jobs.xcu
index 438ab2d23e8e..206d83dd7eb2 100644
--- a/extensions/source/oooimprovement/Jobs.xcu
+++ b/extensions/source/oooimprovement/Jobs.xcu
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
<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="OOoImprovement.OnLogRotateJob" oor:op="replace">
diff --git a/external/prj/build.lst b/external/prj/build.lst
index 20e0d4127964..8bcc6c10c07e 100644
--- a/external/prj/build.lst
+++ b/external/prj/build.lst
@@ -1,4 +1,4 @@
-el external : SO:external_so soltools NULL
+el external : soltools NULL
el external usr1 - all el_mkout NULL
el external\glibc nmake - all el_glibc NULL
el external\gcc3_specific nmake - all el_gcc3 NULL
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 4f1381749a55..b98f5dc85147 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -28,7 +28,9 @@
#ifndef _SVX_ESCHEREX_HXX
#define _SVX_ESCHEREX_HXX
+#include <memory>
#include <vector>
+#include <boost/shared_ptr.hpp>
#include <tools/solar.h>
#include <tools/gen.hxx>
#include <tools/list.hxx>
@@ -945,13 +947,13 @@ enum ESCHER_LineCap
#define ESCHER_Persist_PrivateEntry 0x80000000
#define ESCHER_Persist_Dgg 0x00010000
-#define ESCHER_Persist_Dgg_FIDCL 0x00010001
#define ESCHER_Persist_Dg 0x00020000
-#define ESCHER_Persist_BlibStoreContainer 0x00030000
#define ESCHER_Persist_CurrentPosition 0x00040000
#define ESCHER_Persist_Grouping_Snap 0x00050000
#define ESCHER_Persist_Grouping_Logic 0x00060000
+const sal_uInt32 DFF_DGG_CLUSTER_SIZE = 0x00000400; /// Shape IDs per cluster in DGG atom.
+
// ---------------------------------------------------------------------------------------------
namespace com { namespace sun { namespace star {
@@ -961,6 +963,7 @@ namespace com { namespace sun { namespace star {
namespace drawing {
struct EnhancedCustomShapeAdjustmentValue;
class XShape;
+ class XShapes;
}
}}}
@@ -1030,13 +1033,11 @@ struct EscherPersistEntry
// ---------------------------------------------------------------------------------------------
-class SvMemoryStream;
class EscherBlibEntry
{
friend class EscherGraphicProvider;
friend class EscherEx;
- friend class _EscherEx;
protected:
@@ -1344,52 +1345,137 @@ public:
};
+// ============================================================================
+
+/** Instance for global DFF data, shared through various instances of EscherEx. */
+class MSFILTER_DLLPUBLIC EscherExGlobal : public EscherGraphicProvider
+{
+public:
+ explicit EscherExGlobal( sal_uInt32 nGraphicProvFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ virtual ~EscherExGlobal();
+
+ /** Returns a new drawing ID for a new drawing container (DGCONTAINER). */
+ sal_uInt32 GenerateDrawingId();
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table.
+ @param nDrawingId Drawing identifier has to be passed to be able to
+ generate shape identifiers for multiple drawings simultaniously. */
+ sal_uInt32 GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr );
+ /** Returns the number of shapes in the current drawing, based on number of
+ calls to the GenerateShapeId() function. */
+ sal_uInt32 GetDrawingShapeCount( sal_uInt32 nDrawingId ) const;
+ /** Returns the last shape identifier generated by the GenerateShapeId()
+ function. */
+ sal_uInt32 GetLastShapeId( sal_uInt32 nDrawingId ) const;
+
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline void SetDggContainer() { mbHasDggCont = true; }
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline bool HasDggContainer() const { return mbHasDggCont; }
+ /** Returns the total size of the DGG atom (including header). */
+ sal_uInt32 GetDggAtomSize() const;
+ /** Writes the complete DGG atom to the passed stream (overwrites existing data!). */
+ void WriteDggAtom( SvStream& rStrm ) const;
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+
+ On first invokation, this function calls the virtual member function
+ ImplQueryPictureStream(). The return value will be cached internally
+ for subsequent calls and for the GetPictureStream() function.
+ */
+ SvStream* QueryPictureStream();
+
+ /** Returns the picture stream if existing (queried), otherwise null. */
+ inline SvStream* GetPictureStream() { return mpPicStrm; }
+
+private:
+ /** Derived classes may implement to create a new stream used to store the
+ picture data.
+
+ The implementation has to take care about lifetime of the returned
+ stream (it will not be destructed automatically). This function is
+ called exactly once. The return value will be cached internally for
+ repeated calls of the public QueryPictureStream() function.
+ */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ struct ClusterEntry
+ {
+ sal_uInt32 mnDrawingId; /// Identifier of drawing this cluster belongs to (one-based index into maDrawingInfos).
+ sal_uInt32 mnNextShapeId; /// Next free shape identifier in this cluster.
+ inline explicit ClusterEntry( sal_uInt32 nDrawingId ) : mnDrawingId( nDrawingId ), mnNextShapeId( 0 ) {}
+ };
+ typedef ::std::vector< ClusterEntry > ClusterTable;
+
+ struct DrawingInfo
+ {
+ sal_uInt32 mnClusterId; /// Currently used cluster (one-based index into maClusterTable).
+ sal_uInt32 mnShapeCount; /// Current number of shapes in this drawing.
+ sal_uInt32 mnLastShapeId; /// Last shape identifier generated for this drawing.
+ inline explicit DrawingInfo( sal_uInt32 nClusterId ) : mnClusterId( nClusterId ), mnShapeCount( 0 ), mnLastShapeId( 0 ) {}
+ };
+ typedef ::std::vector< DrawingInfo > DrawingInfoVector;
+
+ ClusterTable maClusterTable; /// List with cluster IDs (used object IDs in drawings).
+ DrawingInfoVector maDrawingInfos; /// Data about all used drawings.
+ SvStream* mpPicStrm; /// Cached result of ImplQueryPictureStream().
+ bool mbHasDggCont; /// True = the DGGCONTAINER has been initialized.
+ bool mbPicStrmQueried; /// True = ImplQueryPictureStream() has been called.
+};
+
+typedef ::boost::shared_ptr< EscherExGlobal > EscherExGlobalRef;
+
// ---------------------------------------------------------------------------------------------
class SdrObject;
class SdrPage;
class ImplEscherExSdr;
-class Color;
-
-class Graphic;
-class SvMemoryStream;
-class SvStream;
-class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicProvider
+class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
{
- protected :
+ protected:
+ typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
+ EscherExGlobalRef mxGlobal;
+ ImplEscherExSdrPtr mpImplEscherExSdr;
SvStream* mpOutStrm;
- ImplEscherExSdr* mpImplEscherExSdr;
UINT32 mnStrmStartOfs;
std::vector< sal_uInt32 > mOffsets;
std::vector< sal_uInt16 > mRecTypes;
- UINT32 mnDrawings;
- UINT32 mnFIDCLs; // anzahl der cluster ID's
-
UINT32 mnCurrentDg;
- UINT32 mnCurrentShapeID; // die naechste freie ID
- UINT32 mnCurrentShapeMaximumID; // die hoechste und auch benutzte ID
- UINT32 mnTotalShapesDg; // anzahl der shapes im Dg
- UINT32 mnTotalShapeIdUsedDg; // anzahl der benutzten shape Id's im Dg
- UINT32 mnTotalShapesDgg; // anzahl der shapes im Dgg
UINT32 mnCountOfs;
UINT32 mnGroupLevel;
UINT16 mnHellLayerId;
BOOL mbEscherSpgr;
- BOOL mbEscherDgg;
BOOL mbEscherDg;
BOOL mbOleEmf; // OLE is EMF instead of WMF
virtual BOOL DoSeek( UINT32 nKey );
- public:
+public:
+ explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm );
+ virtual ~EscherEx();
- EscherEx( SvStream& rOut, UINT32 nDrawings );
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table. */
+ inline sal_uInt32 GenerateShapeId() { return mxGlobal->GenerateShapeId( mnCurrentDg, mbEscherSpgr ); }
+
+ /** Returns the graphic provider from the global object that has been
+ passed to the constructor.
+ */
+ inline EscherGraphicProvider&
+ GetGraphicProvider() { return *mxGlobal; }
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+ */
+ inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
/// Fuegt in den EscherStream interne Daten ein, dieser Vorgang
/// darf und muss nur einmal ausgefuehrt werden.
@@ -1398,14 +1484,29 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// gemerged, wie es fuer Excel (und Word?) benoetigt wird.
virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
- virtual ~EscherEx();
+ /** Inserts the passed number of bytes at the current position of the
+ output stream.
+
+ Inserts dummy bytes and moves all following stream data, and updates
+ all internal stream offsets stored in the PersistTable and the affected
+ container sizes, which makes this operation very expensive. (!)
- // Application may overload this function to maintain an offset
- // table for specific regions but MUST call this function too.
- virtual void InsertAtCurrentPos( UINT32 nBytes, BOOL bCont = FALSE );// es werden nBytes an der aktuellen Stream Position eingefuegt,
- // die PersistantTable und interne Zeiger angepasst
+ @param nBytes The number of bytes to be inserted into the stream.
+
+ @param bExpandEndOfAtom If set to true, an atom that currently ends
+ exactly at the current stream position will be expanded to include
+ the inserted data. If set to false, an atom that currently ends
+ exactly at the current stream position will not be expanded to
+ include the inserted data (used to insert e.g. a new atom after an
+ existing atom). Note that containers that end exactly at the
+ current stream position are always expanded to include the inserted
+ data.
+ */
+ void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
+ void ReplacePersistOffset( UINT32 nKey, UINT32 nOffset );
+ UINT32 GetPersistOffset( UINT32 nKey );
BOOL SeekToPersistOffset( UINT32 nKey );
virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
@@ -1440,21 +1541,16 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
- // reserviert eine ShapeId
- UINT32 GetShapeID();
virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE );
UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE );
- // OLE is written as EMF instead of WMF (default WMF)
- void SetOleEmf( BOOL bVal ) { mbOleEmf = bVal; }
- BOOL IsOleEmf() const { return mbOleEmf; }
-
// ...Sdr... implemented in eschesdo.cxx
void AddSdrPage( const SdrPage& rPage );
+ void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
/// returns the ShapeID
UINT32 AddSdrObject( const SdrObject& rObj );
@@ -1467,7 +1563,9 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// Called before a shape is written, application supplies
/// ClientRecords. May set AppData::bDontWriteShape so the
/// shape is ignored.
- virtual EscherExHostAppData* StartShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
+ virtual EscherExHostAppData* StartShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
+ const Rectangle* pChildAnchor );
/// Called after a shape is written to inform the application
/// of the resulted shape type and ID.
@@ -1491,10 +1589,6 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// the same functionality as an ordinary recursive group.
virtual EscherExHostAppData* EnterAdditionalTextGroup();
- /// Called if a picture shall be written and no PicStream is
- /// set at ImplEscherExSdr
- virtual SvStream* QueryPicStream();
-
/// Called if an ESCHER_Prop_lTxid shall be written
virtual UINT32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, UINT32 nShapeId );
// add an dummy rectangle shape into the escher stream
@@ -1504,6 +1598,14 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
void SetHellLayerId( UINT16 nId ) { mnHellLayerId = nId; }
UINT16 GetHellLayerId() const { return mnHellLayerId; }
+
+private:
+ EscherEx( const EscherEx& );
+ EscherEx& operator=( const EscherEx& );
+
+ // prevent C-style cast to former base class EscherGraphicProvider
+ operator EscherGraphicProvider&();
+ operator EscherGraphicProvider const&();
};
diff --git a/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
index dba3845285d7..2888c0f0ba46 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
index bb0a97823c32..e7bcee7e4c4c 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base16</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
index 72ca4d282717..966a77a47c73 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base4</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/svm_StarView_Metafile.xcu b/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
index ac5e04e18a55..d7e52dbbb11a 100644
--- a/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
+++ b/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>svm</value></prop>
- <prop oor:name="MediaType"><value>image/x-svm</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-svm</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>SVM - StarView Metafile</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/tools/merge/pyAltFCFGMerge b/filter/source/config/tools/merge/pyAltFCFGMerge
index 17fe16fb3445..faf9b9c34cb7 100755
--- a/filter/source/config/tools/merge/pyAltFCFGMerge
+++ b/filter/source/config/tools/merge/pyAltFCFGMerge
@@ -438,7 +438,6 @@ def generateHeader(sVersion, sEncoding, sPath, sPackage, bLanguagePack):
sHeader += " xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
sHeader += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
else:
- sHeader += "<!DOCTYPE oor:component-data SYSTEM \"../../../../component-update.dtd\">\n"
sHeader += "<oor:component-data xmlns:oor=\"http://openoffice.org/2001/registry\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" oor:package=\""
sHeader += sPath
sHeader += "\" oor:name=\""
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 10e1051eba2a..ff5be3476da7 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3669,13 +3669,13 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
// record type
*pMergePicStreamBSE >> n16;
rSt << UINT16( ESCHER_BlipFirst + nBlibType );
- DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherEx::Flush: BLIP record types differ" );
+ DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherGraphicProvider::WriteBlibStoreContainer: BLIP record types differ" );
UINT32 n32;
// record size
*pMergePicStreamBSE >> n32;
nBlipSize -= 8;
rSt << nBlipSize;
- DBG_ASSERT( nBlipSize == n32, "EscherEx::Flush: BLIP sizes differ" );
+ DBG_ASSERT( nBlipSize == n32, "EscherGraphicProvider::WriteBlibStoreContainer: BLIP sizes differ" );
// record
while ( nBlipSize )
{
@@ -4290,63 +4290,189 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm )
}
// ---------------------------------------------------------------------------------------------
+
+EscherExGlobal::EscherExGlobal( sal_uInt32 nGraphicProvFlags ) :
+ EscherGraphicProvider( nGraphicProvFlags ),
+ mpPicStrm( 0 ),
+ mbHasDggCont( false ),
+ mbPicStrmQueried( false )
+{
+}
+
+EscherExGlobal::~EscherExGlobal()
+{
+}
+
+sal_uInt32 EscherExGlobal::GenerateDrawingId()
+{
+ // new drawing starts a new cluster in the cluster table (cluster identifiers are one-based)
+ sal_uInt32 nClusterId = static_cast< sal_uInt32 >( maClusterTable.size() + 1 );
+ // drawing identifiers are one-based
+ sal_uInt32 nDrawingId = static_cast< sal_uInt32 >( maDrawingInfos.size() + 1 );
+ // prepare new entries in the tables
+ maClusterTable.push_back( ClusterEntry( nDrawingId ) );
+ maDrawingInfos.push_back( DrawingInfo( nClusterId ) );
+ // return the new drawing identifier
+ return nDrawingId;
+}
+
+sal_uInt32 EscherExGlobal::GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr )
+{
+ // drawing identifier is one-based
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GenerateShapeId - invalid drawing ID" );
+ if( nDrawingIdx >= maDrawingInfos.size() )
+ return 0;
+ DrawingInfo& rDrawingInfo = maDrawingInfos[ nDrawingIdx ];
+
+ // cluster identifier in drawing info struct is one-based
+ ClusterEntry* pClusterEntry = &maClusterTable[ rDrawingInfo.mnClusterId - 1 ];
+
+ // check cluster overflow, create new cluster entry
+ if( pClusterEntry->mnNextShapeId == DFF_DGG_CLUSTER_SIZE )
+ {
+ // start a new cluster in the cluster table
+ maClusterTable.push_back( ClusterEntry( nDrawingId ) );
+ pClusterEntry = &maClusterTable.back();
+ // new size of maClusterTable is equal to one-based identifier of the new cluster
+ rDrawingInfo.mnClusterId = static_cast< sal_uInt32 >( maClusterTable.size() );
+ }
+
+ // build shape identifier from cluster identifier and next free cluster shape identifier
+ rDrawingInfo.mnLastShapeId = static_cast< sal_uInt32 >( rDrawingInfo.mnClusterId * DFF_DGG_CLUSTER_SIZE + pClusterEntry->mnNextShapeId );
+ // update free shape identifier in cluster entry
+ ++pClusterEntry->mnNextShapeId;
+ /* Old code has counted the shapes only, if we are in a SPGRCONTAINER. Is
+ this really intended? Maybe it's always true... */
+ if( bIsInSpgr )
+ ++rDrawingInfo.mnShapeCount;
+
+ // return the new shape identifier
+ return rDrawingInfo.mnLastShapeId;
+}
+
+sal_uInt32 EscherExGlobal::GetDrawingShapeCount( sal_uInt32 nDrawingId ) const
+{
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GetDrawingShapeCount - invalid drawing ID" );
+ return (nDrawingIdx < maDrawingInfos.size()) ? maDrawingInfos[ nDrawingIdx ].mnShapeCount : 0;
+}
+
+sal_uInt32 EscherExGlobal::GetLastShapeId( sal_uInt32 nDrawingId ) const
+{
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GetLastShapeId - invalid drawing ID" );
+ return (nDrawingIdx < maDrawingInfos.size()) ? maDrawingInfos[ nDrawingIdx ].mnLastShapeId : 0;
+}
+
+sal_uInt32 EscherExGlobal::GetDggAtomSize() const
+{
+ // 8 bytes header, 16 bytes fixed DGG data, 8 bytes for each cluster
+ return static_cast< sal_uInt32 >( 24 + 8 * maClusterTable.size() );
+}
+
+void EscherExGlobal::WriteDggAtom( SvStream& rStrm ) const
+{
+ sal_uInt32 nDggSize = GetDggAtomSize();
+
+ // write the DGG record header (do not include the 8 bytes of the header in the data size)
+ rStrm << static_cast< sal_uInt32 >( ESCHER_Dgg << 16 ) << static_cast< sal_uInt32 >( nDggSize - 8 );
+
+ // claculate and write the fixed DGG data
+ sal_uInt32 nShapeCount = 0;
+ sal_uInt32 nLastShapeId = 0;
+ for( DrawingInfoVector::const_iterator aIt = maDrawingInfos.begin(), aEnd = maDrawingInfos.end(); aIt != aEnd; ++aIt )
+ {
+ nShapeCount += aIt->mnShapeCount;
+ nLastShapeId = ::std::max( nLastShapeId, aIt->mnLastShapeId );
+ }
+ // the non-existing cluster with index #0 is counted too
+ sal_uInt32 nClusterCount = static_cast< sal_uInt32 >( maClusterTable.size() + 1 );
+ sal_uInt32 nDrawingCount = static_cast< sal_uInt32 >( maDrawingInfos.size() );
+ rStrm << nLastShapeId << nClusterCount << nShapeCount << nDrawingCount;
+
+ // write the cluster table
+ for( ClusterTable::const_iterator aIt = maClusterTable.begin(), aEnd = maClusterTable.end(); aIt != aEnd; ++aIt )
+ rStrm << aIt->mnDrawingId << aIt->mnNextShapeId;
+}
+
+SvStream* EscherExGlobal::QueryPictureStream()
+{
+ if( !mbPicStrmQueried )
+ {
+ mpPicStrm = ImplQueryPictureStream();
+ mbPicStrmQueried = true;
+ }
+ return mpPicStrm;
+}
+
+SvStream* EscherExGlobal::ImplQueryPictureStream()
+{
+ return 0;
+}
+
+// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
-EscherEx::EscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
- EscherGraphicProvider ( 0 ),
+EscherEx::EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm ) :
+ mxGlobal ( rxGlobal ),
mpOutStrm ( &rOutStrm ),
- mnDrawings ( nDrawings ),
mnGroupLevel ( 0 ),
mnHellLayerId ( USHRT_MAX ),
mbEscherSpgr ( FALSE ),
- mbEscherDgg ( FALSE ), // TRUE, wenn jemals ein ESCHER_Dgg angelegt wurde, dieser wird dann im Dest. aktualisiert
- mbEscherDg ( FALSE ),
- mbOleEmf ( FALSE )
+ mbEscherDg ( FALSE )
{
mnStrmStartOfs = mpOutStrm->Tell();
- mpImplEscherExSdr = new ImplEscherExSdr( *this );
+ mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
+}
+
+EscherEx::~EscherEx()
+{
}
// ---------------------------------------------------------------------------------------------
void EscherEx::Flush( SvStream* pPicStreamMergeBSE /* = NULL */ )
{
- if ( mbEscherDgg ) // ESCHER_Dgg anpassen
+ if ( mxGlobal->HasDggContainer() )
{
+ // store the current stream position at ESCHER_Persist_CurrentPosition key
PtReplaceOrInsert( ESCHER_Persist_CurrentPosition, mpOutStrm->Tell() );
if ( DoSeek( ESCHER_Persist_Dgg ) )
{
- *mpOutStrm << mnCurrentShapeID << (UINT32)( mnFIDCLs + 1 ) << mnTotalShapesDgg << mnDrawings;
- }
- if ( HasGraphics() )
- {
- if ( DoSeek( ESCHER_Persist_BlibStoreContainer ) ) // ESCHER_BlibStoreContainer schreiben
+ /* The DGG record is still not written. ESCHER_Persist_Dgg seeks
+ to the place where the complete record has to be inserted. */
+ InsertAtCurrentPos( mxGlobal->GetDggAtomSize(), false );
+ mxGlobal->WriteDggAtom( *mpOutStrm );
+
+ if ( mxGlobal->HasGraphics() )
{
- sal_uInt32 nAddBytes = GetBlibStoreContainerSize( pPicStreamMergeBSE );
- if ( nAddBytes )
+ /* Calculate the total size of the BSTORECONTAINER including
+ all BSE records containing the picture data contained in
+ the passed in pPicStreamMergeBSE. */
+ sal_uInt32 nBSCSize = mxGlobal->GetBlibStoreContainerSize( pPicStreamMergeBSE );
+ if ( nBSCSize > 0 )
{
- InsertAtCurrentPos( nAddBytes, TRUE ); // platz schaffen fuer Blib Container samt seinen Blib Atomen
- WriteBlibStoreContainer( *mpOutStrm, pPicStreamMergeBSE );
+ InsertAtCurrentPos( nBSCSize, false );
+ mxGlobal->WriteBlibStoreContainer( *mpOutStrm, pPicStreamMergeBSE );
}
}
+
+ /* Forget the stream position stored for the DGG which is invalid
+ after the call to InsertAtCurrentPos() anyway. */
+ PtDelete( ESCHER_Persist_Dgg );
}
+ // seek to initial position (may be different due to inserted DGG and BLIPs)
mpOutStrm->Seek( PtGetOffsetByID( ESCHER_Persist_CurrentPosition ) );
}
}
// ---------------------------------------------------------------------------------------------
-EscherEx::~EscherEx()
-{
- delete mpImplEscherExSdr;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bContainer )
+void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
{
UINT32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
BYTE* pBuf;
@@ -4364,11 +4490,16 @@ void EscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bContainer )
while ( mpOutStrm->Tell() < nCurPos )
{
*mpOutStrm >> nType >> nSize;
- if ( ( mpOutStrm->Tell() + nSize ) >= ( ( bContainer ) ? nCurPos + 1 : nCurPos ) )
+ sal_uInt32 nEndOfRecord = mpOutStrm->Tell() + nSize;
+ bool bContainer = (nType & 0x0F) == 0x0F;
+ /* Expand the record, if the insertion position is inside, or if the
+ position is at the end of a container (expands always), or at the
+ end of an atom and bExpandEndOfAtom is set. */
+ if ( (nCurPos < nEndOfRecord) || ((nCurPos == nEndOfRecord) && (bContainer || bExpandEndOfAtom)) )
{
mpOutStrm->SeekRel( -4 );
*mpOutStrm << (UINT32)( nSize + nBytes );
- if ( ( nType & 0xf ) != 0xf )
+ if ( !bContainer )
mpOutStrm->SeekRel( nSize );
}
else
@@ -4428,6 +4559,16 @@ void EscherEx::InsertPersistOffset( UINT32 nKey, UINT32 nOffset )
PtInsert( ESCHER_Persist_PrivateEntry | nKey, nOffset );
}
+void EscherEx::ReplacePersistOffset( UINT32 nKey, UINT32 nOffset )
+{
+ PtReplace( ESCHER_Persist_PrivateEntry | nKey, nOffset );
+}
+
+UINT32 EscherEx::GetPersistOffset( UINT32 nKey )
+{
+ return PtGetOffsetByID( ESCHER_Persist_PrivateEntry | nKey );
+}
+
// ---------------------------------------------------------------------------------------------
BOOL EscherEx::DoSeek( UINT32 nKey )
@@ -4476,39 +4617,25 @@ void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
{
case ESCHER_DggContainer :
{
- mbEscherDgg = TRUE;
- mnFIDCLs = mnDrawings;
+ mxGlobal->SetDggContainer();
mnCurrentDg = 0;
- mnCurrentShapeID = 0;
- mnTotalShapesDgg = 0;
- mnCurrentShapeMaximumID = 0;
- AddAtom( 16 + ( mnDrawings << 3 ), ESCHER_Dgg ); // an FDGG and several FIDCLs
+ /* Remember the current position as start position of the DGG
+ record and BSTORECONTAINER, but do not write them actually.
+ This will be done later in Flush() when the number of drawings,
+ the size and contents of the FIDCL cluster table, and the size
+ of the BLIP container are known. */
PtReplaceOrInsert( ESCHER_Persist_Dgg, mpOutStrm->Tell() );
- *mpOutStrm << (UINT32)0 // the current maximum shape ID
- << (UINT32)0 // the number of ID clusters + 1
- << (UINT32)0 // the number of total shapes saved
- << (UINT32)0; // the total number of drawings saved
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() );
- for ( UINT32 i = 0; i < mnFIDCLs; i++ ) // Dummy FIDCLs einfuegen
- {
- *mpOutStrm << (UINT32)0 << (UINT32)0; // Drawing Nummer, Anzahl der Shapes in diesem IDCL
- }
- PtReplaceOrInsert( ESCHER_Persist_BlibStoreContainer, mpOutStrm->Tell() );
}
break;
case ESCHER_DgContainer :
{
- if ( mbEscherDgg )
+ if ( mxGlobal->HasDggContainer() )
{
if ( !mbEscherDg )
{
mbEscherDg = TRUE;
- mnCurrentDg++;
- mnTotalShapesDg = 0;
- mnTotalShapeIdUsedDg = 0;
- mnCurrentShapeID = ( mnCurrentShapeMaximumID &~0x3ff ) + 0x400; // eine neue Seite bekommt immer eine neue ShapeId die ein vielfaches von 1024 ist,
- // damit ist erste aktuelle Shape ID 0x400
+ mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
*mpOutStrm << (UINT32)0 // The number of shapes in this drawing
@@ -4554,48 +4681,7 @@ void EscherEx::CloseContainer()
{
mbEscherDg = FALSE;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
- {
- // shapeanzahl des drawings setzen
- mnTotalShapesDgg += mnTotalShapesDg;
- *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
- if ( DoSeek( ESCHER_Persist_Dgg_FIDCL ) )
- {
- if ( mnTotalShapesDg == 0 )
- {
- mpOutStrm->SeekRel( 8 );
- }
- else
- {
- if ( mnTotalShapeIdUsedDg )
- {
- // die benutzten Shape Ids des drawings in die fidcls setzen
- UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
- if ( nFIDCL )
- {
- if ( nPos > mpOutStrm->Tell() )
- nPos += ( nFIDCL << 3 );
-
- mnFIDCLs += nFIDCL;
- InsertAtCurrentPos( nFIDCL << 3 ); // platz schaffen fuer weitere FIDCL's
- }
- for ( i = 0; i <= nFIDCL; i++ )
- {
- *mpOutStrm << mnCurrentDg;
- if ( i < nFIDCL )
- *mpOutStrm << (UINT32)0x400;
- else
- {
- UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
- if ( !nShapesLeft )
- nShapesLeft = 0x400;
- *mpOutStrm << (UINT32)nShapesLeft;
- }
- }
- }
- }
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() ); // neuen FIDCL Offset fuer naechste Seite
- }
- }
+ *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
}
break;
@@ -4649,10 +4735,10 @@ void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int
void EscherEx::AddChildAnchor( const Rectangle& rRect )
{
AddAtom( 16, ESCHER_ChildAnchor );
- GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
+ *mpOutStrm << (sal_Int32)rRect.Left()
+ << (sal_Int32)rRect.Top()
+ << (sal_Int32)rRect.Right()
+ << (sal_Int32)rRect.Bottom();
}
// ---------------------------------------------------------------------------------------------
@@ -4691,7 +4777,7 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
<< (INT32)aRect.Right()
<< (INT32)aRect.Bottom();
- UINT32 nShapeId = GetShapeID();
+ sal_uInt32 nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
else
@@ -4782,7 +4868,7 @@ void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
AddAtom( 8, ESCHER_Sp, 2, nShpInstance );
if ( !nShapeID )
- nShapeID = GetShapeID();
+ nShapeID = GenerateShapeId();
if ( nFlags ^ 1 ) // is this a group shape ?
{ // if not
@@ -4790,19 +4876,6 @@ void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
nFlags |= 2; // this not a topmost shape
}
*mpOutStrm << nShapeID << nFlags;
-
- if ( mbEscherSpgr )
- mnTotalShapesDg++;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::GetShapeID()
-{
- mnCurrentShapeMaximumID = mnCurrentShapeID; // maximum setzen
- mnCurrentShapeID++; // mnCurrentShape ID auf nachste freie ID
- mnTotalShapeIdUsedDg++;
- return mnCurrentShapeMaximumID;
}
// ---------------------------------------------------------------------------------------------
@@ -4842,3 +4915,4 @@ UINT32 EscherEx::GetColor( const Color& rSOColor, BOOL bSwap )
}
// ---------------------------------------------------------------------------------------------
+
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index b72427d78571..facc6e799d04 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -146,7 +146,7 @@ void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherProperty
#define ADD_SHAPE( nType, nFlags ) \
{ \
nShapeType = nType; \
- nShapeID = mpEscherEx->GetShapeID(); \
+ nShapeID = mpEscherEx->GenerateShapeId(); \
rObj.SetShapeId( nShapeID ); \
mpEscherEx->AddShape( (UINT32)nType, (UINT32)nFlags, nShapeID ); \
rSolverContainer.AddShape( rObj.GetShapeRef(), nShapeID ); \
@@ -182,7 +182,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
UINT32 nGrpShapeID = 0;
do {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -238,8 +238,8 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
+ mpPicStrm = mpEscherEx->QueryPictureStream();
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
// #i51348# shape name
if( aShapeName.Len() > 0 )
@@ -764,7 +764,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
UINT16 nShapeType = 0;
do
{
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -772,8 +772,8 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
+ mpPicStrm = mpEscherEx->QueryPictureStream();
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
INT32 nAngle = rObj.GetAngle();
if( rObj.GetType().EqualsAscii( "drawing.Line" ))
@@ -802,7 +802,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
else
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- nShapeID = mpEscherEx->GetShapeID();
+ nShapeID = mpEscherEx->GenerateShapeId();
mpEscherEx->AddShape( nShapeType = ESCHER_ShpInst_TextBox, 0xa00, nShapeID );
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
@@ -862,7 +862,7 @@ UINT32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >&
{
mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
UINT32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
- mpHostAppData = mpEscherEx->StartShape( rShape );
+ mpHostAppData = mpEscherEx->StartShape( rShape, pBoundRect );
return nGrpId;
}
@@ -934,7 +934,7 @@ ImplEscherExSdr::~ImplEscherExSdr()
// -------------------------------------------------------------------
-SvxDrawPage* ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
+bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
{
do
{
@@ -960,12 +960,32 @@ SvxDrawPage* ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
else
pSvxDrawPage = SvxDrawPage::getImplementation(mXDrawPage);
- return pSvxDrawPage;
+ return pSvxDrawPage != 0;
} while ( 0 );
- return NULL;
+ return false;
}
+// -------------------------------------------------------------------
+
+bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
+{
+ // eventually write SolverContainer of current page, deletes the Solver
+ ImplFlushSolverContainer();
+
+ if( !rxShapes.is() )
+ return false;
+
+ mpSdrPage = 0;
+ mXDrawPage.clear();
+ mXShapes = rxShapes;
+
+ if( !ImplInitPageValues() ) // ImplEESdrWriter
+ return false;
+
+ mpSolverContainer = new EscherSolverContainer;
+ return true;
+}
// -------------------------------------------------------------------
@@ -1020,6 +1040,13 @@ void EscherEx::AddSdrPage( const SdrPage& rPage )
mpImplEscherExSdr->ImplWriteCurrentPage();
}
+// -------------------------------------------------------------------
+
+void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
+{
+ if ( mpImplEscherExSdr->ImplInitUnoShapes( rxShapes ) )
+ mpImplEscherExSdr->ImplWriteCurrentPage();
+}
// -------------------------------------------------------------------
@@ -1041,7 +1068,7 @@ void EscherEx::EndSdrObjectPage()
// -------------------------------------------------------------------
-EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */ )
+EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
{
return NULL;
}
@@ -1054,13 +1081,6 @@ void EscherEx::EndShape( UINT16 /* nShapeType */, UINT32 /* nShapeID */ )
// -------------------------------------------------------------------
-SvStream* EscherEx::QueryPicStream()
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------
-
UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
{
return 0;
@@ -1071,7 +1091,7 @@ UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
UINT32 EscherEx::AddDummyShape()
{
OpenContainer( ESCHER_SpContainer );
- UINT32 nShapeID = GetShapeID();
+ UINT32 nShapeID = GenerateShapeId();
AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nShapeID );
//?? aSolverContainer.AddShape( mXShape, nShapeID );
CloseContainer();
@@ -1109,16 +1129,12 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
{
SdrPage* pPage = rObj.GetPage();
DBG_ASSERT( pPage, "ImplEESdrObject::ImplEESdrObject: no SdrPage" );
- if( pPage )
+ if( pPage && rEx.ImplInitPage( *pPage ) )
{
- SvxDrawPage* pSvxDrawPage = rEx.ImplInitPage( *pPage );
- if( pSvxDrawPage )
- {
- // why not declare a const parameter if the object will
- // not be modified?
- mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
- Init( rEx );
- }
+ // why not declare a const parameter if the object will
+ // not be modified?
+ mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
+ Init( rEx );
}
}
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index 962000e5c2cf..754eb6f3a2c0 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -191,7 +191,8 @@ public:
ImplEscherExSdr( EscherEx& rEx );
virtual ~ImplEscherExSdr();
- SvxDrawPage* ImplInitPage( const SdrPage& rPage );
+ bool ImplInitPage( const SdrPage& rPage );
+ bool ImplInitUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
void ImplWriteCurrentPage();
UINT32 ImplWriteTheShape( ImplEESdrObject& rObj );
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index e3d4337ca402..516c62fe7580 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -981,8 +981,9 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTit
// check the names
if ( FilterNameExists( aFilters ) )
- // TODO: a more precise exception message
- throw IllegalArgumentException();
+ throw IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter name exists")),
+ static_cast< OWeakObject * >(this), 1);
// ensure that we have a filter list
::rtl::OUString sInitialCurrentFilter;
diff --git a/framework/source/classes/addonmenu.cxx b/framework/source/classes/addonmenu.cxx
index d9d0476ca18b..4961a8f7c1f2 100644
--- a/framework/source/classes/addonmenu.cxx
+++ b/framework/source/classes/addonmenu.cxx
@@ -52,7 +52,7 @@
#include <tools/config.hxx>
#include <vcl/svapp.hxx>
#include <svtools/menuoptions.hxx>
-
+#include <svl/solar.hrc>
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
@@ -64,7 +64,6 @@ using namespace ::com::sun::star::beans;
// Please look at sfx2/inc/sfxsids.hrc the values are defined there. Due to build dependencies
// we cannot include the header file.
-const USHORT SID_SFX_START = 5000;
const USHORT SID_HELPMENU = (SID_SFX_START + 410);
const USHORT SID_ONLINE_REGISTRATION = (SID_SFX_START + 1537);
diff --git a/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes.txt b/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes.txt
index becf435a74b0..50fcb25b92d2 100644
--- a/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes.txt
+++ b/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes.txt
@@ -33,35 +33,120 @@ multiwestern = "{D53F8583-419E-440E-AC00-40E9AB31EEBF}"
multiasia = "{C0D08A10-A266-46DC-8EF4-BE0E5928129D}"
[UPGRADECODE]
-en-US = "{8B909084-2220-49AC-A421-142180519088}"
-pt = "{CBFA6A61-D310-4A90-8F49-C7BE2735D58D}"
-ru = "{DF67ADAA-4755-4184-9E32-1020F40DDA81}"
+af = "{3E85B9F2-0AC3-4E57-8072-260A6FE05D02}"
+ar = "{DF297699-3040-48E0-B0E6-B54385D76018}"
+as-IN = "{62E2F6A6-4521-4E36-A751-46E91A58CFB5}"
+be-BY = "{E6DC8D4C-F68E-4BE1-8F00-F0C84ED0F974}"
+bo = "{5F9461CD-2937-4EE0-AF03-24E72987244E}"
+bg = "{29FF0FAA-B831-4398-BE3F-FC13949D1CAE}"
+br = "{6E4658DD-79B0-4707-93C2-B022D66157A1}"
+brx = "{6DD492EA-45CD-483E-8563-23355FD37E28}"
+bn = "{4D1449E7-D10B-44D8-AAB0-257D6930B0C2}"
+bn-BD = "{3195C77E-8462-45DA-BEFC-37F1299D889E}"
+bn-IN = "{763F5343-47FC-4909-8C18-D9E0CEED533A}"
+bs = "{DCC737A4-531E-4DCD-A3C4-376DA4C76D00}"
+by = "{F190162C-DCD0-4266-B9AB-1B1FD7C24C2E}"
+ca = "{8EEC9A45-3BD3-431F-81D0-394F41185BD9}"
+cs = "{DBA607B3-0805-4A18-A45D-769C70D90AB7}"
+cy = "{3CE6CA2E-6ECF-45BC-B26A-348FA03A25D3}"
+da = "{4E7025EF-909F-4609-97BA-304684C4833D}"
+de = "{481E648E-D8AD-478A-A3F6-68FC563FFD8F}"
+dgo = "{205ADC32-F775-476A-B68E-949F85D0B0E3}"
+dz = "{3D391D0A-66D3-4141-8554-65DECA138208}"
el = "{39772F91-1D37-4866-BBA4-900AB53590B0}"
-nl = "{7D14314D-DAF7-4A97-A6EE-97C475080A73}"
-fr = "{B0FDE9B8-D066-4FB2-885D-615A6D58E02F}"
+en-GB = "{E60BC5AC-2513-40AF-A41B-64118A287662}"
+en-US = "{8B909084-2220-49AC-A421-142180519088}"
+en-ZA = "{047EB419-DF2F-4D02-A3B5-E1B2FAFEDC93}"
+eo = "{A256340D-4065-4B6F-AC1D-EB0D5127EBCE}"
es = "{01588DD5-C6C5-4C9D-A1BD-1A63E779DA1A}"
+et = "{34FBD5D3-3F88-4C91-8B9B-A10AE833250F}"
+eu = "{A73CB85E-760B-4E5D-AB26-7DF091C25F16}"
+fa = "{12D1FE4A-95E1-4BED-B377-2E8EA93B2461}"
fi = "{481B0FE0-8313-442E-8A53-7C5139ADA3DC}"
+fr = "{B0FDE9B8-D066-4FB2-885D-615A6D58E02F}"
+ga = "{39B343FE-EC1F-451E-930A-47D85E96DE67}"
+gd = "{DE408221-68E9-418D-9B20-10BE458268F2}"
+gl = "{38616841-D0DB-4768-B9B8-27D61A91FB47}"
+gu = "{382A0F08-CF86-45C4-8119-67C87E275EFE}"
+gu-IN = "{25FF47C5-9FBB-4FBA-89FC-D0FB73336E2B}"
+he = "{13484272-CE60-4867-B494-D56F9049B95A}"
+hi = "{2C70F320-6771-42D6-B3F5-97678C822B20}"
+hi-IN = "{DDAB0849-CC63-475C-AC87-388B93579A28}"
+hr = "{0750A25E-7492-4681-8DFD-E04E89E45C0A}"
hu = "{5981EE94-6763-40AD-A8A0-EEB01CCA153C}"
-ca = "{8EEC9A45-3BD3-431F-81D0-394F41185BD9}"
+is = "{ED6D0C4C-2746-40A9-A672-4D9950C421C0}"
it = "{50087605-A504-441B-B514-67F13A284C10}"
-cs = "{DBA607B3-0805-4A18-A45D-769C70D90AB7}"
-sk = "{19B49960-B58C-48A7-9761-F0B325E00C31}"
-en-GB = "{E60BC5AC-2513-40AF-A41B-64118A287662}"
-da = "{4E7025EF-909F-4609-97BA-304684C4833D}"
-sv = "{5E751B0D-FE96-4D0E-BAC1-5E7501294940}"
+ja = "{74F683CC-8356-4BF7-9098-B85AAB7C1A0C}"
+kid = "{1A4DA798-78EB-46B8-A5CE-4E32F883314C}"
+ky = "{3110031F-1B5D-4457-BB5C-F6A330F15419}"
+ka = "{08E10841-B5EF-4BF9-9688-AE25573E6DA7}"
+kk = "{1527983C-2953-45B4-87A5-C7D67A1F6C60}"
+km = "{B4E6E1AC-C45E-48BB-A038-073C32693B65}"
+kn = "{28FDEA4F-1DAB-4EAC-986E-604B7BB6EF11}"
+ko = "{1D068BF9-FBCF-4A3B-B9A4-4B2DD3DE8CFB}"
+kok = "{CC3129BA-331A-42CC-8569-93F9E05B6400}"
+ks = "{BADB1F2A-B03A-4521-9A4A-61C3EDD365EC}"
+ku = "{2C5FB742-9A33-410D-AC5C-A376D4967D69}"
+lo = "{3968BFB2-35F7-4BBC-9E3E-C640BF09587D}"
+lt = "{3526DA6A-7EA6-471C-973E-C0461DE85909}"
+lv = "{BC085A1A-38A6-462A-889F-6E7CA442D9D8}"
+mai = "{BE522738-E05A-431A-B535-29349EBF86AE}"
+mk = "{9B8D68D5-6903-4C22-AC8F-CA0D2D124FD8}"
+mn = "{A9E2C897-8193-4DBD-9FDE-F9BE9AB7F92E}"
+mni = "{3CBD068D-E6AE-4C02-8091-DD4F2866336A}"
+ms = "{F300CABB-ED67-468E-A336-87DEC6E22CFC}"
+ml-IN = "{F2F04B66-9996-425D-A026-0AE99F5DB878}"
+mr-IN = "{4B87A651-94B3-48DF-800C-9458C3A93179}"
+my = "{E1C174A0-8126-43A8-B696-9F9DE676E1ED}"
+ne = "{FF4DA93A-205F-40A2-9F01-2A5EB6663E6C}"
+nb = "{6E732530-FCDD-484C-A575-1289731020FD}"
+nl = "{7D14314D-DAF7-4A97-A6EE-97C475080A73}"
+nn = "{2F1F8A99-B3C4-4F22-BB08-5F0D217C0BE5}"
no = "{00C1656C-6386-42ED-BE8C-5D6C553EF125}"
+nr = "{0E64C806-9EB2-4651-BB94-B8D9814FD9E5}"
+ns = "{5142883F-6084-4723-907B-EFD4A5097817}"
+om = "{8D6EE539-9E74-41C0-8DED-807F91D68467}"
+oc = "{73B96B61-E98E-4BB1-8E16-BABEBF6D58FB}"
+or-IN = "{11771BE2-44D3-4ACD-882B-26C4947237C5}"
+pap = "{C4AC769D-F356-4D1A-A3A4-62E6729CF403}"
+pa-IN = "{1869854A-30BE-40EF-B72C-AF0CCA1A5A91}"
pl = "{9C92258E-9A41-4A03-AA5C-FD8EF15189BA}"
-de = "{481E648E-D8AD-478A-A3F6-68FC563FFD8F}"
+ps = "{277B630B-64D9-4105-A542-6F279A31A72C}"
+pt = "{CBFA6A61-D310-4A90-8F49-C7BE2735D58D}"
pt-BR = "{7364F154-089D-400B-B275-751AAB9A6122}"
+ru = "{DF67ADAA-4755-4184-9E32-1020F40DDA81}"
+rw = "{D1D013B7-9570-4165-8421-BBDC97842260}"
+sat = "{233A2442-D417-458E-A67F-4C3E58B54387}"
+sa-IN = "{180CEB68-8F15-4533-B2C2-43D47DED7ABB}"
+si = "{6CFE884D-10C2-42F7-A60F-52A8284E8D45}"
+sc = "{AC0B0CE3-DF64-4CCF-88EC-CBF594D63183}"
+sd = "{638AEB7C-B611-4DBE-AD2C-A91BB7D13B75}"
+sk = "{19B49960-B58C-48A7-9761-F0B325E00C31}"
+sl = "{0FBEEB90-0C80-4C77-8CEE-E6347CC465FD}"
+sh = "{8DA3BE37-E70B-41BD-BBBC-C2169FBE01F4}"
+sr = "{49A004A2-3B8B-4029-B403-89919CB52355}"
+ss = "{5B0E4353-AB4E-497E-B38F-2E784C7B1F35}"
+st = "{FC92FF2C-0E4B-4EB1-A962-682861EE4C33}"
+sv = "{5E751B0D-FE96-4D0E-BAC1-5E7501294940}"
+sw = "{90672FAA-14CA-4F63-8FE9-40E572A3969A}"
+sw-TZ = "{905F971E-91FC-4F85-90D6-F6217A4FF01A}"
+te-IN = "{79ADE5C5-96C5-4CAB-B8A3-1024E6A639E7}"
+ti-ER = "{1FEF45BC-1315-46F4-B89B-6660226758DE}"
+ta-IN = "{76D5C227-D097-4B4E-B4C7-B2370B4F7932}"
th = "{1F9BC074-55AA-496A-9EC5-05E65CF64AE6}"
-et = "{34FBD5D3-3F88-4C91-8B9B-A10AE833250F}"
-ja = "{74F683CC-8356-4BF7-9098-B85AAB7C1A0C}"
-ko = "{1D068BF9-FBCF-4A3B-B9A4-4B2DD3DE8CFB}"
+tn = "{685C3085-DCD2-40F6-85C9-5084402D7E0F}"
+tr = "{46AB3EE6-FD98-460D-AE0B-6AE68ED6204D}"
+ts = "{AC285965-9D0F-4D55-8885-0F0A9B9888B1}"
+tg = "{6C238E70-72FA-45FA-BC58-C508CD3AF6FC}"
+ug = "{57836D3D-879A-4288-8C47-691ECC4EECBE}"
+ur-IN = "{CE89FED1-6E4E-41B0-95B2-C39295B6A6BD}"
+uk = "{CB7AB32F-5218-4B5A-982E-F1AA5F00CFC0}"
+uz = "{CD74D285-6FAB-4737-B8C3-2FAA2B0B047D}"
+ve = "{95AD70B2-CE4A-4362-975E-6C48DC70179C}"
+vi = "{9B664C3A-CD48-4717-A40D-3B02475D7E20}"
+xh = "{1BCF7835-9CD6-454E-9530-64222CCF29E7}"
zh-CN = "{5B45DC72-0755-4EC2-BB12-65A1FEADDDE7}"
zh-TW = "{08B2CED3-CFB5-491F-ADC4-FD0CD2366C60}"
-tr = "{46AB3EE6-FD98-460D-AE0B-6AE68ED6204D}"
-hi = "{2C70F320-6771-42D6-B3F5-97678C822B20}"
-ar = "{DF297699-3040-48E0-B0E6-B54385D76018}"
-he = "{13484272-CE60-4867-B494-D56F9049B95A}"
+zu = "{924D7527-25C6-4B95-95C7-7B68DABEC93E}"
multiwestern = "{385A1970-0257-4C57-9383-DD2D668B23CE}"
multiasia = "{74543111-6ABF-4A12-AC11-D315E2939D2A}"
diff --git a/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes_ooodev.txt b/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes_ooodev.txt
index 073fad35d282..f4bd9e6fbbec 100644
--- a/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes_ooodev.txt
+++ b/instsetoo_native/inc_ooolangpack/windows/msi_templates/codes_ooodev.txt
@@ -33,35 +33,120 @@ multiwestern = "{E404F8D3-5FC2-44BF-97F9-901A24DF6A3E}"
multiasia = "{714181AC-7DE5-49D3-AF09-292EB90DB750}"
[UPGRADECODE]
-en-US = "{5A5BF785-994C-44D0-A2D2-7C757C1E87B2}"
-pt = "{C62DBDBB-F1B6-4ACA-A0C6-D0B164A945CD}"
-ru = "{E1475570-6060-4EF8-834A-A241969A2061}"
+af = "{0FB73E2F-AB13-46C2-BA45-245A3F3A4750}"
+ar = "{2E0EFF99-3023-4734-9D56-4E7400898182}"
+as-IN = "{3A400267-1BAE-4912-9800-8C26FDD547DE}"
+be-BY = "{01CD6DF5-A3D9-4D76-B39D-02FEC0C439E5}"
+bo = "{18DE4A08-BD3A-433A-91B1-85998EA033F5}"
+bg = "{2DFA49FA-A3B6-44CA-A2BB-01DF463186D7}"
+br = "{77851653-0428-4A45-AE05-076D7D58E9B0}"
+brx = "{F2BC3BEC-6634-4F9E-B878-5008EC622E5C}"
+bn = "{C85CC50B-AD2E-4462-8517-36E499DF7CED}"
+bn-BD = "{3D4B1DA5-3846-49B0-8BEC-05869EF3F587}"
+bn-IN = "{2F8A7B29-EDC9-4681-B5B5-0DED9EA7E563}"
+bs = "{2AB403D8-19E9-46FD-A514-40FE49FFDD7C}"
+by = "{BFB3DBFA-B114-41D0-9C78-6BB85161A555}"
+ca = "{5032D03F-55BB-4CF5-ABDA-6AAB4002D12C}"
+cs = "{842F16E3-E4FA-4B23-AFA0-4DF9DE8CA4F8}"
+cy = "{EC0B288E-7A19-4CC3-9B5F-FA63413226B1}"
+da = "{3E8FFADF-A50E-4412-8613-5CFD55864FA3}"
+de = "{63512266-4861-42F3-9269-3FBCFB9F60B2}"
+dgo = "{69F5D053-0E5D-4260-A787-DBB78397D51D}"
+dz = "{EC70E449-B165-43DD-A4ED-34F07C8C1E12}"
el = "{8404A6EF-7E40-4B4C-86BC-450C51CFC8DA}"
-nl = "{6D3E7570-BA59-492D-A83D-9C3D7B457EE6}"
-fr = "{8374FA3E-5454-4060-AD5C-4D9978850194}"
+en-GB = "{DD5DD115-63B5-4C5A-984A-423C4A22F9AB}"
+en-US = "{5A5BF785-994C-44D0-A2D2-7C757C1E87B2}"
+en-ZA = "{83C0A05D-611C-4EEC-A80B-030F9F93C693}"
+eo = "{B891DEBE-300A-4CD5-8828-BE68529DE62E}"
es = "{D30FCA19-CD1F-4052-9D84-BB45C1C7C0DD}"
+et = "{60E1242E-CF22-4ABF-8ED4-F15BFAE31C72}"
+eu = "{A1662F7D-BF01-4F7C-83FB-BAB1B9B5D081}"
+fa = "{09F1B354-A2C1-434A-93ED-A8C0E480BE23}"
fi = "{071D642E-D898-4224-9EB5-353FC79EB6B5}"
+fr = "{8374FA3E-5454-4060-AD5C-4D9978850194}"
+ga = "{4AE98AD0-7D79-48E6-A819-75F7323261D5}"
+gd = "{2D44F336-E62D-41A1-A88B-0A8023217B19}"
+gl = "{97F43DDB-E046-4AC5-81BB-F64707098EE3}"
+gu = "{1FABFA47-C362-4AB1-9E26-C65B4511CF5A}"
+gu-IN = "{DB97DBBB-CC40-405A-A774-CC3F40C935A9}"
+he = "{A657505A-2A57-453B-8B47-F8D605A8AFE0}"
+hi = "{C0B220D1-2548-4E2C-BD7B-B7A14FE1C977}"
+hi-IN = "{EA2CB52A-E5AA-45E7-80C6-DE7EB76A1E5D}"
+hr = "{764043CA-CF26-4862-80BF-29E3AAD9E144}"
hu = "{03CBE5BA-E9C4-4CF3-8B36-7BEDB31F256A}"
-ca = "{5032D03F-55BB-4CF5-ABDA-6AAB4002D12C}"
+is = "{DF95762B-5307-4B85-B4C5-B144BB02C5FB}"
it = "{3F22750A-31C1-4C86-BD57-4A928A7F657E}"
-cs = "{842F16E3-E4FA-4B23-AFA0-4DF9DE8CA4F8}"
-sk = "{9AB7EEDB-11F5-4088-B581-FE711EDE6DCB}"
-en-GB = "{DD5DD115-63B5-4C5A-984A-423C4A22F9AB}"
-da = "{3E8FFADF-A50E-4412-8613-5CFD55864FA3}"
-sv = "{FD2E4280-BCFC-4109-A431-EC720C44A392}"
+ja = "{52E22B79-3C25-4BFF-BC5B-FC37EE5020DC}"
+kid = "{704FAB24-F8F9-4245-8BA7-1931B3176951}"
+ky = "{568D4A30-A1EC-4060-A8EE-41277EF3985C}"
+ka = "{C196B961-1F5F-438E-B764-73F91C6CAEA5}"
+kk = "{B63AD05D-90E5-45B5-B3FA-B69C47380E86}"
+km = "{3A469632-5FB9-4F99-AC5D-744B5D17C6D8}"
+kn = "{D62D8785-CAF0-4650-8EA1-D713D61CC299}"
+ko = "{02FDC794-9AE9-4D64-9312-FF2DE0EF3104}"
+kok = "{6D72F5E0-D1D1-4BF4-8357-E5DC50CC1067}"
+ks = "{4ED85F09-A3C9-4C63-A34B-A2AF16098825}"
+ku = "{D89A3F76-2161-44AA-8FD7-755E3033AC02}"
+lo = "{28FD3AC9-0676-46E6-97E7-5E06B0A3CF0C}"
+lt = "{4E8F4857-EB42-4D96-94AD-0058C817B5F2}"
+lv = "{6BF5ADF5-F75C-4E0A-8E16-9829D3B194FD}"
+mai = "{4D9B6646-80B7-48D1-BB19-684152EB3DA3}"
+mk = "{99F82176-F642-42A7-B0DF-052E7096A4F8}"
+mn = "{7ED4CD40-F9C3-4787-AFBD-FB42F1F9223D}"
+mni = "{031C2836-62D6-481F-B9D9-C0B3340280EC}"
+ms = "{FC4C1B4A-6571-4674-B5B2-6D42860D4DF6}"
+ml-IN = "{D3936188-9845-4AFD-A484-D6D634103917}"
+mr-IN = "{E5ADEAB5-42A1-41D6-AD58-92C17CAE411D}"
+my = "{5EB48BA3-4CFF-48CC-9301-DF5A99E901C8}"
+ne = "{384BCFE4-EDD0-4897-9924-82CB51E80381}"
+nb = "{DF312B1B-93E3-4903-8467-6DF2786F0009}"
+nl = "{6D3E7570-BA59-492D-A83D-9C3D7B457EE6}"
+nn = "{CB24EBA2-28FA-4EFF-9DD6-890D376F036A}"
no = "{A890155F-9333-4869-8816-D32720841A01}"
+nr = "{D6FACDDF-EF17-4773-A9A8-9B84A2E7E62C}"
+ns = "{16FE7611-2139-4D83-81DF-F6ED5A322F06}"
+om = "{CE5F3BEC-D59B-45CD-A451-A08E9F7018EA}"
+oc = "{A485C6CB-34A7-4969-A0AC-78241D417C95}"
+or-IN = "{2B3F3A48-231B-4AB6-B1CB-7FA173F704DB}"
+pap = "{DA0E5FD9-1C4D-4AB6-BA11-B34DFBB3FA17}"
+pa-IN = "{4FF51E79-A1C5-4D60-AE8D-A880483F4182}"
pl = "{F5019C24-CC86-4E86-84A5-53FF98539D04}"
-de = "{63512266-4861-42F3-9269-3FBCFB9F60B2}"
+ps = "{7AA8672E-9811-4ECD-828D-EB694373C72C}"
+pt = "{C62DBDBB-F1B6-4ACA-A0C6-D0B164A945CD}"
pt-BR = "{F7F75CB1-2123-4B5B-BC00-11440725B71B}"
+ru = "{E1475570-6060-4EF8-834A-A241969A2061}"
+rw = "{35BAFF73-3654-4E74-8E44-0F74842785DF}"
+sat = "{E34A52B2-ADAA-4C58-AC3B-9FD91C135BC2}"
+sa-IN = "{6732C0EC-1DC7-428C-BC7B-E1B752AD23E5}"
+si = "{E3F62111-0A68-4268-8850-C49B830A1E57}"
+sc = "{F585A19E-3AB9-496C-B06A-0CE6690148C8}"
+sd = "{43252725-3200-45AF-A99B-913F532BD9DF}"
+sk = "{9AB7EEDB-11F5-4088-B581-FE711EDE6DCB}"
+sl = "{E3363531-F96D-4756-88E8-240E9BFBD3B7}"
+sh = "{8E722E7F-6100-41F6-BCF2-0E8AF1405BF0}"
+sr = "{CB0957AD-996F-4B67-90C7-36E6288EEAB8}"
+ss = "{BF227916-E342-4307-91DB-97D72DE31233}"
+st = "{7B38DA39-FE10-43EC-A9B4-34470BD44252}"
+sv = "{FD2E4280-BCFC-4109-A431-EC720C44A392}"
+sw = "{D3689B53-4B06-443F-8A2B-7937E7514BC4}"
+sw-TZ = "{462A874C-20D9-45B5-970A-B93C922CFCD5}"
+te-IN = "{8916B89F-7763-4112-9820-B58BFF350D9B}"
+ti-ER = "{47D18328-E629-4E6E-9E64-BE6C37C89098}"
+ta-IN = "{DF4D12DF-EB5D-44C8-8E41-60DFEFF1E623}"
th = "{8A51A028-CFBE-4B1F-8C20-94E4A6D53675}"
-et = "{60E1242E-CF22-4ABF-8ED4-F15BFAE31C72}"
-ja = "{52E22B79-3C25-4BFF-BC5B-FC37EE5020DC}"
-ko = "{02FDC794-9AE9-4D64-9312-FF2DE0EF3104}"
+tn = "{BF0EB46F-05D8-4349-BEE8-57A0BFFE809E}"
+tr = "{6D6315EA-4B6F-4A62-AE4B-7197F6C00106}"
+ts = "{6824A943-F895-4F67-812C-0062BEF03E38}"
+tg = "{8AFD7661-482B-48DC-A103-5542A0D54B94}"
+ug = "{7C8A4BC9-0288-4CD2-B721-C43A283F5E52}"
+ur-IN = "{2E261973-B842-4C33-8FEE-1C2EC8D45451}"
+uk = "{AE29A49E-45F0-4BB4-82C9-77FFCA6394E3}"
+uz = "{CF6C8A15-A742-437F-9669-F8BE198873DF}"
+ve = "{C633A368-E04A-44EA-AFAF-15ADEDD8BF91}"
+vi = "{71643076-66F2-47E8-9826-0D378956568E}"
+xh = "{56F23458-B7E6-4D97-89F2-A5A56E605A6C}"
zh-CN = "{14D843EF-5A1D-4EE4-9BAB-EC0A7A6F96D0}"
zh-TW = "{98E66873-0C3E-4399-8676-A9D720071672}"
-tr = "{6D6315EA-4B6F-4A62-AE4B-7197F6C00106}"
-hi = "{C0B220D1-2548-4E2C-BD7B-B7A14FE1C977}"
-ar = "{2E0EFF99-3023-4734-9D56-4E7400898182}"
-he = "{A657505A-2A57-453B-8B47-F8D605A8AFE0}"
+zu = "{E317CFA7-4C92-4B3E-8528-8D44B2081C00}"
multiwestern = "{157A7FB6-A116-455C-AF18-3A46D8273B8D}"
multiiasia = "{E4C656E5-8F10-4A3A-B3A6-35C894DE637C}"
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt
index e3bb73b9ed90..80514fd1904b 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt
@@ -3,36 +3,121 @@ s72 i2 S64 S255
CustomAction Action
ISInitAllUsers 307 ALLUSERS 1
DontRemoveProducts 51 OLDPRODUCTS {}
-DontRemoveLpEnusProducts 51 O2LPENUS {}
-DontRemoveLpptProducts 51 O2LPPT {}
-DontRemoveLpruProducts 51 O2LPRU {}
+DontRemoveLpafProducts 51 O2LPAF {}
+DontRemoveLparProducts 51 O2LPAR {}
+DontRemoveLpasinProducts 51 O2LPASIN {}
+DontRemoveLpbebyProducts 51 O2LPBEBY {}
+DontRemoveLpboProducts 51 O2LPBO {}
+DontRemoveLpbgProducts 51 O2LPBG {}
+DontRemoveLpbrProducts 51 O2LPBR {}
+DontRemoveLpbrxProducts 51 O2LPBRX {}
+DontRemoveLpbnProducts 51 O2LPBN {}
+DontRemoveLpbnbdProducts 51 O2LPBNBD {}
+DontRemoveLpbninProducts 51 O2LPBNIN {}
+DontRemoveLpbsProducts 51 O2LPBS {}
+DontRemoveLpbyProducts 51 O2LPBY {}
+DontRemoveLpcaProducts 51 O2LPCA {}
+DontRemoveLpcsProducts 51 O2LPCS {}
+DontRemoveLpcyProducts 51 O2LPCY {}
+DontRemoveLpdaProducts 51 O2LPDA {}
+DontRemoveLpdeProducts 51 O2LPDE {}
+DontRemoveLpdgoProducts 51 O2LPDGO {}
+DontRemoveLpdzProducts 51 O2LPDZ {}
DontRemoveLpelProducts 51 O2LPEL {}
-DontRemoveLpnlProducts 51 O2LPNL {}
-DontRemoveLpfrProducts 51 O2LPFR {}
+DontRemoveLpengbProducts 51 O2LPENGB {}
+DontRemoveLpenusProducts 51 O2LPENUS {}
+DontRemoveLpenzaProducts 51 O2LPENZA {}
+DontRemoveLpeoProducts 51 O2LPEO {}
DontRemoveLpesProducts 51 O2LPES {}
+DontRemoveLpetProducts 51 O2LPET {}
+DontRemoveLpeuProducts 51 O2LPEU {}
+DontRemoveLpfaProducts 51 O2LPFA {}
DontRemoveLpfiProducts 51 O2LPFI {}
+DontRemoveLpfrProducts 51 O2LPFR {}
+DontRemoveLpgaProducts 51 O2LPGA {}
+DontRemoveLpgdProducts 51 O2LPGD {}
+DontRemoveLpglProducts 51 O2LPGL {}
+DontRemoveLpguProducts 51 O2LPGU {}
+DontRemoveLpguinProducts 51 O2LPGUIN {}
+DontRemoveLpheProducts 51 O2LPHE {}
+DontRemoveLphiProducts 51 O2LPHI {}
+DontRemoveLphiinProducts 51 O2LPHIIN {}
+DontRemoveLphrProducts 51 O2LPHR {}
DontRemoveLphuProducts 51 O2LPHU {}
-DontRemoveLpcaProducts 51 O2LPCA {}
+DontRemoveLpisProducts 51 O2LPIS {}
DontRemoveLpitProducts 51 O2LPIT {}
-DontRemoveLpcsProducts 51 O2LPCS {}
-DontRemoveLpskProducts 51 O2LPSK {}
-DontRemoveLpengbProducts 51 O2LPENGB {}
-DontRemoveLpdaProducts 51 O2LPDA {}
-DontRemoveLpsvProducts 51 O2LPSV {}
+DontRemoveLpjaProducts 51 O2LPJA {}
+DontRemoveLpkidProducts 51 O2LPKID {}
+DontRemoveLpkyProducts 51 O2LPKY {}
+DontRemoveLpkaProducts 51 O2LPKA {}
+DontRemoveLpkkProducts 51 O2LPKK {}
+DontRemoveLpkmProducts 51 O2LPKM {}
+DontRemoveLpknProducts 51 O2LPKN {}
+DontRemoveLpkoProducts 51 O2LPKO {}
+DontRemoveLpkokProducts 51 O2LPKOK {}
+DontRemoveLpksProducts 51 O2LPKS {}
+DontRemoveLpkuProducts 51 O2LPKU {}
+DontRemoveLploProducts 51 O2LPLO {}
+DontRemoveLpltProducts 51 O2LPLT {}
+DontRemoveLplvProducts 51 O2LPLV {}
+DontRemoveLpmaiProducts 51 O2LPMAI {}
+DontRemoveLpmkProducts 51 O2LPMK {}
+DontRemoveLpmnProducts 51 O2LPMN {}
+DontRemoveLpmniProducts 51 O2LPMNI {}
+DontRemoveLpmsProducts 51 O2LPMS {}
+DontRemoveLpmlinProducts 51 O2LPMLIN {}
+DontRemoveLpmrinProducts 51 O2LPMRIN {}
+DontRemoveLpmyProducts 51 O2LPMY {}
+DontRemoveLpneProducts 51 O2LPNE {}
+DontRemoveLpnbProducts 51 O2LPNB {}
+DontRemoveLpnlProducts 51 O2LPNL {}
+DontRemoveLpnnProducts 51 O2LPNN {}
DontRemoveLpnoProducts 51 O2LPNO {}
+DontRemoveLpnrProducts 51 O2LPNR {}
+DontRemoveLpnsProducts 51 O2LPNS {}
+DontRemoveLpomProducts 51 O2LPOM {}
+DontRemoveLpocProducts 51 O2LPOC {}
+DontRemoveLporinProducts 51 O2LPORIN {}
+DontRemoveLppapProducts 51 O2LPPAP {}
+DontRemoveLppainProducts 51 O2LPPAIN {}
DontRemoveLpplProducts 51 O2LPPL {}
-DontRemoveLpdeProducts 51 O2LPDE {}
+DontRemoveLppsProducts 51 O2LPPS {}
+DontRemoveLpptProducts 51 O2LPPT {}
DontRemoveLpptbrProducts 51 O2LPPTBR {}
+DontRemoveLpruProducts 51 O2LPRU {}
+DontRemoveLprwProducts 51 O2LPRW {}
+DontRemoveLpsatProducts 51 O2LPSAT {}
+DontRemoveLpsainProducts 51 O2LPSAIN {}
+DontRemoveLpsiProducts 51 O2LPSI {}
+DontRemoveLpscProducts 51 O2LPSC {}
+DontRemoveLpsdProducts 51 O2LPSD {}
+DontRemoveLpskProducts 51 O2LPSK {}
+DontRemoveLpslProducts 51 O2LPSL {}
+DontRemoveLpshProducts 51 O2LPSH {}
+DontRemoveLpsrProducts 51 O2LPSR {}
+DontRemoveLpssProducts 51 O2LPSS {}
+DontRemoveLpstProducts 51 O2LPST {}
+DontRemoveLpsvProducts 51 O2LPSV {}
+DontRemoveLpswProducts 51 O2LPSW {}
+DontRemoveLpswtzProducts 51 O2LPSWTZ {}
+DontRemoveLpteinProducts 51 O2LPTEIN {}
+DontRemoveLptierProducts 51 O2LPTIER {}
+DontRemoveLptainProducts 51 O2LPTAIN {}
DontRemoveLpthProducts 51 O2LPTH {}
-DontRemoveLpetProducts 51 O2LPET {}
-DontRemoveLpjaProducts 51 O2LPJA {}
-DontRemoveLpkoProducts 51 O2LPKO {}
+DontRemoveLptnProducts 51 O2LPTN {}
+DontRemoveLptrProducts 51 O2LPTR {}
+DontRemoveLptsProducts 51 O2LPTS {}
+DontRemoveLptgProducts 51 O2LPTG {}
+DontRemoveLpugProducts 51 O2LPUG {}
+DontRemoveLpurinProducts 51 O2LPURIN {}
+DontRemoveLpukProducts 51 O2LPUK {}
+DontRemoveLpuzProducts 51 O2LPUZ {}
+DontRemoveLpveProducts 51 O2LPVE {}
+DontRemoveLpviProducts 51 O2LPVI {}
+DontRemoveLpxhProducts 51 O2LPXH {}
DontRemoveLpzhcnProducts 51 O2LPZHCN {}
DontRemoveLpzhtwProducts 51 O2LPZHTW {}
-DontRemoveLptrProducts 51 O2LPTR {}
-DontRemoveLphiProducts 51 O2LPHI {}
-DontRemoveLparProducts 51 O2LPAR {}
-DontRemoveLpheProducts 51 O2LPHE {}
+DontRemoveLpzuProducts 51 O2LPZU {}
setAllUsersProfile2K 51 ALLUSERSPROFILE [%ALLUSERSPROFILE]
SetAllUsersProfileNT 51 ALLUSERSPROFILE [%SystemRoot]\Profiles\All Users
setUserProfileNT 51 USERPROFILE [%USERPROFILE]
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/InstallE.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/InstallE.idt
index 9459e79e283d..11f97a0bb797 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/InstallE.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/InstallE.idt
@@ -11,36 +11,121 @@ CreateFolders 1850
CreateShortcuts 2150
DeleteServices VersionNT 1000
DontRemoveProducts REMOVEOLDPRODUCTS<>"1" 155
-DontRemoveLpEnusProducts REMOVEOLDPRODUCTS<>"1" 157
-DontRemoveLpptProducts REMOVEOLDPRODUCTS<>"1" 158
-DontRemoveLpruProducts REMOVEOLDPRODUCTS<>"1" 159
+DontRemoveLpafProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLparProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpasinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbebyProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpboProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbgProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbrxProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbnProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbnbdProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbninProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpbyProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpcaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpcsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpcyProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpdaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpdeProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpdgoProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpdzProducts REMOVEOLDPRODUCTS<>"1" 160
DontRemoveLpelProducts REMOVEOLDPRODUCTS<>"1" 160
-DontRemoveLpnlProducts REMOVEOLDPRODUCTS<>"1" 161
-DontRemoveLpfrProducts REMOVEOLDPRODUCTS<>"1" 162
-DontRemoveLpesProducts REMOVEOLDPRODUCTS<>"1" 163
-DontRemoveLpfiProducts REMOVEOLDPRODUCTS<>"1" 164
-DontRemoveLphuProducts REMOVEOLDPRODUCTS<>"1" 165
-DontRemoveLpcaProducts REMOVEOLDPRODUCTS<>"1" 166
-DontRemoveLpitProducts REMOVEOLDPRODUCTS<>"1" 167
-DontRemoveLpcsProducts REMOVEOLDPRODUCTS<>"1" 168
-DontRemoveLpskProducts REMOVEOLDPRODUCTS<>"1" 169
-DontRemoveLpengbProducts REMOVEOLDPRODUCTS<>"1" 170
-DontRemoveLpdaProducts REMOVEOLDPRODUCTS<>"1" 171
-DontRemoveLpsvProducts REMOVEOLDPRODUCTS<>"1" 172
-DontRemoveLpnoProducts REMOVEOLDPRODUCTS<>"1" 173
-DontRemoveLpplProducts REMOVEOLDPRODUCTS<>"1" 174
-DontRemoveLpdeProducts REMOVEOLDPRODUCTS<>"1" 175
-DontRemoveLpptbrProducts REMOVEOLDPRODUCTS<>"1" 176
-DontRemoveLpthProducts REMOVEOLDPRODUCTS<>"1" 177
-DontRemoveLpetProducts REMOVEOLDPRODUCTS<>"1" 178
-DontRemoveLpjaProducts REMOVEOLDPRODUCTS<>"1" 179
-DontRemoveLpkoProducts REMOVEOLDPRODUCTS<>"1" 180
-DontRemoveLpzhcnProducts REMOVEOLDPRODUCTS<>"1" 181
-DontRemoveLpzhtwProducts REMOVEOLDPRODUCTS<>"1" 182
-DontRemoveLptrProducts REMOVEOLDPRODUCTS<>"1" 183
-DontRemoveLphiProducts REMOVEOLDPRODUCTS<>"1" 184
-DontRemoveLparProducts REMOVEOLDPRODUCTS<>"1" 185
-DontRemoveLpheProducts REMOVEOLDPRODUCTS<>"1" 186
+DontRemoveLpengbProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpenusProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpenzaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpeoProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpesProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpetProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpeuProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpfaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpfiProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpfrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpgaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpgdProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpglProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpguProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpguinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpheProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLphiProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLphiinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLphrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLphuProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpisProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpitProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpjaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkidProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkyProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkaProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkkProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkmProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpknProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkoProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkokProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpksProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpkuProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLploProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpltProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLplvProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmaiProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmkProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmnProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmniProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmlinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmrinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpmyProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpneProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnbProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnlProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnnProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnoProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpnsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpomProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpocProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLporinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLppapProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLppainProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpplProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLppsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpptProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpptbrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpruProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLprwProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsatProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsainProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsiProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpscProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsdProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpskProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpslProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpshProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpssProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpstProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpsvProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpswProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpswtzProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpteinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptierProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptainProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpthProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptnProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptrProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptsProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLptgProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpugProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpurinProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpukProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpuzProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpveProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpviProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpxhProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpzhcnProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpzhtwProducts REMOVEOLDPRODUCTS<>"1" 160
+DontRemoveLpzuProducts REMOVEOLDPRODUCTS<>"1" 160
DuplicateFiles 2050
FileCost 400
FindRelatedProducts NOT ISSETUPDRIVEN 100
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/upgradecode_remove_ooo.txt b/instsetoo_native/inc_openoffice/windows/msi_templates/upgradecode_remove_ooo.txt
index dfa79a346674..5f26cbd5d04c 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/upgradecode_remove_ooo.txt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/upgradecode_remove_ooo.txt
@@ -4,33 +4,118 @@
# s38 S20 S20 S255 i4 S255 s72
# Upgrade UpgradeCode VersionMin VersionMax Language Attributes
-{8B909084-2220-49AC-A421-142180519088} 3.0.0 0 O2LPENUS
-{CBFA6A61-D310-4A90-8F49-C7BE2735D58D} 3.0.0 0 O2LPPT
-{DF67ADAA-4755-4184-9E32-1020F40DDA81} 3.0.0 0 O2LPRU
+{3E85B9F2-0AC3-4E57-8072-260A6FE05D02} 3.0.0 0 O2LPAF
+{DF297699-3040-48E0-B0E6-B54385D76018} 3.0.0 0 O2LPAR
+{62E2F6A6-4521-4E36-A751-46E91A58CFB5} 3.0.0 0 O2LPASIN
+{E6DC8D4C-F68E-4BE1-8F00-F0C84ED0F974} 3.0.0 0 O2LPBEBY
+{5F9461CD-2937-4EE0-AF03-24E72987244E} 3.0.0 0 O2LPBO
+{29FF0FAA-B831-4398-BE3F-FC13949D1CAE} 3.0.0 0 O2LPBG
+{6E4658DD-79B0-4707-93C2-B022D66157A1} 3.0.0 0 O2LPBR
+{6DD492EA-45CD-483E-8563-23355FD37E28} 3.0.0 0 O2LPBRX
+{4D1449E7-D10B-44D8-AAB0-257D6930B0C2} 3.0.0 0 O2LPBN
+{3195C77E-8462-45DA-BEFC-37F1299D889E} 3.0.0 0 O2LPBNBD
+{763F5343-47FC-4909-8C18-D9E0CEED533A} 3.0.0 0 O2LPBNIN
+{DCC737A4-531E-4DCD-A3C4-376DA4C76D00} 3.0.0 0 O2LPBS
+{F190162C-DCD0-4266-B9AB-1B1FD7C24C2E} 3.0.0 0 O2LPBY
+{8EEC9A45-3BD3-431F-81D0-394F41185BD9} 3.0.0 0 O2LPCA
+{DBA607B3-0805-4A18-A45D-769C70D90AB7} 3.0.0 0 O2LPCS
+{3CE6CA2E-6ECF-45BC-B26A-348FA03A25D3} 3.0.0 0 O2LPCY
+{4E7025EF-909F-4609-97BA-304684C4833D} 3.0.0 0 O2LPDA
+{481E648E-D8AD-478A-A3F6-68FC563FFD8F} 3.0.0 0 O2LPDE
+{205ADC32-F775-476A-B68E-949F85D0B0E3} 3.0.0 0 O2LPDGO
+{3D391D0A-66D3-4141-8554-65DECA138208} 3.0.0 0 O2LPDZ
{39772F91-1D37-4866-BBA4-900AB53590B0} 3.0.0 0 O2LPEL
-{7D14314D-DAF7-4A97-A6EE-97C475080A73} 3.0.0 0 O2LPNL
-{B0FDE9B8-D066-4FB2-885D-615A6D58E02F} 3.0.0 0 O2LPFR
+{E60BC5AC-2513-40AF-A41B-64118A287662} 3.0.0 0 O2LPENGB
+{8B909084-2220-49AC-A421-142180519088} 3.0.0 0 O2LPENUS
+{047EB419-DF2F-4D02-A3B5-E1B2FAFEDC93} 3.0.0 0 O2LPENZA
+{A256340D-4065-4B6F-AC1D-EB0D5127EBCE} 3.0.0 0 O2LPEO
{01588DD5-C6C5-4C9D-A1BD-1A63E779DA1A} 3.0.0 0 O2LPES
+{34FBD5D3-3F88-4C91-8B9B-A10AE833250F} 3.0.0 0 O2LPET
+{A73CB85E-760B-4E5D-AB26-7DF091C25F16} 3.0.0 0 O2LPEU
+{12D1FE4A-95E1-4BED-B377-2E8EA93B2461} 3.0.0 0 O2LPFA
{481B0FE0-8313-442E-8A53-7C5139ADA3DC} 3.0.0 0 O2LPFI
+{B0FDE9B8-D066-4FB2-885D-615A6D58E02F} 3.0.0 0 O2LPFR
+{39B343FE-EC1F-451E-930A-47D85E96DE67} 3.0.0 0 O2LPGA
+{DE408221-68E9-418D-9B20-10BE458268F2} 3.0.0 0 O2LPGD
+{38616841-D0DB-4768-B9B8-27D61A91FB47} 3.0.0 0 O2LPGL
+{382A0F08-CF86-45C4-8119-67C87E275EFE} 3.0.0 0 O2LPGU
+{25FF47C5-9FBB-4FBA-89FC-D0FB73336E2B} 3.0.0 0 O2LPGUIN
+{13484272-CE60-4867-B494-D56F9049B95A} 3.0.0 0 O2LPHE
+{2C70F320-6771-42D6-B3F5-97678C822B20} 3.0.0 0 O2LPHI
+{DDAB0849-CC63-475C-AC87-388B93579A28} 3.0.0 0 O2LPHIIN
+{0750A25E-7492-4681-8DFD-E04E89E45C0A} 3.0.0 0 O2LPHR
{5981EE94-6763-40AD-A8A0-EEB01CCA153C} 3.0.0 0 O2LPHU
-{8EEC9A45-3BD3-431F-81D0-394F41185BD9} 3.0.0 0 O2LPCA
+{ED6D0C4C-2746-40A9-A672-4D9950C421C0} 3.0.0 0 O2LPIS
{50087605-A504-441B-B514-67F13A284C10} 3.0.0 0 O2LPIT
-{DBA607B3-0805-4A18-A45D-769C70D90AB7} 3.0.0 0 O2LPCS
-{19B49960-B58C-48A7-9761-F0B325E00C31} 3.0.0 0 O2LPSK
-{E60BC5AC-2513-40AF-A41B-64118A287662} 3.0.0 0 O2LPENGB
-{4E7025EF-909F-4609-97BA-304684C4833D} 3.0.0 0 O2LPDA
-{5E751B0D-FE96-4D0E-BAC1-5E7501294940} 3.0.0 0 O2LPSV
+{74F683CC-8356-4BF7-9098-B85AAB7C1A0C} 3.0.0 0 O2LPJA
+{1A4DA798-78EB-46B8-A5CE-4E32F883314C} 3.0.0 0 O2LPKID
+{3110031F-1B5D-4457-BB5C-F6A330F15419} 3.0.0 0 O2LPKY
+{08E10841-B5EF-4BF9-9688-AE25573E6DA7} 3.0.0 0 O2LPKA
+{1527983C-2953-45B4-87A5-C7D67A1F6C60} 3.0.0 0 O2LPKK
+{B4E6E1AC-C45E-48BB-A038-073C32693B65} 3.0.0 0 O2LPKM
+{28FDEA4F-1DAB-4EAC-986E-604B7BB6EF11} 3.0.0 0 O2LPKN
+{1D068BF9-FBCF-4A3B-B9A4-4B2DD3DE8CFB} 3.0.0 0 O2LPKO
+{CC3129BA-331A-42CC-8569-93F9E05B6400} 3.0.0 0 O2LPKOK
+{BADB1F2A-B03A-4521-9A4A-61C3EDD365EC} 3.0.0 0 O2LPKS
+{2C5FB742-9A33-410D-AC5C-A376D4967D69} 3.0.0 0 O2LPKU
+{3968BFB2-35F7-4BBC-9E3E-C640BF09587D} 3.0.0 0 O2LPLO
+{3526DA6A-7EA6-471C-973E-C0461DE85909} 3.0.0 0 O2LPLT
+{BC085A1A-38A6-462A-889F-6E7CA442D9D8} 3.0.0 0 O2LPLV
+{BE522738-E05A-431A-B535-29349EBF86AE} 3.0.0 0 O2LPMAI
+{9B8D68D5-6903-4C22-AC8F-CA0D2D124FD8} 3.0.0 0 O2LPMK
+{A9E2C897-8193-4DBD-9FDE-F9BE9AB7F92E} 3.0.0 0 O2LPMN
+{3CBD068D-E6AE-4C02-8091-DD4F2866336A} 3.0.0 0 O2LPMNI
+{F300CABB-ED67-468E-A336-87DEC6E22CFC} 3.0.0 0 O2LPMS
+{F2F04B66-9996-425D-A026-0AE99F5DB878} 3.0.0 0 O2LPMLIN
+{4B87A651-94B3-48DF-800C-9458C3A93179} 3.0.0 0 O2LPMRIN
+{E1C174A0-8126-43A8-B696-9F9DE676E1ED} 3.0.0 0 O2LPMY
+{FF4DA93A-205F-40A2-9F01-2A5EB6663E6C} 3.0.0 0 O2LPNE
+{6E732530-FCDD-484C-A575-1289731020FD} 3.0.0 0 O2LPNB
+{7D14314D-DAF7-4A97-A6EE-97C475080A73} 3.0.0 0 O2LPNL
+{2F1F8A99-B3C4-4F22-BB08-5F0D217C0BE5} 3.0.0 0 O2LPNN
{00C1656C-6386-42ED-BE8C-5D6C553EF125} 3.0.0 0 O2LPNO
+{0E64C806-9EB2-4651-BB94-B8D9814FD9E5} 3.0.0 0 O2LPNR
+{5142883F-6084-4723-907B-EFD4A5097817} 3.0.0 0 O2LPNS
+{8D6EE539-9E74-41C0-8DED-807F91D68467} 3.0.0 0 O2LPOM
+{73B96B61-E98E-4BB1-8E16-BABEBF6D58FB} 3.0.0 0 O2LPOC
+{11771BE2-44D3-4ACD-882B-26C4947237C5} 3.0.0 0 O2LPORIN
+{C4AC769D-F356-4D1A-A3A4-62E6729CF403} 3.0.0 0 O2LPPAP
+{1869854A-30BE-40EF-B72C-AF0CCA1A5A91} 3.0.0 0 O2LPPAIN
{9C92258E-9A41-4A03-AA5C-FD8EF15189BA} 3.0.0 0 O2LPPL
-{481E648E-D8AD-478A-A3F6-68FC563FFD8F} 3.0.0 0 O2LPDE
+{277B630B-64D9-4105-A542-6F279A31A72C} 3.0.0 0 O2LPPS
+{CBFA6A61-D310-4A90-8F49-C7BE2735D58D} 3.0.0 0 O2LPPT
{7364F154-089D-400B-B275-751AAB9A6122} 3.0.0 0 O2LPPTBR
+{DF67ADAA-4755-4184-9E32-1020F40DDA81} 3.0.0 0 O2LPRU
+{D1D013B7-9570-4165-8421-BBDC97842260} 3.0.0 0 O2LPRW
+{233A2442-D417-458E-A67F-4C3E58B54387} 3.0.0 0 O2LPSAT
+{180CEB68-8F15-4533-B2C2-43D47DED7ABB} 3.0.0 0 O2LPSAIN
+{6CFE884D-10C2-42F7-A60F-52A8284E8D45} 3.0.0 0 O2LPSI
+{AC0B0CE3-DF64-4CCF-88EC-CBF594D63183} 3.0.0 0 O2LPSC
+{638AEB7C-B611-4DBE-AD2C-A91BB7D13B75} 3.0.0 0 O2LPSD
+{19B49960-B58C-48A7-9761-F0B325E00C31} 3.0.0 0 O2LPSK
+{0FBEEB90-0C80-4C77-8CEE-E6347CC465FD} 3.0.0 0 O2LPSL
+{8DA3BE37-E70B-41BD-BBBC-C2169FBE01F4} 3.0.0 0 O2LPSH
+{49A004A2-3B8B-4029-B403-89919CB52355} 3.0.0 0 O2LPSR
+{5B0E4353-AB4E-497E-B38F-2E784C7B1F35} 3.0.0 0 O2LPSS
+{FC92FF2C-0E4B-4EB1-A962-682861EE4C33} 3.0.0 0 O2LPST
+{5E751B0D-FE96-4D0E-BAC1-5E7501294940} 3.0.0 0 O2LPSV
+{90672FAA-14CA-4F63-8FE9-40E572A3969A} 3.0.0 0 O2LPSW
+{905F971E-91FC-4F85-90D6-F6217A4FF01A} 3.0.0 0 O2LPSWTZ
+{79ADE5C5-96C5-4CAB-B8A3-1024E6A639E7} 3.0.0 0 O2LPTEIN
+{1FEF45BC-1315-46F4-B89B-6660226758DE} 3.0.0 0 O2LPTIER
+{76D5C227-D097-4B4E-B4C7-B2370B4F7932} 3.0.0 0 O2LPTAIN
{1F9BC074-55AA-496A-9EC5-05E65CF64AE6} 3.0.0 0 O2LPTH
-{34FBD5D3-3F88-4C91-8B9B-A10AE833250F} 3.0.0 0 O2LPET
-{74F683CC-8356-4BF7-9098-B85AAB7C1A0C} 3.0.0 0 O2LPJA
-{1D068BF9-FBCF-4A3B-B9A4-4B2DD3DE8CFB} 3.0.0 0 O2LPKO
+{685C3085-DCD2-40F6-85C9-5084402D7E0F} 3.0.0 0 O2LPTN
+{46AB3EE6-FD98-460D-AE0B-6AE68ED6204D} 3.0.0 0 O2LPTR
+{AC285965-9D0F-4D55-8885-0F0A9B9888B1} 3.0.0 0 O2LPTS
+{6C238E70-72FA-45FA-BC58-C508CD3AF6FC} 3.0.0 0 O2LPTG
+{57836D3D-879A-4288-8C47-691ECC4EECBE} 3.0.0 0 O2LPUG
+{CE89FED1-6E4E-41B0-95B2-C39295B6A6BD} 3.0.0 0 O2LPURIN
+{CB7AB32F-5218-4B5A-982E-F1AA5F00CFC0} 3.0.0 0 O2LPUK
+{CD74D285-6FAB-4737-B8C3-2FAA2B0B047D} 3.0.0 0 O2LPUZ
+{95AD70B2-CE4A-4362-975E-6C48DC70179C} 3.0.0 0 O2LPVE
+{9B664C3A-CD48-4717-A40D-3B02475D7E20} 3.0.0 0 O2LPVI
+{1BCF7835-9CD6-454E-9530-64222CCF29E7} 3.0.0 0 O2LPXH
{5B45DC72-0755-4EC2-BB12-65A1FEADDDE7} 3.0.0 0 O2LPZHCN
{08B2CED3-CFB5-491F-ADC4-FD0CD2366C60} 3.0.0 0 O2LPZHTW
-{46AB3EE6-FD98-460D-AE0B-6AE68ED6204D} 3.0.0 0 O2LPTR
-{2C70F320-6771-42D6-B3F5-97678C822B20} 3.0.0 0 O2LPHI
-{DF297699-3040-48E0-B0E6-B54385D76018} 3.0.0 0 O2LPAR
-{13484272-CE60-4867-B494-D56F9049B95A} 3.0.0 0 O2LPHE
+{924D7527-25C6-4B95-95C7-7B68DABEC93E} 3.0.0 0 O2LPZU
diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index f316b44d3b4d..7897327d8de8 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -300,7 +300,7 @@ OpenOffice_SDK
PACK_INSTALLED 1
POOLPRODUCT 0
DMG_VOLUMEEXTENSION SDK
- DATABASENAME openofficeorg32sdk
+ DATABASENAME openofficeorg33sdk
NO_README_IN_ROOTDIR 1
LICENSENAME LGPL
IGNOREDIRECTORYLAYER 1
@@ -349,7 +349,7 @@ OpenOffice_Dev_SDK
PACK_INSTALLED 1
POOLPRODUCT 0
DMG_VOLUMEEXTENSION SDK
- DATABASENAME openofficeorg32devsdk
+ DATABASENAME openofficeorg33devsdk
NO_README_IN_ROOTDIR 1
LICENSENAME LGPL
IGNOREDIRECTORYLAYER 1
diff --git a/jpeg/jpeg-6b.patch b/jpeg/jpeg-6b.patch
index c1a0f8010669..1180e7a63115 100644
--- a/jpeg/jpeg-6b.patch
+++ b/jpeg/jpeg-6b.patch
@@ -18,111 +18,6 @@
+#undef RIGHT_SHIFT_IS_UNSIGNED
+#define NO_GETENV
+#endif
---- misc/jpeg-6b/jdcolor.c 1997-08-04 01:39:16.000000000 +0200
-+++ misc/build/jpeg-6b/jdcolor.c 2009-03-19 11:30:30.000000000 +0100
-@@ -284,6 +284,90 @@
- }
- }
-
-+METHODDEF(void)
-+ycck_rgb_convert (j_decompress_ptr cinfo,
-+ JSAMPIMAGE input_buf, JDIMENSION input_row,
-+ JSAMPARRAY output_buf, int num_rows)
-+{
-+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
-+ JDIMENSION num_cols = cinfo->output_width;
-+ long cc, cm, cy, ck;
-+ long y, cb, cr;
-+ register JSAMPROW outptr;
-+ register JSAMPROW inptr0, inptr1, inptr2, inptr3;
-+ register JDIMENSION col;
-+ register JSAMPLE* range_limit = cinfo->sample_range_limit;
-+ register int* Crrtab = cconvert->Cr_r_tab;
-+ register int* Cbbtab = cconvert->Cb_b_tab;
-+ register INT32* Crgtab = cconvert->Cr_g_tab;
-+ register INT32* Cbgtab = cconvert->Cb_g_tab;
-+ SHIFT_TEMPS
-+
-+ while( --num_rows >= 0 )
-+ {
-+ inptr0 = input_buf[0][input_row];
-+ inptr1 = input_buf[1][input_row];
-+ inptr2 = input_buf[2][input_row];
-+ inptr3 = input_buf[3][input_row++];
-+
-+ for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
-+ {
-+ y = GETJSAMPLE(inptr0[col]);
-+ cb = GETJSAMPLE(inptr1[col]);
-+ cr = GETJSAMPLE(inptr2[col]);
-+
-+ // YCCK => CMYK
-+ cc = 255L - range_limit[MAXJSAMPLE - (y + Crrtab[cr])];
-+ cm = 255L - range_limit[MAXJSAMPLE - (y + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS)))];
-+ cy = 255L - range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];
-+ ck = 255L - inptr3[col];
-+
-+ // CMYK => RGB
-+ outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
-+ outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
-+ outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
-+ outptr += RGB_PIXELSIZE;
-+ }
-+ }
-+}
-+
-+METHODDEF(void)
-+cmyk_rgb_convert (j_decompress_ptr cinfo,
-+ JSAMPIMAGE input_buf, JDIMENSION input_row,
-+ JSAMPARRAY output_buf, int num_rows)
-+{
-+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
-+ JDIMENSION num_cols = cinfo->output_width;
-+ long cc, cm, cy, ck;
-+ long y, cb, cr;
-+ register JSAMPROW outptr;
-+ register JSAMPROW inptr0, inptr1, inptr2, inptr3;
-+ register JDIMENSION col;
-+ register JSAMPLE* range_limit = cinfo->sample_range_limit;
-+ SHIFT_TEMPS
-+
-+ while( --num_rows >= 0 )
-+ {
-+ inptr0 = input_buf[0][input_row];
-+ inptr1 = input_buf[1][input_row];
-+ inptr2 = input_buf[2][input_row];
-+ inptr3 = input_buf[3][input_row++];
-+
-+ for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
-+ {
-+ cc = 255 - GETJSAMPLE(inptr0[col]);
-+ cm = 255 - GETJSAMPLE(inptr1[col]);
-+ cy = 255 - GETJSAMPLE(inptr2[col]);
-+ ck = 255 - GETJSAMPLE(inptr3[col]);
-+
-+ // CMYK => RGB
-+ outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
-+ outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
-+ outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
-+ outptr += RGB_PIXELSIZE;
-+ }
-+ }
-+}
-
- /*
- * Empty method for start_pass.
-@@ -364,6 +448,11 @@
- cconvert->pub.color_convert = gray_rgb_convert;
- } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
- cconvert->pub.color_convert = null_convert;
-+ } else if (cinfo->jpeg_color_space == JCS_YCCK) {
-+ cconvert->pub.color_convert = ycck_rgb_convert;
-+ build_ycc_rgb_table(cinfo);
-+ } else if (cinfo->jpeg_color_space == JCS_CMYK) {
-+ cconvert->pub.color_convert = cmyk_rgb_convert;
- } else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
--- misc/jpeg-6b/jmorecfg.h 1997-08-10 01:58:56.000000000 +0200
+++ misc/build/jpeg-6b/jmorecfg.h 2009-03-19 11:30:30.000000000 +0100
@@ -157,8 +157,8 @@
@@ -136,18 +31,6 @@
#endif
/* Datatype used for image dimensions. The JPEG standard only supports
-@@ -311,9 +311,9 @@
- * can't use color quantization if you change that value.
- */
-
--#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
-+#define RGB_RED 2 /* Offset of Red in an RGB scanline element */
- #define RGB_GREEN 1 /* Offset of Green */
--#define RGB_BLUE 2 /* Offset of Blue */
-+#define RGB_BLUE 0 /* Offset of Blue */
- #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
-
-
--- misc/jpeg-6b/makefile.mk 2009-03-19 11:30:46.000000000 +0100
+++ misc/build/jpeg-6b/makefile.mk 2009-03-19 11:30:30.000000000 +0100
@@ -1 +1,76 @@
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index f84bcb4f9ec0..896342b5389d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -175,7 +175,7 @@ rtl::OUString getRuntimeLib(const rtl::ByteSequence & data)
jmp_buf jmp_jvm_abort;
sig_atomic_t g_bInGetJavaVM = 0;
-void abort_handler()
+extern "C" void JNICALL abort_handler()
{
// If we are within JNI_CreateJavaVM then we jump back into getJavaVM
if( g_bInGetJavaVM != 0 )
@@ -508,20 +508,6 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
return JFW_PLUGIN_E_VM_CREATION_FAILED;
}
- // The office sets a signal handler at startup. That causes a crash
- // with java 1.3 under Solaris. To make it work, we set back the
- // handler
-#ifdef UNX
- struct sigaction act;
- act.sa_handler=SIG_DFL;
- act.sa_flags= 0;
- sigaction( SIGSEGV, &act, NULL);
- sigaction( SIGPIPE, &act, NULL);
- sigaction( SIGBUS, &act, NULL);
- sigaction( SIGILL, &act, NULL);
- sigaction( SIGFPE, &act, NULL);
-#endif
-
// Some testing with Java 1.4 showed that JavaVMOption.optionString has to
// be encoded with the system encoding (i.e., osl_getThreadTextEncoding):
JavaVMInitArgs vm_args;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index a911b75f85ab..bd49956c8baf 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -124,7 +124,7 @@ extern VendorSupportMapEntry gVendorMap[];
bool getSDKInfoFromRegistry(vector<OUString> & vecHome);
bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome);
-rtl::OUString decodeOutput(const rtl::OString& s);
+bool decodeOutput(const rtl::OString& s, rtl::OUString* out);
@@ -452,7 +452,9 @@ bool getJavaProps(const OUString & exePath,
break;
JFW_TRACE2(OString("[Java framework] line:\" ")
+ aLine + OString(" \".\n"));
- OUString sLine = decodeOutput(aLine);
+ OUString sLine;
+ if (!decodeOutput(aLine, &sLine))
+ continue;
JFW_TRACE2(OString("[Java framework] line:\" ")
+ OString( CHAR_POINTER(sLine)) + OString(" \".\n"));
sLine = sLine.trim();
@@ -486,8 +488,9 @@ bool getJavaProps(const OUString & exePath,
readable strings. The strings are encoded as integer values separated
by spaces.
*/
-rtl::OUString decodeOutput(const rtl::OString& s)
+bool decodeOutput(const rtl::OString& s, rtl::OUString* out)
{
+ OSL_ASSERT(out != 0);
OUStringBuffer buff(512);
sal_Int32 nIndex = 0;
do
@@ -495,14 +498,19 @@ rtl::OUString decodeOutput(const rtl::OString& s)
OString aToken = s.getToken( 0, ' ', nIndex );
if (aToken.getLength())
{
+ for (sal_Int32 i = 0; i < aToken.getLength(); ++i)
+ {
+ if (aToken[i] < '0' || aToken[i] > '9')
+ return false;
+ }
sal_Unicode value = (sal_Unicode)(aToken.toInt32());
buff.append(value);
}
} while (nIndex >= 0);
- OUString sDecoded(buff.makeStringAndClear());
- JFW_TRACE2(sDecoded);
- return sDecoded;
+ *out = buff.makeStringAndClear();
+ JFW_TRACE2(*out);
+ return true;
}
@@ -793,8 +801,9 @@ OUString resolveDirPath(const OUString & path)
{
OUString ret;
OUString sResolved;
+ //getAbsoluteFileURL also resolves links
if (File::getAbsoluteFileURL(
- rtl::OUString(), path, sResolved) != File::E_None)
+ OUSTR("file:///"), path, sResolved) != File::E_None)
return OUString();
//check if this is a valid path and if it is a directory
@@ -824,7 +833,7 @@ OUString resolveFilePath(const OUString & path)
OUString sResolved;
if (File::getAbsoluteFileURL(
- rtl::OUString(), path, sResolved) != File::E_None)
+ OUSTR("file:///"), path, sResolved) != File::E_None)
return OUString();
//check if this is a valid path to a file or and if it is a link
diff --git a/l10ntools/source/filter/utils/XMLHelper.java b/l10ntools/source/filter/utils/XMLHelper.java
index edd7508cbf94..175d04ebacef 100644
--- a/l10ntools/source/filter/utils/XMLHelper.java
+++ b/l10ntools/source/filter/utils/XMLHelper.java
@@ -804,7 +804,7 @@ public class XMLHelper
sHeader.append(sVersion);
sHeader.append("\" encoding=\"");
sHeader.append(sEncoding);
- sHeader.append("\"?>\n<!DOCTYPE oor:component-data SYSTEM \"../../../../component-update.dtd\">\n");
+ sHeader.append("\"?>\n");
sHeader.append("<oor:component-data xmlns:oor=\"http://openoffice.org/2001/registry\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" oor:package=\"");
sHeader.append(sPath);
sHeader.append("\" oor:name=\"");
diff --git a/libxmlsec/makefile.mk b/libxmlsec/makefile.mk
index f9c0310ad18b..0c9db0860ae3 100644
--- a/libxmlsec/makefile.mk
+++ b/libxmlsec/makefile.mk
@@ -127,6 +127,7 @@ xmlsec_CFLAGS+=$(C_RESTRICTIONFLAGS)
.ENDIF # "$(COMNAME)"=="sunpro5"
.IF "$(EXTRA_CFLAGS)"!=""
xmlsec_CFLAGS+=$(EXTRA_CFLAGS)
+xmlsec_CPPFLAGS+=$(EXTRA_CFLAGS)
.ENDIF # "$(EXTRA_CFLAGS)"!=""
xmlsec_LDFLAGS+=-L$(SYSBASE)$/usr$/lib
.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!=""
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 81c7932a5092..90e433f50f07 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -640,15 +640,14 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
for (sal_Int32 i = 0; i < nLen; ++i)
{
// property names look like
- // "ServiceManager/ThesaurusList/cfg:any['de-CH']"
+ // "ServiceManager/ThesaurusList/de-CH"
const OUString &rName = pPropertyNames[i];
- sal_Int32 nKeyStart, nKeyEnd;
- nKeyStart = rName.indexOf( A2OU("['"), 0 );
- nKeyEnd = rName.indexOf( A2OU("']"), nKeyStart + 2);
+ sal_Int32 nKeyStart;
+ nKeyStart = rName.lastIndexOf( '/' );
OUString aKeyText;
- if (nKeyStart != -1 && nKeyEnd != -1)
- aKeyText = rName.copy( nKeyStart + 2, nKeyEnd - nKeyStart - 2);
+ if (nKeyStart != -1)
+ aKeyText = rName.copy( nKeyStart + 1 );
DBG_ASSERT( aKeyText.getLength() != 0, "unexpected key (lang::Locale) string" );
if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() ))
{
diff --git a/moz/makefile.mk b/moz/makefile.mk
index c1649d2f8b85..96ea794e8532 100644
--- a/moz/makefile.mk
+++ b/moz/makefile.mk
@@ -163,7 +163,7 @@ MOZILLA_CONFIGURE_FLAGS+= --enable-default-toolkit=$(DEFAULT_MOZILLA_TOOLKIT)
# create a objdir build = build files in a seperate directory, not in the sourcetree directly
CONFIGURE_DIR=$(CPU)_objdir
BUILD_DIR=$(CONFIGURE_DIR)
-MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="gcc -arch $(MOZ_ARCH)" CXX="g++ -arch $(MOZ_ARCH)" AR=ar
+MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="$(CC) -arch $(MOZ_ARCH)" CXX="$(CXX) -arch $(MOZ_ARCH)" AR=ar
CONFIGURE_ACTION=$(null,$(MOZ_ARCH) $(NULL) $(MOZ_CROSSCOMPILE)) ../configure $(MOZILLA_CONFIGURE_FLAGS)
diff --git a/odk/docs/images/sdk_head-1.gif b/odk/docs/images/sdk_head-1.gif
index 015250e0e612..53bf8a54685a 100644
--- a/odk/docs/images/sdk_head-1.gif
+++ b/odk/docs/images/sdk_head-1.gif
Binary files differ
diff --git a/odk/docs/install.html b/odk/docs/install.html
index f29b099334b0..e11440538bb5 100644
--- a/odk/docs/install.html
+++ b/odk/docs/install.html
@@ -407,12 +407,12 @@
</tr>
<tr>
<td colspan="3">
- <div align="center"><p>Copyright 2009 Sun Microsystems, Inc.</p></div>
+ <div align="center"><p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p></div>
</td>
</tr>
</table>
<map name="Map">
- <area shape="rect" coords="10,68,93,105" href="http://www.sun.com">
+ <area shape="rect" coords="10,68,93,105" href="http://www.oracle.com">
</map>
</body>
</html>
diff --git a/odk/docs/notsupported.html b/odk/docs/notsupported.html
index c3e40cc60ee1..ce02acedb3c0 100644
--- a/odk/docs/notsupported.html
+++ b/odk/docs/notsupported.html
@@ -1 +1 @@
-<html> <head> <title>[TITLE] - Not supported page</title> <link rel="stylesheet" type="text/css" href="sdk_styles.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="author" content="J&uuml;rgen Schmidt"> <meta name="created" content="2004-12-14"> </head> <body class="sdkbody"> <table class="table1" cellpadding=0> <tr style="background-image:url(images/sdk_head-2.gif); backgorund-position: bottom; "> <td colspan="2" align="left"><img src="images/sdk_head-1.gif" width="335" height="109" usemap="#Map" border="0"></td> <td align=right><img src="images/sdk_head-3.gif" width="32" height="109"></td> </tr> <tr> <td colspan="3"><img class="nothing10" src="images/nada.gif"></td> </tr> <tr> <td colspan="3"> <table class="table2"> <tr> <td> <p align="center"><a href="../index.html" title="link to the SDK start page"><img class="navigate" src="images/nav_home.png"></a></p> </td> </tr> <tr> <td><img class="nothing8" src="images/nada.gif"></td> </tr> <tr> <td> <p class="note">This page is currently not supported!</p> </td> </tr> </table> </td> </tr> <tr> <td colspan="3"><img class="nothing30" src="images/nada.gif"></td> </tr> <tr> <td colspan="3"><img class="line" src="images/sdk_line-1.gif"></td> </tr> <tr> <td colspan="3"> <div align="center"><p>Copyright 2009 Sun Microsystems, Inc.</p></div> </td> </tr> </table> <map name="Map"> <area shape="rect" coords="10,68,93,105" href="http://www.sun.com"> </map> </body> </html> \ No newline at end of file
+<html> <head> <title>[TITLE] - Not supported page</title> <link rel="stylesheet" type="text/css" href="sdk_styles.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="author" content="J&uuml;rgen Schmidt"> <meta name="created" content="2004-12-14"> </head> <body class="sdkbody"> <table class="table1" cellpadding=0> <tr style="background-image:url(images/sdk_head-2.gif); backgorund-position: bottom; "> <td colspan="2" align="left"><img src="images/sdk_head-1.gif" width="335" height="109" usemap="#Map" border="0"></td> <td align=right><img src="images/sdk_head-3.gif" width="32" height="109"></td> </tr> <tr> <td colspan="3"><img class="nothing10" src="images/nada.gif"></td> </tr> <tr> <td colspan="3"> <table class="table2"> <tr> <td> <p align="center"><a href="../index.html" title="link to the SDK start page"><img class="navigate" src="images/nav_home.png"></a></p> </td> </tr> <tr> <td><img class="nothing8" src="images/nada.gif"></td> </tr> <tr> <td> <p class="note">This page is currently not supported!</p> </td> </tr> </table> </td> </tr> <tr> <td colspan="3"><img class="nothing30" src="images/nada.gif"></td> </tr> <tr> <td colspan="3"><img class="line" src="images/sdk_line-1.gif"></td> </tr> <tr> <td colspan="3"> <div align="center"><p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p></div> </td> </tr> </table> <map name="Map"> <area shape="rect" coords="10,68,93,105" href="http://www.oracle.com"> </map> </body> </html> \ No newline at end of file
diff --git a/odk/docs/tools.html b/odk/docs/tools.html
index 21d2fbe56833..b02265dfb488 100644
--- a/odk/docs/tools.html
+++ b/odk/docs/tools.html
@@ -1081,13 +1081,12 @@ types the specified types depend on.</p>
</tr>
<tr>
<td colspan="3">
- <div align="center"><p>Copyright 2009 Sun Microsystems, Inc.</p></div>
+ <div align="center"><p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p></div>
</td>
</tr>
</table>
<map name="Map">
- <area shape="rect" coords="10,10,80,50" href="http://www.sun.com">
- <area shape="rect" coords="155,65,335,85" href="../index.html">
+ <area shape="rect" coords="10,68,93,105" href="http://www.oracle.com">
</map>
</body>
</html>
diff --git a/odk/examples/DevelopersGuide/examples.html b/odk/examples/DevelopersGuide/examples.html
index edf21ce4e2ba..da1453107f49 100644
--- a/odk/examples/DevelopersGuide/examples.html
+++ b/odk/examples/DevelopersGuide/examples.html
@@ -3022,14 +3022,14 @@ for the Office application.</td>
<tr>
<td colspan="3">
<div align="center">
- <p>Copyright 2009 Sun Microsystems, Inc.</p>
+ <p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p>
</div>
</td>
</tr>
</tbody>
</table>
<map name="Map">
-<area shape="rect" coords="10,68,93,105" href="http://www.sun.com">
+<area shape="rect" coords="10,68,93,105" href="http://www.oracle.com">
</map>
</body>
</html>
diff --git a/odk/examples/examples.html b/odk/examples/examples.html
index 03ca9f1c9d8d..395c59682b2a 100644
--- a/odk/examples/examples.html
+++ b/odk/examples/examples.html
@@ -737,12 +737,12 @@
</tr>
<tr>
<td colspan="3">
- <div align="center"><p>Copyright 2009 Sun Microsystems, Inc.</p></div>
+ <div align="center"><p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p></div>
</td>
</tr>
</table>
<map name="Map">
- <area shape="rect" coords="10,68,93,105" href="http://www.sun.com">
+ <area shape="rect" coords="10,68,93,105" href="http://www.oracle.com">
</map>
</body>
</html>
diff --git a/odk/index.html b/odk/index.html
index 723a65c406d5..ace6cbeb65a0 100644
--- a/odk/index.html
+++ b/odk/index.html
@@ -166,8 +166,8 @@
</tr>
<tr valign="top">
<td class="content4"><img src="docs/images/arrow-1.gif"></td>
- <td colspan="2"><a target="_blank" href="http://www.sun.com/developers/" title="link to the Sun Developer Resources (online)">Sun Developer Resources</a></td>
- <td class="content70">Sun's one-stop location for Developers.</td>
+ <td colspan="2"><a target="_blank" href="http://www.sun.com/developers/" title="link to the Sun Developer Resources (online)">Oracle Developer Network</a></td>
+ <td class="content70">A Community for Developers</td>
</tr>
<tr valign="middle">
<td><img class="nothing10" src="docs/images/nada.gif"></td>
@@ -202,12 +202,12 @@
</tr>
<tr>
<td colspan="3">
- <div align="center"><p>Copyright 2009 Sun Microsystems, Inc.</p></div>
+ <div align="center"><p>Copyright &copy; 1995, 2010, Oracle and/or its affiliates. All rights reserved.</p></div>
</td>
</tr>
</table>
<map name="Map">
- <area shape="rect" coords="10,68,93,105" href="http://www.sun.com">
+ <area shape="rect" coords="10,68,93,105" href="http://www.oracle.com">
</map>
</body>
</html>
diff --git a/odk/pack/copying/apiref-autodoc.since b/odk/pack/copying/apiref-autodoc.since
deleted file mode 100644
index c374a1d23740..000000000000
--- a/odk/pack/copying/apiref-autodoc.since
+++ /dev/null
@@ -1,27 +0,0 @@
-"3.3.0" "OpenOffice 3.3.0"
-"3.3" "OpenOffice 3.3"
-"3.2.0" "OpenOffice 3.2.0"
-"3.2" "OpenOffice 3.2"
-"3.1.0" "OpenOffice 3.1.0"
-"3.1" "OpenOffice 3.1"
-"3.0.1" "OpenOffice 3.0.1"
-"3.0.0" "OpenOffice 3.0.0"
-"3.0" "OpenOffice 3.0"
-"2.4.1" "OpenOffice 2.4.1"
-"2.4.0" "OpenOffice 2.4.0"
-"2.4" "OpenOffice 2.4"
-"2.3.1" "OpenOffice 2.3.1"
-"2.3.0" "OpenOffice 2.3.0"
-"2.3" "OpenOffice 2.3"
-"2.2.1" "OpenOffice 2.2.1"
-"2.2.0" "OpenOffice 2.2.0"
-"2.2" "OpenOffice 2.2"
-"2.1" "OpenOffice 2.1"
-"2.0.6" "OpenOffice 2.0.6"
-"2.0.4" "OpenOffice 2.0.4"
-"2.0.3" "OpenOffice 2.0.3"
-"2.0.2" "OpenOffice 2.0.2"
-"2.0.1" "OpenOffice 2.0.1"
-"2.0.0" "OpenOffice 2.0"
-"2.0" "OpenOffice 2.0"
-"1.1.2" "OpenOffice 1.1.2"
diff --git a/odk/pack/copying/makefile.mk b/odk/pack/copying/makefile.mk
index 76838708b150..5396496e1a3a 100644
--- a/odk/pack/copying/makefile.mk
+++ b/odk/pack/copying/makefile.mk
@@ -46,7 +46,6 @@ IDL_DOCU_INDEX_FILE = $(DESTDIRGENIDLREF)$/module-ix.html
IDL_DOCU_CLEANUP_FLAG = $(MISC)$/idl_docu_cleanup.flag
IDL_CHAPTER_REFS=idl_chapter_refs.txt
-IDL_SINCE_TAGS=apiref-autodoc.since
EXELIST = \
$(DESTDIRBIN)$/cppumaker$(EXEPOSTFIX) \
@@ -245,14 +244,14 @@ $(CONVERTTAGFLAG) : $(DOCUHTMLFILES)
$(PERL) $(CONVERTTAGSCRIPT) 1 "$(TITLE)" "$(OFFICEPRODUCTNAME)" $(DOCUHTMLFILES)
@echo "tags converted" > $@
-$(IDL_DOCU_CLEANUP_FLAG) : $(IDL_CHAPTER_REFS) $(IDL_SINCE_TAGS) $(PRJ)$/docs$/common$/ref$/idl.css
+$(IDL_DOCU_CLEANUP_FLAG) : $(IDL_CHAPTER_REFS) $(PRJ)$/docs$/common$/ref$/idl.css
@@-$(MY_DELETE_RECURSIVE) $(DESTDIRGENIDLREF)
$(TOUCH) $@
$(IDL_DOCU_INDEX_FILE) : $(IDL_DOCU_CLEANUP_FLAG)
-$(MKDIRHIER) $(@:d)
- $(MY_AUTODOC) -html $(DESTDIRGENIDLREF) -dvgroot "http://wiki.services.openoffice.org/wiki" -sincefile $(IDL_SINCE_TAGS) -name $(IDLDOCREFNAME) -lg \
- idl -dvgfile $(IDL_CHAPTER_REFS) -t $(DESTDIRIDL)
+ $(MY_AUTODOC) -html $(DESTDIRGENIDLREF) -dvgroot "http://wiki.services.openoffice.org/wiki" \
+ -name $(IDLDOCREFNAME) -lg idl -dvgfile $(IDL_CHAPTER_REFS) -t $(DESTDIRIDL)
-rm $(@:d)$/idl.css
$(MY_TEXTCOPY) $(MY_TEXTCOPY_SOURCEPRE) $(PRJ)$/docs$/common$/ref$/idl.css $(MY_TEXTCOPY_TARGETPRE) $(@:d:d)$/idl.css
diff --git a/odk/util/makefile.pmk b/odk/util/makefile.pmk
index e48a3032860c..0eb4c76b625d 100644
--- a/odk/util/makefile.pmk
+++ b/odk/util/makefile.pmk
@@ -26,7 +26,7 @@
#*************************************************************************
# used for sdk common files
-PRODUCT_RELEASE=3.2
+PRODUCT_RELEASE=3.3
OFFICENAME=OpenOffice.org
SDKDIRNAME=openoffice.org$(PRODUCT_RELEASE)_sdk
OFFICEPRODUCTNAME=$(OFFICENAME) $(PRODUCT_RELEASE)
diff --git a/offapi/com/sun/star/configuration/ConfigurationRegistry.idl b/offapi/com/sun/star/configuration/ConfigurationRegistry.idl
index c3b98b115a52..870af90e7986 100644
--- a/offapi/com/sun/star/configuration/ConfigurationRegistry.idl
+++ b/offapi/com/sun/star/configuration/ConfigurationRegistry.idl
@@ -43,6 +43,10 @@ module com { module sun { module star { module configuration {
/* provides access to a configuration tree as a registry.
+ <p>This service is deprecated,
+ <type scope="com.sun.star.configuration">ConfigurationProvider</type> should
+ be used instead.</p>
+
<p> Using the <type scope="com::sun::star::registry">XSimpleRegistry</type>
interface, the service can be bound to a subtree within the
configuration tree, as provided by an
diff --git a/offapi/com/sun/star/text/RedlinePortion.idl b/offapi/com/sun/star/text/RedlinePortion.idl
index be39882474c3..c399d976e04a 100644
--- a/offapi/com/sun/star/text/RedlinePortion.idl
+++ b/offapi/com/sun/star/text/RedlinePortion.idl
@@ -52,7 +52,7 @@ published service RedlinePortion
/** contains the name of the author of the change.*/
[readonly, property] string RedlineAuthor;
/** contains the date and time of the change.*/
- [readonly, property] com::sun::star::util::DateTime RedlineDataTime;
+ [readonly, property] com::sun::star::util::DateTime RedlineDateTime;
/** contains a comment for the change.*/
[readonly, property] string RedlineComment;
/** contains the type of the change
@@ -70,7 +70,7 @@ published service RedlinePortion
<p> The elements of the sequence are:</p>
<UL>
<LI><P>string RedlineAuthor; </P>
- <LI><P>com::sun::star::util::DateTime RedlineDataTime; </P>
+ <LI><P>com::sun::star::util::DateTime RedlineDateTime; </P>
<LI><P>string RedlineComment; </P>
<LI><P>string RedlineType; </P>
</UL>
diff --git a/offapi/com/sun/star/text/XFormField.idl b/offapi/com/sun/star/text/XFormField.idl
index f1f2d1bab9b9..53555728ba40 100644
--- a/offapi/com/sun/star/text/XFormField.idl
+++ b/offapi/com/sun/star/text/XFormField.idl
@@ -1,26 +1,20 @@
- #ifndef __com_sun_star_text_XFormField_idl__
- #define __com_sun_star_text_XFormField_idl__
+#ifndef __com_sun_star_text_XFormField_idl__
+#define __com_sun_star_text_XFormField_idl__
- #ifndef __com_sun_star_uno_XInterface_idl__
- #include <com/sun/star/uno/XInterface.idl>
- #endif
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/container/XNameContainer.idl>
- module com { module sun { module star { module text {
+module com { module sun { module star { module text {
-/** @deprecated
- */
- interface XFormField: com::sun::star::uno::XInterface
- {
- short getType();
- short getRes();
- string getDescription( );
+ /** @deprecated
+ */
+ interface XFormField : com::sun::star::uno::XInterface
+ {
+ string getFieldType();
+ void setFieldType([in] string fieldType);
+ com::sun::star::container::XNameContainer getParameters();
+ };
- void setType([in] short fieldType );
- void setRes([in] short res );
- void setDescription([in] string description );
+}; }; }; };
- };
-
- }; }; }; };
-
- #endif
+#endif
diff --git a/offapi/type_reference/typelibrary_history.txt b/offapi/type_reference/typelibrary_history.txt
index 70f0e1d0cb35..086397e8967e 100644
--- a/offapi/type_reference/typelibrary_history.txt
+++ b/offapi/type_reference/typelibrary_history.txt
@@ -141,10 +141,16 @@
to maybevoid and deprecate. They should be removed in a future version. The
implementation will never return them.
-25/02/09 (MST, JSC): TaskID=i96209
+02/25/09 (MST, JSC): TaskID=i96209
rename module css.text.FieldMaster to css.text.fieldmaster.
the implementation handles both variants.
-15/05/09 (MST, JSC): TaskID=i101965
+05/15/09 (MST, JSC): TaskID=i101965
fix read-only status of properties of css.text.TextPortion
+02/12/10 (JSC): TaskID=i107712, i107695
+ correct typo in com.sun.star.text.RedlinePortion. Property
+ RedLineDataTime have to be RedlineDateTime.
+ Update reference type library with the version of OOo 3.2. The new
+ reference type library is taken from the release source tree OOO320 m12.
+
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index f9a30cdbbd53..22b8904052ff 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/officecfg/prj/d.lst b/officecfg/prj/d.lst
index 66ba41abd60e..debb9659a9e7 100644
--- a/officecfg/prj/d.lst
+++ b/officecfg/prj/d.lst
@@ -27,10 +27,8 @@ mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\OOoImprovement
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\ucb
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\TypeDetection
-..\registry\schema\oo-ldap-attr.map %_DEST%\xml%_EXT%\registry\schema\oo-ldap-attr.map
-..\registry\schema\oo-ad-ldap-attr.map %_DEST%\xml%_EXT%\registry\schema\oo-ad-ldap-attr.map
-
-..\%__SRC%\misc\registry\data\org\openoffice\*.xcu.sample %_DEST%\xml%_EXT%\registry\data\org\openoffice\*.xcu.sample
+..\registry\schema\oo-ldap.xcd.sample %_DEST%\xml%_EXT%\oo-ldap.xcd.sample
+..\registry\schema\oo-ad-ldap.xcd.sample %_DEST%\xml%_EXT%\oo-ad-ldap.xcd.sample
..\%__SRC%\misc\registry\data\org\openoffice\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice
..\%__SRC%\misc\registry\data\org\openoffice\Office\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office
diff --git a/officecfg/registry/component-schema.dtd b/officecfg/registry/component-schema.dtd
index 7fb3f4a1e5cc..17d265da9193 100644
--- a/officecfg/registry/component-schema.dtd
+++ b/officecfg/registry/component-schema.dtd
@@ -1,127 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
<!ELEMENT oor:component-schema (info?, import*, uses*, templates?, component)>
<!ATTLIST oor:component-schema
- oor:name NMTOKEN #REQUIRED
- oor:package NMTOKEN #REQUIRED
+ oor:package CDATA #REQUIRED
+ oor:name CDATA #REQUIRED
oor:version NMTOKEN #IMPLIED
xml:lang CDATA #IMPLIED
xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
- xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
- xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
->
+ xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema">
<!ELEMENT import EMPTY>
<!ATTLIST import
- oor:component CDATA #REQUIRED
->
+ oor:component CDATA #REQUIRED>
<!ELEMENT uses EMPTY>
<!ATTLIST uses
- oor:component CDATA #REQUIRED
->
+ oor:component CDATA #REQUIRED>
-<!ELEMENT templates (info?, (group | set)*)>
-<!ELEMENT component (info?, (node-ref | group | set)*)>
+<!ELEMENT templates (info?, (set | group)*)>
+<!ATTLIST templates>
<!ELEMENT info (deprecated?, author*, desc*, label*)>
+<!ATTLIST info>
<!ELEMENT deprecated (#PCDATA)>
+<!ATTLIST deprecated>
<!ELEMENT author (#PCDATA)>
+<!ATTLIST author>
<!ELEMENT desc (#PCDATA)>
<!ATTLIST desc
- xml:lang CDATA #IMPLIED
->
+ xml:lang CDATA #IMPLIED>
<!ELEMENT label (#PCDATA)>
<!ATTLIST label
- xml:lang CDATA #IMPLIED
->
+ xml:lang CDATA #IMPLIED>
-<!ELEMENT group (info?, (prop | node-ref | group | set)*)>
-<!ATTLIST group
- oor:name CDATA #REQUIRED
- oor:extensible (true | false) #IMPLIED
->
+<!ELEMENT component (info?, (set | group | prop | node-ref)*)>
+<!ATTLIST component>
<!ELEMENT set (info?, item*)>
<!ATTLIST set
oor:name CDATA #REQUIRED
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
-<!ELEMENT node-ref (info?)>
-<!ATTLIST node-ref
+<!ELEMENT item EMPTY>
+<!ATTLIST item
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
+
+<!ELEMENT group (info?, (set | group | prop | node-ref)*)>
+<!ATTLIST group
oor:name CDATA #REQUIRED
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
+ oor:extensible (false | true) #IMPLIED>
<!ELEMENT prop (info?, constraints?, value?)>
<!ATTLIST prop
oor:name CDATA #REQUIRED
- oor:type (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string | xs:hexBinary | oor:any | oor:boolean-list | oor:short-list | oor:int-list | oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list) #REQUIRED
- oor:localized (true | false) #IMPLIED
- oor:nillable (true | false) #IMPLIED
->
-
-<!ELEMENT item EMPTY>
-<!ATTLIST item
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
-
-<!ELEMENT value (#PCDATA)>
-<!ATTLIST value
- oor:separator CDATA #IMPLIED
->
-
-<!ELEMENT constraints (enumeration*, length?, minLength?, maxLength?, minInclusive?, maxInclusive?, minExclusive?, maxExclusive?, whiteSpace?)>
+ oor:localized (false | true) #IMPLIED
+ oor:type
+ (oor:any | xs:boolean | xs:short | xs:int | xs:long | xs:double |
+ xs:string | xs:hexBinary | oor:boolean-list | oor:short-list |
+ oor:int-list | oor:long-list | oor:double-list | oor:string-list |
+ oor:hexBinary-list)
+ #REQUIRED
+ oor:nillable (false | true) #IMPLIED>
+
+<!ELEMENT constraints
+ (enumeration*, length?, minLength?, maxLength?, minInclusive?,
+ maxInclusive?, minExclusive?, maxExclusive?, whiteSpace?)>
<!ELEMENT enumeration (info?)>
<!ATTLIST enumeration
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT length (info?)>
<!ATTLIST length
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minLength (info?)>
<!ATTLIST minLength
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxLength (info?)>
<!ATTLIST maxLength
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minInclusive (info?)>
<!ATTLIST minInclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxInclusive (info?)>
<!ATTLIST maxInclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minExclusive (info?)>
<!ATTLIST minExclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxExclusive (info?)>
<!ATTLIST maxExclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT whiteSpace (info?)>
<!ATTLIST whiteSpace
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
+
+<!ELEMENT value (#PCDATA | it | unicode)*>
+<!ATTLIST value
+ oor:separator CDATA #IMPLIED>
+<!ELEMENT it (#PCDATA | unicode)*>
+<!ATTLIST it>
+
+<!ELEMENT unicode EMPTY>
+<!ATTLIST unicode
+ oor:scalar NMTOKEN #REQUIRED>
+
+<!ELEMENT node-ref (info?)>
+<!ATTLIST node-ref
+ oor:name CDATA #REQUIRED
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
diff --git a/officecfg/registry/component-schema.xsd b/officecfg/registry/component-schema.xsd
deleted file mode 100644
index cc3c18a16c3d..000000000000
--- a/officecfg/registry/component-schema.xsd
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Dirk Grobler (OpenOffice) -->
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>specifies the document format for OOo configuration component schemata.</xs:documentation>
- </xs:annotation>
- <xs:attribute name="extensible" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>determines, whether a node has an extensible list of attributes or fixed list of attributes.</xs:documentation>
- </xs:annotation>
-</xs:attribute>
-<xs:attribute name="localized" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>specifies, whether an attribute has or might have different values for different locales. </xs:documentation>
- </xs:annotation>
-</xs:attribute>
- <xs:attribute name="nillable" type="xs:boolean" use="optional" default="true">
- <xs:annotation>
- <xs:documentation>specifies, whether it is permissible to have a 'nil' i.e., missing, node content. The default for 'nillable' is 'true'.
-If a non-optional (nillable = 'false') has no default value (given in the component schema) it must be
-explicitly specified for each user.</xs:documentation>
- </xs:annotation>
-</xs:attribute>
- <xs:complexType name="prop">
- <xs:annotation>
- <xs:documentation>redefines the property type
- by adding documentation and type constraint elements.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-prop">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="constraints" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="enumeration" type="oor:constraint" minOccurs="0" maxOccurs="unbounded"/>
- <xs:element name="length" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minLength" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxLength" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minInclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxInclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minExclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxExclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="whiteSpace" type="oor:constraint" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="value" type="oor:value" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute ref="oor:localized"/>
- <xs:attribute ref="oor:nillable"/>
- <xs:attribute ref="oor:type" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="group">
- <xs:annotation>
- <xs:documentation>type definition for group nodes</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="prop" type="oor:prop" />
- <xs:element name="group" type="oor:group"/>
- <xs:element name="set" type="oor:set"/>
- <xs:element name="node-ref" type="oor:node-ref"/>
- </xs:choice>
- </xs:sequence>
- <xs:attribute ref="oor:extensible"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="set">
- <xs:annotation>
- <xs:documentation>type definition for set nodes</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="item" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute ref="oor:extensible"/>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="node-ref">
- <xs:annotation>
- <xs:documentation>allows to define node references. A node references points to an existing templated definition. This definition will be expanded at runtime.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute ref="oor:name" use="required"/>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:complexType>
- <xs:complexType name="constraint">
- <xs:annotation>
- <xs:documentation>basic type for constraints, which can be applied for property elements.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="value" type="xs:anySimpleType" use="required"/>
- </xs:complexType>
- <xs:complexType name="info">
- <xs:annotation>
- <xs:documentation>type for providing human readable information. Can be attached to any kind of component schema element.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="deprecated" type="xs:string" minOccurs="0">
- <xs:annotation>
- <xs:documentation>identifies an entry as deprecated. Can be assiciated with an explanation e.g. since when the entry is deprecated.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>author(s) of the configuration entry.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="desc" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation>provide a human
- readable documentation for a schema element.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation>describes a title or label,
- which can be reused in a console.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:element name="component-schema">
- <xs:annotation>
- <xs:documentation>Root element, which encompasses the schema specification</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="import" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute ref="oor:component" use="required"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="uses" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute ref="oor:component" use="required"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="templates" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="group" type="oor:group">
- <xs:unique name="groupMember">
- <xs:selector xpath="group|set|node-ref|prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="set" type="oor:set"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="templatesMember">
- <xs:selector xpath="oor:group|oor:set"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="component">
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="1" maxOccurs="unbounded">
- <xs:element name="prop" type="oor:prop"/>
- <xs:element name="node-ref" type="oor:node-ref"/>
- <xs:element name="group" type="oor:group">
- <xs:unique name="groupMember1">
- <xs:selector xpath="oor:group|oor:set|oor:node-ref|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="set" type="oor:set"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="schemaMember">
- <xs:selector xpath="oor:group|oor:set|oor:node-ref|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
- <xs:attribute ref="oor:package"/>
- <xs:attribute name="version" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation>identifies the version of the component. The version number is build of major.minor.micro</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute ref="xml:lang" use="optional"/>
- </xs:complexType>
- </xs:element>
-</xs:schema>
diff --git a/officecfg/registry/component-types.xsd b/officecfg/registry/component-types.xsd
deleted file mode 100644
index 9b2f2371ce2f..000000000000
--- a/officecfg/registry/component-types.xsd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oor="http://openoffice.org/2001/registry" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>provides a list of standard attribute and element definitions, reused in most parts of the different OOR document types</xs:documentation>
- </xs:annotation>
- <xs:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
- <!--List of attributes known in OOR-->
- <xs:attribute name="name" type="xs:string" use="required">
- <xs:annotation>
- <xs:documentation>identifies a node or an attribute within a tree, must be unique for all siblings.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="package" type="xs:NMTOKEN" use="required">
- <xs:annotation>
- <xs:documentation>contains the name of the package.
- Package names are composed similar to java packages.
- Packages are used to structure component configuration data.
- An example of a package is 'org.openoffice',
- where 'org' and 'openoffice' each define a package.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="node-type" type="xs:NMTOKEN">
- <xs:annotation>
- <xs:documentation>identifies the template to use for the set or a node reference. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="component" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation>specifies the component, which contains a template definition</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="separator" type="xs:string" default=" ">
- <xs:annotation>
- <xs:documentation>specifies a separator for list types. The default
- is a blank, which is sufficient for most basic types like xs:int or
- xs:boolean. Only in certain cases, when using a sting or a binary
- list, the separator might differ. For example, a list of string values like build of the items 'europe' and 'south america' needs a different separator, as the usage of the default separator would result in a list of three items.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="type" use="optional">
- <xs:annotation>
- <xs:documentation>specifies the list of known basic types and their list equivalents. Is only allowed for properties.</xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="xs:boolean"/>
- <xs:enumeration value="xs:short"/>
- <xs:enumeration value="xs:int"/>
- <xs:enumeration value="xs:long"/>
- <xs:enumeration value="xs:double"/>
- <xs:enumeration value="xs:string"/>
- <xs:enumeration value="xs:hexBinary"/>
- <xs:enumeration value="oor:any"/>
- <xs:enumeration value="oor:boolean-list"/>
- <xs:enumeration value="oor:short-list"/>
- <xs:enumeration value="oor:int-list"/>
- <xs:enumeration value="oor:long-list"/>
- <xs:enumeration value="oor:double-list"/>
- <xs:enumeration value="oor:string-list"/>
- <xs:enumeration value="oor:hexBinary-list"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attributeGroup name="node-info">
- <xs:annotation>
- <xs:documentation>encompasses common attributes for nodes.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:name" use="required"/>
- </xs:attributeGroup>
- <xs:attributeGroup name="node-type-info">
- <xs:annotation>
- <xs:documentation>encompasses attributes for referencing a node-type.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:node-type" use="required"/>
- <xs:attribute ref="oor:component" use="optional"/>
- </xs:attributeGroup>
- <xs:attributeGroup name="prop-info">
- <xs:annotation>
- <xs:documentation>encompasses common attributes for properties.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:name" use="required"/>
- </xs:attributeGroup>
- <!--List of list data types supported by OOR-->
- <xs:simpleType name="boolean-list">
- <xs:list itemType="xs:boolean"/>
- </xs:simpleType>
- <xs:simpleType name="short-list">
- <xs:list itemType="xs:short"/>
- </xs:simpleType>
- <xs:simpleType name="int-list">
- <xs:list itemType="xs:int"/>
- </xs:simpleType>
- <xs:simpleType name="long-list">
- <xs:list itemType="xs:long"/>
- </xs:simpleType>
- <xs:simpleType name="double-list">
- <xs:list itemType="xs:double"/>
- </xs:simpleType>
- <xs:simpleType name="string-list">
- <xs:restriction base="xs:string"/>
- </xs:simpleType>
- <xs:simpleType name="hexBinary-list">
- <xs:restriction base="xs:string"/>
- </xs:simpleType>
- <!--List of basic type definitions for all schema and instance elements known by OOR-->
- <xs:complexType name="basic-node">
- <xs:annotation>
- <xs:documentation>base class for all kinds of nodes (set | group)</xs:documentation>
- </xs:annotation>
- <xs:attributeGroup ref="oor:node-info"/>
- </xs:complexType>
- <xs:complexType name="basic-prop">
- <xs:annotation>
- <xs:documentation>type definition for node properties</xs:documentation>
- </xs:annotation>
- <xs:attributeGroup ref="oor:prop-info"/>
- </xs:complexType>
- <xs:complexType name="value">
- <xs:annotation>
- <xs:documentation>type definition for value nodes.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="oor:anyValue">
- <xs:attribute ref="oor:separator" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- <xs:simpleType name="anyValue">
- <xs:annotation>
- <xs:documentation>defines the list of possible basic data-types for properties.</xs:documentation>
- </xs:annotation>
- <xs:union memberTypes="xs:boolean xs:short xs:int xs:long xs:double xs:string xs:hexBinary oor:boolean-list oor:short-list oor:int-list oor:long-list oor:double-list oor:string-list oor:hexBinary-list"/>
- </xs:simpleType>
-</xs:schema>
diff --git a/officecfg/registry/component-update.dtd b/officecfg/registry/component-update.dtd
index 10c4632a91de..51623f40bafa 100644
--- a/officecfg/registry/component-update.dtd
+++ b/officecfg/registry/component-update.dtd
@@ -1,41 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
-<!ELEMENT oor:component-data ((prop|node)*)>
+<!ELEMENT oor:component-data ((node | prop)*)>
<!ATTLIST oor:component-data
- oor:name NMTOKEN #REQUIRED
- oor:package NMTOKEN #REQUIRED
- oor:finalized (true | false) #IMPLIED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
- xmlns:install CDATA #FIXED "http://openoffice.org/2004/installation"
- xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
- xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
->
-
-<!ELEMENT node ((prop|node)*)>
+ oor:package CDATA #REQUIRED
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (false | true) #IMPLIED
+ xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
+ xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:install CDATA #FIXED "http://openoffice.org/2004/installation">
+
+<!ELEMENT node ((node | prop)*)>
<!ATTLIST node
- oor:name CDATA #REQUIRED
- oor:component CDATA #IMPLIED
- oor:finalized (true | false) #IMPLIED
- oor:mandatory (true | false) #IMPLIED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- oor:node-type NMTOKEN #IMPLIED
- install:module NMTOKEN #IMPLIED
->
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (true | false) #IMPLIED
+ oor:mandatory (true | false) #IMPLIED
+ oor:node-type CDATA #IMPLIED
+ oor:component CDATA #IMPLIED
+ install:module CDATA #IMPLIED>
<!ELEMENT prop (value*)>
<!ATTLIST prop
- oor:name CDATA #REQUIRED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- oor:finalized CDATA #IMPLIED
- oor:type (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string | xs:hexBinary | oor:boolean-list | oor:short-list | oor:int-list | oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list) #IMPLIED
- install:module NMTOKEN #IMPLIED
->
-
-<!ELEMENT value (#PCDATA)>
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (true | false) #IMPLIED
+ oor:type
+ (oor:any | xs:boolean | xs:short | xs:int | xs:long | xs:double |
+ xs:string | xs:hexBinary | oor:boolean-list | oor:short-list |
+ oor:int-list | oor:long-list | oor:double-list | oor:string-list |
+ oor:hexBinary-list)
+ #IMPLIED
+ install:module CDATA #IMPLIED>
+
+<!ELEMENT value (#PCDATA | it | unicode)*>
+ <!-- EMPTY if oor:op="remove", xsi:nil="true", or oor:external is used
+ #PCDATA if the property type is a non-list type other than xs:string
+ (#PCDATA | unicode)* if the property type is xs:string
+ #PCDATA or it* if the property type is a list type other than
+ oor:string-list
+ (#PCDATA | unicode)* or it* if the property type is
+ oor:string-list -->
<!ATTLIST value
- xsi:nil (true | false) #IMPLIED
- oor:separator CDATA #IMPLIED
- xml:lang CDATA #IMPLIED
- install:module NMTOKEN #IMPLIED
->
+ xml:lang CDATA #IMPLIED
+ oor:op (fuse | remove) #IMPLIED
+ xsi:nil (true | false) #IMPLIED
+ oor:type
+ (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string |
+ xs:hexBinary | oor:boolean-list | oor:short-list | oor:int-list |
+ oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list)
+ #IMPLIED
+ oor:separator CDATA #IMPLIED
+ oor:external CDATA #IMPLIED
+ install:module CDATA #IMPLIED>
+ <!-- xml:lang must only be used for localized properties; defaults to the
+ empty string
+ oor:op defaults to "fuse"; "remove" must only be used for localized
+ properties
+ xsi:nil defaults to "false"; "true" must only be used for nillable
+ properties
+ oor:type is relevant for localized properties of type oor:any with
+ different value types for different locales
+ oor:separator must only be used if the property type is a list type
+ and the element content is #PCDATA or (#PCDATA | unicode)* (and not
+ EMPTY or it*)
+ oor:external must only be used for non-localized properties and must
+ not be used together with xsi:nil="true" -->
+
+<!ELEMENT it (#PCDATA | unicode)*>
+ <!-- #PCDATA if the property type is a list type other than
+ oor:string-list
+ (#PCDATA | unicode)* if the property type is oor:string-list -->
+<!ATTLIST it>
+
+<!ELEMENT unicode EMPTY>
+<!ATTLIST unicode
+ oor:scalar NMTOKEN #REQUIRED>
+ <!-- must syntactically match xs:integer and have a value in {0, ..., 8,
+ 11, 12, 14, ..., 31, 65534, 65535} -->
+
+<!-- oor:items is an alternative root element to oor:component-data (in plain
+ .xcu files only; not when nested in an .xcd file), used for the user-layer
+ registrymodifications.xcu: -->
+
+<!ELEMENT oor:items (item*)>
+<!ATTLIST oor:items>
+
+<!ELEMENT item ((prop | node)*)>
+<!ATTLIST item
+ oor:path CDATA #REQUIRED>
+ <!-- the absolute path representation of a set or group node -->
diff --git a/officecfg/registry/component-update.xsd b/officecfg/registry/component-update.xsd
deleted file mode 100644
index 5e0d0994739d..000000000000
--- a/officecfg/registry/component-update.xsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>defines the document format for configuration update documents.
- Updates are increments to default documents like a component schema and contain
- additional information for merging and access control</xs:documentation>
- </xs:annotation>
- <xs:redefine schemaLocation="component-types.xsd">
- <xs:complexType name="value">
- <xs:annotation>
- <xs:documentation>adds the xml:lang attribute for localized information. Only the update format is allowed to contain localized data.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="oor:value">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:redefine>
- <xs:complexType name="node">
- <xs:annotation>
- <xs:documentation>Identifies a node in the schema by it's name and position within the hierarchy. Overrides or adds information from the base layer. A node can be of type set or group.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="node" type="oor:node"/>
- <xs:element name="prop" type="oor:prop">
- <xs:unique name="uniqueLang">
- <xs:selector xpath="oor:value"/>
- <xs:field xpath="@xml:lang"/>
- </xs:unique>
- </xs:element>
- </xs:choice>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:mandatory"/>
- <xs:attributeGroup ref="oor:node-type-info" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="prop">
- <xs:annotation>
- <xs:documentation>adds operational info to a property, should only be applied for dynamic properties. Dynamic properties are not available in the component schema and are added or removed during runtime.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-prop">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:element name="value" type="oor:value" nillable="true"/>
- </xs:sequence>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:type" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:attributeGroup name="update-info">
- <xs:attribute ref="oor:finalized"/>
- <xs:attribute ref="oor:readonly"/>
- <xs:attribute ref="oor:op"/>
- </xs:attributeGroup>
- <xs:attribute name="op" use="optional" default="modify">
- <xs:annotation>
- <xs:documentation>defines a list of possible operations, which are applied during merging of node fragments.</xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="modify"/>
- <xs:enumeration value="replace"/>
- <xs:enumeration value="fuse"/>
- <xs:enumeration value="remove"/>
- <xs:enumeration value="reset"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="finalized" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>indicates that the content of a node and its descendant nodes are not allowed to be overwritten.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="mandatory" type="xs:boolean" default="false">
- <xs:annotation>
- <xs:documentation>specifies that a node MUST be present and can not be removed or replaced by a node during the merging process. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="readonly" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>determines, whether a node and its descendants are readonly or not. This is a computed attribute and can not be set by an application.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:element name="component-data">
- <xs:annotation>
- <xs:documentation>root element of the update document.</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:extension base="oor:basic-node">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="node" type="oor:node"/>
- <xs:element name="prop" type="oor:prop">
- <xs:unique name="uniqueLang">
- <xs:selector xpath="oor:value"/>
- <xs:field xpath="@xml:lang"/>
- </xs:unique>
- </xs:element>
- </xs:choice>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:package"/>
- </xs:extension>
- </xs:complexType>
- <xs:unique name="member">
- <xs:selector xpath="oor:node|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
-</xs:schema>
diff --git a/officecfg/registry/data.dtd b/officecfg/registry/data.dtd
new file mode 100644
index 000000000000..c3f7d0a61b9a
--- /dev/null
+++ b/officecfg/registry/data.dtd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!ELEMENT oor:data (dependency*, (oor:component-schema | oor:component-data)*)>
+<!ATTLIST oor:data>
+
+<!ELEMENT dependency EMPTY>
+<!ATTLIST dependency
+ file CDATA #REQUIRED>
+
+<!ENTITY % component-schema.dtd SYSTEM "component-schema.dtd">
+%component-schema.dtd;
+
+<!ENTITY % component-update.dtd SYSTEM "component-update.dtd">
+%component-update.dtd;
diff --git a/officecfg/registry/data/org/openoffice/Inet.xcu b/officecfg/registry/data/org/openoffice/Inet.xcu
index e6c126eaab4b..0533c68086f4 100644
--- a/officecfg/registry/data/org/openoffice/Inet.xcu
+++ b/officecfg/registry/data/org/openoffice/Inet.xcu
@@ -26,10 +26,72 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="Inet" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<oor:component-data oor:name="Inet" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node oor:name="Settings">
+ <prop oor:name="ooInetNoProxy">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetNoProxy"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetNoProxy"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetNoProxy"/>
+ </prop>
<prop oor:name="ooInetProxyType">
<value>1</value>
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetProxyType"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetProxyType"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetProxyType"/>
+ </prop>
+ <prop oor:name="ooInetFTPProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetFTPProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetFTPProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetFTPProxyName"/>
+ </prop>
+ <prop oor:name="ooInetFTPProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetFTPProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetFTPProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetFTPProxyPort"/>
+ </prop>
+ <prop oor:name="ooInetHTTPProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPProxyName"/>
+ </prop>
+ <prop oor:name="ooInetHTTPProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPProxyPort"/>
+ </prop>
+ <prop oor:name="ooInetHTTPSProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPSProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPSProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPSProxyName"/>
+ </prop>
+ <prop oor:name="ooInetHTTPSProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPSProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPSProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPSProxyPort"/>
</prop>
</node>
<node oor:name="SearchEngines">
diff --git a/officecfg/registry/data/org/openoffice/LDAP.xcu.sample b/officecfg/registry/data/org/openoffice/LDAP.xcu.sample
deleted file mode 100644
index 2917e65a51e7..000000000000
--- a/officecfg/registry/data/org/openoffice/LDAP.xcu.sample
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!-- This file is an example of an LDAP.xcu ldap configuration file.
-
- To use user data from LDAP in your installation, you need to provide a
- customized version of this file named 'LDAP.xcu'.
-
- To customize values in this file, please replace the data within
- <value>...</value> elements with the values for your organization.
-
- If a certain setting is not necessary for your installation, you may remove the
- entire 'prop' element, i.e. everything from '<prop oor:name="[SettingName]"' to
- the closing '</prop>'.
--->
-<oor:component-data oor:name="LDAP" oor:package="org.openoffice"
- 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="UserDirectory">
- <node oor:name="ServerDefinition">
- <prop oor:name="Server" oor:type="xs:string">
- <value>ldapserver.mycorp.com</value>
- </prop>
- <prop oor:name="BaseDN" oor:type="xs:string">
- <value>dc=mycorp,dc=com</value>
- </prop>
- <prop oor:name="Port" oor:type="xs:int">
- <value>389</value>
- </prop>
- </node>
- <!-- The following settings should be omitted, if anonymous access is possible
- <prop oor:name="SearchUser" oor:type="xs:string"><value>MyUserLogin</value></prop>
- <prop oor:name="SearchPassword" oor:type="xs:string"><value>MyPassword</value></prop>
- -->
- <prop oor:name="UserObjectClass" oor:type="xs:string">
- <value>inetorgperson</value>
- </prop>
- <prop oor:name="UserUniqueAttribute" oor:type="xs:string">
- <value>uid</value>
- </prop>
- <prop oor:name="Mapping" oor:type="xs:string">
- <value>oo-ldap</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 41a5ecafb4d2..ddd4145e57da 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -100,6 +100,27 @@
<value xml:lang="zh-TW">13</value>
</prop>
</node>
+ <node oor:name="FontAntiAliasing" install:module="gconflockdown">
+ <prop oor:name="Enabled">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend FontAntiAliasingEnabled"/>
+ </prop>
+ <prop oor:name="MinPixelHeight">
+ <value oor:external=
+"com.sun.star.configuration.backend.GconfBackend FontAntiAliasingMinPixelHeight"
+/>
+ </prop>
+ </node>
+ <node oor:name="Menu" install:module="gconflockdown">
+ <prop oor:name="DontHideDisabledEntry">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend DontHideDisabledEntry"/>
+ </prop>
+ <prop oor:name="ShowIconsInMenues">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend ShowIconsInMenues"/>
+ </prop>
+ </node>
</node>
<node oor:name="Help">
<node oor:name="StartCenter">
@@ -546,18 +567,32 @@
</node>
</node>
<node oor:name="Misc">
- <prop oor:name="UseSystemFileDialog" install:module="UseOOoFileDialogs">
- <value>false</value>
+ <prop oor:name="UseSystemFileDialog">
+ <value install:module="UseOOoFileDialogs">false</value>
+ <value install:module="gconflockdown" oor:external=
+ "com.sun.star.configuration.backend.GconfBackend UseSystemFileDialog"/>
</prop>
<prop oor:name="UseSystemPrintDialog" install:module="macosx">
<value>true</value>
</prop>
+ <prop oor:name="SymbolSet" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend SymbolSet"/>
+ </prop>
</node>
<node oor:name="Save">
<node oor:name="Document">
<prop oor:name="SaveBackwardCompatibleODF" oor:type="xs:boolean">
<value>true</value>
</prop>
+ <prop oor:name="CreateBackup" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend CreateBackup"/>
+ </prop>
+ <prop oor:name="WarnAlienFormat" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnAlienFormat"/>
+ </prop>
</node>
<node oor:name="ODF">
<prop oor:name="DefaultVersion" oor:type="xs:short">
@@ -570,6 +605,36 @@
<prop oor:name="HyperlinksWithCtrlClick" oor:type="xs:boolean">
<value>true</value>
</prop>
+ <prop oor:name="MacroSecurityLevel" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend MacroSecurityLevel"/>
+ </prop>
+ <prop oor:name="RecommendPasswordProtection"
+ install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend RecommendPasswordProtection"/>
+ </prop>
+ <prop oor:name="RemovePersonalInfoOnSaving"
+ install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend RemovePersonalInfoOnSaving"/>
+ </prop>
+ <prop oor:name="WarnCreatePDF" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnCreatePDF"/>
+ </prop>
+ <prop oor:name="WarnPrintDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnPrintDoc"/>
+ </prop>
+ <prop oor:name="WarnSaveOrSendDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnSaveOrSendDoc"/>
+ </prop>
+ <prop oor:name="WarnSignDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnSignDoc"/>
+ </prop>
</node>
</node>
<node oor:name="Path">
@@ -581,4 +646,60 @@
</prop>
</node>
</node>
+ <node oor:name="ExternalMailer" install:module="unixdesktop">
+ <prop oor:name="Program">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ExternalMailer"/>
+ </prop>
+ </node>
+ <node oor:name="Font">
+ <node oor:name="SourceViewFont" install:module="unixdesktop">
+ <prop oor:name="FontName">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend SourceViewFontName"/>
+ </prop>
+ <prop oor:name="FontHeight">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend SourceViewFontHeight"/>
+ </prop>
+ </node>
+ <node oor:name="View" install:module="gconflockdown">
+ <prop oor:name="History">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend FontViewHistory"/>
+ </prop>
+ <prop oor:name="ShowFontBoxWYSIWYG">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend ShowFontBoxWYSIWYG"/>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Accessibility" install:module="gconflockdown">
+ <prop oor:name="IsSystemFont">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AccessibilityIsSystemFont"/>
+ </prop>
+ </node>
+ <node oor:name="Print" install:module="gconflockdown">
+ <prop oor:name="PrintingModifiesDocument">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend PrintingModifiesDocument"/>
+ </prop>
+ </node>
+ <node oor:name="Undo" install:module="gconflockdown">
+ <prop oor:name="Steps">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend UndoSteps"/>
+ </prop>
+ </node>
+ <node oor:name="_3D_Engine" install:module="gconflockdown">
+ <prop oor:name="OpenGL">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend OpenGL"/>
+ </prop>
+ <prop oor:name="OpenGL_Faster">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend OpenGL_Faster"/>
+ </prop>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Labels.xcu b/officecfg/registry/data/org/openoffice/Office/Labels.xcu
index fd7aefadf128..9f92541e60dd 100644
--- a/officecfg/registry/data/org/openoffice/Office/Labels.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Labels.xcu
@@ -36,8 +36,8 @@
<node oor:name="L0" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video Spine</value>
+
+ <value>C2050 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -47,8 +47,8 @@
<node oor:name="L1" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video Face</value>
+
+ <value>C2050 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -58,9 +58,8 @@
<node oor:name="L2" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2070 Transfer Film for Mouse Pad</value>
+ <value>C2070 Transfer Film for Mouse Pad</value>
</prop>
<prop oor:name="Measure">
@@ -70,8 +69,8 @@
<node oor:name="L3" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2080 Transfer Film for Puzzle</value>
+
+ <value>C2080 Transfer Film for Puzzle</value>
</prop>
<prop oor:name="Measure">
@@ -82,8 +81,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2090 T-Shirt Transfer Set</value>
+ <value>C2090 T-Shirt Transfer Set</value>
</prop>
<prop oor:name="Measure">
@@ -94,8 +92,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2160 Avery Inkjet Label</value>
+ <value>C2160 Avery Inkjet Label</value>
</prop>
<prop oor:name="Measure">
@@ -106,8 +103,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2163 Avery Inkjet Label</value>
+ <value>C2163 Avery Inkjet Label</value>
</prop>
<prop oor:name="Measure">
@@ -118,8 +114,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2165 Large Labels</value>
+ <value>C2165 Large Labels</value>
</prop>
<prop oor:name="Measure">
@@ -130,8 +125,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2166 Avery 3.5&quot; Disk Label (Face only)</value>
+ <value>C2166 Avery 3.5&quot; Disk Label (Face only)</value>
</prop>
<prop oor:name="Measure">
@@ -142,8 +136,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2241 Avery Rectangle Sticker</value>
+ <value>C2241 Avery Rectangle Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -154,8 +147,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2243 Avery Small Round Sticker</value>
+ <value>C2243 Avery Small Round Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -166,8 +158,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2244 Avery Big Round Sticker</value>
+ <value>C2244 Avery Big Round Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -178,8 +169,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2246 Avery Full Page Sticker</value>
+ <value>C2246 Avery Full Page Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -190,8 +180,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2265 Disk Labels</value>
+ <value>C2265 Disk Labels</value>
</prop>
<prop oor:name="Measure">
@@ -202,8 +191,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2341 Embossed Cards A5 (Cover)</value>
+ <value>C2341 Embossed Cards A5 (Cover)</value>
</prop>
<prop oor:name="Measure">
@@ -214,8 +202,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2341 Embossed Cards A5 (Inside)</value>
+ <value>C2341 Embossed Cards A5 (Inside)</value>
</prop>
<prop oor:name="Measure">
@@ -226,8 +213,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2342 Embossed cards A6 (Coverl)</value>
+ <value>C2342 Embossed cards A6 (Coverl)</value>
</prop>
<prop oor:name="Measure">
@@ -238,8 +224,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2342 Embossed Cards A6 (Inside)</value>
+ <value>C2342 Embossed Cards A6 (Inside)</value>
</prop>
<prop oor:name="Measure">
@@ -250,8 +235,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2351 Avery A5 Greeting Card</value>
+ <value>C2351 Avery A5 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -262,8 +246,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2352 Avery A6 Greeting Card</value>
+ <value>C2352 Avery A6 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -274,8 +257,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2353 Avery Postcard</value>
+ <value>C2353 Avery Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -286,8 +268,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2354 Avery Biz Card</value>
+ <value>C2354 Avery Biz Card</value>
</prop>
<prop oor:name="Measure">
@@ -298,8 +279,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2355 Avery Note Cards</value>
+ <value>C2355 Avery Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -310,8 +290,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2356 Avery Full Page Card</value>
+ <value>C2356 Avery Full Page Card</value>
</prop>
<prop oor:name="Measure">
@@ -322,8 +301,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2357 Compliment Cards</value>
+ <value>C2357 Compliment Cards</value>
</prop>
<prop oor:name="Measure">
@@ -334,8 +312,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2361 Greeting Cards (A6)</value>
+ <value>C2361 Greeting Cards (A6)</value>
</prop>
<prop oor:name="Measure">
@@ -346,8 +323,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2364 Marbled Business Cards</value>
+ <value>C2364 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -358,8 +334,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2365 Marbled Business Cards</value>
+ <value>C2365 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -370,8 +345,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2366 Marbled Business Cards</value>
+ <value>C2366 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -382,8 +356,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2367 Marbled Business Cards</value>
+ <value>C2367 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -394,8 +367,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2370 A4 Coated Paper -110gsm</value>
+ <value>C2370 A4 Coated Paper -110gsm</value>
</prop>
<prop oor:name="Measure">
@@ -406,8 +378,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2371 A4 Coated Paper -160gsm</value>
+ <value>C2371 A4 Coated Paper -160gsm</value>
</prop>
<prop oor:name="Measure">
@@ -418,8 +389,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2374 Marbled Paper</value>
+ <value>C2374 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -430,8 +400,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2375 Marbled Paper</value>
+ <value>C2375 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -442,8 +411,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2376 Marbled Paper</value>
+ <value>C2376 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -454,8 +422,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2377 Marbled Paper</value>
+ <value>C2377 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -466,8 +433,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2378 A4 Colour Laser Paper</value>
+ <value>C2378 A4 Colour Laser Paper</value>
</prop>
<prop oor:name="Measure">
@@ -478,8 +444,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2379 A4 Bright White</value>
+ <value>C2379 A4 Bright White</value>
</prop>
<prop oor:name="Measure">
@@ -490,8 +455,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2410 Avery Self-Laminating Card</value>
+ <value>C2410 Avery Self-Laminating Card</value>
</prop>
<prop oor:name="Measure">
@@ -502,8 +466,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2420 Avery Self-Laminating Bookmark</value>
+ <value>C2420 Avery Self-Laminating Bookmark</value>
</prop>
<prop oor:name="Measure">
@@ -514,8 +477,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Windows Decals</value>
+ <value>C2546 Windows Decals</value>
</prop>
<prop oor:name="Measure">
@@ -526,8 +488,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -538,8 +499,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2651 Avery Inkjet Mini Label</value>
+ <value>C2651 Avery Inkjet Mini Label</value>
</prop>
<prop oor:name="Measure">
@@ -550,8 +510,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C6353 Photo Quality Gloss 4 x 6 Cards</value>
+ <value>C6353 Photo Quality Gloss 4 x 6 Cards</value>
</prop>
<prop oor:name="Measure">
@@ -562,8 +521,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9146 Photo Quality Label (Full Page)</value>
+ <value>C9146 Photo Quality Label (Full Page)</value>
</prop>
<prop oor:name="Measure">
@@ -574,8 +532,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9151 Photo Quality Label</value>
+ <value>C9151 Photo Quality Label</value>
</prop>
<prop oor:name="Measure">
@@ -586,8 +543,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9169 Photo Quality Label (4 per page)</value>
+ <value>C9169 Photo Quality Label (4 per page)</value>
</prop>
<prop oor:name="Measure">
@@ -598,8 +554,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9312 Clean Edge(TM) Business Card</value>
+ <value>C9312 Clean Edge(TM) Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -610,8 +565,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9351 Photo Quality Gloss A5 Greeting Card</value>
+ <value>C9351 Photo Quality Gloss A5 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -622,8 +576,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9352 Greeting Cards Glossy A6</value>
+ <value>C9352 Greeting Cards Glossy A6</value>
</prop>
<prop oor:name="Measure">
@@ -634,8 +587,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9353 Photo Quality Gloss Postcards</value>
+ <value>C9353 Photo Quality Gloss Postcards</value>
</prop>
<prop oor:name="Measure">
@@ -646,8 +598,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9354 Photo Quality Gloss Business Cards</value>
+ <value>C9354 Photo Quality Gloss Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -658,8 +609,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Post Cards</value>
+ <value>C9355 Post Cards</value>
</prop>
<prop oor:name="Measure">
@@ -670,8 +620,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9356 Photo Quality A4 Card Sheet</value>
+ <value>C9356 Photo Quality A4 Card Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -682,8 +631,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9362 Business Cards Glossy</value>
+ <value>C9362 Business Cards Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -694,8 +642,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9372 Photo Paper Glossy 9 x 13</value>
+ <value>C9372 Photo Paper Glossy 9 x 13</value>
</prop>
<prop oor:name="Measure">
@@ -706,8 +653,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9373 Photo Gloss Paper</value>
+ <value>C9373 Photo Gloss Paper</value>
</prop>
<prop oor:name="Measure">
@@ -718,8 +664,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9374 Photo Quality Glossy Inkjet Card</value>
+ <value>C9374 Photo Quality Glossy Inkjet Card</value>
</prop>
<prop oor:name="Measure">
@@ -730,8 +675,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9405 Avery T-Shirt Transfer Sheets</value>
+ <value>C9405 Avery T-Shirt Transfer Sheets</value>
</prop>
<prop oor:name="Measure">
@@ -742,8 +686,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9406 Avery T-Shirt Transfer Sheets</value>
+ <value>C9406 Avery T-Shirt Transfer Sheets</value>
</prop>
<prop oor:name="Measure">
@@ -754,8 +697,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9430 Photo Quality Glossy A4 Inkjet Paper</value>
+ <value>C9430 Photo Quality Glossy A4 Inkjet Paper</value>
</prop>
<prop oor:name="Measure">
@@ -766,8 +708,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9431 Photo Quality Glossy Paper - 160gsm</value>
+ <value>C9431 Photo Quality Glossy Paper - 160gsm</value>
</prop>
<prop oor:name="Measure">
@@ -778,8 +719,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9433 Inkjet Glossy Double Sided Paper</value>
+ <value>C9433 Inkjet Glossy Double Sided Paper</value>
</prop>
<prop oor:name="Measure">
@@ -790,8 +730,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9434 Photo Cards Glossy</value>
+ <value>C9434 Photo Cards Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -802,8 +741,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9612 CD-R Business Card</value>
+ <value>C9612 CD-R Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -814,8 +752,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 Full Face CD/DVD Labels</value>
+ <value>C9660 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -826,8 +763,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">COPT210 Copier Transparency</value>
+ <value>COPT210 Copier Transparency</value>
</prop>
<prop oor:name="Measure">
@@ -838,8 +774,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">IJT310 Inkjet Transparency - 90microns</value>
+ <value>IJT310 Inkjet Transparency - 90microns</value>
</prop>
<prop oor:name="Measure">
@@ -850,8 +785,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">IJT311 Inkjet Transparency - 120 microns</value>
+ <value>IJT311 Inkjet Transparency - 120 microns</value>
</prop>
<prop oor:name="Measure">
@@ -862,8 +796,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J40063 Address</value>
+ <value>J40063 Address</value>
</prop>
<prop oor:name="Measure">
@@ -874,8 +807,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J40065 Parcel</value>
+ <value>J40065 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -886,8 +818,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400DK 3.5&quot; Diskette - Face Only</value>
+ <value>J400DK 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -898,8 +829,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400SL 35mm Slide</value>
+ <value>J400SL 35mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -910,8 +840,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400VF Video Face</value>
+ <value>J400VF Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -922,8 +851,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400VS Video Spine</value>
+ <value>J400VS Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -934,8 +862,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8156 Address</value>
+ <value>J8156 Address</value>
</prop>
<prop oor:name="Measure">
@@ -946,8 +873,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8157 Address</value>
+ <value>J8157 Address</value>
</prop>
<prop oor:name="Measure">
@@ -958,8 +884,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8158 Address</value>
+ <value>J8158 Address</value>
</prop>
<prop oor:name="Measure">
@@ -970,8 +895,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8159 Address</value>
+ <value>J8159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -982,8 +906,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8160 Address</value>
+ <value>J8160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -994,8 +917,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8161 Address</value>
+ <value>J8161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1006,8 +928,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8162 Address</value>
+ <value>J8162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1018,8 +939,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8163 Address</value>
+ <value>J8163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1030,8 +950,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8164 Address</value>
+ <value>J8164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1042,8 +961,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8165 Parcel</value>
+ <value>J8165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1054,8 +972,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8166 Parcel</value>
+ <value>J8166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1066,8 +983,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8167 Shipping</value>
+ <value>J8167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1078,8 +994,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8168 Shipping</value>
+ <value>J8168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1090,8 +1005,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8169 Parcel</value>
+ <value>J8169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1102,8 +1016,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8170 Collect/Filing</value>
+ <value>J8170 Collect/Filing</value>
</prop>
<prop oor:name="Measure">
@@ -1114,8 +1027,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8171 Lever Arch Labels - White</value>
+ <value>J8171 Lever Arch Labels - White</value>
</prop>
<prop oor:name="Measure">
@@ -1126,8 +1038,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8173 Address</value>
+ <value>J8173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1138,8 +1049,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8359 Address</value>
+ <value>J8359 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1150,8 +1060,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8360 Address</value>
+ <value>J8360 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1162,8 +1071,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8361 Address</value>
+ <value>J8361 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1174,8 +1082,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8362 Address</value>
+ <value>J8362 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1186,8 +1093,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8363 Address</value>
+ <value>J8363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1198,8 +1104,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8364 Address</value>
+ <value>J8364 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1210,8 +1115,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8365 Parcel</value>
+ <value>J8365 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1222,8 +1126,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8366 Parcel</value>
+ <value>J8366 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1234,8 +1137,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8367 Shipping</value>
+ <value>J8367 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1246,8 +1148,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8368 Shipping</value>
+ <value>J8368 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1258,8 +1159,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8369 Parcel</value>
+ <value>J8369 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1270,8 +1170,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8371 Lever Arch</value>
+ <value>J8371 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1282,8 +1181,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8414 Clean Edge (TM) Business Card</value>
+ <value>J8414 Clean Edge (TM) Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -1294,8 +1192,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8415 Greeting Cards Maxi (A6)</value>
+ <value>J8415 Greeting Cards Maxi (A6)</value>
</prop>
<prop oor:name="Measure">
@@ -1306,8 +1203,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8423 Name Card</value>
+ <value>J8423 Name Card</value>
</prop>
<prop oor:name="Measure">
@@ -1318,8 +1214,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8431 CD Case Insert - Cover</value>
+ <value>J8431 CD Case Insert - Cover</value>
</prop>
<prop oor:name="Measure">
@@ -1330,8 +1225,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8432 CD Case Insert - Tray</value>
+ <value>J8432 CD Case Insert - Tray</value>
</prop>
<prop oor:name="Measure">
@@ -1342,8 +1236,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8433 CD Envelope</value>
+ <value>J8433 CD Envelope</value>
</prop>
<prop oor:name="Measure">
@@ -1354,8 +1247,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8434 Inkjet CD Inserts - Cover Section</value>
+ <value>J8434 Inkjet CD Inserts - Cover Section</value>
</prop>
<prop oor:name="Measure">
@@ -1366,8 +1258,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8434 Inkjet CD Inserts - Tray Section</value>
+ <value>J8434 Inkjet CD Inserts - Tray Section</value>
</prop>
<prop oor:name="Measure">
@@ -1378,8 +1269,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD Case Insert Cover Section</value>
+ <value>J8435 CD Case Insert Cover Section</value>
</prop>
<prop oor:name="Measure">
@@ -1390,8 +1280,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD Case Insert Tray Section</value>
+ <value>J8435 CD Case Insert Tray Section</value>
</prop>
<prop oor:name="Measure">
@@ -1402,8 +1291,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8436 CD Case Spine Labels</value>
+ <value>J8436 CD Case Spine Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1414,8 +1302,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8440 Zip(TM) Disk Card Insert - Panels</value>
+ <value>J8440 Zip(TM) Disk Card Insert - Panels</value>
</prop>
<prop oor:name="Measure">
@@ -1426,8 +1313,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8560 Clear Address</value>
+ <value>J8560 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1438,8 +1324,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8562 Clear Address</value>
+ <value>J8562 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1450,8 +1335,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8563 Clear Address</value>
+ <value>J8563 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1462,8 +1346,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8565 Clear Parcel</value>
+ <value>J8565 Clear Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1474,8 +1357,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8567 Clear A4 Labels</value>
+ <value>J8567 Clear A4 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1486,8 +1368,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8570 Full Face CD/DVD Labels - Clear Inkjet</value>
+ <value>J8570 Full Face CD/DVD Labels - Clear Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -1498,8 +1379,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8587 Inkjet Transparencies</value>
+ <value>J8587 Inkjet Transparencies</value>
</prop>
<prop oor:name="Measure">
@@ -1510,8 +1390,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8612 CD-R Business Card</value>
+ <value>J8612 CD-R Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -1522,8 +1401,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8651 Mini Address</value>
+ <value>J8651 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -1534,8 +1412,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8654 Miini Address</value>
+ <value>J8654 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -1546,8 +1423,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8655 Audio Cassette</value>
+ <value>J8655 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -1558,8 +1434,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8656 35 mm Slide</value>
+ <value>J8656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -1570,8 +1445,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8657 35 mm Slides/Small Items</value>
+ <value>J8657 35 mm Slides/Small Items</value>
</prop>
<prop oor:name="Measure">
@@ -1582,8 +1456,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8658 Mini Labels - Removable</value>
+ <value>J8658 Mini Labels - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -1594,8 +1467,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8659 Mini Labels - Removable</value>
+ <value>J8659 Mini Labels - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -1606,8 +1478,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8666 3.5&quot; Diskette - Face Only</value>
+ <value>J8666 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1618,8 +1489,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8667 Mini Disk Label - Face</value>
+ <value>J8667 Mini Disk Label - Face</value>
</prop>
<prop oor:name="Measure">
@@ -1630,8 +1500,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8667 Mini Disk Label - Spine</value>
+ <value>J8667 Mini Disk Label - Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1642,8 +1511,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8668 Labels for Zip (TM.) Disk</value>
+ <value>J8668 Labels for Zip (TM.) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -1654,8 +1522,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8671 Video Face</value>
+ <value>J8671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1666,8 +1533,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8674 Video Spine</value>
+ <value>J8674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1678,8 +1544,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8676 Full Face CD/DVD Labels</value>
+ <value>J8676 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1690,8 +1555,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8701 Lever Arch</value>
+ <value>J8701 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1702,8 +1566,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8702 Lever Arch</value>
+ <value>J8702 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1714,8 +1577,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8766 3.5&quot; Diskette - Face Only</value>
+ <value>J8766 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1726,8 +1588,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8770 Full Face CD/DVD Labels</value>
+ <value>J8770 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1738,8 +1599,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8771 Video Face</value>
+ <value>J8771 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1750,8 +1610,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8774 Video Spine</value>
+ <value>J8774 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1762,8 +1621,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8776 Full Face CD/DVD Labels - Holographic</value>
+ <value>J8776 Full Face CD/DVD Labels - Holographic</value>
</prop>
<prop oor:name="Measure">
@@ -1774,8 +1632,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8777 Full Face CD/DVD Labels - Silver</value>
+ <value>J8777 Full Face CD/DVD Labels - Silver</value>
</prop>
<prop oor:name="Measure">
@@ -1786,8 +1643,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8778 Full Face CD/DVD Labels - Gold</value>
+ <value>J8778 Full Face CD/DVD Labels - Gold</value>
</prop>
<prop oor:name="Measure">
@@ -1798,8 +1654,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8867 Printable Magnets - Full Sheet</value>
+ <value>J8867 Printable Magnets - Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -1810,8 +1665,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8871 Printable Magnets</value>
+ <value>J8871 Printable Magnets</value>
</prop>
<prop oor:name="Measure">
@@ -1822,8 +1676,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8875 Printable Magnets</value>
+ <value>J8875 Printable Magnets</value>
</prop>
<prop oor:name="Measure">
@@ -1834,8 +1687,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J9124 Inkjet Labels, Glossy</value>
+ <value>J9124 Inkjet Labels, Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -1846,8 +1698,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L30063 Address</value>
+ <value>L30063 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1858,8 +1709,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L30065 Parcel</value>
+ <value>L30065 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1870,8 +1720,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300DK 3.5&quot; Diskette - Face Only</value>
+ <value>L300DK 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1882,8 +1731,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300SL 35mm Slide</value>
+ <value>L300SL 35mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -1894,8 +1742,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300VF Video Face</value>
+ <value>L300VF Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1906,8 +1753,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300VS Video Spine</value>
+ <value>L300VS Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1918,8 +1764,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6008 Silver Heavy Duty Labels</value>
+ <value>L6008 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1930,8 +1775,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6009 Silver Heavy Duty Labels</value>
+ <value>L6009 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1942,8 +1786,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6011 Silver Heavy Duty Labels</value>
+ <value>L6011 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1954,8 +1797,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6012 Silver Heavy Duty Labels</value>
+ <value>L6012 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1966,8 +1808,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6112 Anti Tamper Labels</value>
+ <value>L6112 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1978,8 +1819,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6113 Anti Tamper Labels</value>
+ <value>L6113 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1990,8 +1830,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6114 Anti Tamper Labels</value>
+ <value>L6114 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2002,8 +1841,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7051 Heavy Duty Labels Mini</value>
+ <value>L7051 Heavy Duty Labels Mini</value>
</prop>
<prop oor:name="Measure">
@@ -2014,8 +1852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7060 White Heavy Duty Labels</value>
+ <value>L7060 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2026,8 +1863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7063 White Heavy Duty Labels</value>
+ <value>L7063 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2038,8 +1874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7067 White Heavy Duty Labels</value>
+ <value>L7067 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2050,8 +1885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7068 White Heavy Duty Labels</value>
+ <value>L7068 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2062,8 +1896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7069 White Heavy Duty Labels</value>
+ <value>L7069 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2074,8 +1907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7156 Address</value>
+ <value>L7156 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2086,8 +1918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7157 Address</value>
+ <value>L7157 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2098,8 +1929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7158 Address</value>
+ <value>L7158 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2110,8 +1940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Address</value>
+ <value>L7159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2122,8 +1951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Address</value>
+ <value>L7160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2134,8 +1962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Address</value>
+ <value>L7161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2146,8 +1973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Address</value>
+ <value>L7162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2158,8 +1984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Address</value>
+ <value>L7163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2170,8 +1995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Address</value>
+ <value>L7164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2182,8 +2006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Parcel</value>
+ <value>L7165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2194,8 +2017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Parcel</value>
+ <value>L7166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2206,8 +2028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Shipping</value>
+ <value>L7167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2218,8 +2039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Shipping</value>
+ <value>L7168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2230,8 +2050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Parcel</value>
+ <value>L7169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2242,8 +2061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7170 Eurofolio</value>
+ <value>L7170 Eurofolio</value>
</prop>
<prop oor:name="Measure">
@@ -2254,8 +2072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171 Lever Arch - White</value>
+ <value>L7171 Lever Arch - White</value>
</prop>
<prop oor:name="Measure">
@@ -2266,8 +2083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171B Lever Arch Labels - Blue</value>
+ <value>L7171B Lever Arch Labels - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -2278,8 +2094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171G Lever Arch Labels - Green</value>
+ <value>L7171G Lever Arch Labels - Green</value>
</prop>
<prop oor:name="Measure">
@@ -2290,8 +2105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171R Lever Arch Labels - Red</value>
+ <value>L7171R Lever Arch Labels - Red</value>
</prop>
<prop oor:name="Measure">
@@ -2302,8 +2116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7172 Ring Binder</value>
+ <value>L7172 Ring Binder</value>
</prop>
<prop oor:name="Measure">
@@ -2314,8 +2127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Shipping</value>
+ <value>L7173 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2326,8 +2138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7176 Labels for 60mm Box File</value>
+ <value>L7176 Labels for 60mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2338,8 +2149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7177 Address</value>
+ <value>L7177 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2350,8 +2160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7178 Labels for 40mm Box File</value>
+ <value>L7178 Labels for 40mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2362,8 +2171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7179 Labels for 25mm Box File</value>
+ <value>L7179 Labels for 25mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2374,8 +2182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7263 Fluorescent Yellow Address</value>
+ <value>L7263 Fluorescent Yellow Address</value>
</prop>
<prop oor:name="Measure">
@@ -2386,8 +2193,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7363 Address</value>
+ <value>L7363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2398,8 +2204,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7400 Suspended Files (Cupboard)</value>
+ <value>L7400 Suspended Files (Cupboard)</value>
</prop>
<prop oor:name="Measure">
@@ -2410,8 +2215,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7408 Suspended Files (Drawer)</value>
+ <value>L7408 Suspended Files (Drawer)</value>
</prop>
<prop oor:name="Measure">
@@ -2422,8 +2226,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7409 Suspension Tab Card Inserts</value>
+ <value>L7409 Suspension Tab Card Inserts</value>
</prop>
<prop oor:name="Measure">
@@ -2434,8 +2237,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 IndexMaker 5 part - Labels</value>
+ <value>L7410-5 IndexMaker 5 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2446,8 +2248,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 IndexMaker 5 part - Contents Sheet</value>
+ <value>L7410-5 IndexMaker 5 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2458,8 +2259,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-6 IndexMaker 6 part - Labels</value>
+ <value>L7410-6 IndexMaker 6 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2470,8 +2270,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-6 IndexMaker 6 part - Contents Sheet</value>
+ <value>L7410-6 IndexMaker 6 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2482,8 +2281,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 IndexMaker 10 part - Labels</value>
+ <value>L7410-10 IndexMaker 10 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2494,8 +2292,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 IndexMaker 10 part - Contents Sheet</value>
+ <value>L7410-10 IndexMaker 10 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2506,8 +2303,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 IndexMaker 12 part - Labels</value>
+ <value>L7410-12 IndexMaker 12 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2518,8 +2314,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 IndexMaker 12 part - Contents Sheet</value>
+ <value>L7410-12 IndexMaker 12 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2530,8 +2325,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-5 ReadyIndex 1-5 Index - Contents Sheet</value>
+ <value>L7411-5 ReadyIndex 1-5 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2542,8 +2336,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-6 ReadyIndex 1-6 Index - Contents Sheet</value>
+ <value>L7411-6 ReadyIndex 1-6 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2554,8 +2347,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-10 ReadyIndex 1-10 Index - Contents Sheet</value>
+ <value>L7411-10 ReadyIndex 1-10 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2566,8 +2358,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-12 ReadyIndex 1-12 Index - Contents Sheet</value>
+ <value>L7411-12 ReadyIndex 1-12 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2578,8 +2369,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-15 ReadyIndex 1-15 Index - Contents Sheet</value>
+ <value>L7411-15 ReadyIndex 1-15 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2590,8 +2380,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-20 ReadyIndex 1-20 Index - Contents Sheet</value>
+ <value>L7411-20 ReadyIndex 1-20 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2602,8 +2391,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-31 ReadyIndex 1-31 Index - Contents Sheet</value>
+ <value>L7411-31 ReadyIndex 1-31 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2614,8 +2402,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-AZ ReadyIndex A-Z Index - Contents Sheet</value>
+ <value>L7411-AZ ReadyIndex A-Z Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2626,8 +2413,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-JD ReadyIndex Jan-Dec Index - Contents Sheet</value>
+ <value>L7411-JD ReadyIndex Jan-Dec Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2638,8 +2424,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-5 Insertable Tab Dividers - 5 Tabs</value>
+ <value>L7412-5 Insertable Tab Dividers - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2650,8 +2435,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-6 Insertable Tab Dividers - 6 Tabs</value>
+ <value>L7412-6 Insertable Tab Dividers - 6 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2662,8 +2446,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-8 Insertable Tab Dividers - 8 Tabs</value>
+ <value>L7412-8 Insertable Tab Dividers - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2674,8 +2457,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-10 Insertable Tab Dividers - 10 Tabs</value>
+ <value>L7412-10 Insertable Tab Dividers - 10 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2686,8 +2468,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-12 Insertable Tab Dividers - 12 Tabs</value>
+ <value>L7412-12 Insertable Tab Dividers - 12 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2698,8 +2479,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7413 Business Card</value>
+ <value>L7413 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2710,8 +2490,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7414 Business Card</value>
+ <value>L7414 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2722,8 +2501,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7415 Business Card</value>
+ <value>L7415 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2734,8 +2512,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-5 IndexMaker 5 part (Unpunched) - Labels</value>
+ <value>L7416-5 IndexMaker 5 part (Unpunched) - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2746,8 +2523,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-5 IndexMaker 5 part (Unpunched) - Contents Sheet</value>
+ <value>L7416-5 IndexMaker 5 part (Unpunched) - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2758,8 +2534,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-6 IndexMaker 6 part - Extra Wide - Labels</value>
+ <value>L7416-6 IndexMaker 6 part - Extra Wide - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2770,8 +2545,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-6 IndexMaker 6 part - Extra Wide - Contents Sheet</value>
+ <value>L7416-6 IndexMaker 6 part - Extra Wide - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2782,8 +2556,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-10 IndexMaker 10 part (Unpunched) - Labels</value>
+ <value>L7416-10 IndexMaker 10 part (Unpunched) - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2794,8 +2567,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-10 IndexMaker 10 part (Unpunched) - Contents Sheet</value>
+ <value>L7416-10 IndexMaker 10 part (Unpunched) - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2806,8 +2578,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-12 IndexMaker 12 part - Extra Wide - Labels</value>
+ <value>L7416-12 IndexMaker 12 part - Extra Wide - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2818,8 +2589,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-12 IndexMaker 12 part - Extra Wide - Contents Sheet</value>
+ <value>L7416-12 IndexMaker 12 part - Extra Wide - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2830,8 +2600,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7417 Business Card</value>
+ <value>L7417 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2842,8 +2611,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7418 Name Badge</value>
+ <value>L7418 Name Badge</value>
</prop>
<prop oor:name="Measure">
@@ -2854,8 +2622,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7419 Business Card</value>
+ <value>L7419 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2866,8 +2633,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-5 Direct Print Dividers</value>
+ <value>L7420-5 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2878,8 +2644,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-6 Direct Print Dividers</value>
+ <value>L7420-6 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2890,8 +2655,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-8 Direct Print Dividers</value>
+ <value>L7420-8 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2902,8 +2666,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7421 Post Card</value>
+ <value>L7421 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -2914,8 +2677,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7422 Suspension Tab Card Inserts</value>
+ <value>L7422 Suspension Tab Card Inserts</value>
</prop>
<prop oor:name="Measure">
@@ -2926,8 +2688,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7423 Delegate Card - Embossed</value>
+ <value>L7423 Delegate Card - Embossed</value>
</prop>
<prop oor:name="Measure">
@@ -2938,8 +2699,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7424 Lever Arch Labels</value>
+ <value>L7424 Lever Arch Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2950,8 +2710,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7425 Lever Arch Labels</value>
+ <value>L7425 Lever Arch Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2962,8 +2721,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7426 Note Card</value>
+ <value>L7426 Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -2974,8 +2732,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7451-5 ReadyIndex 5 Index (Unnumbered) - Contents</value>
+ <value>L7451-5 ReadyIndex 5 Index (Unnumbered) - Contents</value>
</prop>
<prop oor:name="Measure">
@@ -2986,8 +2743,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7451-10 ReadyIndex 10 Index (Unnumbered) - Contents</value>
+ <value>L7451-10 ReadyIndex 10 Index (Unnumbered) - Contents</value>
</prop>
<prop oor:name="Measure">
@@ -2998,8 +2754,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7551 Clear Mini Address</value>
+ <value>L7551 Clear Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3010,8 +2765,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7552 Clear Mini</value>
+ <value>L7552 Clear Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3022,8 +2776,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7553 Clear Mini</value>
+ <value>L7553 Clear Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3034,8 +2787,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7560 Clear Address</value>
+ <value>L7560 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3046,8 +2798,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7562 Clear Address</value>
+ <value>L7562 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3058,8 +2809,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7563 Clear Address</value>
+ <value>L7563 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3070,8 +2820,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7565 Clear Parcel</value>
+ <value>L7565 Clear Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -3082,8 +2831,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7567 Clear A4 Labels</value>
+ <value>L7567 Clear A4 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3094,8 +2842,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7568 Clear A5 Labels</value>
+ <value>L7568 Clear A5 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3106,8 +2853,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7587 Laser Transparencies</value>
+ <value>L7587 Laser Transparencies</value>
</prop>
<prop oor:name="Measure">
@@ -3118,8 +2864,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7630 Circular</value>
+ <value>L7630 Circular</value>
</prop>
<prop oor:name="Measure">
@@ -3130,8 +2875,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7650 Circular</value>
+ <value>L7650 Circular</value>
</prop>
<prop oor:name="Measure">
@@ -3142,8 +2886,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Mini Address</value>
+ <value>L7651 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3154,8 +2897,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651/PF Mini Address</value>
+ <value>L7651/PF Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3166,8 +2908,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651/YF Mini Address</value>
+ <value>L7651/YF Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3178,8 +2919,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7652 Miini Address</value>
+ <value>L7652 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3190,8 +2930,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7653 Mini</value>
+ <value>L7653 Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3202,8 +2941,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7654 Miini Address</value>
+ <value>L7654 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3214,8 +2952,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7655 Audio Cassette</value>
+ <value>L7655 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -3226,8 +2963,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7656 35 mm Slide</value>
+ <value>L7656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -3238,8 +2974,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7657 Mini Labels - Removable - Laser</value>
+ <value>L7657 Mini Labels - Removable - Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3250,8 +2985,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7658 Mini Labels - Removable - Laser</value>
+ <value>L7658 Mini Labels - Removable - Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3262,8 +2996,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7663 5.25&quot; Diskette</value>
+ <value>L7663 5.25&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -3274,8 +3007,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7664 3.5&quot; Diskette - Wraparound</value>
+ <value>L7664 3.5&quot; Diskette - Wraparound</value>
</prop>
<prop oor:name="Measure">
@@ -3286,8 +3018,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7665 Mini Data Cartridge</value>
+ <value>L7665 Mini Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3298,8 +3029,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7666 3.5&quot; Diskette - Face Only</value>
+ <value>L7666 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -3310,8 +3040,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7667 Standard Data Cartridge</value>
+ <value>L7667 Standard Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3322,8 +3051,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7668 Labels for Zip(TM) Disk</value>
+ <value>L7668 Labels for Zip(TM) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -3334,8 +3062,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7669 Labels for SuperDisk (TM )</value>
+ <value>L7669 Labels for SuperDisk (TM )</value>
</prop>
<prop oor:name="Measure">
@@ -3346,8 +3073,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7670 Circular - Fluorescent Yellow</value>
+ <value>L7670 Circular - Fluorescent Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -3358,8 +3084,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7671 Video Face</value>
+ <value>L7671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -3370,8 +3095,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7674 Video Spine</value>
+ <value>L7674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -3382,8 +3106,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7675 4mm Data Cartridge</value>
+ <value>L7675 4mm Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3394,8 +3117,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7676 Full Face CD/DVD Labels - Black &amp; White</value>
+ <value>L7676 Full Face CD/DVD Labels - Black &amp; White</value>
</prop>
<prop oor:name="Measure">
@@ -3406,8 +3128,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7680 Mini Address - Gold</value>
+ <value>L7680 Mini Address - Gold</value>
</prop>
<prop oor:name="Measure">
@@ -3418,8 +3139,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7701 Lever Arch</value>
+ <value>L7701 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3430,8 +3150,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7702 Lever Arch</value>
+ <value>L7702 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3442,8 +3161,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7760 Full Face CD/DVD Labels - Colour Laser</value>
+ <value>L7760 Full Face CD/DVD Labels - Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3454,8 +3172,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7765 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7765 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3466,8 +3183,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7767 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7767 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3478,8 +3194,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7768 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7768 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3490,8 +3205,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7769 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7769 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3502,8 +3216,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7901 Organizer Page</value>
+ <value>L7901 Organizer Page</value>
</prop>
<prop oor:name="Measure">
@@ -3514,8 +3227,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7902 Organizer Page (A5)</value>
+ <value>L7902 Organizer Page (A5)</value>
</prop>
<prop oor:name="Measure">
@@ -3526,8 +3238,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7905 Compliment Slip</value>
+ <value>L7905 Compliment Slip</value>
</prop>
<prop oor:name="Measure">
@@ -3538,8 +3249,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">LPT110 Laser/Copier Transparency - 100micron</value>
+ <value>LPT110 Laser/Copier Transparency - 100micron</value>
</prop>
<prop oor:name="Measure">
@@ -3550,8 +3260,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">LPT111 Laser/Copier Transparency - 100micron</value>
+ <value>LPT111 Laser/Copier Transparency - 100micron</value>
</prop>
<prop oor:name="Measure">
@@ -3565,8 +3274,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2412 Laminated Cards, large</value>
+ <value>C2412 Laminated Cards, large</value>
</prop>
<prop oor:name="Measure">
@@ -3577,8 +3285,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2413 Laminated Cards</value>
+ <value>C2413 Laminated Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3589,8 +3296,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2414 Laminated Cards</value>
+ <value>C2414 Laminated Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3601,8 +3307,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C24412 Laminated Cards, large</value>
+ <value>C24412 Laminated Cards, large</value>
</prop>
<prop oor:name="Measure">
@@ -3613,8 +3318,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C25446 A5 Sheet</value>
+ <value>C25446 A5 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3625,8 +3329,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C25447 A5 Sheet</value>
+ <value>C25447 A5 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3637,8 +3340,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Windows Decals</value>
+ <value>C2546 Windows Decals</value>
</prop>
<prop oor:name="Measure">
@@ -3649,8 +3351,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -3661,8 +3362,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C91131 Business Cards</value>
+ <value>C91131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3673,8 +3373,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C91149 Business Cards</value>
+ <value>C91149 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3685,8 +3384,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9167 A4 Sheet</value>
+ <value>C9167 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3697,8 +3395,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9169 Glossy Photo Quality Labels</value>
+ <value>C9169 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3709,8 +3406,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9356 Photo Quality A4 Card Sheet</value>
+ <value>C9356 Photo Quality A4 Card Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3721,8 +3417,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21013 Business Cards</value>
+ <value>J21013 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3733,8 +3428,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21015 Business Cards</value>
+ <value>J21015 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3745,8 +3439,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21016 Business Cards</value>
+ <value>J21016 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3757,8 +3450,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21031 Business Cards</value>
+ <value>J21031 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3769,8 +3461,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21033 Business Cards</value>
+ <value>J21033 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3781,8 +3472,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21131 Business Cards</value>
+ <value>J21131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3793,8 +3483,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21141 Greeting Cards</value>
+ <value>J21141 Greeting Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3805,8 +3494,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21149 Business Cards</value>
+ <value>J21149 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3817,8 +3505,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J2356 A4 Sheet</value>
+ <value>J2356 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3829,8 +3516,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8359 Address</value>
+ <value>J8359 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3841,8 +3527,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8360 Address</value>
+ <value>J8360 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3853,8 +3538,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8361 Address</value>
+ <value>J8361 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3865,8 +3549,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8362 Address</value>
+ <value>J8362 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3877,8 +3560,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8363 Address</value>
+ <value>J8363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3889,8 +3571,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8365 Address</value>
+ <value>J8365 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3901,8 +3582,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8367 Shipping A4</value>
+ <value>J8367 Shipping A4</value>
</prop>
<prop oor:name="Measure">
@@ -3913,8 +3593,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8368 Shipping A5</value>
+ <value>J8368 Shipping A5</value>
</prop>
<prop oor:name="Measure">
@@ -3925,8 +3604,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8369 Parcel</value>
+ <value>J8369 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -3937,8 +3615,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8371 Lever Arch</value>
+ <value>J8371 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3949,8 +3626,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8751 Mini Address</value>
+ <value>J8751 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3961,8 +3637,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8756 35 mm Slide</value>
+ <value>J8756 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -3973,8 +3648,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8766 3.5&quot; Diskette</value>
+ <value>J8766 3.5&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -3985,8 +3659,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8771 Video Face</value>
+ <value>J8771 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -3997,8 +3670,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8774 Video Spine</value>
+ <value>J8774 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -4009,8 +3681,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88911 Address</value>
+ <value>J88911 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4021,8 +3692,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88915 Address</value>
+ <value>J88915 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4033,8 +3703,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88919 Address</value>
+ <value>J88919 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4045,8 +3714,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88923 Address</value>
+ <value>J88923 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4057,8 +3725,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88927 Address</value>
+ <value>J88927 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4069,8 +3736,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88935 Address</value>
+ <value>J88935 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4081,8 +3747,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Address</value>
+ <value>L7159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4093,8 +3758,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Address</value>
+ <value>L7160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4105,8 +3769,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Address</value>
+ <value>L7161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4117,8 +3780,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Address</value>
+ <value>L7162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4129,8 +3791,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Address</value>
+ <value>L7163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4141,8 +3802,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Address</value>
+ <value>L7164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4153,8 +3813,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Parcel</value>
+ <value>L7165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4165,8 +3824,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Parcel</value>
+ <value>L7166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4177,8 +3835,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Shipping</value>
+ <value>L7167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4189,8 +3846,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Shipping</value>
+ <value>L7168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4201,8 +3857,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Parcel</value>
+ <value>L7169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4213,8 +3868,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7170 Eurofolio</value>
+ <value>L7170 Eurofolio</value>
</prop>
<prop oor:name="Measure">
@@ -4225,8 +3879,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171 Lever Arch</value>
+ <value>L7171 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -4237,8 +3890,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7172 Ring Binder</value>
+ <value>L7172 Ring Binder</value>
</prop>
<prop oor:name="Measure">
@@ -4249,8 +3901,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Address</value>
+ <value>L7173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4261,8 +3912,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Mini Adress</value>
+ <value>L7651 Mini Adress</value>
</prop>
<prop oor:name="Measure">
@@ -4273,8 +3923,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7656 35 mm Slide</value>
+ <value>L7656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -4285,8 +3934,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7664 3.5&quot; Diskette - Wraparound</value>
+ <value>L7664 3.5&quot; Diskette - Wraparound</value>
</prop>
<prop oor:name="Measure">
@@ -4297,8 +3945,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7665 Mini Data Cartridge</value>
+ <value>L7665 Mini Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -4309,8 +3956,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7666 3.5&quot; Diskette</value>
+ <value>L7666 3.5&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -4321,8 +3967,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7667 Standard Data Cartridge</value>
+ <value>L7667 Standard Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -4333,8 +3978,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7668 Labels for Zip(TM) Disk</value>
+ <value>L7668 Labels for Zip(TM) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -4345,8 +3989,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7671 Video Face</value>
+ <value>L7671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -4357,8 +4000,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7674 Video Spine</value>
+ <value>L7674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -4369,8 +4011,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78382 Address</value>
+ <value>L78382 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4381,8 +4022,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78383 Address</value>
+ <value>L78383 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4393,8 +4033,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78384 Address</value>
+ <value>L78384 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4405,8 +4044,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78386 Address</value>
+ <value>L78386 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4417,8 +4055,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78387 Address</value>
+ <value>L78387 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4429,8 +4066,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78388 Address</value>
+ <value>L78388 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4441,8 +4077,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M21131 Business Cards</value>
+ <value>M21131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -4453,8 +4088,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M8167 A4 Sheet</value>
+ <value>M8167 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4465,8 +4099,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88173 Address</value>
+ <value>M88173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4477,8 +4110,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88175 Address</value>
+ <value>M88175 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4489,8 +4121,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88177 Address</value>
+ <value>M88177 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4501,8 +4132,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88179 Address</value>
+ <value>M88179 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4513,8 +4143,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88183 Address</value>
+ <value>M88183 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4525,8 +4154,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88185 Address</value>
+ <value>M88185 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4537,8 +4165,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88187 Address</value>
+ <value>M88187 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4549,8 +4176,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88315 Address</value>
+ <value>M88315 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4561,8 +4187,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78204 Address</value>
+ <value>P78204 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4573,8 +4198,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78261 Address</value>
+ <value>P78261 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4585,8 +4209,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78270 Address</value>
+ <value>P78270 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4597,8 +4220,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78275 Address</value>
+ <value>P78275 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4612,8 +4234,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5167 Return Address</value>
+ <value>5167 Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4624,8 +4245,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5267 Return Address</value>
+ <value>5267 Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4636,8 +4256,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5160 Address</value>
+ <value>5160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4648,8 +4267,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5260 Address</value>
+ <value>5260 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4660,8 +4278,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5960 Address</value>
+ <value>5960 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4672,8 +4289,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5159 Address</value>
+ <value>5159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4684,8 +4300,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5161 Address</value>
+ <value>5161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4696,8 +4311,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5261 Address</value>
+ <value>5261 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4708,8 +4322,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5961 Address</value>
+ <value>5961 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4720,8 +4333,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5162 Address</value>
+ <value>5162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4732,8 +4344,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5262 Address</value>
+ <value>5262 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4744,8 +4355,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5922 Address</value>
+ <value>5922 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4756,8 +4366,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5962 Address</value>
+ <value>5962 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4768,8 +4377,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5163 Address / Shipping</value>
+ <value>5163 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4780,8 +4388,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5263 Address / Shipping</value>
+ <value>5263 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4792,8 +4399,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5963 Address / Shipping</value>
+ <value>5963 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4804,8 +4410,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5164 Address / Shipping</value>
+ <value>5164 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4816,8 +4421,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5264 Address / Shipping</value>
+ <value>5264 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4828,8 +4432,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5168 Shipping</value>
+ <value>5168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4840,8 +4443,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5667 Clear Return Address</value>
+ <value>5667 Clear Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4852,8 +4454,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5660 Clear Address</value>
+ <value>5660 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4864,8 +4465,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5930 Clear Address</value>
+ <value>5930 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4876,8 +4476,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5661 Clear Address</value>
+ <value>5661 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4888,8 +4487,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5662 Clear Address</value>
+ <value>5662 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4900,8 +4498,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5663 Clear Address</value>
+ <value>5663 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4912,8 +4509,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5664 Clear Address / Shipping</value>
+ <value>5664 Clear Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4924,8 +4520,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5165 Full Sheet</value>
+ <value>5165 Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4936,8 +4531,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5265 Full Sheet</value>
+ <value>5265 Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4948,8 +4542,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5266 File Folder-Assorted</value>
+ <value>5266 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -4960,8 +4553,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5066 File Folder-Red</value>
+ <value>5066 File Folder-Red</value>
</prop>
<prop oor:name="Measure">
@@ -4972,8 +4564,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5166 File Folder-Orange</value>
+ <value>5166 File Folder-Orange</value>
</prop>
<prop oor:name="Measure">
@@ -4984,8 +4575,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5366 File Folder-White</value>
+ <value>5366 File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -4996,8 +4586,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5666 File Folder-Purple</value>
+ <value>5666 File Folder-Purple</value>
</prop>
<prop oor:name="Measure">
@@ -5008,8 +4597,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5766 File Folder-Blue</value>
+ <value>5766 File Folder-Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5020,8 +4608,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5866 File Folder-Green</value>
+ <value>5866 File Folder-Green</value>
</prop>
<prop oor:name="Measure">
@@ -5032,8 +4619,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5966 File Folder-Yellow</value>
+ <value>5966 File Folder-Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -5044,8 +4630,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5293 Round</value>
+ <value>5293 Round</value>
</prop>
<prop oor:name="Measure">
@@ -5056,8 +4641,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5294 Round</value>
+ <value>5294 Round</value>
</prop>
<prop oor:name="Measure">
@@ -5068,8 +4652,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5196 3-1/2&quot; Diskette - White</value>
+ <value>5196 3-1/2&quot; Diskette - White</value>
</prop>
<prop oor:name="Measure">
@@ -5080,8 +4663,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5096 3-1/2&quot; Diskette - Red</value>
+ <value>5096 3-1/2&quot; Diskette - Red</value>
</prop>
<prop oor:name="Measure">
@@ -5092,8 +4674,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5896 3-1/2&quot; Diskette - Blue</value>
+ <value>5896 3-1/2&quot; Diskette - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5104,8 +4685,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5197 5-1/4 Diskette - White</value>
+ <value>5197 5-1/4 Diskette - White</value>
</prop>
<prop oor:name="Measure">
@@ -5116,8 +4696,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5198 Audio Cassette</value>
+ <value>5198 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -5128,8 +4707,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5199 Video Cassette Face</value>
+ <value>5199 Video Cassette Face</value>
</prop>
<prop oor:name="Measure">
@@ -5140,8 +4718,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5199 Video Cassette Spine</value>
+ <value>5199 Video Cassette Spine</value>
</prop>
<prop oor:name="Measure">
@@ -5152,8 +4729,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (bottom spine)</value>
+ <value>5925 White Laser Labels for Zip Disks (bottom spine)</value>
</prop>
<prop oor:name="Measure">
@@ -5164,8 +4740,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (face)</value>
+ <value>5925 White Laser Labels for Zip Disks (face)</value>
</prop>
<prop oor:name="Measure">
@@ -5176,8 +4751,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (top spine)</value>
+ <value>5925 White Laser Labels for Zip Disks (top spine)</value>
</prop>
<prop oor:name="Measure">
@@ -5188,8 +4762,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5931 White CD/DVD Labels for Lasers (face)</value>
+ <value>5931 White CD/DVD Labels for Lasers (face)</value>
</prop>
<prop oor:name="Measure">
@@ -5200,8 +4773,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5931 White CD/DVD Labels for Lasers (spines)</value>
+ <value>5931 White CD/DVD Labels for Lasers (spines)</value>
</prop>
<prop oor:name="Measure">
@@ -5212,8 +4784,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5970 Fluorescent Laser - Magenta</value>
+ <value>5970 Fluorescent Laser - Magenta</value>
</prop>
<prop oor:name="Measure">
@@ -5224,8 +4795,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5971 Fluorescent Laser - Green</value>
+ <value>5971 Fluorescent Laser - Green</value>
</prop>
<prop oor:name="Measure">
@@ -5236,8 +4806,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5972 Fluorescent Laser - Yellow</value>
+ <value>5972 Fluorescent Laser - Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -5248,8 +4817,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5975 Fluorescent Laser - Full Sheet Assorted</value>
+ <value>5975 Fluorescent Laser - Full Sheet Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5260,8 +4828,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5979 Fluorescent Laser - Assorted</value>
+ <value>5979 Fluorescent Laser - Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5272,8 +4839,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5980 Pastel Laser - Blue</value>
+ <value>5980 Pastel Laser - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5284,8 +4850,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5997 Videotape Face</value>
+ <value>5997 Videotape Face</value>
</prop>
<prop oor:name="Measure">
@@ -5296,8 +4861,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5997 Videotape Spine</value>
+ <value>5997 Videotape Spine</value>
</prop>
<prop oor:name="Measure">
@@ -5308,8 +4872,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5998 Audio Tape</value>
+ <value>5998 Audio Tape</value>
</prop>
<prop oor:name="Measure">
@@ -5320,8 +4883,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5395 Name Badge - White</value>
+ <value>5395 Name Badge - White</value>
</prop>
<prop oor:name="Measure">
@@ -5332,8 +4894,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5095 Name Badge - Red</value>
+ <value>5095 Name Badge - Red</value>
</prop>
<prop oor:name="Measure">
@@ -5344,8 +4905,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5895 Name Badge - Blue</value>
+ <value>5895 Name Badge - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5356,8 +4916,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5371 Business Card - White</value>
+ <value>5371 Business Card - White</value>
</prop>
<prop oor:name="Measure">
@@ -5368,8 +4927,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5871 Laser Business Card</value>
+ <value>5871 Laser Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -5380,8 +4938,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5376 Business Card - Ivory</value>
+ <value>5376 Business Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -5392,8 +4949,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5377 Business Card - Gray</value>
+ <value>5377 Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -5404,8 +4960,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5911 Business Card</value>
+ <value>5911 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -5416,8 +4971,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5383 Name Tag Kit</value>
+ <value>5383 Name Tag Kit</value>
</prop>
<prop oor:name="Measure">
@@ -5428,8 +4982,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5390 Name Tag Refill</value>
+ <value>5390 Name Tag Refill</value>
</prop>
<prop oor:name="Measure">
@@ -5440,8 +4993,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5883 Name Tag Kit - Blue</value>
+ <value>5883 Name Tag Kit - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5452,8 +5004,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5384 Name Tag Kit</value>
+ <value>5384 Name Tag Kit</value>
</prop>
<prop oor:name="Measure">
@@ -5464,8 +5015,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5392 Name Tag Refill</value>
+ <value>5392 Name Tag Refill</value>
</prop>
<prop oor:name="Measure">
@@ -5476,8 +5026,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5385 Rotary Card - Small</value>
+ <value>5385 Rotary Card - Small</value>
</prop>
<prop oor:name="Measure">
@@ -5488,8 +5037,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5386 Rotary Card - Large</value>
+ <value>5386 Rotary Card - Large</value>
</prop>
<prop oor:name="Measure">
@@ -5500,8 +5048,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5388 Index Card</value>
+ <value>5388 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -5512,8 +5059,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5389 Post Card</value>
+ <value>5389 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -5524,8 +5070,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5305 Laser Tent Cards Med.</value>
+ <value>5305 Laser Tent Cards Med.</value>
</prop>
<prop oor:name="Measure">
@@ -5536,8 +5081,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5309 Laser Tent Cards Large</value>
+ <value>5309 Laser Tent Cards Large</value>
</prop>
<prop oor:name="Measure">
@@ -5548,8 +5092,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5315 Laser Note Cards</value>
+ <value>5315 Laser Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5560,8 +5103,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5361 Laminated ID Cards</value>
+ <value>5361 Laminated ID Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5572,8 +5114,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5361 Laminated ID Cards-Single Card</value>
+ <value>5361 Laminated ID Cards-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5584,8 +5125,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5362 Laminated Name Badges</value>
+ <value>5362 Laminated Name Badges</value>
</prop>
<prop oor:name="Measure">
@@ -5596,8 +5136,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5362 Laminated N. Badges-Single Card</value>
+ <value>5362 Laminated N. Badges-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5608,8 +5147,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5364 Laminated Rotary Index Cards</value>
+ <value>5364 Laminated Rotary Index Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5620,8 +5158,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5364 Laminated Rotary Index-Single Card</value>
+ <value>5364 Laminated Rotary Index-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5632,8 +5169,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74520 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74520 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5644,8 +5180,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74540 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74540 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5656,8 +5191,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74541 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74541 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5668,8 +5202,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74550 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74550 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5680,8 +5213,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74552 Name Badge Inserts - 2&quot; x 3&quot;</value>
+ <value>74552 Name Badge Inserts - 2&quot; x 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5692,8 +5224,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74558 Name Badge Inserts - 2&quot; x 3&quot;</value>
+ <value>74558 Name Badge Inserts - 2&quot; x 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5704,8 +5235,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74650 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74650 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5716,8 +5246,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74651 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74651 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5728,8 +5257,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8160 Ink Jet Address</value>
+ <value>8160 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5740,8 +5268,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8460 Ink Jet Address</value>
+ <value>8460 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5752,8 +5279,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8461 Ink Jet Address</value>
+ <value>8461 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5764,8 +5290,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8161 Ink Jet Address</value>
+ <value>8161 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5776,8 +5301,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8162 Ink Jet Address</value>
+ <value>8162 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5788,8 +5312,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8462 Ink Jet Address</value>
+ <value>8462 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5800,8 +5323,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8163 Ink Jet Address / Shipping</value>
+ <value>8163 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5812,8 +5334,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8463 Ink Jet Address / Shipping</value>
+ <value>8463 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5824,8 +5345,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8464 Ink Jet Address / Shipping</value>
+ <value>8464 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5836,8 +5356,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8923 Ink Jet Address / Shipping</value>
+ <value>8923 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5848,8 +5367,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8164 Ink Jet Address / Shipping</value>
+ <value>8164 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5860,8 +5378,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8165 Ink Jet Full Sheet</value>
+ <value>8165 Ink Jet Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -5872,8 +5389,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8465 Ink Jet Full Sheet</value>
+ <value>8465 Ink Jet Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -5884,8 +5400,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8166 Ink Jet File Folder-Assorted</value>
+ <value>8166 Ink Jet File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5896,8 +5411,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8366 Ink Jet File Folder-White</value>
+ <value>8366 Ink Jet File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -5908,8 +5422,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8167 Ink Jet Return Address</value>
+ <value>8167 Ink Jet Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -5920,8 +5433,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8196 Ink Jet 3-1/2&quot; Diskette</value>
+ <value>8196 Ink Jet 3-1/2&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -5932,8 +5444,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8250 Ink Jet Label for Color Printing</value>
+ <value>8250 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5944,8 +5455,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8252 Ink Jet Label for Color Printing</value>
+ <value>8252 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5956,8 +5466,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8253 Ink Jet Label for Color Printing</value>
+ <value>8253 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5968,8 +5477,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8254 Ink Jet Label for Color Printing</value>
+ <value>8254 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5980,8 +5488,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8255 Ink Jet Label for Color Printing </value>
+ <value>8255 Ink Jet Label for Color Printing </value>
</prop>
<prop oor:name="Measure">
@@ -5992,8 +5499,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8257 Ink Jet Return Address for Color Printing</value>
+ <value>8257 Ink Jet Return Address for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -6004,8 +5510,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8309 Tent Card Large</value>
+ <value>8309 Tent Card Large</value>
</prop>
<prop oor:name="Measure">
@@ -6016,8 +5521,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8315 Ink Jet Note Cards</value>
+ <value>8315 Ink Jet Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -6028,8 +5532,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8316 Ink Jet Greeting Card (Portrait)*</value>
+ <value>8316 Ink Jet Greeting Card (Portrait)*</value>
</prop>
<prop oor:name="Measure">
@@ -6040,8 +5543,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8316 Ink Jet Greeting Card (Landscape)*</value>
+ <value>8316 Ink Jet Greeting Card (Landscape)*</value>
</prop>
<prop oor:name="Measure">
@@ -6052,8 +5554,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8324 Ink Jet Brochures</value>
+ <value>8324 Ink Jet Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -6064,8 +5565,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8371 Ink Jet Business Card</value>
+ <value>8371 Ink Jet Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -6076,8 +5576,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8385 Rotary Card - Small</value>
+ <value>8385 Rotary Card - Small</value>
</prop>
<prop oor:name="Measure">
@@ -6088,8 +5587,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8387 Ink Jet Postcard - 4-up</value>
+ <value>8387 Ink Jet Postcard - 4-up</value>
</prop>
<prop oor:name="Measure">
@@ -6100,8 +5598,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8388 Index Card</value>
+ <value>8388 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -6112,8 +5609,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8871 Clean Edge Business Cards (IJ)</value>
+ <value>8871 Clean Edge Business Cards (IJ)</value>
</prop>
<prop oor:name="Measure">
@@ -6124,8 +5620,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8376 Ink Jet Business Card - Ivory</value>
+ <value>8376 Ink Jet Business Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -6136,8 +5631,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8377 Ink Jet Business Card - Gray</value>
+ <value>8377 Ink Jet Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -6148,8 +5642,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8660 Ink Jet Clear Address</value>
+ <value>8660 Ink Jet Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -6160,8 +5653,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8662 Ink Jet Clear Address</value>
+ <value>8662 Ink Jet Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -6172,8 +5664,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8663 Ink Jet Clear Address/Shipping</value>
+ <value>8663 Ink Jet Clear Address/Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6184,8 +5675,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8665 Ink Jet Clear Full Sheet</value>
+ <value>8665 Ink Jet Clear Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -6196,8 +5686,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8667 Ink Jet Clear Address Labels</value>
+ <value>8667 Ink Jet Clear Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -6208,8 +5697,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (bottom spine)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (bottom spine)</value>
</prop>
<prop oor:name="Measure">
@@ -6220,8 +5708,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (face)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (face)</value>
</prop>
<prop oor:name="Measure">
@@ -6232,8 +5719,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (top spine)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (top spine)</value>
</prop>
<prop oor:name="Measure">
@@ -6244,8 +5730,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Insert (spines)</value>
+ <value>8931 White CD/DVD Jewel Case Insert (spines)</value>
</prop>
<prop oor:name="Measure">
@@ -6256,8 +5741,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Inserts (cover)</value>
+ <value>8931 White CD/DVD Jewel Case Inserts (cover)</value>
</prop>
<prop oor:name="Measure">
@@ -6268,8 +5752,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Inserts (tray)</value>
+ <value>8931 White CD/DVD Jewel Case Inserts (tray)</value>
</prop>
<prop oor:name="Measure">
@@ -6280,8 +5763,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Labels for Inkjet Printers</value>
+ <value>8931 White CD/DVD Labels for Inkjet Printers</value>
</prop>
<prop oor:name="Measure">
@@ -6292,8 +5774,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11161 Ready Index ExtraWide 5 Tab</value>
+ <value>11161 Ready Index ExtraWide 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6304,8 +5785,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11163 Ready Index ExtraWide 8 Tab</value>
+ <value>11163 Ready Index ExtraWide 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6316,8 +5796,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11165 Ready Index ExtraWide 10 Tab</value>
+ <value>11165 Ready Index ExtraWide 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6328,8 +5807,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11526 Direct Print Custom Dividers 5 Tab Single Set</value>
+ <value>11526 Direct Print Custom Dividers 5 Tab Single Set</value>
</prop>
<prop oor:name="Measure">
@@ -6340,8 +5818,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11527 Direct Print Custom Dividers 8 Tab Single Set</value>
+ <value>11527 Direct Print Custom Dividers 8 Tab Single Set</value>
</prop>
<prop oor:name="Measure">
@@ -6352,8 +5829,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11171 Easy Edit Ready Index - 5 Tabs</value>
+ <value>11171 Easy Edit Ready Index - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6364,8 +5840,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11172 Easy Edit Ready Index - 8 Tabs</value>
+ <value>11172 Easy Edit Ready Index - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6376,8 +5851,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11173 Easy Edit Ready Index - 10 Tabs</value>
+ <value>11173 Easy Edit Ready Index - 10 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6388,8 +5862,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Presentation Kit 5 Tab</value>
+ <value>11251 Clear Label/Index Maker Presentation Kit 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6400,8 +5873,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6412,8 +5884,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6424,8 +5895,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6436,8 +5906,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
+ <value>11251 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
</prop>
<prop oor:name="Measure">
@@ -6448,8 +5917,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Narrow 5 Tab</value>
+ <value>11253 Clear Label/Index Maker Narrow 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6460,8 +5928,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6472,8 +5939,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6484,8 +5950,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6496,8 +5961,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
+ <value>11253 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
</prop>
<prop oor:name="Measure">
@@ -6508,8 +5972,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11260 Ready Index Landscape - 5 Tabs</value>
+ <value>11260 Ready Index Landscape - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6520,8 +5983,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11261 Ready Index Landscape - 8 Tabs</value>
+ <value>11261 Ready Index Landscape - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6532,8 +5994,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">12260 Ready Index Landscape - 5 Tabs</value>
+ <value>12260 Ready Index Landscape - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6544,8 +6005,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">12261 Ready Index Landscape - 8 Tabs</value>
+ <value>12261 Ready Index Landscape - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6556,8 +6016,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 3 Tab</value>
+ <value>Index Maker 3 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6568,8 +6027,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 5 Tab</value>
+ <value>Index Maker 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6580,8 +6038,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 8 Tab</value>
+ <value>Index Maker 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6592,8 +6049,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 5 Tab</value>
+ <value>Hidden Tab 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6604,8 +6060,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 8 Tab</value>
+ <value>Hidden Tab 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6616,8 +6071,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 10 Tab</value>
+ <value>Hidden Tab 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6628,8 +6082,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 1&quot;</value>
+ <value>Prof. Ready Index Spine Insert 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6640,8 +6093,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 1 1/2&quot;</value>
+ <value>Prof. Ready Index Spine Insert 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6652,8 +6104,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 2&quot;</value>
+ <value>Prof. Ready Index Spine Insert 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6664,8 +6115,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 3&quot;</value>
+ <value>Prof. Ready Index Spine Insert 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6676,8 +6126,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 5 Tab</value>
+ <value>Ready Index 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6688,8 +6137,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 8 Tab</value>
+ <value>Ready Index 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6700,8 +6148,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 10 Tab</value>
+ <value>Ready Index 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6712,8 +6159,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 12 Tab</value>
+ <value>Ready Index 12 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6724,8 +6170,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 15 Tab</value>
+ <value>Ready Index 15 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6736,8 +6181,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Divider 5 Tabs</value>
+ <value>WorkSaver Divider 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6748,8 +6192,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Divider 8 Tabs</value>
+ <value>WorkSaver Divider 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6760,8 +6203,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Inserts 1/3 Cut</value>
+ <value>WorkSaver Inserts 1/3 Cut</value>
</prop>
<prop oor:name="Measure">
@@ -6772,8 +6214,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Inserts 1/5 Cut</value>
+ <value>WorkSaver Inserts 1/5 Cut</value>
</prop>
<prop oor:name="Measure">
@@ -6784,8 +6225,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 1&quot;</value>
+ <value>Self Adhesive Index Tab 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6796,8 +6236,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 1 1/2&quot;</value>
+ <value>Self Adhesive Index Tab 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6808,8 +6247,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 2&quot;</value>
+ <value>Self Adhesive Index Tab 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6820,8 +6258,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Protect &apos;n Tab - 5 Tab</value>
+ <value>Protect &apos;n Tab - 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6832,8 +6269,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Protect &apos;n Tab - 8 Tab</value>
+ <value>Protect &apos;n Tab - 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6844,8 +6280,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 1&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6856,8 +6291,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 1 1/2&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6868,8 +6302,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 2&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6880,8 +6313,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst. Spines Insert 3&quot;</value>
+ <value>TitleFrames Asst. Spines Insert 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6892,8 +6324,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Cover - 1&quot;</value>
+ <value>TitleFrames Cover - 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6904,8 +6335,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Spine - 1&quot;</value>
+ <value>TitleFrames Spine - 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6916,8 +6346,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Cover - 1 1/2&quot;</value>
+ <value>TitleFrames Cover - 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6928,8 +6357,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Spine - 1 1/2&quot;</value>
+ <value>TitleFrames Spine - 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6940,8 +6368,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2160 Addressing</value>
+ <value>2160 Addressing</value>
</prop>
<prop oor:name="Measure">
@@ -6952,8 +6379,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2162 Addressing</value>
+ <value>2162 Addressing</value>
</prop>
<prop oor:name="Measure">
@@ -6964,8 +6390,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2163 Address/Shipping</value>
+ <value>2163 Address/Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6976,8 +6401,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2164 Shipping</value>
+ <value>2164 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6988,8 +6412,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2180 File Folder-Assorted</value>
+ <value>2180 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -7000,8 +6423,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2181 File Folder-White</value>
+ <value>2181 File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -7012,8 +6434,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2186 3.5&quot; Diskette-White</value>
+ <value>2186 3.5&quot; Diskette-White</value>
</prop>
<prop oor:name="Measure">
@@ -7024,8 +6445,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6490 Remove &apos;Em 3.5&quot; Diskette-Face Only Labels</value>
+ <value>6490 Remove &apos;Em 3.5&quot; Diskette-Face Only Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7036,8 +6456,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6466 Remove &apos;Em File Folder Labels</value>
+ <value>6466 Remove &apos;Em File Folder Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7048,8 +6467,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6460 Remove &apos;Em Address Labels</value>
+ <value>6460 Remove &apos;Em Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7060,8 +6478,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6464 Remove &apos;Em Shipping Labels</value>
+ <value>6464 Remove &apos;Em Shipping Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7072,8 +6489,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6465 Removable Laser - Full Sheet</value>
+ <value>6465 Removable Laser - Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -7084,8 +6500,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6467 Removable Laser - Small Multi-Purpose</value>
+ <value>6467 Removable Laser - Small Multi-Purpose</value>
</prop>
<prop oor:name="Measure">
@@ -7096,8 +6511,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6503 Remove&apos;em white laser 8 1/2&quot; x 11&quot;</value>
+ <value>6503 Remove&apos;em white laser 8 1/2&quot; x 11&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -7108,8 +6522,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5824 CD-Recordable Labels</value>
+ <value>5824 CD-Recordable Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7120,8 +6533,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5836 MtgCreator Portfolio Label</value>
+ <value>5836 MtgCreator Portfolio Label</value>
</prop>
<prop oor:name="Measure">
@@ -7132,8 +6544,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5836 MtgCreator Divider 5 Tab</value>
+ <value>5836 MtgCreator Divider 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -7144,8 +6555,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3111 Square Stickers</value>
+ <value>3111 Square Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7156,8 +6566,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3112 Small Round Stickers</value>
+ <value>3112 Small Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7168,8 +6577,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3114 Full Page Stickers</value>
+ <value>3114 Full Page Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7180,8 +6588,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3248 Glossy Photo Quality Postcard</value>
+ <value>3248 Glossy Photo Quality Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7192,8 +6599,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3251 Feather Edge Greeting Card</value>
+ <value>3251 Feather Edge Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7204,8 +6610,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3252 Vellum Overlay Greeting Card</value>
+ <value>3252 Vellum Overlay Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7216,8 +6621,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3254 Glossy Photo Quality Print-to-the-Edge Greeting Card</value>
+ <value>3254 Glossy Photo Quality Print-to-the-Edge Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7228,8 +6632,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3256 White Embossed Note Cards</value>
+ <value>3256 White Embossed Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7240,8 +6643,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3259 Ivory Embossed Note Card</value>
+ <value>3259 Ivory Embossed Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -7252,8 +6654,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3260 Ivory Embossed Half-Fold Card</value>
+ <value>3260 Ivory Embossed Half-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7264,8 +6665,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Large Labels</value>
+ <value>3261 White Large Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7276,8 +6676,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Small Labels</value>
+ <value>3261 White Small Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7288,8 +6687,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Return Address Labels</value>
+ <value>3261 White Return Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7300,8 +6698,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3263 White Postcard</value>
+ <value>3263 White Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7312,8 +6709,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3265 White Half-Fold Card</value>
+ <value>3265 White Half-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7324,8 +6720,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3266 White Quarter-Fold Card</value>
+ <value>3266 White Quarter-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7336,8 +6731,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3268 White Note Card</value>
+ <value>3268 White Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -7348,8 +6742,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Big Round Stickers</value>
+ <value>3274 White Big Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7360,8 +6753,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Small Round Stickers</value>
+ <value>3274 White Small Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7372,8 +6764,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Square Stickers</value>
+ <value>3274 White Square Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7384,8 +6775,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3269 Glossy Photo Quality Half-Fold Cards</value>
+ <value>3269 Glossy Photo Quality Half-Fold Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7396,8 +6786,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8313 Glossy Photo Quality 4&quot; x 6&quot; Card</value>
+ <value>8313 Glossy Photo Quality 4&quot; x 6&quot; Card</value>
</prop>
<prop oor:name="Measure">
@@ -7408,8 +6797,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8314 Glossy Photo Quality 8-1/2&quot; x 11&quot; Card</value>
+ <value>8314 Glossy Photo Quality 8-1/2&quot; x 11&quot; Card</value>
</prop>
<prop oor:name="Measure">
@@ -7420,8 +6808,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8373 Glossy Photo Quality Business Card</value>
+ <value>8373 Glossy Photo Quality Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -7432,8 +6819,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8389 Glossy Photo Quality Postcard</value>
+ <value>8389 Glossy Photo Quality Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7444,8 +6830,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8763 Glossy Photo Quality Labels</value>
+ <value>8763 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7456,8 +6841,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8769 Glossy Photo Quality Labels</value>
+ <value>8769 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7468,8 +6852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3273 White Print-to-the-Edge Greeting Cards</value>
+ <value>3273 White Print-to-the-Edge Greeting Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7480,8 +6863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3277 Textured Canvas for Ink Jet Printers</value>
+ <value>3277 Textured Canvas for Ink Jet Printers</value>
</prop>
<prop oor:name="Measure">
@@ -7492,8 +6874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8317 Embossed Ink Jet Note Card - Ivory</value>
+ <value>8317 Embossed Ink Jet Note Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -7504,8 +6885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8384 Photo Quality Brochures</value>
+ <value>8384 Photo Quality Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -7516,8 +6896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">53220 Glossy 4x6 Photo Paper</value>
+ <value>53220 Glossy 4x6 Photo Paper</value>
</prop>
<prop oor:name="Measure">
@@ -7528,8 +6907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">53221 Glossy 5x7 Photo Paper</value>
+ <value>53221 Glossy 5x7 Photo Paper</value>
</prop>
<prop oor:name="Measure">
@@ -7540,8 +6918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5881 Color Laser Business Cards</value>
+ <value>5881 Color Laser Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7552,8 +6929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5884 Glossy Color Laser Brochures</value>
+ <value>5884 Glossy Color Laser Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -7564,8 +6940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5889 Color Laser Postcards</value>
+ <value>5889 Color Laser Postcards</value>
</prop>
<prop oor:name="Measure">
@@ -7576,8 +6951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8877 Ink Jet Business Card - Gray</value>
+ <value>8877 Ink Jet Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -7588,8 +6962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6873 Color Laser Address Labels</value>
+ <value>6873 Color Laser Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7600,8 +6973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6879 Color Laser Address Labels</value>
+ <value>6879 Color Laser Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7612,8 +6984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4207 Price Marking</value>
+ <value>4207 Price Marking</value>
</prop>
<prop oor:name="Measure">
@@ -7624,8 +6995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4144 Address</value>
+ <value>4144 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7636,8 +7006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4021 Address</value>
+ <value>4021 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7648,8 +7017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4145 Address</value>
+ <value>4145 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7660,8 +7028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4013 Address</value>
+ <value>4013 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7672,8 +7039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">R-4013 Address</value>
+ <value>R-4013 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7684,8 +7050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4030 Address</value>
+ <value>4030 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7696,8 +7061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4031 Address</value>
+ <value>4031 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7708,8 +7072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4029 Address</value>
+ <value>4029 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7720,8 +7083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4060 Address</value>
+ <value>4060 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7732,8 +7094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4065 Address</value>
+ <value>4065 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7744,8 +7105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4143 Address</value>
+ <value>4143 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7756,8 +7116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4066 Address</value>
+ <value>4066 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7768,8 +7127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4146 Address</value>
+ <value>4146 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7780,8 +7138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4014 Address</value>
+ <value>4014 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7792,8 +7149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4032 Address</value>
+ <value>4032 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7804,8 +7160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4033 Address</value>
+ <value>4033 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7816,8 +7171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4022 Address</value>
+ <value>4022 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7828,8 +7182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4162 Address-Clear</value>
+ <value>4162 Address-Clear</value>
</prop>
<prop oor:name="Measure">
@@ -7840,8 +7193,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4601 Address-Clear</value>
+ <value>4601 Address-Clear</value>
</prop>
<prop oor:name="Measure">
@@ -7852,8 +7204,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4161 Shipping-Red Border</value>
+ <value>4161 Shipping-Red Border</value>
</prop>
<prop oor:name="Measure">
@@ -7864,8 +7215,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4088 Shipping</value>
+ <value>4088 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7876,8 +7226,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4076 Shipping</value>
+ <value>4076 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7888,8 +7237,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4110 Shipping</value>
+ <value>4110 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7900,8 +7248,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4027 File Folder / Address</value>
+ <value>4027 File Folder / Address</value>
</prop>
<prop oor:name="Measure">
@@ -7912,8 +7259,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4255 File Folder</value>
+ <value>4255 File Folder</value>
</prop>
<prop oor:name="Measure">
@@ -7924,8 +7270,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4266 File Folder-Assorted</value>
+ <value>4266 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -7936,8 +7281,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4163 Piggyback</value>
+ <value>4163 Piggyback</value>
</prop>
<prop oor:name="Measure">
@@ -7948,8 +7292,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4160 Name Badge</value>
+ <value>4160 Name Badge</value>
</prop>
<prop oor:name="Measure">
@@ -7960,8 +7303,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4241 3-1/2&quot; Diskette</value>
+ <value>4241 3-1/2&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -7972,8 +7314,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4166 Index Card</value>
+ <value>4166 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -7984,8 +7325,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4167 Post Card</value>
+ <value>4167 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -7996,8 +7336,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4037 Address</value>
+ <value>4037 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8008,8 +7347,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4020 Address</value>
+ <value>4020 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8020,8 +7358,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4109 Address</value>
+ <value>4109 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8032,8 +7369,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4018 Address - Removable</value>
+ <value>4018 Address - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -8044,8 +7380,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4062 Address</value>
+ <value>4062 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8056,8 +7391,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4035 Address</value>
+ <value>4035 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8068,8 +7402,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4052 Data Storage</value>
+ <value>4052 Data Storage</value>
</prop>
<prop oor:name="Measure">
@@ -8080,8 +7413,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4067 Address</value>
+ <value>4067 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8092,8 +7424,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4019 Address - Removable</value>
+ <value>4019 Address - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -8104,8 +7435,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4015 Address</value>
+ <value>4015 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8116,8 +7446,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4090 Address</value>
+ <value>4090 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8128,8 +7457,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4043 Shipping</value>
+ <value>4043 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -8143,8 +7471,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2493 Inkjet-Photo-Papier, blanko</value>
+ <value>2493 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8155,8 +7482,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2494 Inkjet-Photo-Papier, blanko</value>
+ <value>2494 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8167,8 +7493,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2495 Inkjet-Photo-Papier, blanko</value>
+ <value>2495 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8179,8 +7504,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32010 Visitenkarten, blanko</value>
+ <value>32010 Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8191,8 +7515,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32011 Visitenkarten, blanko, schnittgestanzt</value>
+ <value>32011 Visitenkarten, blanko, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8203,8 +7526,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32012 Visitenkarten, blanko, schnittgestanzt</value>
+ <value>32012 Visitenkarten, blanko, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8215,8 +7537,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32014 Inkjet-Visitenkarten, blanko</value>
+ <value>32014 Inkjet-Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8227,8 +7548,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32017 Doppel-Visitenkarten, blanko</value>
+ <value>32017 Doppel-Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8239,8 +7559,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32020 Visitenkarten, marmoriert</value>
+ <value>32020 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8251,8 +7570,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32021 Visitenkarten, marmoriert</value>
+ <value>32021 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8263,8 +7581,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32022 Visitenkarten, marmoriert</value>
+ <value>32022 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8275,8 +7592,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32023 Visitenkarten, marmoriert</value>
+ <value>32023 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8287,8 +7603,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32029 Visitenkarten, blanko, Glossy</value>
+ <value>32029 Visitenkarten, blanko, Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -8299,8 +7614,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32030 Visitenkarten, Blue Wave</value>
+ <value>32030 Visitenkarten, Blue Wave</value>
</prop>
<prop oor:name="Measure">
@@ -8311,8 +7625,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32031 Visitenkarten, Paradise</value>
+ <value>32031 Visitenkarten, Paradise</value>
</prop>
<prop oor:name="Measure">
@@ -8323,8 +7636,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32032 Visitenkarten, Sahara</value>
+ <value>32032 Visitenkarten, Sahara</value>
</prop>
<prop oor:name="Measure">
@@ -8335,8 +7647,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32036 Visitenkarten, Cosmic</value>
+ <value>32036 Visitenkarten, Cosmic</value>
</prop>
<prop oor:name="Measure">
@@ -8347,8 +7658,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32040 Visitenkarten, blanko</value>
+ <value>32040 Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8359,8 +7669,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32060 Inkjet Bütten-Papier, Cream</value>
+ <value>32060 Inkjet Bütten-Papier, Cream</value>
</prop>
<prop oor:name="Measure">
@@ -8371,8 +7680,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32061 Inkjet Bütten-Papier, Aqua</value>
+ <value>32061 Inkjet Bütten-Papier, Aqua</value>
</prop>
<prop oor:name="Measure">
@@ -8383,8 +7691,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32062 Inkjet Bütten-Papier, Jade</value>
+ <value>32062 Inkjet Bütten-Papier, Jade</value>
</prop>
<prop oor:name="Measure">
@@ -8395,8 +7702,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32063 Inkjet Bütten-Papier, Sand</value>
+ <value>32063 Inkjet Bütten-Papier, Sand</value>
</prop>
<prop oor:name="Measure">
@@ -8407,8 +7713,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32064 Inkjet-Papier, Leinenstruktur</value>
+ <value>32064 Inkjet-Papier, Leinenstruktur</value>
</prop>
<prop oor:name="Measure">
@@ -8419,8 +7724,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32065 Inkjet-Papier, Hammerschlag</value>
+ <value>32065 Inkjet-Papier, Hammerschlag</value>
</prop>
<prop oor:name="Measure">
@@ -8431,8 +7735,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32080 Marmoriertes Papier</value>
+ <value>32080 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8443,8 +7746,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32081 Marmoriertes Papier</value>
+ <value>32081 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8455,8 +7757,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32082 Marmoriertes Papier</value>
+ <value>32082 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8467,8 +7768,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32083 Marmoriertes Papier</value>
+ <value>32083 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8479,8 +7779,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32098 Urkunde marmoriert, Text rot</value>
+ <value>32098 Urkunde marmoriert, Text rot</value>
</prop>
<prop oor:name="Measure">
@@ -8491,8 +7790,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32099 Urkunde marmoriert, Text gold</value>
+ <value>32099 Urkunde marmoriert, Text gold</value>
</prop>
<prop oor:name="Measure">
@@ -8503,8 +7801,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32250 CD-Einleger, blanko</value>
+ <value>32250 CD-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8515,8 +7812,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32251 Inkjet-CD-Einleger</value>
+ <value>32251 Inkjet-CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -8527,8 +7823,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32252 Postkarte, blanko</value>
+ <value>32252 Postkarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8539,8 +7834,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32253 Tischkarte, blanko</value>
+ <value>32253 Tischkarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8551,8 +7845,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32254 Karteikarte, blanko</value>
+ <value>32254 Karteikarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8563,8 +7856,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32255 Cassetten-Einleger, blanko</value>
+ <value>32255 Cassetten-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8575,8 +7867,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32256 Video-Einleger, blanko</value>
+ <value>32256 Video-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8587,8 +7878,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32257 Tischkarte lang, blanko</value>
+ <value>32257 Tischkarte lang, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8599,8 +7889,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32258 Regalschilder</value>
+ <value>32258 Regalschilder</value>
</prop>
<prop oor:name="Measure">
@@ -8611,8 +7900,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32286 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32286 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8623,8 +7911,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32287 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32287 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8635,8 +7922,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32288 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32288 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8647,8 +7933,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32289 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32289 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8659,8 +7944,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9312 Glossy Visitenkarten, schnittgestanzt</value>
+ <value>C9312 Glossy Visitenkarten, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8671,8 +7955,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3415 Kreise</value>
+ <value>3415 Kreise</value>
</prop>
<prop oor:name="Measure">
@@ -8683,8 +7966,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3416 Kreise</value>
+ <value>3416 Kreise</value>
</prop>
<prop oor:name="Measure">
@@ -8695,8 +7977,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3418 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3418 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8707,8 +7988,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3420 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3420 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8719,8 +7999,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3421 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3421 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8731,8 +8010,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3422 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3422 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8743,8 +8021,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3423 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3423 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8755,8 +8032,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3424 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3424 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8767,8 +8043,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3425 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3425 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8779,8 +8054,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3426 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3426 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8791,8 +8065,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3427 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3427 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8803,8 +8076,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3448 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3448 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8815,8 +8087,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3449 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3449 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8827,8 +8098,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3450 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3450 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8839,8 +8109,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3451 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3451 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8851,8 +8120,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3452 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3452 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8863,8 +8131,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3453 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3453 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8875,8 +8142,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3454 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3454 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8887,8 +8153,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3455 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3455 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8899,8 +8164,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3456 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3456 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8911,8 +8175,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3457 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3457 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8923,8 +8186,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3458 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3458 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8935,8 +8197,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3459 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3459 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8947,8 +8208,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3470 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3470 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8959,8 +8219,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3471 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3471 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8971,8 +8230,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3472 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3472 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8983,8 +8241,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3473 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3473 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8995,8 +8252,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3474 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3474 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9007,8 +8263,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3475 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3475 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9019,8 +8274,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3477 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3477 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9031,8 +8285,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3478 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3478 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9043,8 +8296,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3479 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3479 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9055,8 +8307,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3481 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3481 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9067,8 +8318,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3483 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3483 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9079,8 +8329,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3484 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3484 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9091,8 +8340,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3489 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3489 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9103,8 +8351,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3490 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3490 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9115,8 +8362,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3651 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3651 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9127,8 +8373,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3652 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3652 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9139,8 +8384,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3653 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3653 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9151,8 +8395,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3654 CD-Etiketten</value>
+ <value>3654 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9163,8 +8406,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3655 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3655 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9175,8 +8417,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3657 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3657 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9187,8 +8428,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3658 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3658 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9199,8 +8439,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3659 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3659 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9211,8 +8450,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3660 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3660 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9223,8 +8461,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3661 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3661 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9235,8 +8472,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3662 Ordnerrücken-Etiketten, schmal</value>
+ <value>3662 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9247,8 +8483,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3663 Ordnerrücken-Etiketten, breit</value>
+ <value>3663 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9259,8 +8494,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3664 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3664 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9271,8 +8505,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3665 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3665 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9283,8 +8516,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3666 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3666 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9295,8 +8527,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3667 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3667 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9307,8 +8538,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3668 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3668 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9319,8 +8549,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3669 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3669 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9331,8 +8560,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3674 Computer-Etiketten</value>
+ <value>3674 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9343,8 +8571,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3675 Computer-Etiketten</value>
+ <value>3675 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9355,8 +8582,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3676 Computer-Etiketten</value>
+ <value>3676 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9367,8 +8593,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3677 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3677 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9379,8 +8604,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3684 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3684 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9391,8 +8615,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3685 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3685 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9403,8 +8626,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3686 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3686 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9415,8 +8637,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3687 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3687 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9427,8 +8648,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3688 Ordnerrücken-Etiketten, breit</value>
+ <value>3688 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9439,8 +8659,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3689 Ordnerrücken-Etiketten, schmal</value>
+ <value>3689 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9451,8 +8670,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3691 Ordnerrücken-Etiketten, breit</value>
+ <value>3691 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9463,8 +8681,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3692 Ordnerrücken-Etiketten, breit</value>
+ <value>3692 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9475,8 +8692,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3693 Ordnerrücken-Etiketten, breit</value>
+ <value>3693 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9487,8 +8703,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3694 Ordnerrücken-Etiketten, breit</value>
+ <value>3694 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9499,8 +8714,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3696 Ordnerrücken-Etiketten, schmal</value>
+ <value>3696 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9511,8 +8725,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3697 Ordnerrücken-Etiketten, schmal</value>
+ <value>3697 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9523,8 +8736,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3698 Ordnerrücken-Etiketten, schmal</value>
+ <value>3698 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9535,8 +8747,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3699 Ordnerrücken-Etiketten, schmal</value>
+ <value>3699 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9547,8 +8758,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4720 Transparente Etiketten</value>
+ <value>4720 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9559,8 +8769,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4721 Transparente Etiketten</value>
+ <value>4721 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9571,8 +8780,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4722 Transparente Etiketten</value>
+ <value>4722 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9583,8 +8791,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4723 Transparente Etiketten</value>
+ <value>4723 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9595,8 +8802,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4730 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4730 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9607,8 +8813,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4731 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4731 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9619,8 +8824,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4732 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4732 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9631,8 +8835,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4733 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4733 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9643,8 +8846,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4734 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4734 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9655,8 +8857,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4735 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4735 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9667,8 +8868,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4736 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4736 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9679,8 +8879,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4737 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4737 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9691,8 +8890,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4738 Disketten-Etiketten, Stick+Lift</value>
+ <value>4738 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9703,8 +8901,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4739 Disketten-Etiketten, Stick+Lift</value>
+ <value>4739 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9715,8 +8912,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4740 Disketten-Etiketten, Stick+Lift</value>
+ <value>4740 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9727,8 +8923,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4741 Disketten-Etiketten, Stick+Lift</value>
+ <value>4741 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9739,8 +8934,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4742 Video-Etiketten, Stick+Lift</value>
+ <value>4742 Video-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9751,8 +8945,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4743 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4743 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9763,8 +8956,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4744 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4744 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9775,8 +8967,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4745 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4745 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9787,8 +8978,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4746 Video-Etiketten, Stick+Lift</value>
+ <value>4746 Video-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9799,8 +8989,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4747 Etiketten für ZIP-Disketten</value>
+ <value>4747 Etiketten für ZIP-Disketten</value>
</prop>
<prop oor:name="Measure">
@@ -9811,8 +9000,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4748 Ordnerrücken-Etiketten, schmal</value>
+ <value>4748 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9823,8 +9011,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4749 Ordnerrücken-Etiketten, schmal</value>
+ <value>4749 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9835,8 +9022,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4750 Ordnerrücken-Etiketten, schmal</value>
+ <value>4750 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9847,8 +9033,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4751 Ordnerrücken-Etiketten, schmal</value>
+ <value>4751 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9859,8 +9044,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4752 Ordnerrücken-Etiketten, breit</value>
+ <value>4752 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9871,8 +9055,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4753 Ordnerrücken-Etiketten, breit</value>
+ <value>4753 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9883,8 +9066,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4754 Ordnerrücken-Etiketten, breit</value>
+ <value>4754 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9895,8 +9077,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4755 Ordnerrücken-Etiketten, breit</value>
+ <value>4755 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9907,8 +9088,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4756 Hängeordner-Etiketten, schmal</value>
+ <value>4756 Hängeordner-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9919,8 +9099,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4757 Hängeordner-Etiketten, breit</value>
+ <value>4757 Hängeordner-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9931,8 +9110,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4758 Ordnerrücken-Etiketten, schmal</value>
+ <value>4758 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9943,8 +9121,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4759 Ordnerrücken-Etiketten, breit</value>
+ <value>4759 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9955,8 +9132,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4760 Ordnerrücken-Etiketten, schmal</value>
+ <value>4760 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9967,8 +9143,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4761 Ordnerrücken-Etiketten, breit</value>
+ <value>4761 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9979,8 +9154,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4762 Ordnerrücken-Etiketten, schmal</value>
+ <value>4762 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9991,8 +9165,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4763 Ordnerrücken-Etiketten, schmal</value>
+ <value>4763 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10003,8 +9176,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4764 Ordnerrücken-Etiketten, schmal</value>
+ <value>4764 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10015,8 +9187,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4765 Ordnerrücken-Etiketten, schmal</value>
+ <value>4765 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10027,8 +9198,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4766 Ordnerrücken-Etiketten, breit</value>
+ <value>4766 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10039,8 +9209,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4767 Ordnerrücken-Etiketten, breit</value>
+ <value>4767 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10051,8 +9220,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4768 Ordnerrücken-Etiketten, breit</value>
+ <value>4768 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10063,8 +9231,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4769 Ordnerrücken-Etiketten, breit</value>
+ <value>4769 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10075,8 +9242,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4770 Transparente Etiketten</value>
+ <value>4770 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10087,8 +9253,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4771 Transparente Etiketten</value>
+ <value>4771 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10099,8 +9264,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4772 Transparente Etiketten</value>
+ <value>4772 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10111,8 +9275,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4773 Wetterfeste Etiketten</value>
+ <value>4773 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10123,8 +9286,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4774 Wetterfeste Etiketten</value>
+ <value>4774 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10135,8 +9297,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4775 Wetterfeste Etiketten</value>
+ <value>4775 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10147,8 +9308,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4776 Wetterfeste Etiketten</value>
+ <value>4776 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10159,8 +9319,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4777 Transparente Etiketten</value>
+ <value>4777 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10171,8 +9330,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4780 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4780 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10183,8 +9341,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4781 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4781 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10195,8 +9352,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4782 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4782 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10207,8 +9363,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4784 Namens-Etiketten</value>
+ <value>4784 Namens-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10219,8 +9374,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4790 Inkjet-Etiketten, rund</value>
+ <value>4790 Inkjet-Etiketten, rund</value>
</prop>
<prop oor:name="Measure">
@@ -10231,8 +9385,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4791 Inkjet-Etiketten</value>
+ <value>4791 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10243,8 +9396,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4792 Inkjet-Etiketten</value>
+ <value>4792 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10255,8 +9407,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4793 Inkjet-Etiketten</value>
+ <value>4793 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10267,8 +9418,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4794 Inkjet-Etiketten</value>
+ <value>4794 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10279,8 +9429,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4795 Inkjet-Etiketten</value>
+ <value>4795 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10291,8 +9440,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4798 Disketten-Etiketten Photo-Qualität</value>
+ <value>4798 Disketten-Etiketten Photo-Qualität</value>
</prop>
<prop oor:name="Measure">
@@ -10303,8 +9451,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4799 Inkjet-Etiketten, oval</value>
+ <value>4799 Inkjet-Etiketten, oval</value>
</prop>
<prop oor:name="Measure">
@@ -10315,8 +9462,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6002 Neon-Etiketten</value>
+ <value>6002 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10327,8 +9473,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6003 Neon-Etiketten</value>
+ <value>6003 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10339,8 +9484,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6004 Neon-Etiketten</value>
+ <value>6004 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10351,8 +9495,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6005 Neon-Etiketten</value>
+ <value>6005 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10363,8 +9506,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6006 Neon-Etiketten</value>
+ <value>6006 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10375,8 +9517,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6008 Typenschild-Etiketten</value>
+ <value>6008 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10387,8 +9528,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6009 Typenschild-Etiketten</value>
+ <value>6009 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10399,8 +9539,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6011 Typenschild-Etiketten</value>
+ <value>6011 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10411,8 +9550,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6012 Typenschild-Etiketten</value>
+ <value>6012 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10423,8 +9561,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6013 Typenschild-Etiketten</value>
+ <value>6013 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10435,8 +9572,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6014 Etiketten für CD-Hüllen</value>
+ <value>6014 Etiketten für CD-Hüllen</value>
</prop>
<prop oor:name="Measure">
@@ -10447,8 +9583,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6015 CD-Etiketten incl. Zentrierhilfe</value>
+ <value>6015 CD-Etiketten incl. Zentrierhilfe</value>
</prop>
<prop oor:name="Measure">
@@ -10459,8 +9594,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6019 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6019 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10471,8 +9605,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6020 Dia-Etiketten, Stick+Lift</value>
+ <value>6020 Dia-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10483,8 +9616,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6021 Sichtreiter-Etiketten, Stick+Lift</value>
+ <value>6021 Sichtreiter-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10495,8 +9627,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6022 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6022 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10507,8 +9638,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6023 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6023 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10519,8 +9649,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6024 Inkjet+Laser+Kopier-Etiketten Stick+Lift, </value>
+ <value>6024 Inkjet+Laser+Kopier-Etiketten Stick+Lift, </value>
</prop>
<prop oor:name="Measure">
@@ -10531,8 +9660,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6025 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6025 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10543,8 +9671,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6026 Disketten-Etiketten, Stick+Lift</value>
+ <value>6026 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10555,8 +9682,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6029 Disketten-Etiketten, Stick+Lift</value>
+ <value>6029 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10567,8 +9693,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6030 Cassetten-Etiketten, Stick+Lift</value>
+ <value>6030 Cassetten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10579,8 +9704,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6031 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6031 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10591,8 +9715,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6036 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6036 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10603,8 +9726,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6037 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6037 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10615,8 +9737,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6038 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6038 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10627,8 +9748,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6039 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6039 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10639,8 +9759,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6040 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6040 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10651,8 +9770,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6041 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6041 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10663,8 +9781,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6043 CD-Etiketten</value>
+ <value>6043 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10675,8 +9792,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6044 CD-Etiketten</value>
+ <value>6044 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10687,8 +9803,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6045 CD-Etiketten</value>
+ <value>6045 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10699,8 +9814,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6046 CD-Etiketten</value>
+ <value>6046 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10711,8 +9825,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6047 CD-Etiketten</value>
+ <value>6047 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10723,8 +9836,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6058 Ordnerrücken-Etiketten, schmal</value>
+ <value>6058 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10735,8 +9847,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6059 Ordnerrücken-Etiketten, breit</value>
+ <value>6059 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10747,8 +9858,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6060 Ordnerrücken-Etiketten, schmal</value>
+ <value>6060 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10759,8 +9869,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6061 Ordnerrücken-Etiketten, breit</value>
+ <value>6061 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10771,8 +9880,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6074 Inkjet-Glossy-CD-Etiketten</value>
+ <value>6074 Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10783,8 +9891,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6077 Inkjet-Glossy-Etiketten</value>
+ <value>6077 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10795,8 +9902,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6078 Inkjet-Glossy-Etiketten</value>
+ <value>6078 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10807,8 +9913,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6079 Inkjet-Glossy-Etiketten, oval</value>
+ <value>6079 Inkjet-Glossy-Etiketten, oval</value>
</prop>
<prop oor:name="Measure">
@@ -10819,8 +9924,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6080 Inkjet-Glossy-Etiketten</value>
+ <value>6080 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10831,8 +9935,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6081 Inkjet-Glossy-Etiketten</value>
+ <value>6081 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10843,8 +9946,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6082 Inkjet-Glossy-CD-Etiketten</value>
+ <value>6082 Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10855,8 +9957,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6083 Inkjet-Glossy-Etiketten</value>
+ <value>6083 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10867,8 +9968,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6090 Korrektur- und Abdeck-Etiketten</value>
+ <value>6090 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10879,8 +9979,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6091 Korrektur- und Abdeck-Etiketten</value>
+ <value>6091 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10891,8 +9990,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6092 Korrektur- und Abdeck-Etiketten</value>
+ <value>6092 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10903,8 +10001,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6093 Korrektur- und Abdeck-Etiketten</value>
+ <value>6093 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10915,8 +10012,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6094 Korrektur- und Abdeck-Etiketten</value>
+ <value>6094 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10927,8 +10023,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6102 Farbige Folien-Etiketten</value>
+ <value>6102 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10939,8 +10034,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6103 Farbige Folien-Etiketten</value>
+ <value>6103 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10951,8 +10045,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6104 Farbige Folien-Etiketten</value>
+ <value>6104 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10963,8 +10056,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6105 Farbige Folien-Etiketten</value>
+ <value>6105 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10975,8 +10067,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6106 Farbige Folien-Etiketten</value>
+ <value>6106 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10987,8 +10078,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6107 Farbige Folien-Etiketten</value>
+ <value>6107 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10999,8 +10089,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6108 Farbige Folien-Etiketten</value>
+ <value>6108 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11011,8 +10100,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6109 Farbige Folien-Etiketten</value>
+ <value>6109 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11023,8 +10111,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6110 Farbige Folien-Etiketten</value>
+ <value>6110 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11035,8 +10122,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6111 Farbige Folien-Etiketten</value>
+ <value>6111 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11047,8 +10133,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6112 Sicherheits-Etiketten</value>
+ <value>6112 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11059,8 +10144,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6113 Sicherheits-Etiketten</value>
+ <value>6113 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11071,8 +10155,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6114 Sicherheits-Etiketten</value>
+ <value>6114 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11083,8 +10166,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6115 CD-Etiketten</value>
+ <value>6115 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11095,8 +10177,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6116 MiniDisc-Etiketten</value>
+ <value>6116 MiniDisc-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11107,8 +10188,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6117 CD-Etiketten</value>
+ <value>6117 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11119,8 +10199,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6118 CD-Etiketten</value>
+ <value>6118 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11131,8 +10210,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7767 Farblaser-Glossy-Etiketten</value>
+ <value>L7767 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11143,8 +10221,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7768 Farblaser-Glossy-Etiketten</value>
+ <value>L7768 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11155,8 +10232,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7769 Farblaser-Glossy-Etiketten</value>
+ <value>L7769 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11167,8 +10243,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7765 Farblaser-Glossy-Etiketten</value>
+ <value>L7765 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11179,8 +10254,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 SuperSize Inkjet-Glossy-CD-Etiketten</value>
+ <value>C9660 SuperSize Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11191,8 +10265,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7760 SuperSize Farblaser-Glossy-CD-Etiketten</value>
+ <value>L7760 SuperSize Farblaser-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11203,8 +10276,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8776 Inkjet-Stardust-CD-Etiketten*</value>
+ <value>J8776 Inkjet-Stardust-CD-Etiketten*</value>
</prop>
<prop oor:name="Measure">
@@ -11215,8 +10287,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8871 Inkjet-Magnet-Schilder**</value>
+ <value>J8871 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11227,8 +10298,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8875 Inkjet-Magnet-Schilder**</value>
+ <value>J8875 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11239,8 +10309,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8867 Inkjet-Magnet-Schilder**</value>
+ <value>J8867 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11251,8 +10320,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2166 Etikett rechteckig</value>
+ <value>C2166 Etikett rechteckig</value>
</prop>
<prop oor:name="Measure">
@@ -11263,8 +10331,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2243 Etikett rund, klein</value>
+ <value>C2243 Etikett rund, klein</value>
</prop>
<prop oor:name="Measure">
@@ -11275,8 +10342,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2351 Glückwunschkarten A5</value>
+ <value>C2351 Glückwunschkarten A5</value>
</prop>
<prop oor:name="Measure">
@@ -11287,8 +10353,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2354 Visitenkarten bis zum Rand</value>
+ <value>C2354 Visitenkarten bis zum Rand</value>
</prop>
<prop oor:name="Measure">
@@ -11299,8 +10364,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2355 Glückwunschkarten Standard</value>
+ <value>C2355 Glückwunschkarten Standard</value>
</prop>
<prop oor:name="Measure">
@@ -11311,8 +10375,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2410 Clubkarten laminiert</value>
+ <value>C2410 Clubkarten laminiert</value>
</prop>
<prop oor:name="Measure">
@@ -11323,8 +10386,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2651 Etikett rechteckig, klein</value>
+ <value>C2651 Etikett rechteckig, klein</value>
</prop>
<prop oor:name="Measure">
@@ -11335,8 +10397,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9405 T-Shirt Transferfolie</value>
+ <value>C9405 T-Shirt Transferfolie</value>
</prop>
<prop oor:name="Measure">
@@ -11347,8 +10408,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -11359,8 +10419,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2070 Transfer-Folie für Mousepad</value>
+ <value>C2070 Transfer-Folie für Mousepad</value>
</prop>
<prop oor:name="Measure">
@@ -11371,8 +10430,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2090 T-Shirt Transfer-Folie</value>
+ <value>C2090 T-Shirt Transfer-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11383,8 +10441,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2080 Transfer-Folie für Puzzles</value>
+ <value>C2080 Transfer-Folie für Puzzles</value>
</prop>
<prop oor:name="Measure">
@@ -11395,8 +10452,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8416 Einladungskarten mit Klebeverschluss</value>
+ <value>J8416 Einladungskarten mit Klebeverschluss</value>
</prop>
<prop oor:name="Measure">
@@ -11407,8 +10463,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Fensterbilder</value>
+ <value>C2546 Fensterbilder</value>
</prop>
<prop oor:name="Measure">
@@ -11419,8 +10474,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 CD-Etiketten, glossy, Super-Size</value>
+ <value>C9660 CD-Etiketten, glossy, Super-Size</value>
</prop>
<prop oor:name="Measure">
@@ -11431,8 +10485,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8770 CD-Etiketten, Super-Ssize</value>
+ <value>J8770 CD-Etiketten, Super-Ssize</value>
</prop>
<prop oor:name="Measure">
@@ -11443,8 +10496,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video-Etiketten, seitlich</value>
+ <value>C2050 Video-Etiketten, seitlich</value>
</prop>
<prop oor:name="Measure">
@@ -11455,8 +10507,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video-Etiketten, oben</value>
+ <value>C2050 Video-Etiketten, oben</value>
</prop>
<prop oor:name="Measure">
@@ -11467,8 +10518,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8666 Disketten-Etiketten</value>
+ <value>J8666 Disketten-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11479,8 +10529,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J9124 Photo-Etiketten, 13 x 18</value>
+ <value>J9124 Photo-Etiketten, 13 x 18</value>
</prop>
<prop oor:name="Measure">
@@ -11491,8 +10540,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7424 Ordner-Etiketten, breit</value>
+ <value>L7424 Ordner-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -11503,8 +10551,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7425 Ordner-Etiketten, schmal</value>
+ <value>L7425 Ordner-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -11515,8 +10562,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8587 Inkjet-Folie</value>
+ <value>J8587 Inkjet-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11527,8 +10573,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7587 Laser-Folie</value>
+ <value>L7587 Laser-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11539,8 +10584,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9431 Photo-Papier, glossy</value>
+ <value>C9431 Photo-Papier, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11551,8 +10595,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9434 Photo-Karton, glossy</value>
+ <value>C9434 Photo-Karton, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11563,8 +10606,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9372 Photo-Papier, glossy, 9 x 13</value>
+ <value>C9372 Photo-Papier, glossy, 9 x 13</value>
</prop>
<prop oor:name="Measure">
@@ -11575,8 +10617,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2371 Inkjet-Papier</value>
+ <value>C2371 Inkjet-Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11587,8 +10628,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2370 Inkjet-Papier</value>
+ <value>C2370 Inkjet-Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11599,8 +10639,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2374 Marmoriertes Papier</value>
+ <value>C2374 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11611,8 +10650,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2375 Marmoriertes Papier</value>
+ <value>C2375 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11623,8 +10661,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2376 Marmoriertes Papier</value>
+ <value>C2376 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11635,8 +10672,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2377 Marmoriertes Papier</value>
+ <value>C2377 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11647,8 +10683,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Postkarten, Vorderseite</value>
+ <value>C9355 Postkarten, Vorderseite</value>
</prop>
<prop oor:name="Measure">
@@ -11659,8 +10694,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Postkarten, Rückseite</value>
+ <value>C9355 Postkarten, Rückseite</value>
</prop>
<prop oor:name="Measure">
@@ -11671,8 +10705,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD-Einleger</value>
+ <value>J8435 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -11683,8 +10716,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9362 Visitenkarten, glossy</value>
+ <value>C9362 Visitenkarten, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11695,8 +10727,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2364 Marmorierte Visitenkarten</value>
+ <value>C2364 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11707,8 +10738,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2365 Marmorierte Visitenkarten</value>
+ <value>C2365 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11719,8 +10749,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2366 Marmorierte Visitenkarten</value>
+ <value>C2366 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11731,8 +10760,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2367 Marmorierte Visitenkarten</value>
+ <value>C2367 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11743,8 +10771,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9352 Glückwunschkarten A6, glossy</value>
+ <value>C9352 Glückwunschkarten A6, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11755,8 +10782,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Laser-Etiketten</value>
+ <value>L7159 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11767,8 +10793,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Laser-Etiketten</value>
+ <value>L7160 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11779,8 +10804,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Laser-Etiketten</value>
+ <value>L7161 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11791,8 +10815,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Laser-Etiketten</value>
+ <value>L7162 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11803,8 +10826,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Laser-Etiketten</value>
+ <value>L7163 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11815,8 +10837,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Laser-Etiketten</value>
+ <value>L7164 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11827,8 +10848,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Laser-Etiketten</value>
+ <value>L7165 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11839,8 +10859,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Laser-Etiketten</value>
+ <value>L7166 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11851,8 +10870,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Laser-Etiketten</value>
+ <value>L7167 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11863,8 +10881,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Laser-Etiketten</value>
+ <value>L7168 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11875,8 +10892,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Laser-Etiketten</value>
+ <value>L7169 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11887,8 +10903,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Laser-Etiketten</value>
+ <value>L7173 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11899,8 +10914,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Laser-Etiketten</value>
+ <value>L7651 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11911,8 +10925,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 Etiketten Register - Etikettenbogen 10</value>
+ <value>L7410-10 Etiketten Register - Etikettenbogen 10</value>
</prop>
<prop oor:name="Measure">
@@ -11923,8 +10936,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 Etiketten Register - Inhaltsblatt 10-t</value>
+ <value>L7410-10 Etiketten Register - Inhaltsblatt 10-t</value>
</prop>
<prop oor:name="Measure">
@@ -11935,8 +10947,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 Etiketten Register - Etikettenbogen 12</value>
+ <value>L7410-12 Etiketten Register - Etikettenbogen 12</value>
</prop>
<prop oor:name="Measure">
@@ -11947,8 +10958,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 Etiketten Register - Inhaltsblatt 12-t</value>
+ <value>L7410-12 Etiketten Register - Inhaltsblatt 12-t</value>
</prop>
<prop oor:name="Measure">
@@ -11959,8 +10969,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 Etiketten Register - Etikettenbogen 5-t</value>
+ <value>L7410-5 Etiketten Register - Etikettenbogen 5-t</value>
</prop>
<prop oor:name="Measure">
@@ -11971,8 +10980,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 Etiketten Register - Inhaltsblatt 5-tei</value>
+ <value>L7410-5 Etiketten Register - Inhaltsblatt 5-tei</value>
</prop>
<prop oor:name="Measure">
@@ -11983,8 +10991,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-10 Zahlen Register - Inhaltsblatt 1-10</value>
+ <value>L7411-10 Zahlen Register - Inhaltsblatt 1-10</value>
</prop>
<prop oor:name="Measure">
@@ -11995,8 +11002,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-12 Zahlen Register - Inhaltsblatt 1-12</value>
+ <value>L7411-12 Zahlen Register - Inhaltsblatt 1-12</value>
</prop>
<prop oor:name="Measure">
@@ -12007,8 +11013,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-15 Zahlen Register - Inhaltsblatt 1-15</value>
+ <value>L7411-15 Zahlen Register - Inhaltsblatt 1-15</value>
</prop>
<prop oor:name="Measure">
@@ -12019,8 +11024,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-20 Zahlen Register - Inhaltsblatt 1-20</value>
+ <value>L7411-20 Zahlen Register - Inhaltsblatt 1-20</value>
</prop>
<prop oor:name="Measure">
@@ -12031,8 +11035,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-31 Zahlen Register - Inhaltsblatt 1-31</value>
+ <value>L7411-31 Zahlen Register - Inhaltsblatt 1-31</value>
</prop>
<prop oor:name="Measure">
@@ -12043,8 +11046,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-5 Zahlen Register - Inhaltsblatt 1-5</value>
+ <value>L7411-5 Zahlen Register - Inhaltsblatt 1-5</value>
</prop>
<prop oor:name="Measure">
@@ -12055,8 +11057,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-AZ A-Z Register - Inhaltsblatt</value>
+ <value>L7411-AZ A-Z Register - Inhaltsblatt</value>
</prop>
<prop oor:name="Measure">
@@ -12067,8 +11068,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-JD Monats Register - Inhaltsblatt Jan - D</value>
+ <value>L7411-JD Monats Register - Inhaltsblatt Jan - D</value>
</prop>
<prop oor:name="Measure">
@@ -12079,8 +11079,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-10 Einsteckschilder für Register 10-teilig</value>
+ <value>L7412-10 Einsteckschilder für Register 10-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12091,8 +11090,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-12 Einsteckschilder für Register 12-teilig</value>
+ <value>L7412-12 Einsteckschilder für Register 12-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12103,8 +11101,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-5 Einsteckschilder für Register 5-teilig</value>
+ <value>L7412-5 Einsteckschilder für Register 5-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12115,8 +11112,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5129061 Trennstreifen </value>
+ <value>5129061 Trennstreifen </value>
</prop>
<prop oor:name="Measure">
@@ -12127,8 +11123,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3600 Computer-Etikett</value>
+ <value>3600 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12139,8 +11134,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3601 Computer-Etikett</value>
+ <value>3601 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12151,8 +11145,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3602 Computer-Etikett</value>
+ <value>3602 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12163,8 +11156,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3603 Computer-Etikett</value>
+ <value>3603 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12175,8 +11167,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3604 Computer-Etikett</value>
+ <value>3604 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12187,8 +11178,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3605 Computer-Etikett</value>
+ <value>3605 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12199,8 +11189,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3606 Computer-Etikett</value>
+ <value>3606 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12211,8 +11200,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3607 Computer-Etikett</value>
+ <value>3607 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12223,8 +11211,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3608 Computer-Etikett</value>
+ <value>3608 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12235,8 +11222,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3609 Computer-Etikett</value>
+ <value>3609 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12247,8 +11233,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3610 Computer-Etikett</value>
+ <value>3610 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12259,8 +11244,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3611 Computer-Etikett</value>
+ <value>3611 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12271,8 +11255,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3612 Computer-Etikett</value>
+ <value>3612 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12283,8 +11266,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3613 Computer-Etikett</value>
+ <value>3613 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12295,8 +11277,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3614 Computer-Etikett</value>
+ <value>3614 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12307,8 +11288,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3615 Computer-Etikett</value>
+ <value>3615 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12319,8 +11299,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3617 Computer-Etikett</value>
+ <value>3617 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12331,8 +11310,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3620 Computer-Etikett</value>
+ <value>3620 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12343,8 +11321,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3621 Computer-Etikett</value>
+ <value>3621 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12355,8 +11332,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3623 Computer-Etikett</value>
+ <value>3623 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12367,8 +11343,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3633 Computer-Etikett</value>
+ <value>3633 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12379,8 +11354,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3634 Computer-Etikett, schnittgestanzt</value>
+ <value>3634 Computer-Etikett, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -12391,8 +11365,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3635 Computer-Etikett</value>
+ <value>3635 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12403,8 +11376,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3643 Computer-Etikett</value>
+ <value>3643 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12415,8 +11387,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3645 Computer-Etikett</value>
+ <value>3645 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12427,8 +11398,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3646 Computer-Etikett</value>
+ <value>3646 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12439,8 +11409,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3647 Computer-Etikett</value>
+ <value>3647 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12451,8 +11420,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3648 Computer-Etikett, ablösbar</value>
+ <value>3648 Computer-Etikett, ablösbar</value>
</prop>
<prop oor:name="Measure">
@@ -12463,8 +11431,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3674 Computer-Etikett</value>
+ <value>3674 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12475,8 +11442,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3675 Computer-Etikett</value>
+ <value>3675 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12487,8 +11453,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3676 Computer-Etikett</value>
+ <value>3676 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12499,8 +11464,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5100 Computer-Etikett</value>
+ <value>5100 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12511,8 +11475,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5101 Computer-Etikett</value>
+ <value>5101 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12523,8 +11486,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5103 Computer-Etikett</value>
+ <value>5103 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12535,8 +11497,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5104 Computer-Etikett</value>
+ <value>5104 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12547,8 +11508,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5105 Computer-Etikett</value>
+ <value>5105 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12559,8 +11519,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5106 Computer-Etikett</value>
+ <value>5106 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12571,8 +11530,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5107 Computer-Etikett</value>
+ <value>5107 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12583,8 +11541,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5108 Computer-Etikett</value>
+ <value>5108 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12595,8 +11552,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5109 Computer-Etikett</value>
+ <value>5109 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12607,8 +11563,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5110 Computer-Etikett</value>
+ <value>5110 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12619,8 +11574,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5111 Computer-Etikett</value>
+ <value>5111 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12631,8 +11585,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5112 Computer-Etikett</value>
+ <value>5112 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12643,8 +11596,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5121 Computer-Etikett</value>
+ <value>5121 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12655,8 +11607,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5122 Computer-Etikett</value>
+ <value>5122 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12667,8 +11618,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5123 Computer-Etikett</value>
+ <value>5123 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12679,8 +11629,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5124 Computer-Etikett</value>
+ <value>5124 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12691,8 +11640,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5130 Computer-Etikett</value>
+ <value>5130 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12703,8 +11651,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5131 Computer-Etikett</value>
+ <value>5131 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12715,8 +11662,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5132 Computer-Etikett</value>
+ <value>5132 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12727,8 +11673,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5133 Computer-Etikett</value>
+ <value>5133 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12739,8 +11684,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5137 Computer-Etikett</value>
+ <value>5137 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12751,8 +11695,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5140 Computer-Etikett</value>
+ <value>5140 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12763,8 +11706,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5141 Computer-Etikett</value>
+ <value>5141 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12775,8 +11717,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5142 Computer-Etikett</value>
+ <value>5142 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12787,8 +11728,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5143 Computer-Etikett</value>
+ <value>5143 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12799,8 +11739,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5145 Computer-Etikett</value>
+ <value>5145 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12811,8 +11750,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5146 Computer-Etikett</value>
+ <value>5146 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12823,8 +11761,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5147 Computer-Etikett</value>
+ <value>5147 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12835,8 +11772,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5160 Computer-Etikett</value>
+ <value>5160 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12847,8 +11783,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5161 Computer-Etikett</value>
+ <value>5161 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12859,8 +11794,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5162 Computer-Etikett</value>
+ <value>5162 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12871,8 +11805,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5163 Computer-Etikett</value>
+ <value>5163 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12883,8 +11816,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5164 Computer-Etikett</value>
+ <value>5164 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12895,8 +11827,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5170 Computer-Etikett</value>
+ <value>5170 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12907,8 +11838,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5171 Computer-Etikett</value>
+ <value>5171 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12922,8 +11852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083200/6 Adressetikett</value>
+ <value>083200/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12934,8 +11863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083200/6 Adressetikett</value>
+ <value>083200/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12946,8 +11874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083203/0 Adressetikett</value>
+ <value>083203/0 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12958,8 +11885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083204/8 Adressetikett</value>
+ <value>083204/8 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12970,8 +11896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083205/5 Diskettenetikett</value>
+ <value>083205/5 Diskettenetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12982,8 +11907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083207/1 Adressetikett</value>
+ <value>083207/1 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12994,8 +11918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083215/4 Diskettenetikett</value>
+ <value>083215/4 Diskettenetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13006,8 +11929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083216/2 CD-ROM-Etikett</value>
+ <value>083216/2 CD-ROM-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -13018,8 +11940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083217/0 Adressetikett</value>
+ <value>083217/0 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13030,8 +11951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083219/6 Adressetikett</value>
+ <value>083219/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13042,8 +11962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083220/4 Adressetikett Laser</value>
+ <value>083220/4 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13054,8 +11973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083221/2 Adressetikett Laser</value>
+ <value>083221/2 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13066,8 +11984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083222/0 Adressetikett Laser</value>
+ <value>083222/0 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13078,8 +11995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083224/6 Diskettenetikett Laser</value>
+ <value>083224/6 Diskettenetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13090,8 +12006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083230/3 Adressetikett Inkjet</value>
+ <value>083230/3 Adressetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13102,8 +12017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083231/1 Adressetikett Inkjet</value>
+ <value>083231/1 Adressetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13114,8 +12028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083234/5 Diskettenetikett Inkjet</value>
+ <value>083234/5 Diskettenetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13126,8 +12039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083240/2 Adressetik. Laser+InkJet</value>
+ <value>083240/2 Adressetik. Laser+InkJet</value>
</prop>
<prop oor:name="Measure">
@@ -13138,8 +12050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083244/4 Diskettenetik.Laser+InkJet</value>
+ <value>083244/4 Diskettenetik.Laser+InkJet</value>
</prop>
<prop oor:name="Measure">
@@ -13150,8 +12061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083250/1 Adressetiketten</value>
+ <value>083250/1 Adressetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13162,8 +12072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083251/9 Ordner-Etiketten, 8 cm</value>
+ <value>083251/9 Ordner-Etiketten, 8 cm</value>
</prop>
<prop oor:name="Measure">
@@ -13174,8 +12083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083252/7 Ordner-Etiketten, 5 cm</value>
+ <value>083252/7 Ordner-Etiketten, 5 cm</value>
</prop>
<prop oor:name="Measure">
@@ -13186,8 +12094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083253/5 Neonetiketten</value>
+ <value>083253/5 Neonetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13198,8 +12105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083254/3 Transparente Etiketten</value>
+ <value>083254/3 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13210,8 +12116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083255/0 Diskettenetiketten</value>
+ <value>083255/0 Diskettenetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13222,8 +12127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">83256/8a Videoetiketten 0</value>
+ <value>83256/8a Videoetiketten 0</value>
</prop>
<prop oor:name="Measure">
@@ -13234,8 +12138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">83256/8b Videoetiketten 0</value>
+ <value>83256/8b Videoetiketten 0</value>
</prop>
<prop oor:name="Measure">
@@ -13246,8 +12149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083257/6 Diaetiketten</value>
+ <value>083257/6 Diaetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13258,8 +12160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083258/4 Farbdruck-Etiketten</value>
+ <value>083258/4 Farbdruck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13270,8 +12171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">502041/7 Visitenkarten</value>
+ <value>502041/7 Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -13282,8 +12182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083271/7 Ordnerrückeneinsteckschilder</value>
+ <value>083271/7 Ordnerrückeneinsteckschilder</value>
</prop>
<prop oor:name="Measure">
@@ -13293,987 +12192,987 @@
</node>
<node oor:name="Herma A4" oor:op="replace">
- <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4093 SuperPrint CD-Etikett, gold</value></prop>
+ <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4093 SuperPrint CD-Etikett, gold</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
- <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4094 SuperPrint CD-Etikett, silber</value></prop>
+ <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4094 SuperPrint CD-Etikett, silber</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
- <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4097 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4097 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
- <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4098 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4098 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
- <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4099 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4099 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
- <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4100 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4100 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
- <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4101 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4101 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4318;1270;4318;1030;1864;1000;4;22</value></prop></node>
- <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4102 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4102 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4830;2540;4830;2540;840;880;4;11</value></prop></node>
- <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4103 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4103 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
- <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4104 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4104 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4105 SuperPrint Goldfolie, Kreise 60 mm</value></prop>
+<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4105 SuperPrint Goldfolie, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4106 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4106 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4107 SuperPrint Goldfolie, A4</value></prop>
+<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4107 SuperPrint Goldfolie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4108 SuperPrint Goldfolie</value></prop>
+<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4108 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4109 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4109 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4110 SuperPrint Silberfolie</value></prop>
+<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4110 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
-<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4111 SuperPrint Silberfolie</value></prop>
+<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4111 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4318;1270;4318;1030;1864;1000;4;22</value></prop></node>
-<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4112 SuperPrint Silberfolie</value></prop>
+<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4112 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4113 SuperPrint Silberfolie</value></prop>
+<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4113 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4114 SuperPrint Silberfolie</value></prop>
+<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4114 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4115 SuperPrint Silberfolie, Kreise 60 mm</value></prop>
+<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4115 SuperPrint Silberfolie, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4116 SuperPrint Silberfolie, oval</value></prop>
+<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4116 SuperPrint Silberfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4117 SuperPrint Silberfolie, A4</value></prop>
+<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4117 SuperPrint Silberfolie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4118 SuperPrint Silberfolie</value></prop>
+<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4118 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4119 SuperPrint Silberfolie</value></prop>
+<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4119 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;1693;6350;1693;721;1303;3;16</value></prop></node>
-<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4200 SuperPrint weiß</value></prop>
+<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4200 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;3387;4830;3387;840;1302;4;8</value></prop></node>
-<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4201 SuperPrint Sichtreiteretiketten, weiß</value></prop>
+<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4201 SuperPrint Sichtreiteretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4572;1693;975;1306;4;16</value></prop></node>
-<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4202 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4202 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;847;6350;847;721;1298;3;32</value></prop></node>
-<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4203 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4203 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4204 SuperPrint 3,5"-Disketten, gelb</value></prop>
+<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4204 SuperPrint 3,5"-Disketten, gelb</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4205 SuperPrint 3,5"-Disketten, rot</value></prop>
+<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4205 SuperPrint 3,5"-Disketten, rot</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4206 SuperPrint 3,5"-Disketten, blau</value></prop>
+<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4206 SuperPrint 3,5"-Disketten, blau</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4207 SuperPrint 3,5"-Disketten, grün</value></prop>
+<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4207 SuperPrint 3,5"-Disketten, grün</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4208 SuperPrint Musik-Cassetten, weiß</value></prop>
+<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4208 SuperPrint Musik-Cassetten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9154;4233;8900;4233;1475;2150;2;6</value></prop></node>
-<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4209 SuperPrint weiß, z.B. für Regalbeschriftung, ablösbar</value></prop>
+<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4209 SuperPrint weiß, z.B. für Regalbeschriftung, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;1693;9600;1693;773;1306;2;16</value></prop></node>
-<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4210 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4210 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;1270;3810;1270;975;880;5;22</value></prop></node>
-<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4211 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4211 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1306;7;16</value></prop></node>
-<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4212 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4212 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4226 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4226 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4227 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4227 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;6460;3387;6460;3387;810;1303;3;8</value></prop></node>
-<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4228 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4228 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2151;2;6</value></prop></node>
-<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4229 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4229 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4230 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4230 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4232 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4232 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4233 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4233 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4234 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4234 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4249 SuperPrint weiß</value></prop>
+<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4249 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;19960;14350;19960;14350;520;500;1;2</value></prop></node>
-<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4250 SuperPrint weiß</value></prop>
+<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4250 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10190;13900;9910;13900;450;950;2;2</value></prop></node>
-<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4252 SuperPrint weiß</value></prop>
+<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4252 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;19960;28910;19960;28910;520;395;1;1</value></prop></node>
-<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4256 SuperPrint gelb</value></prop>
+<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4256 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4257 SuperPrint rot</value></prop>
+<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4257 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4258 SuperPrint blau</value></prop>
+<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4258 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4259 SuperPrint grün</value></prop>
+<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4259 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4262 SuperPrint weiß</value></prop>
+<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4262 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6460;3387;6460;3387;810;1303;3;8</value></prop></node>
-<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4263 SuperPrint weiß</value></prop>
+<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4263 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3387;7000;3387;0;1303;3;8</value></prop></node>
-<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4264 SuperPrint weiß</value></prop>
+<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4264 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3387;10500;3387;0;1303;2;8</value></prop></node>
-<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4265 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4265 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4266 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4266 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;7200;6350;7200;721;450;3;4</value></prop></node>
-<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4267 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4267 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4268 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4268 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;5700;9906;5700;467;600;2;5</value></prop></node>
-<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4269 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4269 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4270 SuperPrint weiß</value></prop>
+<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4270 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4271 SuperPrint weiß</value></prop>
+<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4271 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4272 SuperPrint weiß</value></prop>
+<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4272 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4273 SuperPrint weiß</value></prop>
+<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4273 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4275 SuperPrint weiß</value></prop>
+<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4275 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;2540;6600;2540;600;880;3;11</value></prop></node>
-<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4278 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4278 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4279 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4279 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;6773;7000;6773;0;1303;3;4</value></prop></node>
-<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4280 SuperPrint weiß</value></prop>
+<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4280 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4281 SuperPrint weiß</value></prop>
+<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4281 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5080;10500;5080;0;2150;2;5</value></prop></node>
-<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4282 SuperPrint weiß, A5</value></prop>
+<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4282 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4283 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4283 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4284 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4284 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4290 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4290 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4291 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4291 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4292 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4292 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4293 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4293 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4294 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4294 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4295 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4295 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4296 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4296 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4297 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4297 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4298 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4298 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4299 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4299 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4333 SuperPrint weiß </value></prop>
+<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4333 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4334 SuperPrint weiß </value></prop>
+<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4334 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1306;7;16</value></prop></node>
-<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4336 SuperPrint weiß </value></prop>
+<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4336 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;3810;1693;3556;1693;1102;1306;5;16</value></prop></node>
-<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4343 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4343 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2041;1000;1780;1000;425,5;1350;10;27</value></prop></node>
-<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4344 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4344 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4345 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4345 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;1693;3556;1693;1102;1306;5;16</value></prop></node>
-<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4346 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4346 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4347 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4347 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4348 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4348 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;2150;2;6</value></prop></node>
-<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4349 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4349 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4350 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4350 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;2150;2;4</value></prop></node>
-<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4351 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4351 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4352 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4352 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4353 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4353 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4354 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
+<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4354 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4355 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4355 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4356 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
+<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4356 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4357 SuperPrint weiß</value></prop>
+<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4357 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4850;2540;4850;2540;800;2150;4;10</value></prop></node>
-<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4358 SuperPrint Oval, weiß, ablösbar</value></prop>
+<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4358 SuperPrint Oval, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4359 SuperPrint weiß</value></prop>
+<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4359 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4360 SuperPrint weiß</value></prop>
+<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4360 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4361 SuperPrint weiß</value></prop>
+<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4361 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4362 SuperPrint weiß</value></prop>
+<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4362 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4363 SuperPrint weiß</value></prop>
+<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4363 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4364 SuperPrint weiß</value></prop>
+<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4364 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4366 SuperPrint gelb, Ecken abgerundet</value></prop>
+<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4366 SuperPrint gelb, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4367 SuperPrint rot, Ecken abgerundet</value></prop>
+<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4367 SuperPrint rot, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4368 SuperPrint blau, Ecken abgerundet</value></prop>
+<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4368 SuperPrint blau, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4369 SuperPrint grün, Ecken abgerundet</value></prop>
+<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4369 SuperPrint grün, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4373 SuperPrint CD-Cover, weiß</value></prop>
+<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4373 SuperPrint CD-Cover, weiß</value></prop>
<prop oor:name="Measure"><value>S;12150;14550;12150;11750;4425;1700;1;2</value></prop></node>
-<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4374 SuperPrint CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4374 SuperPrint CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4375 SuperPrint transparente Folie</value></prop>
+<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4375 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4376 SuperPrint transparente Folie</value></prop>
+<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4376 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4377 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4377 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4378 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4378 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4379 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4379 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L119" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4380 SuperPrint Oval, weiß</value></prop>
+<node oor:name="L119" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4380 SuperPrint Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L120" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4385 SuperPrint Kreise 10 mm, weiß, ablösbar</value></prop>
+<node oor:name="L120" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4385 SuperPrint Kreise 10 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1270;1270;1000;1000;1110;1650;15;21</value></prop></node>
-<node oor:name="L121" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4386 SuperPrint Kreise 20 mm, weiß, ablösbar</value></prop>
+<node oor:name="L121" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4386 SuperPrint Kreise 20 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2254;2254;2000;2000;1611;1453;8;12</value></prop></node>
-<node oor:name="L122" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4387 SuperPrint Kreise 30 mm, weiß</value></prop>
+<node oor:name="L122" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4387 SuperPrint Kreise 30 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;3254;3254;3000;3000;865;1961;6;8</value></prop></node>
-<node oor:name="L123" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4388 SuperPrint Tiefkühletiketten, weiß</value></prop>
+<node oor:name="L123" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4388 SuperPrint Tiefkühletiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L124" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4389 SuperPrint Tiefkühletiketten, weiß</value></prop>
+<node oor:name="L124" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4389 SuperPrint Tiefkühletiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L125" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4390 SuperPrint weiß</value></prop>
+<node oor:name="L125" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4390 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L126" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4391 SuperPrint weiß</value></prop>
+<node oor:name="L126" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4391 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L127" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4392 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L127" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4392 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L128" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4393 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L128" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4393 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L129" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4394 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L129" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4394 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L130" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4396 SuperPrint gelb, A6</value></prop>
+<node oor:name="L130" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4396 SuperPrint gelb, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L131" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4397 SuperPrint rot, A6</value></prop>
+<node oor:name="L131" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4397 SuperPrint rot, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L132" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4398 SuperPrint blau, A6</value></prop>
+<node oor:name="L132" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4398 SuperPrint blau, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L133" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4399 SuperPrint grün, A6</value></prop>
+<node oor:name="L133" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4399 SuperPrint grün, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L134" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4401 SuperPrint gelb, A4</value></prop>
+<node oor:name="L134" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4401 SuperPrint gelb, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L135" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4402 SuperPrint rot, A4</value></prop>
+<node oor:name="L135" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4402 SuperPrint rot, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L136" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4403 SuperPrint blau, A4</value></prop>
+<node oor:name="L136" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4403 SuperPrint blau, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L137" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4404 SuperPrint grün, A4</value></prop>
+<node oor:name="L137" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4404 SuperPrint grün, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L138" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4406 SuperPrint gelb</value></prop>
+<node oor:name="L138" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4406 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L139" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4407 SuperPrint rot</value></prop>
+<node oor:name="L139" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4407 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L140" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4408 SuperPrint blau</value></prop>
+<node oor:name="L140" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4408 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L141" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4409 SuperPrint grün</value></prop>
+<node oor:name="L141" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4409 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L142" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4414 SuperPrint weiß</value></prop>
+<node oor:name="L142" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4414 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L143" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4415 SuperPrint weiß</value></prop>
+<node oor:name="L143" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4415 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L144" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4416 SuperPrint weiß</value></prop>
+<node oor:name="L144" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4416 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L145" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4417 SuperPrint weiß</value></prop>
+<node oor:name="L145" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4417 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L146" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4418 SuperPrint Namensetiketten Acetatseide, rot</value></prop>
+<node oor:name="L146" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4418 SuperPrint Namensetiketten Acetatseide, rot</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L147" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4419 SuperPrint Namensetiketten Acetatseide, blau</value></prop>
+<node oor:name="L147" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4419 SuperPrint Namensetiketten Acetatseide, blau</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L148" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4421 SuperPrint gelb</value></prop>
+<node oor:name="L148" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4421 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L149" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4422 SuperPrint rot</value></prop>
+<node oor:name="L149" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4422 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L150" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4423 SuperPrint blau</value></prop>
+<node oor:name="L150" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4423 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L151" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4424 SuperPrint grün</value></prop>
+<node oor:name="L151" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4424 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L152" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4425 SuperPrint weiß</value></prop>
+<node oor:name="L152" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4425 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5700;10500;5700;0;600;2;5</value></prop></node>
-<node oor:name="L153" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4426 SuperPrint weiß</value></prop>
+<node oor:name="L153" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4426 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7000;10500;7000;0;850;2;4</value></prop></node>
-<node oor:name="L154" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4427 SuperPrint weiß</value></prop>
+<node oor:name="L154" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4427 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3500;10500;3500;0;850;2;8</value></prop></node>
-<node oor:name="L155" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4428 SuperPrint weiß, A4</value></prop>
+<node oor:name="L155" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4428 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L156" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4429 SuperPrint weiß</value></prop>
+<node oor:name="L156" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4429 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3500;7000;3500;0;850;3;8</value></prop></node>
-<node oor:name="L157" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4450 SuperPrint weiß</value></prop>
+<node oor:name="L157" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4450 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3200;7000;3200;0;450;3;9</value></prop></node>
-<node oor:name="L158" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4451 SuperPrint weiß</value></prop>
+<node oor:name="L158" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4451 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L159" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4452 SuperPrint weiß</value></prop>
+<node oor:name="L159" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4452 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L160" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4453 SuperPrint weiß</value></prop>
+<node oor:name="L160" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4453 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L161" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4454 SuperPrint weiß</value></prop>
+<node oor:name="L161" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4454 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L162" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4455 SuperPrint weiß</value></prop>
+<node oor:name="L162" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4455 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2540;7000;2540;0;880;3;11</value></prop></node>
-<node oor:name="L163" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4456 SuperPrint weiß</value></prop>
+<node oor:name="L163" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4456 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2970;7000;2970;0;0;3;10</value></prop></node>
-<node oor:name="L164" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4457 SuperPrint weiß</value></prop>
+<node oor:name="L164" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4457 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L165" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4458 SuperPrint weiß</value></prop>
+<node oor:name="L165" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4458 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;20000;29700;20000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L166" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4459 SuperPrint weiß</value></prop>
+<node oor:name="L166" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4459 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;1693;7000;1693;0;460;3;17</value></prop></node>
-<node oor:name="L167" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4461 SuperPrint weiß</value></prop>
+<node oor:name="L167" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4461 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L168" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4462 SuperPrint weiß</value></prop>
+<node oor:name="L168" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4462 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L169" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4464 SuperPrint weiß</value></prop>
+<node oor:name="L169" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4464 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L170" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4465 SuperPrint transparente Folie</value></prop>
+<node oor:name="L170" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4465 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L171" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4466 SuperPrint gelb</value></prop>
+<node oor:name="L171" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4466 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L172" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4467 SuperPrint rot</value></prop>
+<node oor:name="L172" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4467 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L173" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4468 SuperPrint blau</value></prop>
+<node oor:name="L173" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4468 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L174" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4469 SuperPrint grün</value></prop>
+<node oor:name="L174" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4469 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L175" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4470 SuperPrint weiß</value></prop>
+<node oor:name="L175" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4470 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L176" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4471 SuperPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L176" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4471 SuperPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L177" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4472 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L177" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4472 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;8128;13970;7874;13970;2499;880;2;2</value></prop></node>
-<node oor:name="L178" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4473 SuperPrint weiß</value></prop>
+<node oor:name="L178" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4473 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4100;7000;4100;0;500;3;7</value></prop></node>
-<node oor:name="L179" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4474 SuperPrint weiß</value></prop>
+<node oor:name="L179" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4474 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4850;2540;4850;2540;800;2150;4;10</value></prop></node>
-<node oor:name="L180" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4475 SuperPrint weiß</value></prop>
+<node oor:name="L180" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4475 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4100;10500;4100;0;500;2;7</value></prop></node>
-<node oor:name="L181" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4476 SuperPrint Kreise 40 mm, weiß</value></prop>
+<node oor:name="L181" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4476 SuperPrint Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L182" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4477 SuperPrint Kreise 60 mm, weiß</value></prop>
+<node oor:name="L182" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4477 SuperPrint Kreise 60 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L183" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4478 SuperPrint Kreise 85 mm, weiß</value></prop>
+<node oor:name="L183" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4478 SuperPrint Kreise 85 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;9500;9500;8500;8500;1500;1100;2;3</value></prop></node>
-<node oor:name="L184" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4479 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L184" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4479 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L185" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4606 SuperPrint weiß</value></prop>
+<node oor:name="L185" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4606 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L186" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4607 SuperPrint weiß</value></prop>
+<node oor:name="L186" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4607 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L187" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4608 SuperPrint weiß</value></prop>
+<node oor:name="L187" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4608 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L188" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4609 SuperPrint weiß</value></prop>
+<node oor:name="L188" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4609 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L189" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4610 SuperPrint weiß</value></prop>
+<node oor:name="L189" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4610 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L190" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4611 SuperPrint weiß</value></prop>
+<node oor:name="L190" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4611 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;1693;7000;1693;0;460;3;17</value></prop></node>
-<node oor:name="L191" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4612 SuperPrint weiß</value></prop>
+<node oor:name="L191" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4612 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2970;7000;2970;0;0;3;10</value></prop></node>
-<node oor:name="L192" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4613 SuperPrint weiß</value></prop>
+<node oor:name="L192" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4613 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;2540;6600;2540;600;880;3;11</value></prop></node>
-<node oor:name="L193" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4614 SuperPrint weiß</value></prop>
+<node oor:name="L193" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4614 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L194" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4615 SuperPrint weiß</value></prop>
+<node oor:name="L194" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4615 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L195" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4616 SuperPrint weiß</value></prop>
+<node oor:name="L195" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4616 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L196" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4617 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L196" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4617 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;6773;7000;6773;0;1303;3;4</value></prop></node>
-<node oor:name="L197" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4618 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L197" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4618 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L198" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4619 SuperPrint weiß</value></prop>
+<node oor:name="L198" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4619 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L199" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4620 SuperPrint weiß</value></prop>
+<node oor:name="L199" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4620 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L200" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4623 SuperPrint weiß</value></prop>
+<node oor:name="L200" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4623 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2151;2;6</value></prop></node>
-<node oor:name="L201" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4624 SuperPrint weiß</value></prop>
+<node oor:name="L201" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4624 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L202" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4625 SuperPrint weiß</value></prop>
+<node oor:name="L202" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4625 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L203" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4626 SuperPrint weiß</value></prop>
+<node oor:name="L203" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4626 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L204" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4627 SuperPrint weiß, A6</value></prop>
+<node oor:name="L204" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4627 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L205" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4628 SuperPrint weiß, A5</value></prop>
+<node oor:name="L205" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4628 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L206" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4629 SuperPrint weiß</value></prop>
+<node oor:name="L206" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4629 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5080;10500;5080;0;2150;2;5</value></prop></node>
-<node oor:name="L207" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4631 SuperPrint weiß</value></prop>
+<node oor:name="L207" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4631 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L208" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4654 SuperPrint weiß</value></prop>
+<node oor:name="L208" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4654 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3900;10500;3900;0;1200;2;7</value></prop></node>
-<node oor:name="L209" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4664 SuperPrint Lohnsteueretikett,perforiert mit Klebestreifen, weiß </value></prop>
+<node oor:name="L209" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4664 SuperPrint Lohnsteueretikett,perforiert mit Klebestreifen, weiß </value></prop>
<prop oor:name="Measure"><value>S;10500;3900;10500;3900;0;1200;2;7</value></prop></node>
-<node oor:name="L210" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4666 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L210" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4666 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;880;2;6</value></prop></node>
-<node oor:name="L211" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4667 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L211" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4667 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L212" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4668 SuperPrint weiß</value></prop>
+<node oor:name="L212" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4668 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L213" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4669 SuperPrint weiß</value></prop>
+<node oor:name="L213" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4669 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L214" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4670 SuperPrint weiß</value></prop>
+<node oor:name="L214" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4670 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L215" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4672 SuperPrint weiß</value></prop>
+<node oor:name="L215" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4672 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L216" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4674 SuperPrint weiß</value></prop>
+<node oor:name="L216" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4674 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L217" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4676 SuperPrint weiß, A6</value></prop>
+<node oor:name="L217" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4676 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L218" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4677 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L218" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4677 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L219" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4678 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L219" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4678 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L220" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4680 SuperPrint transparente Folie</value></prop>
+<node oor:name="L220" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4680 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L221" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4681 SuperPrint transparente Folie</value></prop>
+<node oor:name="L221" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4681 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L222" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4682 SuperPrint transparente Folie</value></prop>
+<node oor:name="L222" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4682 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L223" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4683 SuperPrint transparente Folie, A5</value></prop>
+<node oor:name="L223" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4683 SuperPrint transparente Folie, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L224" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4684 SuperPrint transparente Folie</value></prop>
+<node oor:name="L224" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4684 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L225" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4685 SuperPrint transparente Folie</value></prop>
+<node oor:name="L225" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4685 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L226" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4686 SuperPrint Kreise 40 mm, transparent</value></prop>
+<node oor:name="L226" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4686 SuperPrint Kreise 40 mm, transparent</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L227" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4690 SuperPrint weiße Folie</value></prop>
+<node oor:name="L227" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4690 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L228" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4691 SuperPrint weiße Folie</value></prop>
+<node oor:name="L228" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4691 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L229" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4692 SuperPrint weiße Folie</value></prop>
+<node oor:name="L229" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4692 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L230" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4693 SuperPrint weiße Folie, A5</value></prop>
+<node oor:name="L230" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4693 SuperPrint weiße Folie, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L231" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4694 SuperPrint weiße Folie</value></prop>
+<node oor:name="L231" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4694 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L232" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4695 SuperPrint weiße Folie</value></prop>
+<node oor:name="L232" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4695 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L233" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4696 SuperPrint weiße Folie</value></prop>
+<node oor:name="L233" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4696 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L234" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4697 SuperPrint weiße Folie</value></prop>
+<node oor:name="L234" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4697 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L235" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4698 SuperPrint weiße Folie</value></prop>
+<node oor:name="L235" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4698 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L236" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4810 InkPrint Special weiß</value></prop>
+<node oor:name="L236" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4810 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L237" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4811 InkPrint Special weiß</value></prop>
+<node oor:name="L237" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4811 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1303;4;16</value></prop></node>
-<node oor:name="L238" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4812 InkPrint Special weiß</value></prop>
+<node oor:name="L238" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4812 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L239" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4814 InkPrint Special weiß</value></prop>
+<node oor:name="L239" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4814 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L240" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4815 InkPrint Special weiß</value></prop>
+<node oor:name="L240" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4815 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L241" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4816 InkPrint Special weiß</value></prop>
+<node oor:name="L241" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4816 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4230;9652;4230;848;2150;2;6</value></prop></node>
-<node oor:name="L242" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4817 InkPrint Special weiß</value></prop>
+<node oor:name="L242" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4817 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L243" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4819 InkPrint Special weiß</value></prop>
+<node oor:name="L243" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4819 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L244" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4820 InkPrint Special weiß</value></prop>
+<node oor:name="L244" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4820 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L245" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4821 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L245" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4821 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;6773;6600;6773;600;1303;3;4</value></prop></node>
-<node oor:name="L246" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4822 InkPrint Special weiß</value></prop>
+<node oor:name="L246" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4822 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L247" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4823 InkPrint Special weiß</value></prop>
+<node oor:name="L247" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4823 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4230;9652;4230;848;2150;2;6</value></prop></node>
-<node oor:name="L248" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4824 InkPrint Special weiß</value></prop>
+<node oor:name="L248" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4824 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L249" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4825 InkPrint Special für schmale Ordner, weiß</value></prop>
+<node oor:name="L249" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4825 InkPrint Special für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L250" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4826 InkPrint Special für breite Ordner, weiß</value></prop>
+<node oor:name="L250" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4826 InkPrint Special für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L251" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4827 InkPrint Special Videocassette, Rücken, weiß</value></prop>
+<node oor:name="L251" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4827 InkPrint Special Videocassette, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;2000;14732;2000;3134;1850;1;13</value></prop></node>
-<node oor:name="L252" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4828 InkPrint Special Videocassette, Front, weiß</value></prop>
+<node oor:name="L252" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4828 InkPrint Special Videocassette, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4656;7874;4656;2499;882;2;6</value></prop></node>
-<node oor:name="L253" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4829 InkPrint Special Diabeschriftung, weiß</value></prop>
+<node oor:name="L253" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4829 InkPrint Special Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L254" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4830 InkPrint Special für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L254" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4830 InkPrint Special für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L255" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4831 InkPrint Special für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L255" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4831 InkPrint Special für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L256" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4841 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L256" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4841 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L257" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4842 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L257" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4842 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L258" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4843 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L258" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4843 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L259" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4844 InkPrint Special transparente Folie, A4</value></prop>
+<node oor:name="L259" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4844 InkPrint Special transparente Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L260" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4845 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L260" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4845 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L261" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4846 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L261" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4846 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L262" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4847 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L262" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4847 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L263" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4848 InkPrint Special CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L263" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4848 InkPrint Special CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L264" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4851 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L264" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4851 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L265" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4852 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L265" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4852 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L266" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4853 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L266" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4853 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L267" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4854 InkPrint Special weiße Folie, A4</value></prop>
+<node oor:name="L267" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4854 InkPrint Special weiße Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L268" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4864 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L268" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4864 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L269" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4865 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L269" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4865 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L270" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4866 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L270" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4866 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L271" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4867 InkPrint Special wetterfeste Folie, weiß, oval</value></prop>
+<node oor:name="L271" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4867 InkPrint Special wetterfeste Folie, weiß, oval</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L272" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5051 SuperPrint weiß</value></prop>
+<node oor:name="L272" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5051 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L273" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5052 SuperPrint weiß</value></prop>
+<node oor:name="L273" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5052 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L274" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5053 SuperPrint weiß</value></prop>
+<node oor:name="L274" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5053 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L275" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5054 SuperPrint weiß</value></prop>
+<node oor:name="L275" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5054 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L276" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5055 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L276" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5055 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L277" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5056 SuperPrint weiß</value></prop>
+<node oor:name="L277" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5056 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;850;2151;2;6</value></prop></node>
-<node oor:name="L278" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5057 SuperPrint weiß</value></prop>
+<node oor:name="L278" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5057 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L279" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5058 SuperPrint gelb</value></prop>
+<node oor:name="L279" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5058 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L280" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5059 SuperPrint rot</value></prop>
+<node oor:name="L280" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5059 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L281" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5060 SuperPrint blau</value></prop>
+<node oor:name="L281" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5060 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L282" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5061 SuperPrint grün</value></prop>
+<node oor:name="L282" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5061 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L283" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5062 SuperPrint weiß</value></prop>
+<node oor:name="L283" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5062 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L284" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5063 SuperPrint weiß, A6</value></prop>
+<node oor:name="L284" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5063 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L285" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5064 SuperPrint weiß, A5</value></prop>
+<node oor:name="L285" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5064 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L286" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5065 SuperPrint weiß, A4</value></prop>
+<node oor:name="L286" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5065 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L287" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5066 SuperPrint Kreise 40 mm, weiß</value></prop>
+<node oor:name="L287" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5066 SuperPrint Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L288" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5067 SuperPrint Kreise 60 mm, weiß</value></prop>
+<node oor:name="L288" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5067 SuperPrint Kreise 60 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L289" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5068 SuperPrint Kreise 85 mm, weiß</value></prop>
+<node oor:name="L289" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5068 SuperPrint Kreise 85 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;9500;9500;8500;8500;1500;1100;2;3</value></prop></node>
-<node oor:name="L290" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5069 SuperPrint Videocassette, Rücken, weiß</value></prop>
+<node oor:name="L290" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5069 SuperPrint Videocassette, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;2000;14732;2000;3134;1850;1;13</value></prop></node>
-<node oor:name="L291" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5070 SuperPrint Videocassette, Front, weiß</value></prop>
+<node oor:name="L291" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5070 SuperPrint Videocassette, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4656;7874;4656;2499;882;2;6</value></prop></node>
-<node oor:name="L292" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5071 SuperPrint Diabeschriftung, weiß</value></prop>
+<node oor:name="L292" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5071 SuperPrint Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L293" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5072 SuperPrint Pfeile, gelb</value></prop>
+<node oor:name="L293" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5072 SuperPrint Pfeile, gelb</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;9144;2540;1102;1938;2;6</value></prop></node>
-<node oor:name="L294" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5073 SuperPrint Pfeile, rot</value></prop>
+<node oor:name="L294" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5073 SuperPrint Pfeile, rot</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;9144;2540;1102;1938;2;6</value></prop></node>
-<node oor:name="L295" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5074 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L295" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5074 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L296" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5075 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L296" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5075 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L297" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5076 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L297" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5076 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L298" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5077 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L298" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5077 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L299" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5078 SuperPrint CD-Box-Etiketten, weiß</value></prop>
+<node oor:name="L299" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5078 SuperPrint CD-Box-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;11430;550;11430;550;4785;1650;1;48</value></prop></node>
-<node oor:name="L300" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5079 SuperPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L300" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5079 SuperPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L301" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5080 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L301" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5080 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L302" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5081 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L302" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5081 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L303" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5082 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L303" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5082 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L304" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5083 SuperPrint CD-Etikett, gelb</value></prop>
+<node oor:name="L304" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5083 SuperPrint CD-Etikett, gelb</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L305" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5084 SuperPrint CD-Etikett, rot</value></prop>
+<node oor:name="L305" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5084 SuperPrint CD-Etikett, rot</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L306" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5085 SuperPrint CD-Etikett, blau</value></prop>
+<node oor:name="L306" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5085 SuperPrint CD-Etikett, blau</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L307" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5086 SuperPrint CD-Etikett, grün</value></prop>
+<node oor:name="L307" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5086 SuperPrint CD-Etikett, grün</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L308" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5087 SuperPrint ZIP-Disketten, weiß</value></prop>
+<node oor:name="L308" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5087 SuperPrint ZIP-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6175;5000;5900;5000;1375;2350;3;5</value></prop></node>
-<node oor:name="L309" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5088 SuperPrint für schmale Ordner, farbig sort.</value></prop>
+<node oor:name="L309" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5088 SuperPrint für schmale Ordner, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L310" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5089 SuperPrint für breite Ordner, farbig sort.</value></prop>
+<node oor:name="L310" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5089 SuperPrint für breite Ordner, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L311" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5090 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L311" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5090 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L312" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5091 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L312" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5091 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L313" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5092 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L313" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5092 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L314" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5093 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L314" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5093 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L315" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5094 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L315" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5094 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L316" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5095 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L316" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5095 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L317" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5096 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L317" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5096 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L318" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5097 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L318" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5097 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L319" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5098 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L319" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5098 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L320" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5099 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L320" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5099 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L321" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5123 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L321" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5123 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L322" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5124 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L322" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5124 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L323" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5125 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L323" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5125 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L324" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5126 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L324" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5126 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L325" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5127 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L325" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5127 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L326" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5128 SuperPrint für schmale Ordner, lang, farbig sort.</value></prop>
+<node oor:name="L326" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5128 SuperPrint für schmale Ordner, lang, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L327" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5129 SuperPrint für breite Ordner, lang, farbig sort.</value></prop>
+<node oor:name="L327" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5129 SuperPrint für breite Ordner, lang, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L328" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5130 SuperPrint für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L328" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5130 SuperPrint für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L329" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5131 SuperPrint für schmale Ordner, lang, gelb</value></prop>
+<node oor:name="L329" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5131 SuperPrint für schmale Ordner, lang, gelb</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L330" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5132 SuperPrint für schmale Ordner, lang, rot</value></prop>
+<node oor:name="L330" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5132 SuperPrint für schmale Ordner, lang, rot</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L331" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5133 SuperPrint für schmale Ordner, lang, blau</value></prop>
+<node oor:name="L331" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5133 SuperPrint für schmale Ordner, lang, blau</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L332" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5134 SuperPrint für schmale Ordner, lang, grün</value></prop>
+<node oor:name="L332" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5134 SuperPrint für schmale Ordner, lang, grün</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L333" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5135 SuperPrint für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L333" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5135 SuperPrint für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L334" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5136 SuperPrint für breite Ordner, lang, gelb</value></prop>
+<node oor:name="L334" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5136 SuperPrint für breite Ordner, lang, gelb</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L335" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5137 SuperPrint für breite Ordner, lang, rot</value></prop>
+<node oor:name="L335" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5137 SuperPrint für breite Ordner, lang, rot</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L336" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5138 SuperPrint für breite Ordner, lang, blau</value></prop>
+<node oor:name="L336" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5138 SuperPrint für breite Ordner, lang, blau</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L337" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5139 SuperPrint für breite Ordner, lang, grün</value></prop>
+<node oor:name="L337" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5139 SuperPrint für breite Ordner, lang, grün</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L338" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5140 SuperPrint neon-gelb</value></prop>
+<node oor:name="L338" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5140 SuperPrint neon-gelb</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L339" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5141 SuperPrint neon-orange</value></prop>
+<node oor:name="L339" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5141 SuperPrint neon-orange</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L340" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5142 SuperPrint neon-pink</value></prop>
+<node oor:name="L340" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5142 SuperPrint neon-pink</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L341" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5143 SuperPrint neon-grün</value></prop>
+<node oor:name="L341" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5143 SuperPrint neon-grün</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L342" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5144 SuperPrint neon-gelb</value></prop>
+<node oor:name="L342" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5144 SuperPrint neon-gelb</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L343" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5145 SuperPrint neon-orange</value></prop>
+<node oor:name="L343" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5145 SuperPrint neon-orange</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L344" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5146 SuperPrint neon-pink</value></prop>
+<node oor:name="L344" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5146 SuperPrint neon-pink</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L345" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5147 SuperPrint neon-grün</value></prop>
+<node oor:name="L345" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5147 SuperPrint neon-grün</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L346" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5148 SuperPrint neon-gelb, A4</value></prop>
+<node oor:name="L346" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5148 SuperPrint neon-gelb, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L347" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5149 SuperPrint neon-orange, A4</value></prop>
+<node oor:name="L347" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5149 SuperPrint neon-orange, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L348" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5150 SuperPrint neon-pink, A4</value></prop>
+<node oor:name="L348" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5150 SuperPrint neon-pink, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L349" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5151 SuperPrint neon-grün, A4</value></prop>
+<node oor:name="L349" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5151 SuperPrint neon-grün, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L350" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5152 SuperPrint neon-gelb, Kreise 60 mm</value></prop>
+<node oor:name="L350" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5152 SuperPrint neon-gelb, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L351" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5153 SuperPrint neon-orange, Kreise 60 mm</value></prop>
+<node oor:name="L351" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5153 SuperPrint neon-orange, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L352" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5154 SuperPrint neon-pink, Kreise 60 mm</value></prop>
+<node oor:name="L352" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5154 SuperPrint neon-pink, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L353" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5155 SuperPrint neon-grün, Kreise 60 mm</value></prop>
+<node oor:name="L353" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5155 SuperPrint neon-grün, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L354" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5158 SuperPrint für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L354" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5158 SuperPrint für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3400;29700;3400;29700;2000;0;5;1</value></prop></node>
-<node oor:name="L355" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5159 SuperPrint für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L355" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5159 SuperPrint für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;5900;29700;5900;29700;1650;0;3;1</value></prop></node>
-<node oor:name="L356" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5160 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L356" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5160 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L357" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5161 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L357" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5161 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L358" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5162 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L358" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5162 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L359" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5163 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L359" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5163 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L360" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5164 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L360" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5164 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L361" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5165 SuperPrint für schmale Hängeordner, weiß</value></prop>
+<node oor:name="L361" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5165 SuperPrint für schmale Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;3400;29700;3400;29700;2000;0;5;1</value></prop></node>
-<node oor:name="L362" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5166 SuperPrint für breite Hängeordner, weiß</value></prop>
+<node oor:name="L362" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5166 SuperPrint für breite Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;5800;29700;5800;29700;1800;0;3;1</value></prop></node>
-<node oor:name="L363" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5167 SuperPrint für breite Hängeordner, weiß</value></prop>
+<node oor:name="L363" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5167 SuperPrint für breite Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;6300;29700;6300;29700;1050;0;3;1</value></prop></node>
-<node oor:name="L364" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8619 SuperPrint Mini-CD-Etiketten, weiß</value></prop>
+<node oor:name="L364" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8619 SuperPrint Mini-CD-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9200;8950;7800;7800;2000;2000;2;3</value></prop></node>
-<node oor:name="L365" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8631 SuperPrint weiß</value></prop>
+<node oor:name="L365" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8631 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L366" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8632 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L366" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8632 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L367" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8633 SuperPrint weiß</value></prop>
+<node oor:name="L367" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8633 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L368" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8634 SuperPrint weiß</value></prop>
+<node oor:name="L368" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8634 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L369" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8635 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L369" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8635 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L370" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8636 SuperPrint weiß, A5</value></prop>
+<node oor:name="L370" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8636 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L371" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8637 SuperPrint weiß, A4</value></prop>
+<node oor:name="L371" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8637 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L372" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8650 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L372" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8650 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L373" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8651 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L373" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8651 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L374" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8652 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L374" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8652 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L375" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8653 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L375" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8653 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L376" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8654 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L376" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8654 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L377" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8655 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L377" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8655 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L378" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8680 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L378" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8680 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L379" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8681 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L379" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8681 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L380" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8682 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L380" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8682 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L381" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8683 ColorPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L381" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8683 ColorPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L382" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8800 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L382" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8800 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6096;3387;5334;3387;1737;1303;3;8</value></prop></node>
-<node oor:name="L383" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8801 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L383" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8801 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L384" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8802 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L384" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8802 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L385" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8803 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L385" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8803 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L386" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8804 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L386" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8804 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L387" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8805 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L387" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8805 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L388" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8806 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L388" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8806 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L389" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8807 InkPrint Special weiß, z.B. Paketadresse, ca. A6</value></prop>
+<node oor:name="L389" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8807 InkPrint Special weiß, z.B. Paketadresse, ca. A6</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L390" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8808 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L390" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8808 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L391" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8809 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L391" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8809 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L392" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8810 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L392" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8810 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L393" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8811 InkPrint Special weiß, ca. DIN A5</value></prop>
+<node oor:name="L393" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8811 InkPrint Special weiß, ca. DIN A5</value></prop>
<prop oor:name="Measure"><value>S;19200;13970;19200;13970;900;880;1;2</value></prop></node>
-<node oor:name="L394" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8830 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
+<node oor:name="L394" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8830 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
<prop oor:name="Measure"><value>S;2794;847;2540;847;848;1303;7;32</value></prop></node>
-<node oor:name="L395" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8831 InkPrint Special weiß, quadratisch</value></prop>
+<node oor:name="L395" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8831 InkPrint Special weiß, quadratisch</value></prop>
<prop oor:name="Measure"><value>S;3048;2540;2540;2540;1610;880;6;11</value></prop></node>
-<node oor:name="L396" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8832 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
+<node oor:name="L396" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8832 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
-<node oor:name="L397" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8833 InkPrint Special weiß</value></prop>
+<node oor:name="L397" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8833 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L398" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8834 InkPrint Special weiß</value></prop>
+<node oor:name="L398" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8834 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;1693;4830;1693;840;1330;4;16</value></prop></node>
-<node oor:name="L399" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8835 InkPrint Special weiß</value></prop>
+<node oor:name="L399" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8835 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;2540;4830;2540;840;880;4;11</value></prop></node>
-<node oor:name="L400" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8836 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L400" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8836 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6096;3387;5334;3387;1737;1303;3;8</value></prop></node>
-<node oor:name="L401" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8837 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L401" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8837 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2540;6350;2540;721;880;3;11</value></prop></node>
-<node oor:name="L402" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8838 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L402" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8838 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L403" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8839 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L403" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8839 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L404" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8840 InkPrint Special weiß, Visitenkartenformat</value></prop>
+<node oor:name="L404" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8840 InkPrint Special weiß, Visitenkartenformat</value></prop>
<prop oor:name="Measure"><value>S;8890;5080;8382;5080;1864;2150;2;5</value></prop></node>
-<node oor:name="L405" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8841 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L405" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8841 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L406" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8842 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L406" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8842 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L407" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8843 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L407" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8843 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;9854;847;9600;847;773;1303;2;32</value></prop></node>
-<node oor:name="L408" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8844 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L408" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8844 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;9854;1693;9600;1693;773;1303;2;16</value></prop></node>
-<node oor:name="L409" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8845 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L409" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8845 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L410" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8846 InkPrint Special weiß</value></prop>
+<node oor:name="L410" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8846 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L411" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8847 InkPrint Special weiß, Paketadresse, ca. A6</value></prop>
+<node oor:name="L411" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8847 InkPrint Special weiß, Paketadresse, ca. A6</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L412" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8848 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L412" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8848 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;19200;847;19200;847;900;1303;1;32</value></prop></node>
-<node oor:name="L413" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8849 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L413" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8849 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;19200;1693;19200;1693;900;1303;1;16</value></prop></node>
-<node oor:name="L414" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8850 InkPrint Special weiß, ca. DIN A5</value></prop>
+<node oor:name="L414" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8850 InkPrint Special weiß, ca. DIN A5</value></prop>
<prop oor:name="Measure"><value>S;19200;13970;19200;13970;900;880;1;2</value></prop></node>
-<node oor:name="L415" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8851 InkPrint Special Kreise 32 mm, weiß</value></prop>
+<node oor:name="L415" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8851 InkPrint Special Kreise 32 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;3810;3200;3200;1280;1820;5;7</value></prop></node>
-<node oor:name="L416" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8852 InkPrint Special Kreise 63,5 mm, weiß</value></prop>
+<node oor:name="L416" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8852 InkPrint Special Kreise 63,5 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;6773;6350;6350;721;1516;3;4</value></prop></node>
-<node oor:name="L417" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8853 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L417" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8853 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L418" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8854 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L418" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8854 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L419" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8855 InkPrint Special abgeschrägte Ecken, weiß</value></prop>
+<node oor:name="L419" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8855 InkPrint Special abgeschrägte Ecken, weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;8890;6773;1229;1303;2;4</value></prop></node>
-<node oor:name="L420" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8856 InkPrint Special Registeretiketten, weiß</value></prop>
+<node oor:name="L420" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8856 InkPrint Special Registeretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;3048;4656;2540;4230;1610;1092;6;6</value></prop></node>
-<node oor:name="L421" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8857 InkPrint Special Sterne 63,5 mm, weiß</value></prop>
+<node oor:name="L421" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8857 InkPrint Special Sterne 63,5 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;6773;6350;6350;721;1516;3;4</value></prop></node>
-<node oor:name="L422" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8858 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L422" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8858 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L423" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8859 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L423" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8859 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L424" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8860 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L424" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8860 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L425" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8861 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L425" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8861 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;5700;9906;5700;467;600;2;5</value></prop></node>
-<node oor:name="L426" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8862 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L426" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8862 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L427" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8863 InkPrint Special Kreise 40 mm, weiß</value></prop>
+<node oor:name="L427" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8863 InkPrint Special Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L428" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8864 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L428" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8864 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L429" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8865 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L429" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8865 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L430" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8866 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L430" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8866 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;2150;2;6</value></prop></node>
-<node oor:name="L431" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8867 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L431" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8867 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;2150;2;4</value></prop></node>
-<node oor:name="L432" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8868 InkPrint Special Sonderform, weiß</value></prop>
+<node oor:name="L432" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8868 InkPrint Special Sonderform, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L433" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8869 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L433" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8869 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L434" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8870 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L434" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8870 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;9854;6773;9600;6350;773;1515;2;4</value></prop></node>
-<node oor:name="L435" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8886 InkPrint Special Glossy-Qualität, Fotos 10x15, Two-in-one</value></prop>
+<node oor:name="L435" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8886 InkPrint Special Glossy-Qualität, Fotos 10x15, Two-in-one</value></prop>
<prop oor:name="Measure"><value>S;15000;14800;15000;10000;3000;2450;1;2</value></prop></node>
-<node oor:name="L436" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8887 InkPrint Special Glossy-Qualität, Paßfoto-Format, Two-in-one</value></prop>
+<node oor:name="L436" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8887 InkPrint Special Glossy-Qualität, Paßfoto-Format, Two-in-one</value></prop>
<prop oor:name="Measure"><value>S;4100;5100;3500;4500;2600;2400;4;5</value></prop></node>
-<node oor:name="L437" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8888 InkPrint Special Glossy-Qualität, CD-Cover-Etikett, weiß</value></prop>
+<node oor:name="L437" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8888 InkPrint Special Glossy-Qualität, CD-Cover-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;12150;14550;12150;11750;4425;1700;1;2</value></prop></node>
-<node oor:name="L438" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8889 InkPrint Special Glossy-Qualität,Visitenkartenetikett, weiß</value></prop>
+<node oor:name="L438" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8889 InkPrint Special Glossy-Qualität,Visitenkartenetikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;9600;5500;8300;5200;1550;1250;2;5</value></prop></node>
-<node oor:name="L439" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8890 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L439" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8890 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L440" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8891 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L440" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8891 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L441" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8892 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L441" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8892 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L442" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8893 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L442" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8893 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L443" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8894 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L443" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8894 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L444" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8895 InkPrint Special Glossy-Qualität, weiß</value></prop>
+<node oor:name="L444" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8895 InkPrint Special Glossy-Qualität, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L445" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8896 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L445" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8896 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;5079;6350;4656;721;2363,5;3;5</value></prop></node>
-<node oor:name="L446" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8897 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L446" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8897 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L447" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8898 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L447" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8898 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9398;13123;8890;12700;1356;1932;2;2</value></prop></node>
-<node oor:name="L448" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8899 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L448" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8899 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;17800;13300;17800;12700;1600;1843;1;2</value></prop></node>
-<node oor:name="L449" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8900 InkPrint Special Glossy-Qualität, CD-Etikett, weiß</value></prop>
+<node oor:name="L449" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8900 InkPrint Special Glossy-Qualität, CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L450" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8901 InkPrint Special Glossy-Qualität, oval</value></prop>
+<node oor:name="L450" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8901 InkPrint Special Glossy-Qualität, oval</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L451" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8939 InkPrint Special Mini-CD-Etiketten, weiß</value></prop>
+<node oor:name="L451" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8939 InkPrint Special Mini-CD-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9200;8950;7800;7800;2000;2000;2;3</value></prop></node>
-<node oor:name="L452" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8961 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L452" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8961 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L453" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8962 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L453" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8962 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L454" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8963 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L454" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8963 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L455" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8964 InkPrint Special transparente Folie, A4</value></prop>
+<node oor:name="L455" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8964 InkPrint Special transparente Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L456" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8965 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L456" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8965 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L457" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8966 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L457" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8966 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L458" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8967 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L458" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8967 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L459" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8968 InkPrint Special CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L459" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8968 InkPrint Special CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L460" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8971 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L460" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8971 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L461" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8972 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L461" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8972 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L462" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8973 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L462" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8973 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L463" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8974 InkPrint Special weiße Folie, A4</value></prop>
+<node oor:name="L463" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8974 InkPrint Special weiße Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L464" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8981 InkPrint Special Goldfolie</value></prop>
+<node oor:name="L464" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8981 InkPrint Special Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L465" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8982 InkPrint Special Goldfolie</value></prop>
+<node oor:name="L465" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8982 InkPrint Special Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L466" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8983 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L466" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8983 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L467" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8984 InkPrint Special CD-Etikett, gold</value></prop>
+<node oor:name="L467" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8984 InkPrint Special CD-Etikett, gold</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L468" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8991 InkPrint Special Silberfolie</value></prop>
+<node oor:name="L468" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8991 InkPrint Special Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L469" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8992 InkPrint Special Silberfolie</value></prop>
+<node oor:name="L469" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8992 InkPrint Special Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L470" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8993 SuperPrint Silberfolie, oval</value></prop>
+<node oor:name="L470" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8993 SuperPrint Silberfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L471" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8994 InkPrint Special CD-Etikett, silber</value></prop>
+<node oor:name="L471" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8994 InkPrint Special CD-Etikett, silber</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L472" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4639a SuperPrint BETACAM SP/U-MATIC, Cassette (Front), weiß</value></prop>
+<node oor:name="L472" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4639a SuperPrint BETACAM SP/U-MATIC, Cassette (Front), weiß</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L473" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4639b SuperPrint BETACAM SP/U-MATIC, Cassette (Rücken), weiß</value></prop>
+<node oor:name="L473" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4639b SuperPrint BETACAM SP/U-MATIC, Cassette (Rücken), weiß</value></prop>
<prop oor:name="Measure"><value>S;14000;1693;14000;1693;3500;1306;1;16</value></prop></node>
-<node oor:name="L474" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4640a SuperPrint Maxi Data Cartridge, weiß</value></prop>
+<node oor:name="L474" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4640a SuperPrint Maxi Data Cartridge, weiß</value></prop>
<prop oor:name="Measure"><value>S;13400;6770;13400;6770;3800;1310;1;4</value></prop></node>
-<node oor:name="L475" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4640b SuperPrint Maxi Data Cartridge (Hülle), weiß</value></prop>
+<node oor:name="L475" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4640b SuperPrint Maxi Data Cartridge (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;13400;1270;13400;1270;3800;1515;1;21</value></prop></node>
-<node oor:name="L476" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4641a SuperPrint Data Cartridge 4 mm, weiß</value></prop>
+<node oor:name="L476" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4641a SuperPrint Data Cartridge 4 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6096;2120;5334;2120;1737;1070;3;13</value></prop></node>
-<node oor:name="L477" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4641b SuperPrint Data Cartridge 4 mm (Hülle), weiß</value></prop>
+<node oor:name="L477" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4641b SuperPrint Data Cartridge 4 mm (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L478" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4642a SuperPrint MiniData Cartridge, weiß</value></prop>
+<node oor:name="L478" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4642a SuperPrint MiniData Cartridge, weiß</value></prop>
<prop oor:name="Measure"><value>S;8800;2400;7300;2400;2450;1650;2;11</value></prop></node>
-<node oor:name="L479" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4642b SuperPrint MiniData Cartridge (Hülle), weiß</value></prop>
+<node oor:name="L479" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4642b SuperPrint MiniData Cartridge (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;1000;7500;1000;2250;1850;2;26</value></prop></node>
-<node oor:name="L480" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4643a SuperPrint Magneto Optical Disk 3,5", weiß</value></prop>
+<node oor:name="L480" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4643a SuperPrint Magneto Optical Disk 3,5", weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L481" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4643b SuperPrint Magneto Optical Disk 3,5" (Hülle), weiß</value></prop>
+<node oor:name="L481" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4643b SuperPrint Magneto Optical Disk 3,5" (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9800;12400;8800;10400;1200;3450;2;2</value></prop></node>
-<node oor:name="L482" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4646a SuperPrint Mini Digital Video, weiß</value></prop>
+<node oor:name="L482" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4646a SuperPrint Mini Digital Video, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L483" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4646b SuperPrint Mini Digital Video (Hülle), weiß</value></prop>
+<node oor:name="L483" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4646b SuperPrint Mini Digital Video (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2540;6350;2540;721;880;3;11</value></prop></node>
-<node oor:name="L484" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4647a SuperPrint Video 8, Hi-8, Data Cartridge 8mm, weiß </value></prop>
+<node oor:name="L484" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4647a SuperPrint Video 8, Hi-8, Data Cartridge 8mm, weiß </value></prop>
<prop oor:name="Measure"><value>S;9000;1000;7500;1000;2250;1850;2;26</value></prop></node>
-<node oor:name="L485" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4647b SuperPrint Video 8, Hi-8, Data Cartridge 8 mm (Hülle), weiß</value></prop>
+<node oor:name="L485" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4647b SuperPrint Video 8, Hi-8, Data Cartridge 8 mm (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L486" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4648a SuperPrint VHS-C, SVHS-C, Cassette (Rücken) weiß</value></prop>
+<node oor:name="L486" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4648a SuperPrint VHS-C, SVHS-C, Cassette (Rücken) weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1200;4318;1200;1102;1050;4;23</value></prop></node>
-<node oor:name="L487" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4648b SuperPrint VHS-C, SVHS-C, Cassette (Front), weiß</value></prop>
+<node oor:name="L487" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4648b SuperPrint VHS-C, SVHS-C, Cassette (Front), weiß</value></prop>
<prop oor:name="Measure"><value>S;6350;3810;5842;3810;1229;1515;3;7</value></prop></node>
-<node oor:name="L488" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4649a SuperPrint MiniDisk, weiß</value></prop>
+<node oor:name="L488" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4649a SuperPrint MiniDisk, weiß</value></prop>
<prop oor:name="Measure"><value>S;3600;5500;3600;5200;1500;1250;5;5</value></prop></node>
-<node oor:name="L489" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4649b SuperPrint MiniDisk-Hülle, weiß</value></prop>
+<node oor:name="L489" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4649b SuperPrint MiniDisk-Hülle, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L490" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5116 taillierte Ringetiketten für Schmuck, weiß</value></prop>
+<node oor:name="L490" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5116 taillierte Ringetiketten für Schmuck, weiß</value></prop>
<prop oor:name="Measure"><value>S;5900;1400;4900;1000;2150;1050;3;20</value>
</prop>
</node>
@@ -14281,280 +13180,280 @@
</node>
<node oor:name="Herma A5" oor:op="replace">
- <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8600 A5 Kreise 10 mm, weiß, ablösbar</value></prop>
+ <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8600 A5 Kreise 10 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1270;1270;1000;1000;1110;1210;15;10</value></prop></node>
- <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8601 A5 Kreise 20 mm, weiß, ablösbar</value></prop>
+ <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8601 A5 Kreise 20 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2300;2300;2000;2000;1450;675;8;6</value></prop></node>
- <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8602 A5 Kreise 60 mm, gelb, ablösbar</value></prop>
+ <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8602 A5 Kreise 60 mm, gelb, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1075;3;2</value></prop></node>
- <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8603 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8603 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1524;850;1270;850;721;1050;13;15</value></prop></node>
- <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8604 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8604 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2034;1000;1780;1000;457;1425;10;12</value></prop></node>
- <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8605 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8605 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1499,5;7;7</value></prop></node>
- <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8606 A5 Diabeschriftung, weiß</value></prop>
+ <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8606 A5 Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1000;4572;1000;975;1425;4;12</value></prop></node>
- <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8607 A5 Sichtreiteretiketten, weiß</value></prop>
+ <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8607 A5 Sichtreiteretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4572;1693;975;1499,5;4;7</value></prop></node>
- <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8608 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8608 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1499,5;3;4</value></prop></node>
- <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8609 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8609 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;1075,5;2;3</value></prop></node>
- <node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8610 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8610 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;1075;2;2</value></prop></node>
- <node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8611 A5 3,5"-Disketten, farbig sortiert</value></prop>
+ <node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8611 A5 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;652;2;2</value></prop></node>
- <node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8612 A5 Videoetiketten, Front, weiß</value></prop>
+ <node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8612 A5 Videoetiketten, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4646;7874;4646;2499;2769;2;2</value></prop></node>
- <node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8613 A5 Videoetiketten, Rücken, weiß</value></prop>
+ <node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8613 A5 Videoetiketten, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;1693;14732;1693;3134;1499,5;1;7</value></prop></node>
- <node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8614 A5 Musik-Cassetten, weiß</value></prop>
+ <node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8614 A5 Musik-Cassetten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9154;4233;8900;4233;1473;1075,5;2;3</value></prop></node>
- <node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8615 A5 für schmale Ordner, farbig sortiert</value></prop>
+ <node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8615 A5 für schmale Ordner, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1725;1;3</value></prop></node>
- <node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8616 A5 für breite Ordner, farbig sortiert</value></prop>
+ <node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8616 A5 für breite Ordner, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;1325;1;2</value></prop></node>
</node>
<node oor:name="Herma endlos" oor:op="replace">
-<node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8001 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8001 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8003 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8003 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;3810;2117;3556;1900;1867;0;2;1</value></prop></node>
-<node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8004 Endlosetiketten 2-bahnig, Diabeschriftung</value></prop>
+<node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8004 Endlosetiketten 2-bahnig, Diabeschriftung</value></prop>
<prop oor:name="Measure"><value>C;4572;1270;4318;1030;1105;0;2;1</value></prop></node>
-<node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8005 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8005 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8006 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8006 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4318;1693;4064;1453;1359;0;2;1</value></prop></node>
-<node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8007 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8007 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4572;3810;4318;3570;1105;0;2;1</value></prop></node>
-<node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8008 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß</value></prop>
+<node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8008 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8009 Endlosetiketten 1-bahnig, Namensetiketten, Acetatseide</value></prop>
+<node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8009 Endlosetiketten 1-bahnig, Namensetiketten, Acetatseide</value></prop>
<prop oor:name="Measure"><value>C;7000;2540;7000;2300;1500;0;1;1</value></prop></node>
-<node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8010 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß, Front</value></prop>
+<node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8010 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß, Front</value></prop>
<prop oor:name="Measure"><value>C;7112;5080;7112;4840;1444;0;1;1</value></prop></node>
-<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8011 Endlosetiketten 1-bahnig, 3,5"-Diskette, gelb</value></prop>
+<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8011 Endlosetiketten 1-bahnig, 3,5"-Diskette, gelb</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8012 Endlosetiketten 1-bahnig, 3,5"-Diskette, rot</value></prop>
+<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8012 Endlosetiketten 1-bahnig, 3,5"-Diskette, rot</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8013 Endlosetiketten 1-bahnig, 3,5"-Diskette, blau</value></prop>
+<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8013 Endlosetiketten 1-bahnig, 3,5"-Diskette, blau</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8014 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8014 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;1571;0;1;1</value></prop></node>
-<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8015 Endlosetiketten 1-bahnig, 3,5"-Diskette, grün</value></prop>
+<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8015 Endlosetiketten 1-bahnig, 3,5"-Diskette, grün</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8021 Endlosetiketten 2-bahnig, gelb</value></prop>
+<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8021 Endlosetiketten 2-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8022 Endlosetiketten 2-bahnig, rot</value></prop>
+<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8022 Endlosetiketten 2-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8036 Endlosetiketten 2-bahnig, ablösbar</value></prop>
+<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8036 Endlosetiketten 2-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8040 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8040 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8041 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8041 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8042 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8042 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8043 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8043 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8045 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8045 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8050 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8050 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8060 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8060 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8061 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8061 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8066 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8066 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8067 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8067 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;3810;10668;3570;916;0;1;1</value></prop></node>
-<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8068 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8068 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8069 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8069 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;5080;10668;4840;916;0;1;1</value></prop></node>
-<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8070 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8070 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8071 Endlosetiketten 1-bahnig, Videocassetten</value></prop>
+<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8071 Endlosetiketten 1-bahnig, Videocassetten</value></prop>
<prop oor:name="Measure"><value>C;14732;2540;14732;1900;1134;0;1;1</value></prop></node>
-<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8072 Endlosetiketten 1-bahnig, Querperforation, weiß</value></prop>
+<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8072 Endlosetiketten 1-bahnig, Querperforation, weiß</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8073 Endlosetiketten 1-bahnig, Querperforation, gelb</value></prop>
+<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8073 Endlosetiketten 1-bahnig, Querperforation, gelb</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8074 Endlosetiketten 1-bahnig, Querperforation, rot</value></prop>
+<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8074 Endlosetiketten 1-bahnig, Querperforation, rot</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8104 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8104 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8111 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8111 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8112 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8112 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8113 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8113 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8116 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8116 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8121 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8121 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8122 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8122 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8123 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8123 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8125 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8125 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8158 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8158 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;7366;1270;7366;1030;1317;0;1;1</value></prop></node>
-<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8160 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8160 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8161 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8161 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8162 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8162 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8163 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8163 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8164 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8164 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;2540;10160;2300;1170;0;1;1</value></prop></node>
-<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8166 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8166 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8167 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8167 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1713;0;2;1</value></prop></node>
-<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8168 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8168 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;2213;0;2;1</value></prop></node>
-<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8169 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8169 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;2540;10160;2300;1213;0;2;1</value></prop></node>
-<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8170 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8170 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8171 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8171 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8172 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8172 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;1571;0;1;1</value></prop></node>
-<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8173 Endlosetiketten 1-bahn., Querperforation, ablösbar</value></prop>
+<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8173 Endlosetiketten 1-bahn., Querperforation, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;14732;7620;14732;7380;1134;0;1;1</value></prop></node>
-<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8178 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
+<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8178 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
<prop oor:name="Measure"><value>C;9500;3810;9500;3810;1000;0;1;1</value></prop></node>
-<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8179 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
+<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8179 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
<prop oor:name="Measure"><value>C;15200;5080;15200;5080;900;0;1;1</value></prop></node>
-<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8181 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8181 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8182 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8182 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8183 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8183 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8185 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8185 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8200 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8200 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7874;2540;7874;2300;1063;0;1;1</value></prop></node>
-<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8201 Endlosetiketten 1-bahnig, 3,5"-Diskette, Front</value></prop>
+<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8201 Endlosetiketten 1-bahnig, 3,5"-Diskette, Front</value></prop>
<prop oor:name="Measure"><value>C;7112;5080;7112;4840;1444;0;1;1</value></prop></node>
-<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8202 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8202 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;7366;1270;7366;1030;1317;0;1;1</value></prop></node>
-<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8203 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8203 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;7620;10160;7380;1170;0;1;1</value></prop></node>
-<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8204 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8204 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8207 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8207 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;881;0;1;1</value></prop></node>
-<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8209 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8209 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;3810;10668;3570;916;0;1;1</value></prop></node>
-<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8210 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8210 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8211 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8211 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8212 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8212 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8213 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8213 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8214 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8214 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;2540;10160;2300;1170;0;1;1</value></prop></node>
-<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8215 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8215 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;3810;11176;3570;1162;0;1;1</value></prop></node>
-<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8216 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8216 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8217 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8217 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;2540;12700;2300;1150;0;1;1</value></prop></node>
-<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8218 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8218 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;3810;12700;3570;1150;0;1;1</value></prop></node>
-<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8219 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8219 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;13460;2117;13460;1900;1200;0;1;1</value></prop></node>
-<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8220 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8220 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;3810;8890;3570;1108;0;2;1</value></prop></node>
-<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8221 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8221 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;2540;8890;2300;1108;0;2;1</value></prop></node>
-<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8222 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8222 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;3810;5080;3570;1043;0;2;1</value></prop></node>
-<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8223 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8223 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8225 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8225 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1213;0;2;1</value></prop></node>
-<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8226 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8226 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;5080;8890;4840;1108;0;2;1</value></prop></node>
-<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8227 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8227 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;1213;0;2;1</value></prop></node>
-<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8228 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8228 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;1270;3810;1030;1613;0;2;1</value></prop></node>
-<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8229 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8229 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;2540;5080;2300;1043;0;2;1</value></prop></node>
-<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8230 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8230 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;2540;8890;2300;1211;0;3;1</value></prop></node>
-<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8231 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8231 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;3810;8890;3570;1211;0;3;1</value></prop></node>
-<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8232 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8232 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1156;0;3;1</value></prop></node>
-<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8233 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8233 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10922;5080;10668;4840;1244;0;3;1</value></prop></node>
-<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8234 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8234 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;5080;8890;4840;1211;0;3;1</value></prop></node>
-<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8235 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8235 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11430;5080;11176;4840;1232;0;3;1</value></prop></node>
-<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8236 Endlosetiketten 3-bahnig, mit Querperforation</value></prop>
+<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8236 Endlosetiketten 3-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;7112;3810;6858;3570;1209;0;3;1</value></prop></node>
-<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8237 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8237 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10922;3810;10668;3570;1244;0;3;1</value></prop></node>
-<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8238 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8238 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;1156;0;3;1</value></prop></node>
-<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8240 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8240 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7620;3810;7366;3570;1087;0;4;1</value></prop></node>
-<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8241 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8241 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;2540;8128;2300;1213;0;4;1</value></prop></node>
-<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8242 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8242 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;3810;8128;3570;1213;0;4;1</value></prop></node>
-<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8243 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8243 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;5080;8128;4840;1213;0;4;1</value></prop></node>
-<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8245 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8245 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;2540;5080;2300;1209;0;4;1</value></prop></node>
-<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8246 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8246 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;3810;5080;3570;1209;0;4;1</value></prop></node>
-<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8265 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8265 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;5080;12700;4840;1150;0;1;1</value></prop></node>
-<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8266 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8266 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12954;5080;12700;4840;1173;0;2;1</value></prop></node>
-<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8267 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8267 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7874;3810;7874;3570;1063;0;1;1</value></prop></node>
-<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8268 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8268 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8269 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8269 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;21082;15240;21082;15000;1209;0;1;1</value></prop></node>
-<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8290 Endlosetiketten 2-bahnig, mit Querperforation</value></prop>
+<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8290 Endlosetiketten 2-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14986;10160;14732;9920;1141;0;2;1</value></prop></node>
-<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8291 Endlosetiketten 1-bahnig, 3,5"-Diskette</value></prop>
+<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8291 Endlosetiketten 1-bahnig, 3,5"-Diskette</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8292 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8292 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8293 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8293 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;5080;14732;4840;1134;0;1;1</value></prop></node>
-<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8294 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8294 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;7620;14732;7380;1134;0;1;1</value></prop></node>
-<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8295 Endlosetiketten 8-bahnig</value></prop>
+<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8295 Endlosetiketten 8-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;1270;3810;1030;1371;0;8;1</value></prop></node>
-<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8296 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8296 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;5080;10668;4840;916;0;1;1</value></prop></node>
-<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8299 Endlosetiketten 1-bahnig, 5,25"-Diskette, ablösbar</value></prop>
+<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8299 Endlosetiketten 1-bahnig, 5,25"-Diskette, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;7112;3386;7112;3146;1444;0;1;1</value></prop></node>
</node>
<node oor:name="Leitz" oor:op="replace">
@@ -14563,7 +13462,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1680 Kartonrückenschilder, breit</value>
+ <value>1680 Kartonrückenschilder, breit</value>
</prop>
<prop oor:name="Measure">
@@ -14574,7 +13473,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1681 Kartonrückenschilder, schmal</value>
+ <value>1681 Kartonrückenschilder, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14585,7 +13484,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1685 Papierrückenschilder selbstkl., breit</value>
+ <value>1685 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14596,7 +13495,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1686 Papierrückenschilder selbstkl., schmal</value>
+ <value>1686 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14607,7 +13506,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1687 Papierrückenschilder selbstkl., breit</value>
+ <value>1687 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14618,7 +13517,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1688 Papierrückenschilder selbstkl., schmal</value>
+ <value>1688 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14629,7 +13528,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6098 Papierrückenschilder selbstkl., breit</value>
+ <value>6098 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14640,7 +13539,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6099 Papierrückenschilder selbstkl., schmal</value>
+ <value>6099 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14651,7 +13550,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1900 Blanko-Schildchen</value>
+ <value>1900 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14662,7 +13561,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">2466 Blanko-Schildchen</value>
+ <value>2466 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14673,7 +13572,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6010 Blanko-Schildchen</value>
+ <value>6010 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14684,7 +13583,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6643 Beschriftungsschilder, selbstklebend </value>
+ <value>6643 Beschriftungsschilder, selbstklebend </value>
</prop>
<prop oor:name="Measure">
@@ -14698,7 +13597,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP001 Tischkarten blanko weiß</value>
+ <value>DP001 Tischkarten blanko weiß</value>
</prop>
<prop oor:name="Measure">
@@ -14709,7 +13608,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP002 Tischkarten konturgestanzt</value>
+ <value>DP002 Tischkarten konturgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -14720,7 +13619,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DE115 Design-Etiketten</value>
+ <value>DE115 Design-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -14731,7 +13630,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DE141 Design-Etiketten</value>
+ <value>DE141 Design-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -14742,7 +13641,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP750 CD-Einleger</value>
+ <value>LP750 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14753,7 +13652,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD300 CD-Einleger</value>
+ <value>DD300 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14764,7 +13663,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD405 CD-Einleger</value>
+ <value>DD405 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14775,7 +13674,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP755 CD-Booklet</value>
+ <value>LP755 CD-Booklet</value>
</prop>
<prop oor:name="Measure">
@@ -14786,7 +13685,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD450 CD-Booklet</value>
+ <value>DD450 CD-Booklet</value>
</prop>
<prop oor:name="Measure">
@@ -14797,7 +13696,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP839/DP939 Design-Visitenkarten</value>
+ <value>DP839/DP939 Design-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14808,7 +13707,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP835/DP935 Design-Visitenkarten gestanzt</value>
+ <value>DP835/DP935 Design-Visitenkarten gestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -14819,7 +13718,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP836/DP936 Design-Visitenkarten</value>
+ <value>DP836/DP936 Design-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14830,7 +13729,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP837/DP937 Design-Visitenkarten gestanzt, m. abger. Ecken</value>
+ <value>DP837/DP937 Design-Visitenkarten gestanzt, m. abger. Ecken</value>
</prop>
<prop oor:name="Measure">
@@ -14841,7 +13740,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP838/DP938 Design-Klapp-Visitenkarten</value>
+ <value>DP838/DP938 Design-Klapp-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14852,7 +13751,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP781 Regalschild</value>
+ <value>LP781 Regalschild</value>
</prop>
<prop oor:name="Measure">
@@ -14863,7 +13762,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP731 Ordner-Einsteckschild</value>
+ <value>LP731 Ordner-Einsteckschild</value>
</prop>
<prop oor:name="Measure">
@@ -14874,7 +13773,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP734 Ordner-Einsteckschild</value>
+ <value>LP734 Ordner-Einsteckschild</value>
</prop>
<prop oor:name="Measure">
@@ -14885,7 +13784,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP710 Postkarte bedruckt</value>
+ <value>LP710 Postkarte bedruckt</value>
</prop>
<prop oor:name="Measure">
@@ -14896,7 +13795,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP711 Postkarte</value>
+ <value>LP711 Postkarte</value>
</prop>
<prop oor:name="Measure">
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index acff4d06ac8f..a7ecd0e224e8 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -223,6 +223,13 @@
</prop>
</node>
</node>
-
+ <node oor:name="Variables">
+ <prop oor:name="Work">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend WorkPathVariable"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend WorkPathVariable"/>
+ </prop>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Recovery.xcu b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
new file mode 100644
index 000000000000..efe80701a6db
--- /dev/null
+++ b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<oor:component-data xmlns:install="http://openoffice.org/2004/installation"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ oor:package="org.openoffice.Office" oor:name="Recovery">
+ <node oor:name="AutoSave" install:module="gconflockdown">
+ <prop oor:name="Enabled">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AutoSaveEnabled"/>
+ </prop>
+ <prop oor:name="TimeIntervall">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AutoSaveTimeIntervall"/>
+ </prop>
+ </node>
+</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
index 418956e05e62..ccd1e979fbef 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
@@ -113,7 +113,7 @@
</prop>
<prop oor:name="Docked" oor:type="xs:boolean">
- <value>False</value>
+ <value>false</value>
</prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
index 296a16a9e697..9341fbd3930d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
@@ -656,6 +656,29 @@
<value xml:lang="en-US">Number of lines in combination chart</value>
</prop>
</node>
+ <node oor:name=".uno:TextAttributes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Te~xt...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ObjectTitleDescription" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Description...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RenameObject" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Name...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Line Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
<!-- menu items with sub menu -->
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
index 9f68802dc355..29e26bbf29a9 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
@@ -59,6 +59,20 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/drawbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Drawing</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 47fba92cb003..553d94fc2fdb 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -220,15 +220,81 @@
</node>
<node oor:name="c3" oor:op="replace">
<prop oor:name="Command">
- <value>.uno:ChartElementSelector</value>
+ <value>.uno:ChartElementSelector</value>
</prop>
<prop oor:name="Module">
- <value>com.sun.star.chart2.ChartDocument</value>
+ <value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
+ <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
</prop>
- </node>
+ </node>
+ <node oor:name="c4" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:BasicShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c5" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:SymbolShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c6" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ArrowShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c7" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:FlowChartShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c8" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:CalloutShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c9" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:StarShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
</node>
<node oor:name="StatusBar">
<node oor:name="c1" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk
index 20ce0479e6e7..5cd876f75b19 100644
--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk
@@ -74,6 +74,8 @@ MODULEFILES= \
Common-base.xcu \
Common-math.xcu \
Common-unx.xcu \
+ Common-unixdesktop.xcu \
+ Common-gconflockdown.xcu \
Common-macosx.xcu \
Common-wnt.xcu \
Common-UseOOoFileDialogs.xcu \
@@ -84,6 +86,7 @@ MODULEFILES= \
Common-korea.xcu \
Paths-macosx.xcu \
Paths-unxwnt.xcu \
+ Paths-unixdesktop.xcu \
Writer-cjk.xcu \
Writer-javamail.xcu \
Impress-ogltrans.xcu \
@@ -94,8 +97,8 @@ MODULEFILES= \
Embedding-math.xcu \
Embedding-base.xcu \
Embedding-writer.xcu \
- UI-brand.xcu
-
+ UI-brand.xcu \
+ Recovery-gconflockdown.xcu
LOCALIZEDFILES= \
Accelerators.xcu \
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index 30da9aebce75..4acf93dee764 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -326,7 +326,7 @@
<value >swform</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Form Design</value>
+ <value>Base: Form Design</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value >WriterFormWindowState</value>
@@ -361,7 +361,7 @@
<value>swreport</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Report Design</value>
+ <value>Base: Report Design</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value>WriterReportWindowState</value>
@@ -399,8 +399,7 @@
<value >swxform</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">XML Form Document</value>
- <value xml:lang="de">XML Formulardokumente</value>
+ <value>XML Form Document</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value >XFormsWindowState</value>
@@ -470,7 +469,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Relation Design</value>
+ <value>Base: Relation Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.QueryDesign" oor:op="replace" install:module="base">
@@ -495,7 +494,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Query Design</value>
+ <value>Base: Query Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.ViewDesign" oor:op="replace" install:module="base">
@@ -520,7 +519,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: View Design</value>
+ <value>Base: View Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.TableDesign" oor:op="replace" install:module="base">
@@ -545,7 +544,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Table Design</value>
+ <value>Base: Table Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.DataSourceBrowser" oor:op="replace" install:module="base">
@@ -570,7 +569,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Data View</value>
+ <value>Base: Data View</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.TableDataView" oor:op="replace" install:module="base">
diff --git a/officecfg/registry/data/org/openoffice/System.xcu b/officecfg/registry/data/org/openoffice/System.xcu
new file mode 100644
index 000000000000..9e3ae0ea77ca
--- /dev/null
+++ b/officecfg/registry/data/org/openoffice/System.xcu
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
+ oor:package="org.openoffice" oor:name="System">
+ <node oor:name="L10N">
+ <prop oor:name="Locale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend Locale"/>
+ </prop>
+ <prop oor:name="UILocale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend UILocale"/>
+ </prop>
+ <prop oor:name="SystemLocale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend SystemLocale"/>
+ </prop>
+ </node>
+</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/UserProfile.xcu b/officecfg/registry/data/org/openoffice/UserProfile.xcu
index ac5e5673ad60..4e4ec41515f1 100644
--- a/officecfg/registry/data/org/openoffice/UserProfile.xcu
+++ b/officecfg/registry/data/org/openoffice/UserProfile.xcu
@@ -34,5 +34,12 @@
<prop oor:name="fathersname" oor:type="xs:string">
<value/>
</prop>
+ <prop oor:name="givenname" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend givenname"/>
+ </prop>
+ <prop oor:name="sn" install:module="gconflockdown">
+ <value oor:external="com.sun.star.configuration.backend.GconfBackend sn"/>
+ </prop>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 3412af748f29..36fd48ebf753 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,16 +26,20 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="VCL" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<oor:component-data oor:name="VCL" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node oor:name="Settings">
<node oor:name="Accessibility" oor:op="replace">
<prop oor:name="EnableATToolSupport" oor:type="xs:string" oor:op="replace">
<value>false</value>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend EnableATToolSupport"/>
</prop>
</node>
<node oor:name="DesktopManagement" oor:op="replace">
<prop oor:name="DisablePrinting" oor:type="xs:string" oor:op="replace">
<value>false</value>
+ <value install:module="gconflockdown" oor:external=
+ "com.sun.star.configuration.backend.GconfBackend DisablePrinting"/>
</prop>
</node>
<node oor:name="Transfer" oor:op="replace">
@@ -1549,7 +1553,6 @@
</prop>
<prop oor:name="SubstFontsMS">
<value>바탕</value>
- <value></value>
</prop>
<prop oor:name="SubstFontsPS">
<value></value>
diff --git a/officecfg/registry/data/org/openoffice/makefile.mk b/officecfg/registry/data/org/openoffice/makefile.mk
index 72ef12a47912..4e69cfecf132 100644
--- a/officecfg/registry/data/org/openoffice/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/makefile.mk
@@ -38,11 +38,15 @@ PACKAGE=org.openoffice
XCUFILES= \
Inet.xcu \
Setup.xcu \
+ System.xcu \
VCL.xcu \
FirstStartWizard.xcu \
UserProfile.xcu
MODULEFILES= \
+ Inet-macosx.xcu \
+ Inet-unixdesktop.xcu \
+ Inet-wnt.xcu \
Setup-brand.xcu \
Setup-writer.xcu \
Setup-calc.xcu \
@@ -51,22 +55,15 @@ MODULEFILES= \
Setup-base.xcu \
Setup-math.xcu \
Setup-report.xcu \
- Setup-start.xcu
+ Setup-start.xcu \
+ UserProfile-gconflockdown.xcu \
+ VCL-gconflockdown.xcu \
+ VCL-unixdesktop.xcu
LOCALIZEDFILES=Setup.xcu
-SAMPLEFILES= \
- LDAP.xcu.sample
-
.INCLUDE : target.mk
LANGUAGEPACKS=$(MISC)$/registry$/spool$/Langpack-{$(alllangiso)}.xcu
-SAMPLETARGETS=$(MISC)$/registry$/data$/$(PACKAGEDIR)$/{$(SAMPLEFILES)}
ALLTAR : $(LANGUAGEPACKS)
-ALLTAR : $(SAMPLETARGETS)
-
-$(SAMPLETARGETS) : $(SAMPLEFILES)
- -$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
-
diff --git a/officecfg/registry/schema/oo-ad-ldap-attr.map b/officecfg/registry/schema/oo-ad-ldap-attr.map
deleted file mode 100644
index 8e4d09b7e582..000000000000
--- a/officecfg/registry/schema/oo-ad-ldap-attr.map
+++ /dev/null
@@ -1,50 +0,0 @@
-# User.givenName
-org.openoffice.UserProfile/Data/givenname = givenName
-
-# User.sn
-org.openoffice.UserProfile/Data/sn = sn
-
-# User.initials
-org.openoffice.UserProfile/Data/initials = initials
-
-# User.street
-org.openoffice.UserProfile/Data/street = street,postalAddress
-
-# User.l (city)
-org.openoffice.UserProfile/Data/l = l
-
-# User.st (state)
-org.openoffice.UserProfile/Data/st = st
-
-# User.postalCode
-org.openoffice.UserProfile/Data/postalcode = postalCode
-
-# User.c (country)
-org.openoffice.UserProfile/Data/c = c,co
-
-# User.department (company)
-org.openoffice.UserProfile/Data/o = department
-
-# deprecated -- no LDAP corollary
-org.openoffice.UserProfile/Data/position =
-
-# User.title
-org.openoffice.UserProfile/Data/title = title
-
-# User.homePhone
-org.openoffice.UserProfile/Data/homephone = homePhone
-
-# User.telephoneNumber
-org.openoffice.UserProfile/Data/telephonenumber = telephoneNumber
-
-# UserfacsimileTelephoneNumber
-org.openoffice.UserProfile/Data/facsimiletelephonenumber = facsimileTelephoneNumber
-
-# User.mail
-org.openoffice.UserProfile/Data/mail = mail
-
-# Deprecated
-#UserGroup =
-
-
-
diff --git a/officecfg/registry/schema/oo-ad-ldap.xcd.sample b/officecfg/registry/schema/oo-ad-ldap.xcd.sample
new file mode 100644
index 000000000000..edc50fb637db
--- /dev/null
+++ b/officecfg/registry/schema/oo-ad-ldap.xcd.sample
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!-- This file is an example of an LDAP configuration file.
+
+ To use user data from LDAP in your installation, you need to provide a
+ customized version of this file, removing the ".sample" suffix.
+
+ This sample file is designed to work with a Windows Active Directory
+ Server. There is another sample file designed to work with a Sun Java
+ System Directory Server. Only one of those files should be activated by
+ removing its ".sample" suffix.
+
+ To customize values in this file, replace the data within <value>...
+ </value> elements flagged as "CUSTOMIZE" with the values for your
+ organization. If a certain setting is not necessary for your installation,
+ you can remove the compelete corresponding <value>...</value> element.
+-->
+
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+ <dependency file="main"/>
+ <oor:component-data oor:package="org.openoffice" oor:name="LDAP">
+ <node oor:name="UserDirectory">
+ <prop oor:name="SearchUser">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyUserLogin</value> -->
+ </prop>
+ <prop oor:name="SearchPassword">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyPassword</value> -->
+ </prop>
+ <prop oor:name="UserObjectClass">
+ <!-- CUSTOMIZE --><value>inetorgperson</value>
+ </prop>
+ <prop oor:name="UserUniqueAttribute">
+ <!-- CUSTOMIZE --><value>uid</value>
+ </prop>
+ <node oor:name="ServerDefinition">
+ <prop oor:name="Server">
+ <!-- CUSTOMIZE --><value>ldapserver.mycorp.com</value>
+ </prop>
+ <prop oor:name="Port">
+ <!-- CUSTOMIZE --><value>389</value>
+ </prop>
+ <prop oor:name="BaseDN">
+ <!-- CUSTOMIZE --><value>dc=mycorp,dc=com</value>
+ </prop>
+ </node>
+ </node>
+ </oor:component-data>
+ <oor:component-data oor:package="org.openoffice" oor:name="UserProfile">
+ <node oor:name="Data">
+ <prop oor:name="o">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe department"/>
+ </prop>
+ <prop oor:name="givenname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe givenname"/>
+ </prop>
+ <prop oor:name="sn">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe sn"/>
+ </prop>
+ <prop oor:name="initials">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe initials"/>
+ </prop>
+ <prop oor:name="street">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe street,postalAddress"/>
+ </prop>
+ <prop oor:name="l">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe l"/>
+ </prop>
+ <prop oor:name="st">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe st"/>
+ </prop>
+ <prop oor:name="postalcode">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe postalCode"/>
+ </prop>
+ <prop oor:name="c">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe c,co"/>
+ </prop>
+ <prop oor:name="title">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe title"/>
+ </prop>
+ <prop oor:name="position">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe position"/>
+ </prop>
+ <prop oor:name="homephone">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe homePhone"/>
+ </prop>
+ <prop oor:name="telephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe telephoneNumber"/>
+ </prop>
+ <prop oor:name="facsimiletelephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe facsimileTelephoneNumber"
+/>
+ </prop>
+ <prop oor:name="mail">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe mail"/>
+ </prop>
+ <!--
+ <prop oor:name="fathersname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <!--
+ <prop oor:name="apartment">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ </node>
+ </oor:component-data>
+</oor:data>
diff --git a/officecfg/registry/schema/oo-ldap-attr.map b/officecfg/registry/schema/oo-ldap-attr.map
deleted file mode 100644
index caf6be58cac2..000000000000
--- a/officecfg/registry/schema/oo-ldap-attr.map
+++ /dev/null
@@ -1,50 +0,0 @@
-# inetOrgPerson.givenName
-org.openoffice.UserProfile/Data/givenname = givenname
-
-# person.sn
-org.openoffice.UserProfile/Data/sn = sn
-
-# inetOrgPerson.initials
-org.openoffice.UserProfile/Data/initials = initials
-
-# organizationalPerson.street
-org.openoffice.UserProfile/Data/street = street,postalAddress,streetAddress
-
-# organizationalPerson.l (city)
-org.openoffice.UserProfile/Data/l = l
-
-# organizationalPerson.st (state)
-org.openoffice.UserProfile/Data/st = st
-
-# organizationalPerson.postalCode
-org.openoffice.UserProfile/Data/postalcode = postalcode
-
-# country.c (country)
-org.openoffice.UserProfile/Data/c =
-
-# organizationalPerson.o (company)
-org.openoffice.UserProfile/Data/o = o,organizationName
-
-# deprecated -- no LDAP corollary
-org.openoffice.UserProfile/Data/position =
-
-# organizationalPerson.title
-org.openoffice.UserProfile/Data/title = title
-
-# inetOrgPerson.homePhone
-org.openoffice.UserProfile/Data/homephone = homephone
-
-# organizationalPerson.telephoneNumber
-org.openoffice.UserProfile/Data/telephonenumber = telephonenumber
-
-# organizationalPerson.facsimileTelephoneNumber
-org.openoffice.UserProfile/Data/facsimiletelephonenumber = facsimiletelephonenumber,officeFax
-
-# inetOrgPerson.mail
-org.openoffice.UserProfile/Data/mail = mail
-
-# Deprecated
-#UserGroup =
-
-
-
diff --git a/officecfg/registry/schema/oo-ldap.xcd.sample b/officecfg/registry/schema/oo-ldap.xcd.sample
new file mode 100644
index 000000000000..8e9271a44dc9
--- /dev/null
+++ b/officecfg/registry/schema/oo-ldap.xcd.sample
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!-- This file is an example of an LDAP configuration file.
+
+ To use user data from LDAP in your installation, you need to provide a
+ customized version of this file, removing the ".sample" suffix.
+
+ This sample file is designed to work with a Sun Java System Directory
+ Server. There is another sample file designed to work with a Windows
+ Active Directory Server. Only one of those files should be activated by
+ removing its ".sample" suffix.
+
+ To customize values in this file, replace the data within <value>...
+ </value> elements flagged as "CUSTOMIZE" with the values for your
+ organization. If a certain setting is not necessary for your installation,
+ you can remove the compelete corresponding <value>...</value> element.
+-->
+
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+ <dependency file="main"/>
+ <oor:component-data oor:package="org.openoffice" oor:name="LDAP">
+ <node oor:name="UserDirectory">
+ <prop oor:name="SearchUser">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyUserLogin</value> -->
+ </prop>
+ <prop oor:name="SearchPassword">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyPassword</value> -->
+ </prop>
+ <prop oor:name="UserObjectClass">
+ <!-- CUSTOMIZE --><value>inetorgperson</value>
+ </prop>
+ <prop oor:name="UserUniqueAttribute">
+ <!-- CUSTOMIZE --><value>uid</value>
+ </prop>
+ <node oor:name="ServerDefinition">
+ <prop oor:name="Server">
+ <!-- CUSTOMIZE --><value>ldapserver.mycorp.com</value>
+ </prop>
+ <prop oor:name="Port">
+ <!-- CUSTOMIZE --><value>389</value>
+ </prop>
+ <prop oor:name="BaseDN">
+ <!-- CUSTOMIZE --><value>dc=mycorp,dc=com</value>
+ </prop>
+ </node>
+ </node>
+ </oor:component-data>
+ <oor:component-data oor:package="org.openoffice" oor:name="UserProfile">
+ <node oor:name="Data">
+ <prop oor:name="o">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe o,organizationName"/>
+ </prop>
+ <prop oor:name="givenname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe givenname"/>
+ </prop>
+ <prop oor:name="sn">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe sn"/>
+ </prop>
+ <prop oor:name="initials">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe initials"/>
+ </prop>
+ <prop oor:name="street">
+ <value oor:external=
+"com.sun.star.configuration.backend.LdapUserProfileBe street,postalAddress,streetAddress"
+/>
+ </prop>
+ <prop oor:name="l">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe l"/>
+ </prop>
+ <prop oor:name="st">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe st"/>
+ </prop>
+ <prop oor:name="postalcode">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe postalcode"/>
+ </prop>
+ <!--
+ <prop oor:name="c">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <prop oor:name="title">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe title"/>
+ </prop>
+ <prop oor:name="position">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe position"/>
+ </prop>
+ <prop oor:name="homephone">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe homephone"/>
+ </prop>
+ <prop oor:name="telephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe telephonenumber"/>
+ </prop>
+ <prop oor:name="facsimiletelephonenumber">
+ <value oor:external=
+"com.sun.star.configuration.backend.LdapUserProfileBe facsimiletelephonenumber,officeFax"
+/>
+ </prop>
+ <prop oor:name="mail">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe mail"/>
+ </prop>
+ <!--
+ <prop oor:name="fathersname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <!--
+ <prop oor:name="apartment">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ </node>
+ </oor:component-data>
+</oor:data>
diff --git a/officecfg/registry/schema/org/openoffice/LDAP.xcs b/officecfg/registry/schema/org/openoffice/LDAP.xcs
index e820de94dfcb..dd5e79833a93 100644
--- a/officecfg/registry/schema/org/openoffice/LDAP.xcs
+++ b/officecfg/registry/schema/org/openoffice/LDAP.xcs
@@ -54,7 +54,7 @@
</prop>
<prop oor:name="UserUniqueAttribute" oor:type="xs:string"><info><desc>Name of User entity unique attribute in LDAP repository</desc></info>
</prop>
- <prop oor:name="Mapping" oor:type="xs:string"><info><desc>Name of OOo to LDAP mapping file</desc></info>
+ <prop oor:name="Mapping" oor:type="xs:string"><info><desc>Obsolete and unused</desc></info>
</prop>
<node-ref oor:name="ServerDefinition" oor:node-type="ServerDefinition">
<info><desc>Specifies the LDAP related settings</desc></info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Chart.xcs b/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
index e70a12b27d81..8989c0f7c270 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
@@ -45,7 +45,8 @@
<desc>Specifies a list of color values to be used for the first n series, where n is the size of the list. For i &gt; n the color used is equal to entry number i modulo n in the list. You should keep the size of the list at 12. Also note that the values are interpreted as unsigned 32bit values, although it is possible to get negative (signed) numbers in this list when being displayed in decimal.</desc>
<label>Chart colors</label>
</info>
- <value>0x004586 0xff420e 0xffd320 0x579d1c 0x7e0021 0x83caff 0x314004 0xaecf00 0x4b1f6f 0xff950e 0xc5000b 0x0084d1</value>
+ <value>17798 16728590 16765728 5741852 8257569 8637183 3227652 11456256 4923247 16749838 12910603 34001</value>
+ <!-- 0x004586 0xff420e 0xffd320 0x579d1c 0x7e0021 0x83caff 0x314004 0xaecf00 0x4b1f6f 0xff950e 0xc5000b 0x0084d1 -->
</prop>
</group>
</component>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 2b2b0f7cb909..4a3c2c02c396 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4796,22 +4796,22 @@
<label>Accept with</label>
</info>
<constraints>
- <enumeration oor:value="0x405">
+ <enumeration oor:value="1029"> <!-- 0x405 -->
<info>
<desc>KeyEnd</desc>
</info>
</enumeration>
- <enumeration oor:value="0x500">
+ <enumeration oor:value="1280"> <!-- 0x500 -->
<info>
<desc>KeyReturn</desc>
</info>
</enumeration>
- <enumeration oor:value="0x403">
+ <enumeration oor:value="1027"> <!-- 0x403 -->
<info>
<desc>KeyRight</desc>
</info>
</enumeration>
- <enumeration oor:value="0x504">
+ <enumeration oor:value="1284"> <!-- 0x504 -->
<info>
<desc>KeySpace</desc>
</info>
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index 998a9a55e2d2..339c6685fa0e 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -312,6 +312,9 @@
<xsl:when test="not ($dataval)">
<xsl:value-of select="true()"/>
</xsl:when>
+ <xsl:when test="$dataval/@oor:external">
+ <xsl:value-of select="false()"/>
+ </xsl:when>
<xsl:when test="not ($schemaval)">
<xsl:choose>
<xsl:when test="$dataval/@xsi:nil='true'">
diff --git a/officecfg/util/data_val.xsl b/officecfg/util/data_val.xsl
index 883bffc1976c..d918431c7566 100644
--- a/officecfg/util/data_val.xsl
+++ b/officecfg/util/data_val.xsl
@@ -202,9 +202,6 @@
<xsl:if test="following-sibling::value[@install:module=$module and @xml:lang=$lang]">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has multiple values for module <xsl:value-of select="$module"/> and locale <xsl:value-of select="$lang"/>!</xsl:message>
</xsl:if>
- <xsl:if test="../value[not(@install:module)]">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values both with and without module. This is currently not supported. Please contact jb@openoffice.org, if you need this!</xsl:message>
- </xsl:if>
<xsl:if test="not(preceding-sibling::value/@install:module)">
<xsl:message>ATTENTION: Property '<xsl:value-of select="$path"/>' has different values for different modules. Make sure the modules are mutually exclusive!</xsl:message>
</xsl:if>
diff --git a/oox/inc/oox/drawingml/chart/chartconverter.hxx b/oox/inc/oox/drawingml/chart/chartconverter.hxx
index d45a5c95c388..f9d10388ce13 100644
--- a/oox/inc/oox/drawingml/chart/chartconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartconverter.hxx
@@ -32,14 +32,15 @@
#include <oox/dllapi.h>
namespace com { namespace sun { namespace star {
+ namespace awt { struct Point; }
+ namespace awt { struct Size; }
+ namespace drawing { class XShapes; }
namespace chart2 { class XChartDocument; }
namespace chart2 { namespace data { class XDataProvider; } }
namespace chart2 { namespace data { class XDataSequence; } }
} } }
-namespace oox { namespace core {
- class XmlFilterBase;
-} }
+namespace oox { namespace core { class XmlFilterBase; } }
namespace oox {
namespace drawingml {
@@ -56,11 +57,32 @@ public:
explicit ChartConverter();
virtual ~ChartConverter();
- /** Converts the passed OOXML chart model to the passed chart2 document. */
+ /** Converts the passed OOXML chart model to the passed chart2 document.
+
+ @param rChartModel The filled MSOOXML chart model structure.
+
+ @param rxChartDoc The UNO chart document model to be initialized.
+
+ @param rxExternalPage If null, all embedded shapes will be inserted
+ into the internal drawing page of the chart document. If not null,
+ all embedded shapes will be inserted into this shapes collection.
+
+ @param rChartPos The position of the chart shape in its drawing page,
+ in 1/100 mm. Will be used only, if parameter rxExternalPage is not
+ null, for correct positioning of the embedded shapes in the
+ external drawing page.
+
+ @param rChartSize The size of the chart shape in 1/100 mm. Needed for
+ calculation of position and size of the chart elements (diagram,
+ titles, legend, etc.) and embedded shapes.
+ */
void convertFromModel(
::oox::core::XmlFilterBase& rFilter,
- ChartSpaceModel& rModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc );
+ ChartSpaceModel& rChartModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos,
+ const ::com::sun::star::awt::Size& rChartSize );
/** Creates an internal data provider. Derived classes may override this
function to create an external data provider. */
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
new file mode 100644
index 000000000000..e38311394046
--- /dev/null
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * 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: chartdrawingfragment.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+#define OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+/** Relative shape position in a chart object. */
+struct AnchorPosModel
+{
+ double mfX; /// X coordinate relative to chart object (0.0 to 1.0).
+ double mfY; /// Y coordinate relative to chart object (0.0 to 1.0).
+
+ inline explicit AnchorPosModel() : mfX( -1.0 ), mfY( -1.0 ) {}
+ inline bool isValid() const { return (0.0 <= mfX) && (mfX <= 1.0) && (0.0 <= mfY) && (mfY <= 1.0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Absolute shape size in a chart object (in EMUs). */
+struct AnchorSizeModel : public EmuSize
+{
+ inline explicit AnchorSizeModel() : EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
+};
+
+// ============================================================================
+
+/** Contains the position of a shape in the chart object. Supports different
+ shape anchor modes (absolute, relative).
+ */
+class ShapeAnchor
+{
+public:
+ explicit ShapeAnchor( bool bRelSize );
+
+ /** Imports the absolute anchor size from the cdr:ext element. */
+ void importExt( const AttributeList& rAttribs );
+ /** Sets an the relative anchor position from the cdr:from or cdr:to element. */
+ void setPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
+
+ /** Calculates the resulting shape anchor in EMUs. */
+ ::com::sun::star::awt::Rectangle
+ calcEmuLocation( const EmuRectangle& rEmuChartRect ) const;
+
+private:
+ AnchorPosModel maFrom; /// Top-left position relative to chart object.
+ AnchorPosModel maTo; /// Bottom-right position relative to chart object.
+ AnchorSizeModel maSize; /// Shape size, if anchor has absolute size.
+ bool mbRelSize; /// True = relative size, false = absolute size.
+};
+
+typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
+
+// ============================================================================
+
+/** Handler for a chart drawing fragment (c:userShapes root element).
+ */
+class ChartDrawingFragment : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit ChartDrawingFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::rtl::OUString& rFragmentPath,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxDrawPage,
+ const ::com::sun::star::awt::Size& rChartSize,
+ const ::com::sun::star::awt::Point& rShapesOffset,
+ bool bOleSupport );
+ virtual ~ChartDrawingFragment();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onEndElement( const ::rtl::OUString& rChars );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
+ mxDrawPage; /// Drawing page of this sheet.
+ ::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
+ ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape.
+ EmuRectangle maEmuChartRect; /// Position and size of the chart object for embedded shapes (in EMUs).
+ bool mbOleSupport; /// True = allow to insert OLE objects into the drawing page.
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
diff --git a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
index edeb24f0022f..b4c40015f825 100644
--- a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
@@ -30,6 +30,10 @@
#include "oox/drawingml/chart/converterbase.hxx"
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShapes; }
+} } }
+
namespace oox {
namespace drawingml {
namespace chart {
@@ -45,7 +49,9 @@ public:
virtual ~ChartSpaceConverter();
/** Converts the contained OOXML chart model to a chart2 document. */
- void convertFromModel();
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos );
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
index 5955dd9aef51..ddfa57fb919c 100644
--- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
@@ -57,6 +57,7 @@ struct ChartSpaceModel
View3DRef mxView3D; /// 3D settings.
TitleRef mxTitle; /// Chart main title.
LegendRef mxLegend; /// Chart legend.
+ ::rtl::OUString maDrawingPath; /// Path to drawing fragment with embedded shapes.
sal_Int32 mnDispBlanksAs; /// Mode how to display blank values.
sal_Int32 mnStyle; /// Index to default formatting.
bool mbAutoTitleDel; /// True = automatic title deleted manually.
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index 683e1cd8f05d..23f5a5ff9266 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -32,6 +32,7 @@
#include "oox/drawingml/chart/objectformatter.hxx"
namespace com { namespace sun { namespace star {
+ namespace awt { struct Size; }
namespace lang { class XMultiServiceFactory; }
namespace chart2 { class XChartDocument; }
} } }
@@ -57,8 +58,9 @@ public:
explicit ConverterRoot(
::oox::core::XmlFilterBase& rFilter,
ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
- const ChartSpaceModel& rChartSpace );
+ const ::com::sun::star::awt::Size& rChartSize );
virtual ~ConverterRoot();
/** Creates an instance for the passed service name, using the passed service factory. */
@@ -79,6 +81,8 @@ protected:
/** Returns the API chart document model. */
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
getChartDocument() const;
+ /** Returns the position and size of the chart shape in 1/100 mm. */
+ const ::com::sun::star::awt::Size& getChartSize() const;
/** Returns the object formatter. */
ObjectFormatter& getFormatter() const;
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index 37d8804bfb62..ed4367e63857 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -146,6 +146,37 @@ IndexRange GetIndexRange( const ::com::sun::star::uno::Reference< ::com::sun::st
// ============================================================================
+struct EmuPoint
+{
+ sal_Int64 X;
+ sal_Int64 Y;
+
+ inline explicit EmuPoint() : X( 0 ), Y( 0 ) {}
+ inline explicit EmuPoint( sal_Int64 nX, sal_Int64 nY ) : X( nX ), Y( nY ) {}
+};
+
+// ============================================================================
+
+struct EmuSize
+{
+ sal_Int64 Width;
+ sal_Int64 Height;
+
+ inline explicit EmuSize() : Width( 0 ), Height( 0 ) {}
+ inline explicit EmuSize( sal_Int64 nWidth, sal_Int64 nHeight ) : Width( nWidth ), Height( nHeight ) {}
+};
+
+// ============================================================================
+
+struct EmuRectangle : public EmuPoint, public EmuSize
+{
+ inline explicit EmuRectangle() {}
+ inline explicit EmuRectangle( const EmuPoint& rPos, const EmuSize& rSize ) : EmuPoint( rPos ), EmuSize( rSize ) {}
+ inline explicit EmuRectangle( sal_Int64 nX, sal_Int64 nY, sal_Int64 nWidth, sal_Int64 nHeight ) : EmuPoint( nX, nY ), EmuSize( nWidth, nHeight ) {}
+};
+
+// ============================================================================
+
} // namespace drawingml
} // namespace oox
diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx
index 0452ed30e895..d515a4553936 100644
--- a/oox/inc/oox/drawingml/graphicshapecontext.hxx
+++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx
@@ -50,10 +50,12 @@ public:
class GraphicalObjectFrameContext : public ShapeContext
{
public:
- GraphicalObjectFrameContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr );
+ GraphicalObjectFrameContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+private:
+ bool mbEmbedShapesInChart;
};
// ====================================================================
@@ -95,13 +97,16 @@ class ChartGraphicDataContext : public ShapeContext
public:
explicit ChartGraphicDataContext(
::oox::core::ContextHandler& rParent,
- const ShapePtr& rxShape );
+ const ShapePtr& rxShape, bool bEmbedShapes );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
createFastChildContext(
sal_Int32 nElement,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ bool mbEmbedShapes;
};
// ====================================================================
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index b6c015f73938..7dad1be76635 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -69,7 +69,8 @@ public:
const ::com::sun::star::awt::Rectangle& rShapeRect );
virtual void onXShapeCreated(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape ) const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ) const;
inline const PropertyMap& getShapeProperties() const { return maShapeProps; }
@@ -143,7 +144,7 @@ public:
// addShape is creating and inserting the corresponding XShape.
void addShape(
const oox::core::XmlFilterBase& rFilterBase,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
ShapeIdMap* pShapeMap = 0 );
@@ -161,7 +162,7 @@ protected:
createAndInsert(
const ::oox::core::XmlFilterBase& rFilterBase,
const ::rtl::OUString& rServiceName,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect,
sal_Bool bClearText );
@@ -169,7 +170,7 @@ protected:
void addChildren(
const ::oox::core::XmlFilterBase& rFilterBase,
Shape& rMaster,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle& rClientRect,
ShapeIdMap* pShapeMap );
diff --git a/oox/inc/oox/dump/dffdumper.hxx b/oox/inc/oox/dump/dffdumper.hxx
index 7a4177cfc104..f229c19eff8c 100644
--- a/oox/inc/oox/dump/dffdumper.hxx
+++ b/oox/inc/oox/dump/dffdumper.hxx
@@ -59,10 +59,15 @@ protected:
private:
void constructDffObj();
+ sal_uInt32 dumpDffSimpleColor( const String& rName );
+ sal_uInt32 dumpDffColor( const String& rName );
+
+ void dumpDffOpt();
sal_uInt16 dumpDffOptPropHeader();
- void dumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue );
private:
+ ItemFormatMap maSimpleProps;
+ ItemFormatMap maComplexProps;
sal_uInt16 mnInstVer;
sal_Int32 mnRealSize;
};
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index b7a46ca71da7..ecca5751c16c 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -101,6 +101,9 @@ const sal_Unicode OOX_DUMP_EMPTYVALUE = '~';
const sal_Unicode OOX_DUMP_CMDPROMPT = '?';
const sal_Unicode OOX_DUMP_PLACEHOLDER = '\x01';
+typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > OUStringPair;
+typedef ::std::pair< sal_Int64, sal_Int64 > Int64Pair;
+
typedef ::std::vector< ::rtl::OUString > OUStringVector;
typedef ::std::vector< sal_Int64 > Int64Vector;
@@ -406,6 +409,7 @@ public:
// string conversion ------------------------------------------------------
static ::rtl::OUString trimSpaces( const ::rtl::OUString& rStr );
+ static ::rtl::OUString trimTrailingNul( const ::rtl::OUString& rStr );
static ::rtl::OString convertToUtf8( const ::rtl::OUString& rStr );
static DataType convertToDataType( const ::rtl::OUString& rStr );
@@ -418,6 +422,8 @@ public:
static bool convertStringToDouble( double& orfData, const ::rtl::OUString& rData );
static bool convertStringToBool( const ::rtl::OUString& rData );
+ static OUStringPair convertStringToPair( const ::rtl::OUString& rString, sal_Unicode cSep = '=' );
+
// string to list conversion ----------------------------------------------
static void convertStringToStringList( OUStringVector& orVec, const ::rtl::OUString& rData, bool bIgnoreEmpty );
@@ -764,10 +770,10 @@ class FlagsList : public NameListBase
public:
explicit FlagsList( const SharedConfigData& rCfgData );
+ /** Returns the flags to be ignored on output. */
+ inline sal_Int64 getIgnoreFlags() const { return mnIgnore; }
/** Sets flags to be ignored on output. */
- template< typename Type >
- inline void setIgnoreFlags( Type nIgnore )
- { mnIgnore = static_cast< sal_Int64 >( nIgnore ); }
+ inline void setIgnoreFlags( sal_Int64 nIgnore ) { mnIgnore = nIgnore; }
protected:
virtual void implProcessConfigItemStr(
@@ -804,12 +810,20 @@ protected:
virtual void implIncludeList( const NameListBase& rList );
private:
+ struct ExtItemFormatKey
+ {
+ sal_Int64 mnKey;
+ Int64Pair maFilter;
+ inline explicit ExtItemFormatKey( sal_Int64 nKey ) : mnKey( nKey ), maFilter( 0, 0 ) {}
+ bool operator<( const ExtItemFormatKey& rRight ) const;
+
+ };
struct ExtItemFormat : public ItemFormat
{
bool mbShiftValue;
inline explicit ExtItemFormat() : mbShiftValue( true ) {}
};
- typedef ::std::map< sal_Int64, ExtItemFormat > ExtItemFormatMap;
+ typedef ::std::map< ExtItemFormatKey, ExtItemFormat > ExtItemFormatMap;
ExtItemFormatMap maFmtMap;
};
@@ -859,6 +873,17 @@ private:
static const NameListWrapper NO_LIST;
// ============================================================================
+
+class ItemFormatMap : public ::std::map< sal_Int64, ItemFormat >
+{
+public:
+ inline explicit ItemFormatMap() {}
+ inline explicit ItemFormatMap( const NameListRef& rxNameList ) { insertFormats( rxNameList ); }
+
+ void insertFormats( const NameListRef& rxNameList );
+};
+
+// ============================================================================
// ============================================================================
class SharedConfigData : public Base, public ConfigItemBase
@@ -1582,8 +1607,8 @@ protected:
sal_Unicode dumpChar( const String& rName, rtl_TextEncoding eTextEnc );
sal_Unicode dumpUnicode( const String& rName );
- ::rtl::OUString dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc );
- ::rtl::OUString dumpUnicodeArray( const String& rName, sal_Int32 nLen );
+ ::rtl::OUString dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul = false );
+ ::rtl::OUString dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul = false );
::rtl::OUString dumpNullCharArray( const String& rName, rtl_TextEncoding eTextEnc );
::rtl::OUString dumpNullUnicodeArray( const String& rName );
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 032e38d1dbbd..59f1beb39677 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -50,7 +50,7 @@ public:
void addShape(
const oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rPersist,
- const oox::drawingml::ThemePtr& rxTheme,
+ const oox::drawingml::Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const com::sun::star::awt::Rectangle* pShapeRect = 0,
::oox::drawingml::ShapeIdMap* pShapeMap = 0 );
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index a75baf41149a..22fddd373a86 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -41,25 +41,19 @@ namespace xls {
// ============================================================================
/** Absolute position in spreadsheet (in EMUs) independent from cells. */
-struct AnchorPosModel
+struct AnchorPosModel : public ::oox::drawingml::EmuPoint
{
- sal_Int64 mnX; /// Absolute X coordinate (EMUs).
- sal_Int64 mnY; /// Absolute Y coordinate (EMUs).
-
- explicit AnchorPosModel();
- inline bool isValid() const { return (mnX >= 0) && (mnY >= 0); }
+ inline explicit AnchorPosModel() : ::oox::drawingml::EmuPoint( -1, -1 ) {}
+ inline bool isValid() const { return (X >= 0) && (Y >= 0); }
};
// ----------------------------------------------------------------------------
/** Absolute size in spreadsheet (in EMUs). */
-struct AnchorSizeModel
+struct AnchorSizeModel : public ::oox::drawingml::EmuSize
{
- sal_Int64 mnWidth; /// Total width (EMUs).
- sal_Int64 mnHeight; /// Total height (EMUs).
-
- explicit AnchorSizeModel();
- inline bool isValid() const { return (mnWidth >= 0) && (mnHeight >= 0); }
+ inline explicit AnchorSizeModel() : ::oox::drawingml::EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
};
// ----------------------------------------------------------------------------
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 6fa79c629dbc..90c0f33c3c50 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -302,8 +302,6 @@ public:
WorksheetBuffer& getWorksheets() const;
/** Returns the office theme object read from the theme substorage. */
ThemeBuffer& getTheme() const;
- /** Returns the office theme object reference read from the theme substorage. */
- ::boost::shared_ptr< ::oox::drawingml::Theme > getThemeRef() const;
/** Returns all cell formatting objects read from the styles substream. */
StylesBuffer& getStyles() const;
/** Returns the shared strings read from the shared strings substream. */
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 9c06caffe0c2..ded047f2436b 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -190,6 +190,7 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
+ xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR );
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index f1b592631f2d..efd8e6d021e1 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -33,6 +33,9 @@
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Exception;
+using ::com::sun::star::awt::Point;
+using ::com::sun::star::awt::Size;
+using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::chart2::XChartDocument;
using ::com::sun::star::chart2::data::XDataProvider;
using ::com::sun::star::chart2::data::XDataSequence;
@@ -53,14 +56,15 @@ ChartConverter::~ChartConverter()
}
void ChartConverter::convertFromModel( XmlFilterBase& rFilter,
- ChartSpaceModel& rModel, const Reference< XChartDocument >& rxChartDoc )
+ ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc,
+ const Reference< XShapes >& rxExternalPage, const Point& rChartPos, const Size& rChartSize )
{
OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" );
if( rxChartDoc.is() )
{
- ConverterRoot aConvBase( rFilter, *this, rxChartDoc, rModel );
- ChartSpaceConverter aSpaceConv( aConvBase, rModel );
- aSpaceConv.convertFromModel();
+ ConverterRoot aConvBase( rFilter, *this, rChartModel, rxChartDoc, rChartSize );
+ ChartSpaceConverter aSpaceConv( aConvBase, rChartModel );
+ aSpaceConv.convertFromModel( rxExternalPage, rChartPos );
}
}
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx
new file mode 100644
index 000000000000..9df064125457
--- /dev/null
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ * 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: chartdrawingfragment.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/drawingml/chart/chartdrawingfragment.hxx"
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/connectorshapecontext.hxx"
+#include "oox/drawingml/graphicshapecontext.hxx"
+#include "oox/drawingml/shapecontext.hxx"
+#include "oox/drawingml/shapegroupcontext.hxx"
+
+using ::rtl::OUString;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::awt::Point;
+using ::com::sun::star::awt::Rectangle;
+using ::com::sun::star::awt::Size;
+using ::com::sun::star::drawing::XShapes;
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::FragmentHandler2;
+using ::oox::core::XmlFilterBase;
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+ShapeAnchor::ShapeAnchor( bool bRelSize ) :
+ mbRelSize( bRelSize )
+{
+}
+
+void ShapeAnchor::importExt( const AttributeList& rAttribs )
+{
+ OSL_ENSURE( !mbRelSize, "ShapeAnchor::importExt - unexpected 'cdr:ext' element" );
+ maSize.Width = rAttribs.getHyper( XML_cx, 0 );
+ maSize.Height = rAttribs.getHyper( XML_cy, 0 );
+}
+
+void ShapeAnchor::setPos( sal_Int32 nElement, sal_Int32 nParentContext, const OUString& rValue )
+{
+ AnchorPosModel* pAnchorPos = 0;
+ switch( nParentContext )
+ {
+ case CDR_TOKEN( from ):
+ pAnchorPos = &maFrom;
+ break;
+ case CDR_TOKEN( to ):
+ OSL_ENSURE( mbRelSize, "ShapeAnchor::setPos - unexpected 'cdr:to' element" );
+ pAnchorPos = &maTo;
+ break;
+ default:
+ OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected parent element" );
+ }
+ if( pAnchorPos ) switch( nElement )
+ {
+ case CDR_TOKEN( x ): pAnchorPos->mfX = rValue.toDouble(); break;
+ case CDR_TOKEN( y ): pAnchorPos->mfY = rValue.toDouble(); break;
+ default: OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected element" );
+ }
+}
+
+Rectangle ShapeAnchor::calcEmuLocation( const EmuRectangle& rEmuChartRect ) const
+{
+ Rectangle aLoc( -1, -1, -1, -1 );
+
+ OSL_ENSURE( maFrom.isValid(), "ShapeAnchor::calcEmuLocation - invalid from position" );
+ OSL_ENSURE( mbRelSize ? maTo.isValid() : maSize.isValid(), "ShapeAnchor::calcEmuLocation - invalid to/size" );
+ if( maFrom.isValid() && (mbRelSize ? maTo.isValid() : maSize.isValid()) )
+ {
+ // calculate shape position
+ aLoc.X = getLimitedValue< sal_Int32, double >( maFrom.mfX * rEmuChartRect.Width, 0, SAL_MAX_INT32 );
+ aLoc.Y = getLimitedValue< sal_Int32, double >( maFrom.mfY * rEmuChartRect.Height, 0, SAL_MAX_INT32 );
+
+ // calculate shape size
+ if( mbRelSize )
+ {
+ aLoc.Width = getLimitedValue< sal_Int32, double >( maTo.mfX * rEmuChartRect.Width, 0, SAL_MAX_INT32 ) - aLoc.X;
+ if( aLoc.Width < 0 )
+ {
+ aLoc.X += aLoc.Width;
+ aLoc.Width *= -1;
+ }
+ aLoc.Height = getLimitedValue< sal_Int32, double >( maTo.mfY * rEmuChartRect.Height, 0, SAL_MAX_INT32 ) - aLoc.Y;
+ if( aLoc.Height < 0 )
+ {
+ aLoc.Y += aLoc.Height;
+ aLoc.Height *= -1;
+ }
+ }
+ else
+ {
+ aLoc.Width = getLimitedValue< sal_Int32, sal_Int64 >( maSize.Width, 0, SAL_MAX_INT32 );
+ aLoc.Height = getLimitedValue< sal_Int32, sal_Int64 >( maSize.Height, 0, SAL_MAX_INT32 );
+ }
+ }
+
+ return aLoc;
+}
+// ============================================================================
+
+ChartDrawingFragment::ChartDrawingFragment( XmlFilterBase& rFilter,
+ const OUString& rFragmentPath, const Reference< XShapes >& rxDrawPage,
+ const Size& rChartSize, const Point& rShapesOffset, bool bOleSupport ) :
+ FragmentHandler2( rFilter, rFragmentPath ),
+ mxDrawPage( rxDrawPage ),
+ mbOleSupport( bOleSupport )
+{
+ maEmuChartRect.X = static_cast< sal_Int64 >( rShapesOffset.X ) * 360;
+ maEmuChartRect.Y = static_cast< sal_Int64 >( rShapesOffset.Y ) * 360;
+ maEmuChartRect.Width = static_cast< sal_Int64 >( rChartSize.Width ) * 360;
+ maEmuChartRect.Height = static_cast< sal_Int64 >( rChartSize.Height ) * 360;
+}
+
+ChartDrawingFragment::~ChartDrawingFragment()
+{
+}
+
+ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nElement == C_TOKEN( userShapes ) ) return this;
+ break;
+
+ case C_TOKEN( userShapes ):
+ switch( nElement )
+ {
+ case CDR_TOKEN( absSizeAnchor ):
+ mxAnchor.reset( new ShapeAnchor( false ) );
+ return this;
+ case CDR_TOKEN( relSizeAnchor ):
+ mxAnchor.reset( new ShapeAnchor( true ) );
+ return this;
+ }
+ break;
+
+ case CDR_TOKEN( absSizeAnchor ):
+ case CDR_TOKEN( relSizeAnchor ):
+ switch( nElement )
+ {
+ case CDR_TOKEN( sp ):
+ mxShape.reset( new Shape( "com.sun.star.drawing.CustomShape" ) );
+ return new ShapeContext( *this, ShapePtr(), mxShape );
+ case CDR_TOKEN( cxnSp ):
+ mxShape.reset( new Shape( "com.sun.star.drawing.ConnectorShape" ) );
+ return new ConnectorShapeContext( *this, ShapePtr(), mxShape );
+ case CDR_TOKEN( pic ):
+ mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) );
+ return new GraphicShapeContext( *this, ShapePtr(), mxShape );
+ case CDR_TOKEN( graphicFrame ):
+ if( !mbOleSupport )
+ return 0;
+ mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
+ return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true );
+ case CDR_TOKEN( grpSp ):
+ mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
+ return new ShapeGroupContext( *this, ShapePtr(), mxShape );
+
+ case CDR_TOKEN( from ):
+ case CDR_TOKEN( to ):
+ return this;
+
+ case CDR_TOKEN( ext ):
+ if( mxAnchor.get() ) mxAnchor->importExt( rAttribs );
+ return 0;
+ }
+ break;
+
+ case CDR_TOKEN( from ):
+ case CDR_TOKEN( to ):
+ switch( nElement )
+ {
+ case CDR_TOKEN( x ):
+ case CDR_TOKEN( y ):
+ return this; // collect value in onEndElement()
+ }
+ break;
+ }
+ return 0;
+}
+
+void ChartDrawingFragment::onEndElement( const OUString& rChars )
+{
+ switch( getCurrentElement() )
+ {
+ case CDR_TOKEN( x ):
+ case CDR_TOKEN( y ):
+ if( mxAnchor.get() ) mxAnchor->setPos( getCurrentElement(), getPreviousElement(), rChars );
+ break;
+
+ case CDR_TOKEN( absSizeAnchor ):
+ case CDR_TOKEN( relSizeAnchor ):
+ if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
+ {
+ Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect );
+ if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
+ mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc );
+ }
+ mxShape.reset();
+ mxAnchor.reset();
+ break;
+ }
+}
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 390f7ccfe7b9..6460e94a4f3b 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -26,24 +26,29 @@
************************************************************************/
#include "oox/drawingml/chart/chartspaceconverter.hxx"
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx"
+#include "oox/drawingml/chart/chartdrawingfragment.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
#include "oox/drawingml/chart/plotareaconverter.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
#include "properties.hxx"
using ::rtl::OUString;
+using ::com::sun::star::awt::Point;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::util::XNumberFormatsSupplier;
+using ::com::sun::star::drawing::XDrawPageSupplier;
+using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::chart2::XDiagram;
using ::com::sun::star::chart2::XTitled;
using ::com::sun::star::chart2::data::XDataReceiver;
@@ -63,7 +68,7 @@ ChartSpaceConverter::~ChartSpaceConverter()
{
}
-void ChartSpaceConverter::convertFromModel()
+void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExternalPage, const Point& rChartPos )
{
/* create data provider (virtual function in the ChartConverter class,
derived converters may create an external data provider) */
@@ -81,8 +86,8 @@ void ChartSpaceConverter::convertFromModel()
}
// formatting of the chart background
- PropertySet aPropSet( getChartDocument()->getPageBackground() );
- getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
+ PropertySet aBackPropSet( getChartDocument()->getPageBackground() );
+ getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE );
// convert plot area (container of all chart type groups)
PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
@@ -121,10 +126,10 @@ void ChartSpaceConverter::convertFromModel()
}
// legend
- if( mrModel.mxLegend.is() )
+ if( xDiagram.is() && mrModel.mxLegend.is() )
{
LegendConverter aLegendConv( *this, *mrModel.mxLegend );
- aLegendConv.convertFromModel( getChartDocument()->getFirstDiagram() );
+ aLegendConv.convertFromModel( xDiagram );
}
// treatment of missing values
@@ -142,12 +147,48 @@ void ChartSpaceConverter::convertFromModel()
aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues );
}
- // set the IncludeHiddenCells property via the old API as only this ensures that the data provider and al created sequences get this flag correctly
- Reference< com::sun::star::chart::XChartDocument > xStandardApiChartDoc( getChartDocument(), UNO_QUERY );
- if( xStandardApiChartDoc.is() )
+ Reference< com::sun::star::chart::XChartDocument > xOldChartDoc( getChartDocument(), UNO_QUERY );
+ if( xOldChartDoc.is() )
+ {
+ /* Set the IncludeHiddenCells property via the old API as only this
+ ensures that the data provider and all created sequences get this
+ flag correctly. */
+ PropertySet aOldDiaProp( xOldChartDoc->getDiagram() );
+ aOldDiaProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly );
+ }
+
+ // embedded drawing shapes
+ if( mrModel.maDrawingPath.getLength() > 0 ) try
+ {
+ /* Get the internal draw page of the chart document, if no external
+ drawing page has been passed. */
+ Reference< XShapes > xShapes;
+ Point aShapesOffset( 0, 0 );
+ if( rxExternalPage.is() )
+ {
+ xShapes = rxExternalPage;
+ // offset for embedded shapes to move them inside the chart area
+ aShapesOffset = rChartPos;
+ }
+ else
+ {
+ Reference< XDrawPageSupplier > xDrawPageSupp( getChartDocument(), UNO_QUERY_THROW );
+ xShapes.set( xDrawPageSupp->getDrawPage(), UNO_QUERY_THROW );
+ }
+
+ /* If an external drawing page is passed, all embedded shapes will be
+ inserted there (used e.g. with 'chart sheets' in spreadsheet
+ documents). In this case, all types of shapes including OLE objects
+ are supported. If the shapes are inserted into the internal chart
+ drawing page instead, it is not possible to embed OLE objects. */
+ bool bOleSupport = rxExternalPage.is();
+
+ // now, xShapes is not null anymore
+ getFilter().importFragment( new ChartDrawingFragment(
+ getFilter(), mrModel.maDrawingPath, xShapes, getChartSize(), aShapesOffset, bOleSupport ) );
+ }
+ catch( Exception& )
{
- PropertySet aStandardApiDiagramProp( xStandardApiChartDoc->getDiagram() );
- aStandardApiDiagramProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly );
}
}
diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx
index d041997636a9..75df94e95de7 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -75,6 +75,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
return 0;
case C_TOKEN( txPr ):
return new TextBodyContext( *this, mrModel.mxTextProp.create() );
+ case C_TOKEN( userShapes ):
+ mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ return 0;
}
break;
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 596efcf8b30f..534ce48e0278 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -40,6 +40,7 @@ using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::frame::XModel;
+using ::com::sun::star::awt::Size;
using ::com::sun::star::chart2::XChartDocument;
using ::oox::core::XmlFilterBase;
@@ -51,16 +52,18 @@ namespace chart {
struct ConverterData
{
+ ObjectFormatter maFormatter;
XmlFilterBase& mrFilter;
ChartConverter& mrConverter;
Reference< XChartDocument > mxDoc;
- ObjectFormatter maFormatter;
+ Size maSize;
explicit ConverterData(
XmlFilterBase& rFilter,
ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
const Reference< XChartDocument >& rxChartDoc,
- const ChartSpaceModel& rChartSpace );
+ const Size& rChartSize );
~ConverterData();
};
@@ -69,12 +72,14 @@ struct ConverterData
ConverterData::ConverterData(
XmlFilterBase& rFilter,
ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
const Reference< XChartDocument >& rxChartDoc,
- const ChartSpaceModel& rChartSpace ) :
+ const Size& rChartSize ) :
+ maFormatter( rFilter, rxChartDoc, rChartModel ),
mrFilter( rFilter ),
mrConverter( rChartConverter ),
mxDoc( rxChartDoc ),
- maFormatter( rFilter, rxChartDoc, rChartSpace )
+ maSize( rChartSize )
{
OSL_ENSURE( mxDoc.is(), "ConverterData::ConverterData - missing chart document" );
// lock the model to suppress internal updates during conversion
@@ -106,9 +111,10 @@ ConverterData::~ConverterData()
ConverterRoot::ConverterRoot(
XmlFilterBase& rFilter,
ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
const Reference< XChartDocument >& rxChartDoc,
- const ChartSpaceModel& rChartSpace ) :
- mxData( new ConverterData( rFilter, rChartConverter, rxChartDoc, rChartSpace ) )
+ const Size& rChartSize ) :
+ mxData( new ConverterData( rFilter, rChartConverter, rChartModel, rxChartDoc, rChartSize ) )
{
}
@@ -151,6 +157,11 @@ Reference< XChartDocument > ConverterRoot::getChartDocument() const
return mxData->mxDoc;
}
+const Size& ConverterRoot::getChartSize() const
+{
+ return mxData->maSize;
+}
+
ObjectFormatter& ConverterRoot::getFormatter() const
{
return mxData->maFormatter;
diff --git a/oox/source/drawingml/chart/makefile.mk b/oox/source/drawingml/chart/makefile.mk
index 3ba22a30f9e6..84762e6a2540 100644
--- a/oox/source/drawingml/chart/makefile.mk
+++ b/oox/source/drawingml/chart/makefile.mk
@@ -46,6 +46,7 @@ SLOFILES = \
$(SLO)$/axismodel.obj \
$(SLO)$/chartcontextbase.obj \
$(SLO)$/chartconverter.obj \
+ $(SLO)$/chartdrawingfragment.obj \
$(SLO)$/chartspaceconverter.obj \
$(SLO)$/chartspacefragment.obj \
$(SLO)$/chartspacemodel.obj \
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index bcb562c0118f..a0335fe68ee2 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -106,8 +106,9 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
// ============================================================================
// CT_GraphicalObjectFrameContext
-GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr )
-: ShapeContext( rParent, pMasterShapePtr, pShapePtr )
+GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart ) :
+ ShapeContext( rParent, pMasterShapePtr, pShapePtr ),
+ mbEmbedShapesInChart( bEmbedShapesInChart )
{
}
@@ -135,7 +136,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon
else if ( sUri.equalsAscii( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ) )
xRet.set( new DiagramGraphicDataContext( *this, mpShapePtr ) );
else if ( sUri.equalsAscii( "http://schemas.openxmlformats.org/drawingml/2006/chart" ) )
- xRet.set( new ChartGraphicDataContext( *this, mpShapePtr ) );
+ xRet.set( new ChartGraphicDataContext( *this, mpShapePtr, mbEmbedShapesInChart ) );
else if ( sUri.compareToAscii( "http://schemas.openxmlformats.org/drawingml/2006/table" ) == 0 )
xRet.set( new table::TableContext( *this, mpShapePtr ) );
else
@@ -349,22 +350,24 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte
class CreateChartCallback : public CreateShapeCallback
{
public:
- explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath );
- virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape ) const;
+ explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes );
+ virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const;
private:
OUString maFragmentPath;
+ bool mbEmbedShapes;
};
// ----------------------------------------------------------------------------
-CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath ) :
+CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ) :
CreateShapeCallback( rFilter ),
- maFragmentPath( rFragmentPath )
+ maFragmentPath( rFragmentPath ),
+ mbEmbedShapes( bEmbedShapes )
{
}
-void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape ) const
+void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const
{
OSL_ENSURE( maFragmentPath.getLength() > 0, "CreateChartCallback::onXShapeCreated - missing chart fragment" );
if( maFragmentPath.getLength() > 0 ) try
@@ -376,14 +379,17 @@ void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& r
// get the XModel interface of the embedded object from the OLE shape
Reference< frame::XModel > xDocModel;
aShapeProp.getProperty( xDocModel, PROP_Model );
+ Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
// load the chart data from the XML fragment
chart::ChartSpaceModel aModel;
mrFilter.importFragment( new chart::ChartSpaceFragment( mrFilter, maFragmentPath, aModel ) );
// convert imported chart model to chart document
- Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
- mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc );
+ Reference< drawing::XShapes > xExternalPage;
+ if( !mbEmbedShapes )
+ xExternalPage = rxShapes;
+ mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, xExternalPage, rxShape->getPosition(), rxShape->getSize() );
}
catch( Exception& )
{
@@ -392,8 +398,9 @@ void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& r
// ============================================================================
-ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape ) :
- ShapeContext( rParent, ShapePtr(), rxShape )
+ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape, bool bEmbedShapes ) :
+ ShapeContext( rParent, ShapePtr(), rxShape ),
+ mbEmbedShapes( bEmbedShapes )
{
rxShape->setServiceName( "com.sun.star.drawing.OLE2Shape" );
}
@@ -405,7 +412,7 @@ Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext
{
AttributeList aAttribs( rxAttribs );
OUString aFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
- CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath ) );
+ CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath, mbEmbedShapes ) );
mpShapePtr->setCreateShapeCallback( xCallback );
}
return 0;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8bbfc820fca1..cab64f11c166 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -76,7 +76,7 @@ OUString CreateShapeCallback::onCreateXShape( const OUString& rServiceName, cons
return rServiceName;
}
-void CreateShapeCallback::onXShapeCreated( const Reference< XShape >& ) const
+void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Reference< XShapes >& ) const
{
}
@@ -135,7 +135,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const
void Shape::addShape(
const ::oox::core::XmlFilterBase& rFilterBase,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const Reference< XShapes >& rxShapes,
const awt::Rectangle* pShapeRect,
ShapeIdMap* pShapeMap )
@@ -145,7 +145,7 @@ void Shape::addShape(
rtl::OUString sServiceName( msServiceName );
if( sServiceName.getLength() )
{
- Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, sal_False ) );
+ Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, sal_False ) );
if( pShapeMap && msId.getLength() )
{
@@ -155,7 +155,7 @@ void Shape::addShape(
// if this is a group shape, we have to add also each child shape
Reference< XShapes > xShapes( xShape, UNO_QUERY );
if ( xShapes.is() )
- addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
+ addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
}
}
catch( const Exception& )
@@ -184,7 +184,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape )
void Shape::addChildren(
const ::oox::core::XmlFilterBase& rFilterBase,
Shape& rMaster,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const Reference< XShapes >& rxShapes,
const awt::Rectangle& rClientRect,
ShapeIdMap* pShapeMap )
@@ -235,14 +235,14 @@ void Shape::addChildren(
pShapeRect = &aShapeRect;
}
}
- (*aIter++)->addShape( rFilterBase, rxTheme, rxShapes, pShapeRect, pShapeMap );
+ (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
}
}
Reference< XShape > Shape::createAndInsert(
const ::oox::core::XmlFilterBase& rFilterBase,
const rtl::OUString& rServiceName,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const awt::Rectangle* pShapeRect,
sal_Bool bClearText )
@@ -383,23 +383,23 @@ Reference< XShape > Shape::createAndInsert(
aFillProperties.moFillType = XML_noFill;
sal_Int32 nFillPhClr = -1;
- if( rxTheme.get() )
+ if( pTheme )
{
if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) )
{
- if( const LineProperties* pLineProps = rxTheme->getLineStyle( pLineRef->mnThemedIdx ) )
+ if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) )
aLineProperties.assignUsed( *pLineProps );
nLinePhClr = pLineRef->maPhClr.getColor( rFilterBase );
}
if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) )
{
- if( const FillProperties* pFillProps = rxTheme->getFillStyle( pFillRef->mnThemedIdx ) )
+ if( const FillProperties* pFillProps = pTheme->getFillStyle( pFillRef->mnThemedIdx ) )
aFillProperties.assignUsed( *pFillProps );
nFillPhClr = pFillRef->maPhClr.getColor( rFilterBase );
}
// if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_fillRef ) )
// {
-// if( const EffectProperties* pEffectProps = rxTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
+// if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
// aEffectProperties.assignUsed( *pEffectProps );
// nEffectPhClr = pEffectRef->maPhClr.getColor( rFilterBase );
// }
@@ -451,8 +451,8 @@ Reference< XShape > Shape::createAndInsert(
TextCharacterProperties aCharStyleProperties;
if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) )
{
- if( rxTheme.get() )
- if( const TextCharacterProperties* pCharProps = rxTheme->getFontStyle( pFontRef->mnThemedIdx ) )
+ if( pTheme )
+ if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) )
aCharStyleProperties.assignUsed( *pCharProps );
aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr );
}
@@ -465,7 +465,7 @@ Reference< XShape > Shape::createAndInsert(
// use a callback for further processing on the XShape (e.g. charts)
if( mxShape.is() && mxCreateCallback.get() )
- mxCreateCallback->onXShapeCreated( mxShape );
+ mxCreateCallback->onXShapeCreated( mxShape, rxShapes );
return mxShape;
}
diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index 3d93d5866886..1b90be3952ab 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -103,7 +103,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
xRet.set( new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
case XML_graphicFrame: // CT_GraphicalObjectFrame
- xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ) ) );
+ xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ), true ) );
break;
}
if( !xRet.is() )
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index 645bb2bb7825..618e89c996e0 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -358,7 +358,7 @@ multilist=RECORD-NAMES-BIFF5
# chart records
exclude=0x1004,0x102D,0x102F,0x1036,0x1037,0x1038,0x103B
0x1040=CHRADARAREA,CHAXESSET,,CHLEGENDENTRY,CHPROPERTIES,CHSERGROUP,CHUSEDAXESSETS,
- 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHPOS
+ 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHFRAMEPOS
0x1050=CHFORMATRUNS,CHSOURCELINK,,,,,,
0x1058=,,,CHSERERRORBAR,,CHSERIESFORMAT,,
end
@@ -976,10 +976,11 @@ end
shortlist=CHPROPERTIES-EMPTYCELLS,0,do-not-plot,as-zero,interpolated
flagslist=CHPROPERTIES-FLAGS
- 0x0001=manual-format
+ 0x0001=manual-series
0x0002=plot-visible-only
0x0004=fixed-size
0x0008=manual-plotarea
+ 0x0010=apply-plotarea-pos
end
# CHSCATTER ------------------------------------------------------------------
@@ -1039,7 +1040,7 @@ shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute
shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute
shortlist=CHTEXT-FILLMODE,1,transparent,opaque
-combilist=CHTEXT-FLAGS-BIFF2
+flagslist=CHTEXT-FLAGS-BIFF2
0x0001=auto-color
0x0002=show-symbol
0x0004=show-value
diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx
index bbd8c78d1a10..599687f5bd50 100644
--- a/oox/source/dump/dffdumper.cxx
+++ b/oox/source/dump/dffdumper.cxx
@@ -36,6 +36,30 @@ namespace dump {
// ============================================================================
+namespace {
+
+const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry.
+const sal_uInt16 DFF_ID_BSTORECONTAINER = 0xF001; /// BLIP store container.
+const sal_uInt16 DFF_ID_CHILDANCHOR = 0xF00F; /// Child anchor (in groups).
+const sal_uInt16 DFF_ID_CLIENTANCHOR = 0xF010; /// Client anchor.
+const sal_uInt16 DFF_ID_DG = 0xF008; /// Drawing.
+const sal_uInt16 DFF_ID_DGG = 0xF006; /// Drawing group.
+const sal_uInt16 DFF_ID_OPT = 0xF00B; /// Property set.
+const sal_uInt16 DFF_ID_OPT2 = 0xF121; /// Secondary property set.
+const sal_uInt16 DFF_ID_OPT3 = 0xF122; /// Ternary property set.
+const sal_uInt16 DFF_ID_SP = 0xF00A; /// Shape.
+const sal_uInt16 DFF_ID_SPGR = 0xF009; /// Shape group.
+const sal_uInt16 DFF_ID_SPLITMENUCOLORS = 0xF11E; /// Current toolbar colors.
+
+const sal_uInt16 DFF_OPT_IDMASK = 0x3FFF;
+const sal_uInt16 DFF_OPT_PICTURE = 0x4000;
+const sal_uInt16 DFF_OPT_COMPLEX = 0x8000;
+const sal_uInt16 DFF_OPT_FLAGSMASK = 0x003F;
+
+} // namespace
+
+// ============================================================================
+
void DffStreamObject::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName )
{
SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, "DFF-RECORD-NAMES" );
@@ -62,10 +86,12 @@ void DffStreamObject::implWriteExtHeader()
const sal_Char* pcListName = "DFF-RECORD-INST";
switch( getRecId() )
{
- case 0xF001: pcListName = "DFFBSTORECONT-RECORD-INST"; break; // DFFBSTORECONTAINER contains BLIP count
- case 0xF007: pcListName = "DFFBSE-RECORD-INST"; break; // DFFBSE contains BLIP type
- case 0xF00A: pcListName = "DFFSP-RECORD-INST"; break; // DFFSP contains shape type
- case 0xF00B: pcListName = "DFFOPT-RECORD-INST"; break; // DFFOPT contains property count
+ case DFF_ID_BSE: pcListName = "DFFBSE-RECORD-INST"; break; // BLIP type
+ case DFF_ID_BSTORECONTAINER: pcListName = "DFFBSTORECONT-RECORD-INST"; break; // BLIP count
+ case DFF_ID_DG: pcListName = "DFFDG-RECORD-INST"; break; // drawing ID
+ case DFF_ID_OPT: pcListName = "DFFOPT-RECORD-INST"; break; // property count
+ case DFF_ID_SP: pcListName = "DFFSP-RECORD-INST"; break; // shape type
+ case DFF_ID_SPLITMENUCOLORS: pcListName = "DFFSPLITMENUC-RECORD-INST"; break; // number of colors
}
MultiItemsGuard aMultiGuard( out() );
writeHexItem( "instance", mnInstVer, pcListName );
@@ -76,7 +102,7 @@ void DffStreamObject::implDumpRecordBody()
{
switch( getRecId() )
{
- case 0xF007: // DFFBSE
+ case DFF_ID_BSE:
dumpDec< sal_uInt8 >( "win-type", "DFFBSE-TYPE" );
dumpDec< sal_uInt8 >( "mac-type", "DFFBSE-TYPE" );
dumpGuid( "guid" );
@@ -89,26 +115,63 @@ void DffStreamObject::implDumpRecordBody()
dumpUnused( 2 );
break;
- case 0xF00A: // DFFSP
- dumpHex< sal_uInt32 >( "shape-id", "CONV-DEC" );
- dumpHex< sal_uInt32 >( "shape-flags", "DFFSP-FLAGS" );
+ case DFF_ID_CHILDANCHOR:
+ dumpDec< sal_uInt32 >( "left" );
+ dumpDec< sal_uInt32 >( "top" );
+ dumpDec< sal_uInt32 >( "right" );
+ dumpDec< sal_uInt32 >( "bottom" );
break;
- case 0xF00B: // DFFOPT
+ case DFF_ID_CLIENTANCHOR:
+ implDumpClientAnchor();
+ break;
+
+ case DFF_ID_DG:
+ dumpDec< sal_uInt32 >( "shape-count" );
+ dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" );
+ break;
+
+ case DFF_ID_DGG:
{
- sal_uInt16 nPropCount = getInst();
- out().resetItemIndex();
- for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx )
+ dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" );
+ sal_uInt32 nClusters = dumpDec< sal_uInt32 >( "id-cluster-count" );
+ dumpDec< sal_uInt32 >( "shape-count" );
+ dumpDec< sal_uInt32 >( "drawing-count" );
+ out().resetItemIndex( 1 );
+ TableGuard aTabGuard( out(), 15, 16 );
+ for( sal_uInt32 nCluster = 1; !in().isEof() && (nCluster < nClusters); ++nCluster )
{
- sal_uInt16 nPropId = dumpDffOptPropHeader();
- IndentGuard aIndent( out() );
- dumpDffOptPropValue( nPropId, in().readuInt32() );
+ MultiItemsGuard aMultiGuard( out() );
+ writeEmptyItem( "#cluster" );
+ dumpDec< sal_uInt32 >( "drawing-id" );
+ dumpHex< sal_uInt32 >( "next-free-id", "CONV-DEC" );
}
}
break;
- case 0xF010: // DFFCLIENTANCHOR
- implDumpClientAnchor();
+ case DFF_ID_OPT:
+ case DFF_ID_OPT2:
+ case DFF_ID_OPT3:
+ dumpDffOpt();
+ break;
+
+ case DFF_ID_SP:
+ dumpHex< sal_uInt32 >( "shape-id", "CONV-DEC" );
+ dumpHex< sal_uInt32 >( "shape-flags", "DFFSP-FLAGS" );
+ break;
+
+ case DFF_ID_SPGR:
+ dumpDec< sal_uInt32 >( "left" );
+ dumpDec< sal_uInt32 >( "top" );
+ dumpDec< sal_uInt32 >( "right" );
+ dumpDec< sal_uInt32 >( "bottom" );
+ break;
+
+ case DFF_ID_SPLITMENUCOLORS:
+ dumpDffSimpleColor( "fill-color" );
+ dumpDffSimpleColor( "line-color" );
+ dumpDffSimpleColor( "shadow-color" );
+ dumpDffSimpleColor( "3d-color" );
break;
}
}
@@ -121,38 +184,136 @@ void DffStreamObject::constructDffObj()
{
mnInstVer = 0;
mnRealSize = 0;
+ if( SequenceRecordObjectBase::implIsValid() )
+ {
+ maSimpleProps.insertFormats( cfg().getNameList( "DFFOPT-SIMPLE-PROPERTIES" ) );
+ maComplexProps.insertFormats( cfg().getNameList( "DFFOPT-COMPLEX-PROPERTIES" ) );
+ }
}
-sal_uInt16 DffStreamObject::dumpDffOptPropHeader()
+sal_uInt32 DffStreamObject::dumpDffSimpleColor( const String& rName )
{
- MultiItemsGuard aMultiGuard( out() );
- TableGuard aTabGuard( out(), 11 );
- writeEmptyItem( "#prop" );
- return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" );
+ return dumpHex< sal_uInt32 >( rName, "DFF-SIMPLE-COLOR" );
+}
+
+sal_uInt32 DffStreamObject::dumpDffColor( const String& rName )
+{
+ return dumpHex< sal_uInt32 >( rName, "DFF-COLOR" );
}
-void DffStreamObject::dumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue )
+namespace {
+
+enum PropType { PROPTYPE_BINARY, PROPTYPE_STRING, PROPTYPE_BLIP, PROPTYPE_COLORARRAY };
+
+struct PropInfo
+{
+ OUString maName;
+ PropType meType;
+ sal_uInt16 mnId;
+ sal_uInt32 mnSize;
+ inline explicit PropInfo( const OUString& rName, PropType eType, sal_uInt16 nId, sal_uInt32 nSize ) :
+ maName( rName ), meType( eType ), mnId( nId ), mnSize( nSize ) {}
+};
+
+typedef ::std::vector< PropInfo > PropInfoVector;
+
+} // namespace
+
+void DffStreamObject::dumpDffOpt()
{
- switch( nPropId & 0x3FFF )
+ sal_uInt16 nPropCount = getInst();
+ PropInfoVector aPropInfos;
+ out().resetItemIndex();
+ for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx )
+ {
+ sal_uInt16 nPropId = dumpDffOptPropHeader();
+ sal_uInt16 nBaseId = nPropId & DFF_OPT_IDMASK;
+ sal_uInt32 nValue = in().readuInt32();
+
+ IndentGuard aIndent( out() );
+ if( getFlag( nPropId, DFF_OPT_COMPLEX ) )
+ {
+ writeHexItem( "complex-size", nValue, "CONV-DEC" );
+ String aName;
+ PropType eType = PROPTYPE_BINARY;
+ ItemFormatMap::const_iterator aIt = maComplexProps.find( nBaseId );
+ if( aIt != maComplexProps.end() )
+ {
+ const ItemFormat& rItemFmt = aIt->second;
+ aName = rItemFmt.maItemName;
+ if( rItemFmt.maListName.equalsAscii( "binary" ) )
+ eType = PROPTYPE_BINARY;
+ else if( rItemFmt.maListName.equalsAscii( "string" ) )
+ eType = PROPTYPE_STRING;
+ else if( rItemFmt.maListName.equalsAscii( "blip" ) )
+ eType = PROPTYPE_BLIP;
+ else if( rItemFmt.maListName.equalsAscii( "colorarray" ) )
+ eType = PROPTYPE_COLORARRAY;
+ }
+ aPropInfos.push_back( PropInfo( aName( "property-data" ), eType, nBaseId, nValue ) );
+ }
+ else
+ {
+ ItemFormatMap::const_iterator aIt = maSimpleProps.find( nBaseId );
+ if( aIt != maSimpleProps.end() )
+ {
+ const ItemFormat& rItemFmt = aIt->second;
+ // flags always at end of block of 64 properties
+ if( (nBaseId & DFF_OPT_FLAGSMASK) == DFF_OPT_FLAGSMASK )
+ {
+ FlagsList* pFlagsList = dynamic_cast< FlagsList* >( cfg().getNameList( rItemFmt.maListName ).get() );
+ sal_Int64 nOldIgnoreFlags = 0;
+ if( pFlagsList )
+ {
+ nOldIgnoreFlags = pFlagsList->getIgnoreFlags();
+ pFlagsList->setIgnoreFlags( nOldIgnoreFlags | 0xFFFF0000 | ~(nValue >> 16) );
+ }
+ writeValueItem( rItemFmt, nValue );
+ if( pFlagsList )
+ pFlagsList->setIgnoreFlags( nOldIgnoreFlags );
+ }
+ else
+ writeValueItem( rItemFmt, nValue );
+ }
+ else
+ writeHexItem( "value", nValue );
+ }
+ }
+
+ out().resetItemIndex();
+ for( PropInfoVector::iterator aIt = aPropInfos.begin(), aEnd = aPropInfos.end(); !in().isEof() && (aIt != aEnd); ++aIt )
{
- case 127: writeHexItem( "flags", nValue, "DFFOPT-LOCK-FLAGS" ); break;
- case 191: writeHexItem( "flags", nValue, "DFFOPT-TEXT-FLAGS" ); break;
- case 255: writeHexItem( "flags", nValue, "DFFOPT-TEXTGEO-FLAGS" ); break;
- case 319: writeHexItem( "flags", nValue, "DFFOPT-PICTURE-FLAGS" ); break;
- case 383: writeHexItem( "flags", nValue, "DFFOPT-GEO-FLAGS" ); break;
- case 447: writeHexItem( "flags", nValue, "DFFOPT-FILL-FLAGS" ); break;
- case 511: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break;
- case 575: writeHexItem( "flags", nValue, "DFFOPT-SHADOW-FLAGS" ); break;
- case 639: writeHexItem( "flags", nValue, "DFFOPT-PERSP-FLAGS" ); break;
- case 703: writeHexItem( "flags", nValue, "DFFOPT-3DOBJ-FLAGS" ); break;
- case 767: writeHexItem( "flags", nValue, "DFFOPT-3DSTYLE-FLAGS" ); break;
- case 831: writeHexItem( "flags", nValue, "DFFOPT-SHAPE1-FLAGS" ); break;
- case 895: writeHexItem( "flags", nValue, "DFFOPT-CALLOUT-FLAGS" ); break;
- case 959: writeHexItem( "flags", nValue, "DFFOPT-SHAPE2-FLAGS" ); break;
- default: writeHexItem( "value", nValue );
+ out().startMultiItems();
+ writeEmptyItem( "#complex-data" );
+ writeHexItem( "id", aIt->mnId, "DFFOPT-PROPERTY-NAMES" );
+ out().endMultiItems();
+ IndentGuard aIndent( out() );
+ switch( aIt->meType )
+ {
+ case PROPTYPE_BINARY:
+ dumpBinary( aIt->maName, aIt->mnSize );
+ break;
+ case PROPTYPE_STRING:
+ dumpUnicodeArray( aIt->maName, aIt->mnSize / 2, true );
+ break;
+ case PROPTYPE_BLIP:
+ dumpBinary( aIt->maName, aIt->mnSize );
+ break;
+ case PROPTYPE_COLORARRAY:
+ dumpBinary( aIt->maName, aIt->mnSize );
+ break;
+ }
}
}
+sal_uInt16 DffStreamObject::dumpDffOptPropHeader()
+{
+ MultiItemsGuard aMultiGuard( out() );
+ TableGuard aTabGuard( out(), 11 );
+ writeEmptyItem( "#prop" );
+ return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" );
+}
+
// ============================================================================
} // namespace dump
diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini
index 9c3184b275e5..c33d733c6bd8 100644
--- a/oox/source/dump/dffdumper.ini
+++ b/oox/source/dump/dffdumper.ini
@@ -12,7 +12,7 @@ multilist=DFF-RECORD-NAMES
0xF010=DFFCLIENTANCHOR,DFFCLIENTDATA,DFFCONNECTORRULE,DFFALIGNRULE,DFFARCRULE,DFFCLIENTRULE,DFFCLASSID,DFFCALLOUTRULE
# 0xF018-0xF117 reserved for pictures
0xF118=DFFREGROUPITEM,DFFSELECTION,DFFCOLORMRU,,,DFFDELETEDPSPL,DFFSPLITMENUCOLORS,DFFOLEOBJECT
- 0xF120=DFFCOLORSCHEME,,DFFUSERDEFPROP
+ 0xF120=DFFCOLORSCHEME,DFFOPT2,DFFOPT3
end
combilist=DFF-RECORD-INST
@@ -25,13 +25,60 @@ constlist=DFF-RECORD-VERSION
15=container
end
-# DFFBSTORECONTAINER ---------------------------------------------------------
+combilist=DFF-SIMPLE-COLOR
+ 0x000000FF=uint8,dec,red,,filter=0x10000000~0x00000000
+ 0x0000FF00=uint8,dec,green,,filter=0x10000000~0x00000000
+ 0x00FF0000=uint8,dec,blue,,filter=0x10000000~0x00000000
+ 0x000000FF=uint8,dec,scheme-idx,,filter=0x10000000~0x10000000
+ 0x10000000=!rgb!scheme
+ ignore=0x08000000
+end
-combilist=DFFBSTORECONT-RECORD-INST
- include=DFF-RECORD-INST
- 0xFFF0=uint16,dec,blip-count
+combilist=DFF-COLOR
+ 0x0000FFFF=uint16,dec,palette-idx,,filter=0xFF000000~0x01000000
+ 0x000000FF=uint8,dec,red,,filter=0xF9000000~0x00000000
+ 0x0000FF00=uint8,dec,green,,filter=0xF9000000~0x00000000
+ 0x00FF0000=uint8,dec,blue,,filter=0xF9000000~0x00000000
+ 0x000000FF=uint8,dec,scheme-idx,,filter=0xFF000000~0x08000000
+ 0x0000FFFF=uint16,dec,system-idx,DFF-SYSTEMCOLOR,filter=0xFF000000~0x10000000
+ 0x00FF0000=uint16,dec,mod-by,,filter=0xFF000000~0x10000000
+ 0x01000000=palette-idx
+ 0x02000000=palette-rgb
+ 0x04000000=system-rgb
+ 0x08000000=scheme-idx
+ 0x10000000=system-idx
+end
+
+combilist=DFF-SYSTEMCOLOR
+ 0x00FF=uint8,dec,color-id,DFF-SYSTEMCOLOR-ID
+ 0x0F00=uint8,dec,mod,DFF-SYSTEMCOLOR-MOD
+ 0x2000=invert-after
+ 0x4000=half-invert-after
+ 0x8000=grey-before
+end
+
+constlist=DFF-SYSTEMCOLOR-ID
+ include=SYSTEMCOLOR
+ 0xF0=shape-fill
+ 0xF1=shape-line-or-fill
+ 0xF2=shape-line
+ 0xF3=shape-shadow
+ 0xF4=current-or-last-used
+ 0xF5=shape-fill-back
+ 0xF6=shape-line-back
+ 0xF7=shape-fill-or-line
+end
+
+shortlist=DFF-SYSTEMCOLOR-MOD,0,none,darken-by,lighten-by,add-grey-by,sub-grey-by,reverse-sub-grey-by,monochrome-by
+
+combilist=DFF-COLORMOD
+ 0x00000300=uint8,dec,type,DFF-COLORMOD-TYPE
+ 0x00FF0000=uint8,dec,level
+ ignore=0x200000FF
end
+shortlist=DFF-COLORMOD-TYPE,0,none,shade,tint
+
# DFFBSE ---------------------------------------------------------------------
combilist=DFFBSE-RECORD-INST
@@ -46,50 +93,18 @@ end
shortlist=DFFBSE-USAGE,0,default,texture
-# DFFSP ----------------------------------------------------------------------
+# DFFBSTORECONTAINER ---------------------------------------------------------
-combilist=DFFSP-RECORD-INST
+combilist=DFFBSTORECONT-RECORD-INST
include=DFF-RECORD-INST
- 0xFFF0=uint16,dec,shape-type,DFFSP-TYPE
+ 0xFFF0=uint16,dec,blip-count
end
-multilist=DFFSP-TYPE
- 0=not-primitive,rectangle,round-rectangle,ellipse,diamond,isoceles-triangle,right-triangle,parallelogram,trapezoid,hexagon
- 10=octagon,plus,star,arrow,thick-arrow,home-plate,cube,balloon,seal,arc
- 20=line,plaque,can,donut,text-simple,text-octagon,text-hexagon,text-curve,text-wave,text-ring
- 30=text-on-curve,text-on-ring,straight-connector-1,bent-connector-2,bent-connector-3,bent-connector-4,bent-connector-5,curved-connector-2,curved-connector-3,curved-connector-4
- 40=curved-connector-5,callout-1,callout-2,callout-3,accent-callout-1,accent-callout-2,accent-callout-3,border-callout-1,border-callout-2,border-callout-3
- 50=accent-border-callout-1,accent-border-callout-2,accent-border-callout-3,ribbon,ribbon-2,chevron,pentagon,no-smoking,seal-8,seal-16
- 60=seal-32,wedge-rect-callout,wedge-rrect-callout,wedge-ellipse-callout,wave,folded-corner,left-arrow,down-arrow,up-arrow,left-right-arrow
- 70=up-down-arrow,irregular-seal-1,irregular-seal-2,lightning-bolt,heart,picture-frame,quad-arrow,left-arrow-callout,right-arrow-callout,up-arrow-callout
- 80=down-arrow-callout,left-right-arrow-callout,up-down-arrow-callout,quad-arrow-callout,bevel,left-bracket,right-bracket,left-brace,right-brace,left-up-arrow
- 90=bent-up-arrow,bent-arrow,seal-24,striped-right-arrow,notched-right-arrow,block-arc,smiley-face,vertical-scroll,horizontal-scroll,circular-arrow
- 100=notched-circular-arrow,uturn-arrow,curved-right-arrow,curved-left-arrow,curved-up-arrow,curved-down-arrow,cloud-callout,ellipse-ribbon,ellipse-ribbon-2,flow-chart-process
- 110=flow-chart-decision,flow-chart-input-output,flow-chart-predefined-process,flow-chart-internal-storage,flow-chart-document,flow-chart-multidocument,flow-chart-terminator,flow-chart-preparation,flow-chart-manual-input,flow-chart-manual-operation
- 120=flow-chart-connector,flow-chart-punched-card,flow-chart-punched-tape,flow-chart-summing-junction,flow-chart-or,flow-chart-collate,flow-chart-sort,flow-chart-extract,flow-chart-merge,flow-chart-offline-storage
- 130=flow-chart-online-storage,flow-chart-magnetic-tape,flow-chart-magnetic-disk,flow-chart-magnetic-drum,flow-chart-display,flow-chart-delay,text-plain-text,text-stop,text-triangle,text-triangle-inverted
- 140=text-chevron,text-chevron-inverted,text-ring-inside,text-ring-outside,text-arch-up-curve,text-arch-down-curve,text-circle-curve,text-button-curve,text-arch-up-pour,text-arch-down-pour
- 150=text-circle-pour,text-button-pour,text-curve-up,text-curve-down,text-cascade-up,text-cascade-down,text-wave-1,text-wave-2,text-wave-3,text-wave-4
- 160=text-inflate,text-deflate,text-inflate-bottom,text-deflate-bottom,text-inflate-top,text-deflate-top,text-deflate-inflate,text-deflate-inflate-deflate,text-fade-right,text-fade-left
- 170=text-fade-up,text-fade-down,text-slant-up,text-slant-down,text-can-up,text-can-down,flow-chart-alternate-process,flow-chart-offpage-connector,callout-90,accent-callout-90
- 180=border-callout-90,accent-border-callout-90,left-right-up-arrow,sun,moon,bracket-pair,brace-pair,seal-4,double-wave,action-button-blank
- 190=action-button-home,action-button-help,action-button-information,action-button-forward-next,action-button-back-previous,action-button-end,action-button-beginning,action-button-return,action-button-document,action-button-sound
- 200=action-button-movie,host-control,text-box
-end
+# DFFDG ----------------------------------------------------------------------
-flagslist=DFFSP-FLAGS
- 0x00000001=group
- 0x00000002=child
- 0x00000004=patriarch
- 0x00000008=deleted
- 0x00000010=ole
- 0x00000020=has-master
- 0x00000040=flip-horizontal
- 0x00000080=flip-vertical
- 0x00000100=connector
- 0x00000200=has-anchor
- 0x00000400=background
- 0x00000800=has-shape-type
+combilist=DFFDG-RECORD-INST
+ include=DFF-RECORD-INST
+ 0xFFF0=uint16,dec,drawing-id
end
# DFFOPT ---------------------------------------------------------------------
@@ -106,205 +121,530 @@ combilist=DFFOPT-PROPERTY-ID
end
multilist=DFFOPT-PROPERTY-NAMES
- # transform
- 0x0004=rotation
- # protection
- 0x007F=lock-flags
- # text
+ # 0x0000-0x003F: transformation
+ 0x0000=transf-left,transf-top,transf-right,transf-bottom,transf-rotation,transf-page
+ 0x003F=transf-flags
+ # 0x0040-0x007F: protection
+ 0x007F=prot-flags
+ # 0x0080-0x00BF: text
0x0080=text-id,text-left,text-top,text-right,text-bottom,text-wrap-mode,text-scale,text-anchor-mode
- 0x0088=text-flow,text-font-rotation,text-next-shape,text-bidi
+ 0x0088=text-flow,text-font-orient,text-next-shape,text-bidi
0x00BF=text-flags
- # text geometry
- 0x00C0=text-unicode-string,text-rtf-string,text-curve-align,text-def-size,text-spacing,text-font-family
- 0x00FF=text-geometry-flags
- # picture
- 0x0100=pic-crop-top,pic-crop-bottom,pic-crop-left,pic-crop-right,pic-data,pic-file-name,pic-flags,pic-transparency-color
- 0x0108=pic-contrast,pic-brightness,pic-gamma,pic-id,pic-double-cr-mod,pic-fill-cr-mod,pic-line-cr-mod,pic-data-print
- 0x0110=pic-name-print,pic-flags-print
- 0x013F=pic-flags
- # geometry
+ # 0x00C0-0x00FF: text geometry
+ 0x00C0=textgeo-unicode-string,textgeo-rtf-string,textgeo-curve-align,textgeo-def-size,textgeo-spacing,textgeo-font,textgeo-css-font
+ 0x00FF=textgeo-flags
+ # 0x0100-0x013F: picture (BLIP)
+ 0x0100=blip-crop-top,blip-crop-bottom,blip-crop-left,blip-crop-right,blip-id,blip-name,blip-opt,blip-transparency-color
+ 0x0108=blip-contrast,blip-brightness,blip-gamma,blip-ole-id,blip-double-cr-mod,blip-fill-cr-mod,blip-line-cr-mod,blip-print-id
+ 0x0110=blip-print-name,blip-print-opt,blip-movie,,,blip-transparency-color-ext,,blip-transparency-color-ext-mod
+ 0x0118,,blip-recolor,blip-recolor,blip-recolor-ext,,blip-recolor-ext-mod
+ 0x013F=blip-flags
+ # 0x0140-0x017F: shape geometry
0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1
- 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8,geo-adjust-9
- 0x0150=geo-adjust-10,geo-connect-points,geo-stretch-x,geo-stretch-y,geo-handles,geo-formulas,geo-text-recs
- 0x0158=geo-connector-type
+ 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8,
+ 0x0150=,geo-connect-sites,geo-connect-sites-dir,geo-stretch-x,geo-stretch-y,geo-handles,geo-guides,geo-inscribe
+ 0x0158=geo-connect-points
0x017F=geo-flags
- # fill style
+ # 0x0180-0x01BF: fill style
0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name
- 0x0188=fill-blip-flags,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right
+ 0x0188=fill-blip-opt,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right
0x0190=fill-to-bottom,fill-rect-left,fill-rect-top,fill-rect-right,fill-rect-bottom,fill-dz-type,fill-shade-preset,fill-shade-colors
- 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type
+ 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type,,fill-color-ext,
+ 0x01A0=fill-color-ext-mod,,fill-back-color-ext,,fill-back-color-ext-mod
0x01BF=fill-flags
- # line style
- 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-flags
+ # 0x01C0-0x01FF: line style
+ 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-opt
0x01C8=line-fill-width,line-fill-height,line-fill-dz-type,line-width,line-miter-limit,line-style,line-dash,line-dash-style
0x01D0=line-start-arrow-head,line-end-arrow-head,line-start-arrow-width,line-start-arrow-length,line-end-arrow-width,line-end-arrow-length,line-join-style,line-end-cap-style
+ 0x01D8=,line-color-ext,,line-color-ext-mod,,line-back-color-ext,,line-back-color-ext-mod
0x01FF=line-flags
- # shadow style
+ # 0x0200-0x023F: shadow style
0x0200=shadow-type,shadow-color,shadow-highlight,shadow-cr-mod,shadow-opacity,shadow-offset-x,shadow-offset-y,shadow-2nd-offset-x
- 0x0208=shadow-2nd-offset-y,shadow-scale-x-to-x,shadow-scale-y-to-x,shadow-scale-x-to-y,shadow-scale-y-to-y,shadow-persp-x,shadow-persp-y,shadow-weight
- 0x0210=shadow-origin-x,shadow-origin-y
+ 0x0208=shadow-2nd-offset-y,,,,,,,
+ 0x0210=shadow-origin-x,shadow-origin-y,shadow-color-ext,,shadow-color-ext-mod,,shadow-highlight-ext,
+ 0x0218=shadow-highlight-ext-mod
0x023F=shadow-flags
- # perspective
+ # 0x0240-0x027F: perspective
0x0240=persp-type,persp-offset-x,persp-offsety,persp-scale-x-to-x,persp-scale-y-to-x,persp-scale-x-to-y,persp-scale-y-to-y,persp-persp-x
0x0248=persp-persp-y,persp-weight,persp-origin-x,persp-origin-y
0x027F=persp-flags
- # 3d object
+ # 0x0280-0x02BF: 3d object
0x0280=3dobj-specular-amt,3dobj-diffuse-amt,3dobj-shininess,3dobj-edge-thickness,3dobj-extrude-forward,3dobj-extrude-backward,3dobj-extrude-plane,3dobj-extrusion-color
- 0x0288=3dobj-cr-mod
+ 0x0288=3dobj-cr-mod,3dobj-extrusion-color-ext,,3dobj-extrusion-color-ext-mod
0x02BF=3dobj-flags
- # 3d style
+ # 0x02C0-0x02FF: 3d style
0x02C0=3dstyle-y-rotation,3dstyle-x-rotation,3dstyle-rotation-axis-x,3dstyle-rotation-axis-y,3dstyle-rotation-axis-z,3dstyle-rotation,3dstyle-rotation-center-x,3dstyle-rotation-center-y
0x02C8=3dstyle-rotation-center-z,3dstyle-render-mode,3dstyle-tolerance,3dstyle-view-point-x,3dstyle-view-point-y,3dstyle-view-point-z,3dstyle-origin-x,3dstyle-origin-y
0x02D0=3dstyle-skew-angle,3dstyle-skew-amount,3dstyle-ambient-intensity,3dstyle-key-light-x,3dstyle-key-light-y,3dstyle-key-light-z,3dstyle-key-light-intensity,3dstyle-fill-light-x
0x02D8=3dstyle-fill-light-y,3dstyle-fill-light-z,3dstyle-fill-light-intensity
0x02FF=3dstyle-flags
- # shape 1
- 0x0301=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw
- 0x033F=shape1-flags
- # callout
- 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-distance,callout-length
+ # 0x0300-0x033F: shape
+ 0x0300=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw,shape-discuss-anchor-id
+ 0x0308=,shape-dia-layout,shape-dia-node-kind,shape-dia-layout-mru,shape-equation-xml
+ 0x033F=shape-flags
+ # 0x0340-0x037F: callout
+ 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-pos,callout-length
0x037F=callout-flags
- # shape 2
- 0x0380=shape-name,shape-description,shape-hyperlink,shape-wrap-polygon-vertices,shape-wrap-left,shape-wrap-top,shape-wrap-right,shape-wrap-bottom
- 0x0388=shape-regroup-id
- 0x03BF=shape2-flags
+ # 0x0380-0x03BF: group or shape
+ 0x0380=group-name,group-description,group-hyperlink,group-wrap-polygon-vertices,group-wrap-left,group-wrap-top,group-wrap-right,group-wrap-bottom
+ 0x0388=group-regroup-id,,,,,group-tooltip,group-script,group-pos-h
+ 0x0390=group-pos-rel-h,group-pos-v,group-pos-rel-v,group-rel-width-hr,group-align-hr,group-height-hr,group-width-hr,group-script-ext-attr
+ 0x0398=group-script-lang,,group-script-lang-attr,group-border-top-color,group-border-left-color,group-border-bottom-color,group-border-right-color,group-table-props
+ 0x03A0=group-table-row-props,,,,,group-web-bot,,
+ 0x03A8=,group-metro-blob,group-rel-z-order,
+ 0x03BF=group-flags
+ # 0x03C0-0x03FF: relative transformation
+ 0x03C0=reltransf-left,reltransf-top,reltransf-right,reltransf-bottom,reltransf-rotation,reltransf-page
+ 0x03FF=reltransf-flags
+ # 0x0400-0x043F: unknown HTML
+ 0x0400=,,uhtml-line-id,uhtml-fill-id,uhtml-pic-id,uhtml-path-id,uhtml-shadow-id,uhtml-persp-id
+ 0x0408=uhtml-text-path-id,uhtml-formulae-id,uhtml-handles-id,uhtml-callout-id,uhtml-lock-id,uhtml-text-id,uhtml-3d-id
+ 0x043F=uhtml-flags
+ # 0x0500-0x053F: diagram
+ 0x0500=dia-type,dia-style,,,dia-rel-table,dia-scale-x,dia-scale-y,dia-def-fontsize
+ 0x0508=dia-constrain-bounds,dia-base-text-scale
+ 0x053F=dia-flags
+ # 0x0540-0x057F: left line style
+ 0x0540=lline-color,lline-opacity,lline-back-color,lline-cr-mod,lline-type,lline-fill-blip,lline-fill-blip-name,lline-fill-blip-opt
+ 0x0548=lline-fill-width,lline-fill-height,lline-fill-dz-type,lline-width,lline-miter-limit,lline-style,lline-dash,lline-dash-style
+ 0x0550=lline-start-arrow-head,lline-end-arrow-head,lline-start-arrow-width,lline-start-arrow-length,lline-end-arrow-width,lline-end-arrow-length,lline-join-style,lline-end-cap-style
+ 0x0558=,lline-color-ext,,lline-color-ext-mod,,lline-back-color-ext,,lline-back-color-ext-mod
+ 0x057F=lline-flags
+ # 0x0580-0x05BF: top line style
+ 0x0580=tline-color,tline-opacity,tline-back-color,tline-cr-mod,tline-type,tline-fill-blip,tline-fill-blip-name,tline-fill-blip-opt
+ 0x0588=tline-fill-width,tline-fill-height,tline-fill-dz-type,tline-width,tline-miter-limit,tline-style,tline-dash,tline-dash-style
+ 0x0590=tline-start-arrow-head,tline-end-arrow-head,tline-start-arrow-width,tline-start-arrow-length,tline-end-arrow-width,tline-end-arrow-length,tline-join-style,tline-end-cap-style
+ 0x0598=,tline-color-ext,,tline-color-ext-mod,,tline-back-color-ext,,tline-back-color-ext-mod
+ 0x05BF=tline-flags
+ # 0x05C0-0x05FF: right line style
+ 0x05C0=rline-color,rline-opacity,rline-back-color,rline-cr-mod,rline-type,rline-fill-blip,rline-fill-blip-name,rline-fill-blip-opt
+ 0x05C8=rline-fill-width,rline-fill-height,rline-fill-dz-type,rline-width,rline-miter-limit,rline-style,rline-dash,rline-dash-style
+ 0x05D0=rline-start-arrow-head,rline-end-arrow-head,rline-start-arrow-width,rline-start-arrow-length,rline-end-arrow-width,rline-end-arrow-length,rline-join-style,rline-end-cap-style
+ 0x05D8=,rline-color-ext,,rline-color-ext-mod,,rline-back-color-ext,,rline-back-color-ext-mod
+ 0x05FF=rline-flags
+ # 0x0600-0x063F: bottom line style
+ 0x0600=bline-color,bline-opacity,bline-back-color,bline-cr-mod,bline-type,bline-fill-blip,bline-fill-blip-name,bline-fill-blip-opt
+ 0x0608=bline-fill-width,bline-fill-height,bline-fill-dz-type,bline-width,bline-miter-limit,bline-style,bline-dash,bline-dash-style
+ 0x0610=bline-start-arrow-head,bline-end-arrow-head,bline-start-arrow-width,bline-start-arrow-length,bline-end-arrow-width,bline-end-arrow-length,bline-join-style,bline-end-cap-style
+ 0x0618=,bline-color-ext,,bline-color-ext-mod,,bline-back-color-ext,,bline-back-color-ext-mod
+ 0x063F=bline-flags
+ # 0x0680-0x06BF: web component
+ 0x0680=webcomp-html,webcomp-name,webcomp-url
+ 0x06BF=webcomp-flags
+ # 0x0700-0x073F: ink data
+ 0x0700=ink-data
+ 0x073F=ink-flags
+ # 0x0780-0x07BF: signature line
+ 0x0780=,sigline-guid,sigline-provider-guid,sigline-suggested-signer,sigline-suggested-signer-info,sigline-suggested-signer-email,sigline-sign-instruction,sigline-add-xml
+ 0x0788=sigline-provider-url
+ 0x07BF=sigline-flags
+ # 0x07C0-0x07FF: group or shape #2
+ 0x07C0=group2-rel-width,group2-rel-height,group2-rel-pos-x,group2-rel-pos-y,group2-size-rel-h,group2-size-rel-v
+end
+
+constlist=DFFOPT-SIMPLE-PROPERTIES
+ # transformation
+ 0x003F=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS
+ # protection
+ 0x007F=uint32,hex,flags,DFFOPT-PROTECTION-FLAGS
+ # text
+ 0x00BF=uint32,hex,flags,DFFOPT-TEXT-FLAGS
+ # text geometry
+ 0x00FF=uint32,hex,flags,DFFOPT-TEXTGEO-FLAGS
+ # picture (BLIP)
+ 0x013F=uint32,hex,flags,DFFOPT-BLIP-FLAGS
+ # shape geometry
+ 0x017F=uint32,hex,flags,DFFOPT-GEO-FLAGS
+ # fill style
+ 0x0180=uint32,dec,type,DFFOPT-FILL-TYPE
+ 0x0181=uint32,hex,color,DFF-COLOR
+ 0x0182=int32,fix,opacity,CONV-FLOAT-TO-PERC
+ 0x0183=uint32,hex,color,DFF-COLOR
+ 0x0184=int32,fix,opacity,DFF-OPACITY
+ 0x0185=uint32,hex,color,DFF-COLOR
+ 0x0186=uint32,dec,blip-id
+ 0x0188=uint32,dec,blip-opt,DFFOPT-BLIPOPT
+ 0x0189=int32,dec,width
+ 0x018A=int32,dec,height
+ 0x018B=int32,fix,angle,CONV-DEG
+ 0x018C=int32,dec,focus,CONV-PERCENT
+ 0x018D=int32,fix,size,CONV-FLOAT-TO-PERC
+ 0x018E=int32,fix,size,CONV-FLOAT-TO-PERC
+ 0x018F=int32,fix,size,CONV-FLOAT-TO-PERC
+ 0x0190=int32,fix,size,CONV-FLOAT-TO-PERC
+ 0x0191=int32,fix,size,CONV-EMU-TO-CM
+ 0x0192=int32,fix,size,CONV-EMU-TO-CM
+ 0x0193=int32,fix,size,CONV-EMU-TO-CM
+ 0x0194=int32,fix,size,CONV-EMU-TO-CM
+ 0x0195=uint32,dec,type,DFFOPT-FILL-DZTYPE
+ 0x0196=int32,dec,preset
+ 0x0198=int32,fix,pos,CONV-FLOAT-TO-PERC
+ 0x0199=int32,fix,pos,CONV-FLOAT-TO-PERC
+ 0x019A=int32,fix,pos,CONV-FLOAT-TO-PERC
+ 0x019B=int32,fix,pos,CONV-FLOAT-TO-PERC
+ 0x019C=uint32,hex,type,DFFOPT-FILL-SHADETYPE
+ 0x019E=uint32,hex,color,DFF-COLOR
+ 0x01A0=uint32,hex,color-mod,DFF-COLORMOD
+ 0x01A2=uint32,hex,color,DFF-COLOR
+ 0x01A4=uint32,hex,color-mod,DFF-COLORMOD
+ 0x01BF=uint32,hex,flags,DFFOPT-FILL-FLAGS
+ # line style
+ 0x01C0=uint32,hex,color,DFF-COLOR
+ 0x01C2=uint32,hex,color,DFF-COLOR
+ 0x01FF=uint32,hex,flags,DFFOPT-LINE-FLAGS
+ # shadow style
+ 0x0201=uint32,hex,color,DFF-COLOR
+ 0x023F=uint32,hex,flags,DFFOPT-SHADOW-FLAGS
+ # perspective
+ 0x027F=uint32,hex,flags,DFFOPT-PERSP-FLAGS
+ # 3d object
+ 0x02BF=uint32,hex,flags,DFFOPT-3DOBJ-FLAGS
+ # 3d style
+ 0x02FF=uint32,hex,flags,DFFOPT-3DSTYLE-FLAGS
+ # shape
+ 0x033F=uint32,hex,flags,DFFOPT-SHAPE-FLAGS
+ # callout
+ 0x037F=uint32,hex,flags,DFFOPT-CALLOUT-FLAGS
+ # group or shape
+ 0x03BF=uint32,hex,flags,DFFOPT-GROUP-FLAGS
+ # relative transformation
+ 0x03FF=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS
+ # unknown HTML
+ 0x043F=uint32,hex,flags,DFFOPT-UHTML-FLAGS
+ # diagram
+ 0x053F=uint32,hex,flags,DFFOPT-DIAGRAM-FLAGS
+ # left line style
+ 0x0540=uint32,hex,color,DFF-COLOR
+ 0x0542=uint32,hex,color,DFF-COLOR
+ 0x057F=uint32,hex,flags,DFFOPT-LINE-FLAGS
+ # top line style
+ 0x0580=uint32,hex,color,DFF-COLOR
+ 0x0582=uint32,hex,color,DFF-COLOR
+ 0x05BF=uint32,hex,flags,DFFOPT-LINE-FLAGS
+ # right line style
+ 0x05C0=uint32,hex,color,DFF-COLOR
+ 0x05C2=uint32,hex,color,DFF-COLOR
+ 0x05FF=uint32,hex,flags,DFFOPT-LINE-FLAGS
+ # bottom line style
+ 0x0600=uint32,hex,color,DFF-COLOR
+ 0x0602=uint32,hex,color,DFF-COLOR
+ 0x063F=uint32,hex,flags,DFFOPT-LINE-FLAGS
+ # web component
+ 0x06BF=uint32,hex,flags,DFFOPT-WEBCOMP-FLAGS
+ # ink data
+ 0x073F=uint32,hex,flags,DFFOPT-INK-FLAGS
+ # signature line
+ 0x07BF=uint32,hex,flags,DFFOPT-SIGLINE-FLAGS
+ # group or shape #2
+end
+
+constlist=DFFOPT-COMPLEX-PROPERTIES
+ 0x0186=uint32,hex,blip,blip
+ 0x0187=uint32,hex,blip-name,string
+ 0x0197=uint32,hex,shade-colors,colorarray
+ 0x0380=uint32,hex,shape-name,string
+end
+
+# common
+
+combilist=DFFOPT-BLIPOPT
+ 0x00000003=uint8,dec,type,DFFOPT-BLIPOPT-TYPE
+ 0x00000004=do-not-save
+ 0x00000008=linked
+end
+
+shortlist=DFFOPT-BLIPOPT-TYPE,0,comment,file,url
+
+# transformation
+
+flagslist=DFFOPT-TRANSFORM-FLAGS
+ 0x0001=:flip-h
+ 0x0002=:flip-v
end
-flagslist=DFFOPT-LOCK-FLAGS
- 0x00000001=lock-against-grouping
- 0x00000002=lock-adjust-handles
- 0x00000004=lock-text
- 0x00000008=lock-vertices
- 0x00000010=lock-cropping
- 0x00000020=lock-against-select
- 0x00000040=lock-position
- 0x00000080=lock-aspect-ratio
- 0x00000100=lock-rotation
- ignore=0xFFFF0000
+# protection
+
+flagslist=DFFOPT-PROTECTION-FLAGS
+ 0x0001=:lock-against-grouping
+ 0x0002=:lock-adjust-handles
+ 0x0004=:lock-text
+ 0x0008=:lock-vertices
+ 0x0010=:lock-cropping
+ 0x0020=:lock-against-select
+ 0x0040=:lock-position
+ 0x0080=:lock-aspect-ratio
+ 0x0100=:lock-rotation
+ 0x0200=:lock-against-ungrouping
end
+# text
+
flagslist=DFFOPT-TEXT-FLAGS
- 0x00000001=fit-text-to-shape
- 0x00000002=fit-shape-to-text
- 0x00000004=rotate-text
- 0x00000008=auto-text-margin
- 0x00000010=select-text
- ignore=0xFFFF0000
+ 0x0002=:fit-shape-to-text
+ 0x0008=:auto-text-margin
+ 0x0010=:select-text
+ ignore=0x0005
end
+# text geometry
+
flagslist=DFFOPT-TEXTGEO-FLAGS
- 0x00000001=strike-through
- 0x00000002=small-caps
- 0x00000004=shadow
- 0x00000008=underline
- 0x00000010=italic
- 0x00000020=bold
- 0x00000040=no-measure-along-path
- 0x00000080=stretch-height
- 0x00000100=scale-on-path
- 0x00000200=shrink-to-fit
- 0x00000400=stretch-to-fit
- 0x00000800=tightening
- 0x00001000=kerning
- 0x00002000=vertical
- 0x00004000=has-effect
- 0x00008000=reverse-rows
- ignore=0xFFFF0000
-end
-
-flagslist=DFFOPT-PICTURE-FLAGS
- 0x00000001=ole-alive
- 0x00000002=bi-level-display
- 0x00000004=grayscale
- 0x00000008=no-hit-test
- ignore=0xFFFF0000
+ 0x0001=:strike-through
+ 0x0002=:small-caps
+ 0x0004=:shadow
+ 0x0008=:underline
+ 0x0010=:italic
+ 0x0020=:bold
+ 0x0040=:no-measure-along-path
+ 0x0080=:normalize
+ 0x0100=:best-fit
+ 0x0200=:shrink-to-fit
+ 0x0400=:stretch-to-fit
+ 0x0800=:tightening
+ 0x1000=:kerning
+ 0x2000=:vertical
+ 0x4000=:has-effect
+ 0x8000=:reverse-rows
+end
+
+# picture (BLIP)
+
+flagslist=DFFOPT-BLIP-FLAGS
+ 0x0001=:ole-alive
+ 0x0002=:bi-level-display
+ 0x0004=:grayscale
+ 0x0008=:no-hit-test
+ 0x0010=:loop-anim
+ 0x0020=:rewind-anim
+ 0x0040=:preserve-gray
end
+# shape geometry
+
flagslist=DFFOPT-GEO-FLAGS
- 0x00000001=fill-support
- 0x00000002=fill-shade-shape-support
- 0x00000004=fontwork-support
- 0x00000008=line-support
- 0x00000010=3d-support
- 0x00000020=shadow-support
- ignore=0xFFFF0000
+ 0x0001=:fill-support
+ 0x0002=:fill-shade-shape-support
+ 0x0004=:fontwork-support
+ 0x0008=:line-support
+ 0x0010=:3d-support
+ 0x0020=:shadow-support
+end
+
+# fill style
+
+shortlist=DFFOPT-FILL-TYPE,0,solid,pattern,texture,picture,edge-shade,linear-shade,shape-shade,point-shade,title-shade,background
+
+combilist=DFFOPT-FILL-DZTYPE
+ 0x00000003=uint8,dec,unit,DFFOPT-FILL-DZTYPE-UNIT
+ 0x0000000C=uint8,dec,aspect,DFFOPT-FILL-DZTYPE-ASPECT
+end
+
+shortlist=DFFOPT-FILL-DZTYPE-UNIT,0,unused,emu,pixel,shape-size-rel
+shortlist=DFFOPT-FILL-DZTYPE-ASPECT,0,none,fixed,prefer-largest
+
+flagslist=DFFOPT-FILL-SHADETYPE
+ 0x00000001=none
+ 0x00000002=gamma
+ 0x00000004=sigma-transfer
+ 0x00000008=flat-band
+ 0x00000010=one-color
end
flagslist=DFFOPT-FILL-FLAGS
- 0x00000001=no-fill-hit-test
- 0x00000002=use-large-rect
- 0x00000004=register-pattern
- 0x00000008=hit-test-fill
- 0x00000010=has-fill
- ignore=0xFFFF0000
+ 0x0001=:no-fill-hit-test
+ 0x0002=:fill-to-rect
+ 0x0004=:fill-rel-to-shape
+ 0x0008=:hit-test-fill
+ 0x0010=:has-fill
+ 0x0020=:shape-anchor
+ 0x0040=:recolor-as-pic
end
+# line style
+
flagslist=DFFOPT-LINE-FLAGS
- 0x00000001=draw-dash-for-invisible
- 0x00000002=register-pattern
- 0x00000004=hit-test-line
- 0x00000008=has-line
- 0x00000010=arrowhead-support
- ignore=0xFFFF0000
+ 0x0001=:draw-dash-for-invisible
+ 0x0002=:fill-rel-to-shape
+ 0x0004=:hit-test-line
+ 0x0008=:has-line
+ 0x0010=:arrowhead-support
+ 0x0020=:inset-pen-support
+ 0x0040=:inset-pen
+ 0x0200=:opaque-back-line
end
+# shadow style
+
flagslist=DFFOPT-SHADOW-FLAGS
- 0x00000001=excel5-style
- 0x00000002=has-shadow
- ignore=0xFFFF0000
+ 0x0001=:obscured-shadow
+ 0x0002=:has-shadow
end
+# perspective
+
flagslist=DFFOPT-PERSP-FLAGS
- 0x00000001=has-perspective
- ignore=0xFFFF0000
+ 0x0001=:has-perspective
end
+# 3d object
+
flagslist=DFFOPT-3DOBJ-FLAGS
- 0x00000001=light-face
- 0x00000002=extrusion-color
- 0x00000004=metallic
- 0x00000008=has-3d
- ignore=0xFFFF0000
+ 0x0001=:light-face
+ 0x0002=:extrusion-color
+ 0x0004=:metallic
+ 0x0008=:has-3d
end
+# 3d style
+
flagslist=DFFOPT-3DSTYLE-FLAGS
- 0x00000001=fill-color-harsh
- 0x00000002=key-color-harsh
- 0x00000004=parallel
- 0x00000008=rotation-center-auto
- 0x00000010=constrain-rotation
- ignore=0xFFFF0000
+ 0x0001=:fill-color-harsh
+ 0x0002=:key-color-harsh
+ 0x0004=:parallel
+ 0x0008=:rotation-center-auto
+ 0x0010=:constrain-rotation
end
-flagslist=DFFOPT-SHAPE1-FLAGS
- 0x00000001=background
- 0x00000002=delete-attached-object
- 0x00000008=lock-shape-type
- 0x00000010=prefer-rel-resize
- 0x00000020=ole-iconified
- ignore=0xFFFF0000
+# shape
+
+flagslist=DFFOPT-SHAPE-FLAGS
+ 0x0001=:background
+ 0x0004=:initiator
+ 0x0008=:lock-shape-type
+ 0x0010=:prefer-rel-resize
+ 0x0020=:ole-iconified
+ 0x0040=:flip-v-override
+ 0x0080=:flip-h-override
+ 0x0100=:policy-barcode
+ 0x0200=:policy-label
end
+# callout
+
flagslist=DFFOPT-CALLOUT-FLAGS
- 0x00000001=length-specified
- 0x00000002=drop-auto
- 0x00000004=minus-y
- 0x00000008=minus-x
- 0x00000010=has-text-border
- 0x00000020=has-accent-bar
- 0x00000040=is-callout
- ignore=0xFFFF0000
-end
-
-flagslist=DFFOPT-SHAPE2-FLAGS
- 0x00000001=print
- 0x00000002=hidden
- 0x00000004=1d-adjustment
- 0x00000008=action-attached
- 0x00000010=notify-double-click
- 0x00000020=behind-text
- 0x00000040=wrap-edited
- ignore=0xFFFF0000
+ 0x0001=:length-specified
+ 0x0002=:drop-auto
+ 0x0004=:minus-y
+ 0x0008=:minus-x
+ 0x0010=:has-text-border
+ 0x0020=:has-accent-bar
+ 0x0040=:is-callout
+end
+
+# group or shape
+
+flagslist=DFFOPT-GROUP-FLAGS
+ 0x0001=:print
+ 0x0002=:hidden
+ 0x0004=:1d-adjustment
+ 0x0008=:is-button
+ 0x0010=:notify-double-click
+ 0x0020=:behind-doc
+ 0x0040=:wrap-edited
+ 0x0080=:script-anchor
+ 0x0100=:really-hidden
+ 0x0200=:allow-overlap
+ 0x0400=:user-drawn
+ 0x0800=:is-hr
+ 0x1000=:no-shade-hr
+ 0x2000=:standard-hr
+ 0x4000=:is-bullet
+ 0x8000=:layout-in-cell
+end
+
+# unknown HTML
+
+flagslist=DFFOPT-UHTML-FLAGS
+ 0x0002=:fake-master
+ 0x0004=:ole-from-html
+end
+
+# diagram
+
+flagslist=DFFOPT-DIAGRAM-FLAGS
+ 0x0001=:pseudo-inline
+ 0x0002=:do-layout
+ 0x0004=:reverse
+ 0x0008=:do-format
+end
+
+# web component
+
+flagslist=DFFOPT-WEBCOMP-FLAGS
+ 0x0001=:is-web-component
+end
+
+# ink data
+
+flagslist=DFFOPT-INK-FLAGS
+ 0x0001=:render-ink
+ 0x0002=:render-shape
+ 0x0004=:hit-test-ink
+ 0x0008=:ink-annotation
+end
+
+# signature line
+
+flagslist=DFFOPT-SIGLINE-FLAGS
+ 0x0001=:is-signature-line
+ 0x0002=:show-sign-instruction
+ 0x0004=:show-sign-comment
+ 0x0008=:show-sign-date
+end
+
+# group or shape #2
+
+# DFFSP ----------------------------------------------------------------------
+
+combilist=DFFSP-RECORD-INST
+ include=DFF-RECORD-INST
+ 0xFFF0=uint16,dec,shape-type,DFFSP-TYPE
+end
+
+multilist=DFFSP-TYPE
+ 0=not-primitive,rectangle,round-rectangle,ellipse,diamond,isoceles-triangle,right-triangle,parallelogram,trapezoid,hexagon
+ 10=octagon,plus,star,arrow,thick-arrow,home-plate,cube,balloon,seal,arc
+ 20=line,plaque,can,donut,text-simple,text-octagon,text-hexagon,text-curve,text-wave,text-ring
+ 30=text-on-curve,text-on-ring,straight-connector-1,bent-connector-2,bent-connector-3,bent-connector-4,bent-connector-5,curved-connector-2,curved-connector-3,curved-connector-4
+ 40=curved-connector-5,callout-1,callout-2,callout-3,accent-callout-1,accent-callout-2,accent-callout-3,border-callout-1,border-callout-2,border-callout-3
+ 50=accent-border-callout-1,accent-border-callout-2,accent-border-callout-3,ribbon,ribbon-2,chevron,pentagon,no-smoking,seal-8,seal-16
+ 60=seal-32,wedge-rect-callout,wedge-rrect-callout,wedge-ellipse-callout,wave,folded-corner,left-arrow,down-arrow,up-arrow,left-right-arrow
+ 70=up-down-arrow,irregular-seal-1,irregular-seal-2,lightning-bolt,heart,picture-frame,quad-arrow,left-arrow-callout,right-arrow-callout,up-arrow-callout
+ 80=down-arrow-callout,left-right-arrow-callout,up-down-arrow-callout,quad-arrow-callout,bevel,left-bracket,right-bracket,left-brace,right-brace,left-up-arrow
+ 90=bent-up-arrow,bent-arrow,seal-24,striped-right-arrow,notched-right-arrow,block-arc,smiley-face,vertical-scroll,horizontal-scroll,circular-arrow
+ 100=notched-circular-arrow,uturn-arrow,curved-right-arrow,curved-left-arrow,curved-up-arrow,curved-down-arrow,cloud-callout,ellipse-ribbon,ellipse-ribbon-2,flow-chart-process
+ 110=flow-chart-decision,flow-chart-input-output,flow-chart-predefined-process,flow-chart-internal-storage,flow-chart-document,flow-chart-multidocument,flow-chart-terminator,flow-chart-preparation,flow-chart-manual-input,flow-chart-manual-operation
+ 120=flow-chart-connector,flow-chart-punched-card,flow-chart-punched-tape,flow-chart-summing-junction,flow-chart-or,flow-chart-collate,flow-chart-sort,flow-chart-extract,flow-chart-merge,flow-chart-offline-storage
+ 130=flow-chart-online-storage,flow-chart-magnetic-tape,flow-chart-magnetic-disk,flow-chart-magnetic-drum,flow-chart-display,flow-chart-delay,text-plain-text,text-stop,text-triangle,text-triangle-inverted
+ 140=text-chevron,text-chevron-inverted,text-ring-inside,text-ring-outside,text-arch-up-curve,text-arch-down-curve,text-circle-curve,text-button-curve,text-arch-up-pour,text-arch-down-pour
+ 150=text-circle-pour,text-button-pour,text-curve-up,text-curve-down,text-cascade-up,text-cascade-down,text-wave-1,text-wave-2,text-wave-3,text-wave-4
+ 160=text-inflate,text-deflate,text-inflate-bottom,text-deflate-bottom,text-inflate-top,text-deflate-top,text-deflate-inflate,text-deflate-inflate-deflate,text-fade-right,text-fade-left
+ 170=text-fade-up,text-fade-down,text-slant-up,text-slant-down,text-can-up,text-can-down,flow-chart-alternate-process,flow-chart-offpage-connector,callout-90,accent-callout-90
+ 180=border-callout-90,accent-border-callout-90,left-right-up-arrow,sun,moon,bracket-pair,brace-pair,seal-4,double-wave,action-button-blank
+ 190=action-button-home,action-button-help,action-button-information,action-button-forward-next,action-button-back-previous,action-button-end,action-button-beginning,action-button-return,action-button-document,action-button-sound
+ 200=action-button-movie,host-control,text-box
+end
+
+flagslist=DFFSP-FLAGS
+ 0x00000001=group
+ 0x00000002=child
+ 0x00000004=patriarch
+ 0x00000008=deleted
+ 0x00000010=ole
+ 0x00000020=has-master
+ 0x00000040=flip-horizontal
+ 0x00000080=flip-vertical
+ 0x00000100=connector
+ 0x00000200=has-anchor
+ 0x00000400=background
+ 0x00000800=has-shape-type
+end
+
+# DFFSPLITMENUCOLORS ---------------------------------------------------------
+
+combilist=DFFSPLITMENUC-RECORD-INST
+ include=DFF-RECORD-INST
+ 0xFFF0=uint16,dec,color-count
end
# ============================================================================
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index 6d834e04c487..8e0e9a4e1225 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -772,6 +772,14 @@ OUString StringHelper::trimSpaces( const OUString& rStr )
return rStr.copy( nBeg, nEnd - nBeg );
}
+OUString StringHelper::trimTrailingNul( const OUString& rStr )
+{
+ sal_Int32 nLastPos = rStr.getLength() - 1;
+ if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) )
+ return rStr.copy( 0, nLastPos );
+ return rStr;
+}
+
OString StringHelper::convertToUtf8( const OUString& rStr )
{
return OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 );
@@ -888,6 +896,25 @@ bool StringHelper::convertStringToBool( const OUString& rData )
return convertStringToInt( nData, rData ) && (nData != 0);
}
+OUStringPair StringHelper::convertStringToPair( const OUString& rString, sal_Unicode cSep )
+{
+ OUStringPair aPair;
+ if( rString.getLength() > 0 )
+ {
+ sal_Int32 nEqPos = rString.indexOf( cSep );
+ if( nEqPos < 0 )
+ {
+ aPair.first = rString;
+ }
+ else
+ {
+ aPair.first = StringHelper::trimSpaces( rString.copy( 0, nEqPos ) );
+ aPair.second = StringHelper::trimSpaces( rString.copy( nEqPos + 1 ) );
+ }
+ }
+ return aPair;
+}
+
void StringHelper::convertStringToStringList( OUStringVector& orVec, const OUString& rData, bool bIgnoreEmpty )
{
orVec.clear();
@@ -1067,25 +1094,11 @@ ConfigItemBase::LineType ConfigItemBase::readConfigLine(
}
}
- LineType eResult = LINETYPE_END;
- if( aLine.getLength() > 0 )
- {
- sal_Int32 nEqPos = aLine.indexOf( '=' );
- if( nEqPos < 0 )
- {
- orKey = aLine;
- }
- else
- {
- orKey = StringHelper::trimSpaces( aLine.copy( 0, nEqPos ) );
- orData = StringHelper::trimSpaces( aLine.copy( nEqPos + 1 ) );
- }
-
- if( (orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" )) )
- eResult = LINETYPE_DATA;
- }
-
- return eResult;
+ OUStringPair aPair = StringHelper::convertStringToPair( aLine );
+ orKey = aPair.first;
+ orData = aPair.second;
+ return ((orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" ))) ?
+ LINETYPE_DATA : LINETYPE_END;
}
ConfigItemBase::LineType ConfigItemBase::readConfigLine( const ConfigInputStreamRef& rxStrm ) const
@@ -1176,6 +1189,15 @@ void NameListBase::exclude( const OUString& rKeys )
// ============================================================================
+void ItemFormatMap::insertFormats( const NameListRef& rxNameList )
+{
+ if( Base::isValid( rxNameList ) )
+ for( NameListBase::const_iterator aIt = rxNameList->begin(), aEnd = rxNameList->end(); aIt != aEnd; ++aIt )
+ (*this)[ aIt->first ].parse( aIt->second );
+}
+
+// ============================================================================
+
ConstList::ConstList( const SharedConfigData& rCfgData ) :
NameListBase( rCfgData ),
maDefName( OOX_DUMP_ERR_NONAME ),
@@ -1283,46 +1305,57 @@ void FlagsList::implProcessConfigItemStr(
void FlagsList::implSetName( sal_Int64 nKey, const OUString& rName )
{
- insertRawName( nKey, rName );
+ if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) ) // only a single bit set?
+ insertRawName( nKey, rName );
}
OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const
{
- sal_Int64 nFlags = nKey;
- setFlag( nFlags, mnIgnore, false );
- sal_Int64 nFound = 0;
+ sal_Int64 nFound = mnIgnore;
OUStringBuffer aName;
// add known flags
for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
{
sal_Int64 nMask = aIt->first;
- const OUString& rFlagName = aIt->second;
- bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!');
- sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1;
- bool bFlag = getFlag( nFlags, nMask );
- if( bFlag )
- {
- if( !bNegated )
- StringHelper::appendToken( aName, rFlagName );
- else if( nBothSep > 0 )
- StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) );
- }
- else if( bNegated )
+ setFlag( nFound, nMask );
+ if( !getFlag( mnIgnore, nMask ) )
{
- if( nBothSep > 0 )
- StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) );
- else
+ const OUString& rFlagName = aIt->second;
+ bool bOnOff = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == ':');
+ bool bFlag = getFlag( nKey, nMask );
+ if( bOnOff )
+ {
StringHelper::appendToken( aName, rFlagName.copy( 1 ) );
+ aName.appendAscii( bFlag ? ":on" : ":off" );
+ }
+ else
+ {
+ bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!');
+ sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1;
+ if( bFlag )
+ {
+ if( !bNegated )
+ StringHelper::appendToken( aName, rFlagName );
+ else if( nBothSep > 0 )
+ StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) );
+ }
+ else if( bNegated )
+ {
+ if( nBothSep > 0 )
+ StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) );
+ else
+ StringHelper::appendToken( aName, rFlagName.copy( 1 ) );
+ }
+ }
}
- setFlag( nFound, nMask );
}
// add unknown flags
- setFlag( nFlags, nFound, false );
- if( nFlags != 0 )
+ setFlag( nKey, nFound, false );
+ if( nKey != 0 )
{
OUStringBuffer aUnknown( CREATE_OUSTRING( OOX_DUMP_UNKNOWN ) );
aUnknown.append( OOX_DUMP_ITEMSEP );
- StringHelper::appendShortHex( aUnknown, nFlags, true );
+ StringHelper::appendShortHex( aUnknown, nKey, true );
StringHelper::enclose( aUnknown, '(', ')' );
StringHelper::appendToken( aName, aUnknown.makeStringAndClear() );
}
@@ -1342,6 +1375,11 @@ void FlagsList::implIncludeList( const NameListBase& rList )
// ============================================================================
+bool CombiList::ExtItemFormatKey::operator<( const ExtItemFormatKey& rRight ) const
+{
+ return (mnKey < rRight.mnKey) || ((mnKey == rRight.mnKey) && (maFilter < rRight.maFilter));
+}
+
CombiList::CombiList( const SharedConfigData& rCfgData ) :
FlagsList( rCfgData )
{
@@ -1351,9 +1389,34 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
{
if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set?
{
- ExtItemFormat& rItemFmt = maFmtMap[ nKey ];
- OUStringVector aRemain = rItemFmt.parse( rName );
- rItemFmt.mbShiftValue = aRemain.empty() || !aRemain.front().equalsAscii( "noshift" );
+ typedef ::std::set< ExtItemFormatKey > ExtItemFormatKeySet;
+ ::std::set< ExtItemFormatKey > aItemKeys;
+ ExtItemFormat aItemFmt;
+ OUStringVector aRemain = aItemFmt.parse( rName );
+ for( OUStringVector::iterator aIt = aRemain.begin(), aEnd = aRemain.end(); aIt != aEnd; ++aIt )
+ {
+ OUStringPair aPair = StringHelper::convertStringToPair( *aIt );
+ if( aPair.first.equalsAscii( "noshift" ) )
+ {
+ aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second );
+ }
+ else if( aPair.first.equalsAscii( "filter" ) )
+ {
+ OUStringPair aFilter = StringHelper::convertStringToPair( aPair.second, '~' );
+ ExtItemFormatKey aKey( nKey );
+ if( (aFilter.first.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.first, aFilter.first ) &&
+ (aFilter.second.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.second, aFilter.second ) )
+ {
+ if( aKey.maFilter.first == 0 )
+ aKey.maFilter.second = 0;
+ aItemKeys.insert( aKey );
+ }
+ }
+ }
+ if( aItemKeys.empty() )
+ aItemKeys.insert( ExtItemFormatKey( nKey ) );
+ for( ExtItemFormatKeySet::iterator aIt = aItemKeys.begin(), aEnd = aItemKeys.end(); aIt != aEnd; ++aIt )
+ maFmtMap[ *aIt ] = aItemFmt;
}
else
{
@@ -1363,18 +1426,18 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const
{
- sal_Int64 nFlags = nKey;
sal_Int64 nFound = 0;
OUStringBuffer aName;
// add known flag fields
for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt )
{
- sal_Int64 nMask = aIt->first;
- if( nMask != 0 )
+ const ExtItemFormatKey& rMapKey = aIt->first;
+ sal_Int64 nMask = rMapKey.mnKey;
+ if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) )
{
const ExtItemFormat& rItemFmt = aIt->second;
- sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nFlags );
+ sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey );
sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask );
if( rItemFmt.mbShiftValue )
while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; }
@@ -1411,8 +1474,8 @@ OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const
setFlag( nFound, nMask );
}
}
- setFlag( nFlags, nFound, false );
- StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nFlags ) );
+ setFlag( nKey, nFound, false );
+ StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nKey ) );
return aName.makeStringAndClear();
}
@@ -2627,7 +2690,7 @@ sal_Unicode InputObjectBase::dumpUnicode( const String& rName )
return cChar;
}
-OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc )
+OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul )
{
sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->getLength() - mxStrm->tell(), 0, nLen );
OUString aString;
@@ -2638,16 +2701,20 @@ OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rt
aBuffer[ nCharsRead ] = 0;
aString = OStringToOUString( OString( &aBuffer.front() ), eTextEnc );
}
+ if( bHideTrailingNul )
+ aString = StringHelper::trimTrailingNul( aString );
writeStringItem( rName( "text" ), aString );
return aString;
}
-OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen )
+OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul )
{
OUStringBuffer aBuffer;
for( sal_Int32 nIndex = 0; !mxStrm->isEof() && (nIndex < nLen); ++nIndex )
aBuffer.append( static_cast< sal_Unicode >( mxStrm->readuInt16() ) );
OUString aString = aBuffer.makeStringAndClear();
+ if( bHideTrailingNul )
+ aString = StringHelper::trimTrailingNul( aString );
writeStringItem( rName( "text" ), aString );
return aString;
}
@@ -3059,12 +3126,7 @@ bool RecordObjectBase::implIsValid() const
void RecordObjectBase::implDump()
{
NameListRef xRecNames = getRecNames();
-
- typedef ::std::map< sal_Int64, ItemFormat > ItemFormatMap;
- ItemFormatMap aSimpleRecs;
- if( NameListBase* pSimpleRecs = maSimpleRecs.getNameList( cfg() ).get() )
- for( NameListBase::const_iterator aIt = pSimpleRecs->begin(), aEnd = pSimpleRecs->end(); aIt != aEnd; ++aIt )
- aSimpleRecs[ aIt->first ].parse( aIt->second );
+ ItemFormatMap aSimpleRecs( maSimpleRecs.getNameList( cfg() ) );
while( implStartRecord( *mxBaseStrm, mnRecPos, mnRecId, mnRecSize ) )
{
diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini
index 99603e12e560..84d742c2b35f 100644
--- a/oox/source/dump/dumperbase.ini
+++ b/oox/source/dump/dumperbase.ini
@@ -164,7 +164,7 @@ show-record-position=0
# include = <LISTNAME>[,<LISTNAME>...]
# exclude = <bitfield>[,<bitfield>...]
# ignore = <bitfield>
-# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1>
+# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1>
# end
#
# - include (optional): See constlist above.
@@ -173,10 +173,14 @@ show-record-position=0
# name and not set in this declaration will be shown as unknown. Default is
# to not ignore a bit.
# - <bitmask>: The bit to be named. Must be a value with a single bit set.
-# - <constname>: sets a name for the bit that will be shown if it is set.
-# - !<constname>: sets a name for the bit that will be shown if it is cleared.
-# - !<constname0>!<constname1>: sets a name for the cleared bit (constname0),
-# and for the set bit (constname1).
+# - <cname> - Sets a name for the bit that will be shown if the bit is set.
+# Does not show anything if the bit is cleared.
+# - !<cname> - Sets a name for the bit that will be shown if the bit is
+# cleared. Does not show anything if the bit is set.
+# - :<cname> - Sets a name for the bit that will always be shown together
+# with the actual state of the bit, appended as ':on' or ':off'.
+# - !<cname0>!<cname1> - Sets a name for both the cleared bit (cname0), and
+# for the set bit (cname1).
#
# ----------------------------------------------------------------------------
#
@@ -191,8 +195,8 @@ show-record-position=0
# include = <LISTNAME>[,<LISTNAME>...]
# exclude = <bitmask>[,<bitmask>...]
# ignore = <bitfield>
-# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1>
-# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,noshift]]
+# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1>
+# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,options...]]
# end
#
# - include (optional): See constlist above.
@@ -206,7 +210,17 @@ show-record-position=0
# - <bitfieldname>: The name of the embedded bitfield.
# - <LISTAME>: Optional name list with names for the values of the embedded
# bitfield.
-# - noshift: If set, the extracted value is not shifted to the right.
+# - options: Additional options for this bitfield:
+# - filter = <filterbitfield>~<filtervalue>: If set, the entire bitfield
+# will only be written, if the complete data item currently dumped
+# contains exactly the value specified in <filtervalue> in the bitfield
+# specified in <filterbitfield>. Otherwise, nothing is written. It is
+# possible to specify multiple filter rules for this bitfield. In that
+# case, the bitfield will be written, if at least one filter rule
+# applies for the current data item.
+# - noshift = <bool>: If set to 'true', the extracted value will be
+# shifted to the right (normalized). If set to 'false', the value will
+# be written unshifted. Default is 'true'.
#
# ----------------------------------------------------------------------------
#
@@ -230,6 +244,7 @@ unitconverter=CONV-PT-TO-CM,/28.346457,cm
unitconverter=CONV-PT1616-TO-CM,/1857713.4,cm
unitconverter=CONV-TWIP-TO-CM,/566.92913,cm
unitconverter=CONV-TWIP-TO-PT,/20,pt
+unitconverter=CONV-EMU-TO-CM,/36000,cm
constlist=BOOLEAN
0=FALSE
@@ -239,7 +254,7 @@ end
combilist=RK-FLAGS
0x00000001=div-100
0x00000002=integer
- 0xFFFFFFFC=int32,dec,value
+ 0xFFFFFFFC=int32,dec,value,,filter=0x2~0x2
end
constlist=CHARSET
@@ -370,5 +385,12 @@ multilist=COUNTRY
980=,iran
end
+multilist=SYSTEMCOLOR
+ 0x00=scrollbar,desktop,active-title,inactive-title,menu,window-back,window-frame,menu-text
+ 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face
+ 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text
+ 0x18=tooltip-back,,hot-light,active-title-2,inactive-title-2,menu-highlight,menubar
+end
+
# ============================================================================
diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx
index 30b4fb67436b..b7750d4113b8 100644
--- a/oox/source/dump/oledumper.cxx
+++ b/oox/source/dump/oledumper.cxx
@@ -671,15 +671,7 @@ sal_uInt32 OcxPropertyObjectBase::dumpColorProperty( sal_uInt32 nDefault )
{
MultiItemsGuard aMultiGuard( out() );
alignInput< sal_uInt32 >();
- sal_uInt32 nColor = dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" );
- switch( extractValue< sal_uInt8 >( nColor, 24, 8 ) )
- {
- case 0x00: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break;
- case 0x01: writeDecItem( "palette-index", extractValue< sal_uInt16 >( nColor, 0, 16 ) ); break;
- case 0x02: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break;
- case 0x80: writeDecItem( "sys-color", extractValue< sal_uInt16 >( nColor, 0, 16 ), "OCX-SYSTEMCOLOR" ); break;
- }
- return nColor;
+ return dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" );
}
return nDefault;
}
diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini
index 96433d63c7fa..c398b0c01e51 100644
--- a/oox/source/dump/oledumper.ini
+++ b/oox/source/dump/oledumper.ini
@@ -115,8 +115,12 @@ end
{0713E8D2-850A-101B-AFC0-4210102A8DA7}=COMCTL.ProgCtrl.1
combilist=OCX-COLOR
+ 0x0000FFFF=uint32,dec,palette-index,,filter=0xFF000000~0x01000000
+ 0x000000FF=uint32,dec,red,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000
+ 0x0000FF00=uint32,dec,green,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000
+ 0x00FF0000=uint32,dec,blue,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000
+ 0x0000FFFF=uint32,dec,system-color,SYSTEMCOLOR,filter=0xFF000000~0x80000000
0xFF000000=uint8,dec,type,OCX-COLORTYPE
- 0x00FFFFFF=uint32,hex,value
end
constlist=OCX-COLORTYPE
@@ -126,13 +130,6 @@ constlist=OCX-COLORTYPE
0x80=system-color
end
-multilist=OCX-SYSTEMCOLOR
- 0x00=scrollbar,desktop,active-title,inactive-title,menubar,window-back,window-frame,menu-text
- 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face
- 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text
- 0x18=tooltip-back
-end
-
combilist=OCX-STRINGLEN
0x80000000=!unicode!compressed
0x7FFFFFFF=int32,dec,buffer-size
@@ -543,16 +540,6 @@ flagslist=OCX-FORMSITE-FLAGS
0x00040000=container
end
-combilist=OCX-FORMSITE-CLASSIDCACHE
- 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX
- 0x8000=!predefined-class-id!class-table-index
-end
-
-constlist=OCX-FORMSITE-CLASSIDCACHEINDEX
- default=
- 0x7FFF=invalid
-end
-
constlist=OCX-FORMSITE-CLASSNAMES
7=Forms.Form.1
12=Forms.Image.1
@@ -572,6 +559,17 @@ constlist=OCX-FORMSITE-CLASSNAMES
57=Forms.MultiPage.1
end
+constlist=OCX-FORMSITE-CLASSIDCACHEINDEX
+ include=OCX-FORMSITE-CLASSNAMES
+ 0x7FFF=invalid
+end
+
+combilist=OCX-FORMSITE-CLASSIDCACHE
+ 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX,filter=0x8000~0x0000
+ 0x7FFF=uint16,dec,class-table-idx,,filter=0x8000~0x8000
+ 0x8000=!predefined-class-id!class-table-index
+end
+
# form design extender ------------------------------------------------------
flagslist=OCX-FORMDESIGNEXT-PROPERTIES
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 534a207a6e58..016857161696 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -64,7 +64,7 @@ PPTShape::~PPTShape()
void PPTShape::addShape(
const oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rSlidePersist,
- const oox::drawingml::ThemePtr& rxTheme,
+ const oox::drawingml::Theme* pTheme,
const Reference< XShapes >& rxShapes,
const awt::Rectangle* pShapeRect,
::oox::drawingml::ShapeIdMap* pShapeMap )
@@ -159,7 +159,7 @@ void PPTShape::addShape(
aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
setMasterTextListStyle( aMasterTextListStyle );
- Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, bClearText ) );
+ Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) );
if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) )
{
try
@@ -185,7 +185,7 @@ void PPTShape::addShape(
// if this is a group shape, we have to add also each child shape
Reference< XShapes > xShapes( xShape, UNO_QUERY );
if ( xShapes.is() )
- addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
+ addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap );
}
}
catch( const Exception& )
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index bd9fd5d549b1..4113b399e6eb 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -104,7 +104,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame
- xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ) ) );
+ xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) );
break;
}
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 227f0b7ce799..c91a1bd1fd79 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -143,9 +143,9 @@ void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase )
{
PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() );
if ( pPPTShape )
- pPPTShape->addShape( rFilterBase, *this, getTheme(), xShapes, 0, &getShapeMap() );
+ pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, 0, &getShapeMap() );
else
- (*aChildIter)->addShape( rFilterBase, getTheme(), xShapes, 0, &getShapeMap() );
+ (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, 0, &getShapeMap() );
aChildIter++;
}
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index ef8831b06db3..42efee474d90 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -74,7 +74,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
case XML_graphic:
mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
mxGraphicShapeContext.set
- (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape));
+ (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape, true));
break;
case XML_pic:
mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
@@ -240,7 +240,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException)
}
else if (mpShape.get() != NULL)
{
- mpShape->addShape(*mxFilterBase, mpThemePtr, xShapes);
+ mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes);
xResult.set(mpShape->getXShape());
}
}
diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl
index b3d277b85c2f..2a7f2e2423bb 100644
--- a/oox/source/token/gennamespaces.pl
+++ b/oox/source/token/gennamespaces.pl
@@ -50,6 +50,7 @@ print ( HXX "// defines for tokens with specific namespaces, can be used in swit
print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" );
print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" );
print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" );
+print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" );
print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" );
print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" );
print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" );
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 63ca76e95f54..45bb59541b1b 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -14,6 +14,7 @@ DRAWINGML
PICTURE
DIAGRAM
CHART
+CDR
DOC_DRAWINGML
# VML
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 56e1c888d0a2..28687ba92da7 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -92,22 +92,6 @@ sal_Int64 lclCalcEmu( const UnitConverter& rUnitConv, sal_Int64 nValue, Unit eFr
// ============================================================================
-AnchorPosModel::AnchorPosModel() :
- mnX( -1 ),
- mnY( -1 )
-{
-}
-
-// ----------------------------------------------------------------------------
-
-AnchorSizeModel::AnchorSizeModel() :
- mnWidth( -1 ),
- mnHeight( -1 )
-{
-}
-
-// ----------------------------------------------------------------------------
-
AnchorCellModel::AnchorCellModel() :
mnCol( -1 ),
mnRow( -1 ),
@@ -155,15 +139,15 @@ void ShapeAnchor::importAnchor( sal_Int32 nElement, const AttributeList& rAttrib
void ShapeAnchor::importPos( const AttributeList& rAttribs )
{
OSL_ENSURE( meType == ANCHOR_ABSOLUTE, "ShapeAnchor::importPos - unexpected 'xdr:pos' element" );
- maPos.mnX = rAttribs.getHyper( XML_x, 0 );
- maPos.mnY = rAttribs.getHyper( XML_y, 0 );
+ maPos.X = rAttribs.getHyper( XML_x, 0 );
+ maPos.Y = rAttribs.getHyper( XML_y, 0 );
}
void ShapeAnchor::importExt( const AttributeList& rAttribs )
{
OSL_ENSURE( (meType == ANCHOR_ABSOLUTE) || (meType == ANCHOR_ONECELL), "ShapeAnchor::importExt - unexpected 'xdr:ext' element" );
- maSize.mnWidth = rAttribs.getHyper( XML_cx, 0 );
- maSize.mnHeight = rAttribs.getHyper( XML_cy, 0 );
+ maSize.Width = rAttribs.getHyper( XML_cx, 0 );
+ maSize.Height = rAttribs.getHyper( XML_cy, 0 );
}
void ShapeAnchor::importClientData( const AttributeList& rAttribs )
@@ -229,12 +213,12 @@ bool ShapeAnchor::isValidAnchor() const
case ANCHOR_ABSOLUTE:
OSL_ENSURE( maPos.isValid(), "ShapeAnchor::isValidAnchor - invalid position" );
OSL_ENSURE( maSize.isValid(), "ShapeAnchor::isValidAnchor - invalid size" );
- bValid = maPos.isValid() && maSize.isValid() && (maSize.mnWidth > 0) && (maSize.mnHeight > 0);
+ bValid = maPos.isValid() && maSize.isValid() && (maSize.Width > 0) && (maSize.Height > 0);
break;
case ANCHOR_ONECELL:
OSL_ENSURE( maFrom.isValid(), "ShapeAnchor::isValidAnchor - invalid from position" );
OSL_ENSURE( maSize.isValid(), "ShapeAnchor::isValidAnchor - invalid size" );
- bValid = maFrom.isValid() && maSize.isValid() && (maSize.mnWidth > 0) && (maSize.mnHeight > 0);
+ bValid = maFrom.isValid() && maSize.isValid() && (maSize.Width > 0) && (maSize.Height > 0);
break;
case ANCHOR_TWOCELL:
case ANCHOR_VML:
@@ -264,10 +248,10 @@ Rectangle ShapeAnchor::calcApiLocation( const Size& rApiSheetSize, const AnchorS
{
case ANCHOR_ABSOLUTE:
OSL_ENSURE( maPos.isValid(), "ShapeAnchor::calcApiLocation - invalid position" );
- if( maPos.isValid() && (maPos.mnX < rEmuSheetSize.mnWidth) && (maPos.mnY < rEmuSheetSize.mnHeight) )
+ if( maPos.isValid() && (maPos.X < rEmuSheetSize.Width) && (maPos.Y < rEmuSheetSize.Height) )
{
- aApiLoc.X = rUnitConv.scaleToMm100( static_cast< double >( maPos.mnX ), UNIT_EMU );
- aApiLoc.Y = rUnitConv.scaleToMm100( static_cast< double >( maPos.mnY ), UNIT_EMU );
+ aApiLoc.X = rUnitConv.scaleToMm100( static_cast< double >( maPos.X ), UNIT_EMU );
+ aApiLoc.Y = rUnitConv.scaleToMm100( static_cast< double >( maPos.Y ), UNIT_EMU );
}
break;
case ANCHOR_ONECELL:
@@ -295,10 +279,10 @@ Rectangle ShapeAnchor::calcApiLocation( const Size& rApiSheetSize, const AnchorS
if( maSize.isValid() )
{
aApiLoc.Width = ::std::min< sal_Int32 >(
- rUnitConv.scaleToMm100( static_cast< double >( maSize.mnWidth ), UNIT_EMU ),
+ rUnitConv.scaleToMm100( static_cast< double >( maSize.Width ), UNIT_EMU ),
rApiSheetSize.Width - aApiLoc.X );
aApiLoc.Height = ::std::min< sal_Int32 >(
- rUnitConv.scaleToMm100( static_cast< double >( maSize.mnHeight ), UNIT_EMU ),
+ rUnitConv.scaleToMm100( static_cast< double >( maSize.Height ), UNIT_EMU ),
rApiSheetSize.Height - aApiLoc.Y );
}
break;
@@ -340,8 +324,8 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c
UnitConverter& rUnitConv = getUnitConverter();
Size aSheetSize(
- getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.mnWidth, 0, SAL_MAX_INT32 ),
- getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.mnHeight, 0, SAL_MAX_INT32 ) );
+ getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.Width, 0, SAL_MAX_INT32 ),
+ getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.Height, 0, SAL_MAX_INT32 ) );
Rectangle aLoc( -1, -1, -1, -1 );
Unit eUnitX = (meType == ANCHOR_VML) ? UNIT_SCREENX : UNIT_EMU;
Unit eUnitY = (meType == ANCHOR_VML) ? UNIT_SCREENY : UNIT_EMU;
@@ -351,10 +335,10 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c
{
case ANCHOR_ABSOLUTE:
OSL_ENSURE( maPos.isValid(), "ShapeAnchor::calcEmuLocation - invalid position" );
- if( maPos.isValid() && (maPos.mnX < aSheetSize.Width) && (maPos.mnY < aSheetSize.Height) )
+ if( maPos.isValid() && (maPos.X < aSheetSize.Width) && (maPos.Y < aSheetSize.Height) )
{
- aLoc.X = static_cast< sal_Int32 >( maPos.mnX );
- aLoc.Y = static_cast< sal_Int32 >( maPos.mnY );
+ aLoc.X = static_cast< sal_Int32 >( maPos.X );
+ aLoc.Y = static_cast< sal_Int32 >( maPos.Y );
}
break;
case ANCHOR_ONECELL:
@@ -386,8 +370,8 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c
OSL_ENSURE( maSize.isValid(), "ShapeAnchor::calcEmuLocation - invalid size" );
if( maSize.isValid() )
{
- aLoc.Width = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.mnWidth, aSheetSize.Width - aLoc.X ) );
- aLoc.Height = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.mnHeight, aSheetSize.Height - aLoc.Y ) );
+ aLoc.Width = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.Width, aSheetSize.Width - aLoc.X ) );
+ aLoc.Height = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.Height, aSheetSize.Height - aLoc.Y ) );
}
break;
case ANCHOR_TWOCELL:
@@ -439,8 +423,8 @@ OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OU
{
OSL_ENSURE( mxDrawPage.is(), "OoxDrawingFragment::OoxDrawingFragment - missing drawing page" );
maApiSheetSize = getDrawPageSize();
- maEmuSheetSize.mnWidth = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) );
- maEmuSheetSize.mnHeight = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) );
+ maEmuSheetSize.Width = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) );
+ maEmuSheetSize.Height = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) );
}
// oox.core.ContextHandler2Helper interface -----------------------------------
@@ -481,7 +465,7 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
return new GraphicShapeContext( *this, ShapePtr(), mxShape );
case XDR_TOKEN( graphicFrame ):
mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
- return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape );
+ return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, getSheetType() != SHEETTYPE_CHARTSHEET );
case XDR_TOKEN( grpSp ):
mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
return new ShapeGroupContext( *this, ShapePtr(), mxShape );
@@ -526,7 +510,7 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
{
Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuSheetSize );
if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
- mxShape->addShape( getOoxFilter(), getThemeRef(), mxDrawPage, &aLoc );
+ mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aLoc );
}
mxShape.reset();
mxAnchor.reset();
diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx
index 8f6fb872e71e..93ad0a65422f 100644
--- a/oox/source/xls/workbookhelper.cxx
+++ b/oox/source/xls/workbookhelper.cxx
@@ -317,8 +317,6 @@ public:
inline WorksheetBuffer& getWorksheets() const { return *mxWorksheets; }
/** Returns the office theme object read from the theme substorage. */
inline ThemeBuffer& getTheme() const { return *mxTheme; }
- /** Returns the office theme object reference read from the theme substorage. */
- inline ::boost::shared_ptr< Theme > getThemeRef() const { return mxTheme; }
/** Returns all cell formatting objects read from the styles substream. */
inline StylesBuffer& getStyles() const { return *mxStyles; }
/** Returns the shared strings read from the shared strings substream. */
@@ -961,11 +959,6 @@ ThemeBuffer& WorkbookHelper::getTheme() const
return mrBookData.getTheme();
}
-::boost::shared_ptr< Theme > WorkbookHelper::getThemeRef() const
-{
- return mrBookData.getThemeRef();
-}
-
StylesBuffer& WorkbookHelper::getStyles() const
{
return mrBookData.getStyles();
diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk
new file mode 100644
index 000000000000..054f98233389
--- /dev/null
+++ b/postprocess/packregistry/makefile.mk
@@ -0,0 +1,531 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+PRJ = ..
+PRJNAME = postprocess
+TARGET = packregistry
+
+MY_XCS = $(SOLARXMLDIR)/registry/schema/org/openoffice
+MY_XCU = $(SOLARXMLDIR)/registry/data/org/openoffice
+MY_MOD = $(SOLARXMLDIR)/registry/spool
+
+MY_XCDS = \
+ $(MISC)/base.xcd \
+ $(MISC)/brand.xcd \
+ $(MISC)/calc.xcd \
+ $(MISC)/cjk.xcd \
+ $(MISC)/ctl.xcd \
+ $(MISC)/draw.xcd \
+ $(MISC)/graphicfilter.xcd \
+ $(MISC)/impress.xcd \
+ $(MISC)/korea.xcd \
+ $(MISC)/lingucomponent.xcd \
+ $(MISC)/main.xcd \
+ $(MISC)/math.xcd \
+ $(MISC)/onlineupdate.xcd \
+ $(MISC)/oooimprovement.xcd \
+ $(MISC)/palm.xcd \
+ $(MISC)/pocketexcel.xcd \
+ $(MISC)/pocketword.xcd \
+ $(MISC)/pyuno.xcd \
+ $(MISC)/w4w.xcd \
+ $(MISC)/writer.xcd \
+ $(MISC)/xsltfilter.xcd
+
+MY_DEPS_base = main
+MY_FILES_base = \
+ $(MY_MOD)/fcfg_database_filters.xcu \
+ $(MY_MOD)/fcfg_database_others.xcu \
+ $(MY_MOD)/fcfg_database_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-base.xcu \
+ $(MY_MOD)/org/openoffice/Setup-base.xcu
+
+MY_FILES_brand = \
+ $(MY_XCU)/Office/Compatibility.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-brand.xcu \
+ $(MY_MOD)/org/openoffice/Office/UI-brand.xcu \
+ $(MY_MOD)/org/openoffice/Setup-brand.xcu
+.IF "$(ENABLE_SVCTAGS)" == "YES"
+MY_FILES_brand += \
+ $(MY_MOD)/org/openoffice/Office/Jobs/Jobs-registration.xcu
+.END
+
+MY_DEPS_calc = main
+MY_FILES_calc = \
+ $(MY_XCS)/Office/UI/CalcCommands.xcs \
+ $(MY_XCS)/Office/UI/CalcWindowState.xcs \
+ $(MY_XCU)/Office/UI/CalcCommands.xcu \
+ $(MY_XCU)/Office/UI/CalcWindowState.xcu \
+ $(MY_MOD)/DataAccess/calc.xcu \
+ $(MY_MOD)/fcfg_calc_filters.xcu \
+ $(MY_MOD)/fcfg_calc_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-calc.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-calc.xcu \
+ $(MY_MOD)/org/openoffice/Setup-calc.xcu
+
+MY_FILES_cjk = \
+ $(MY_MOD)/org/openoffice/Office/Common-cjk.xcu \
+ $(MY_MOD)/org/openoffice/Office/Writer-cjk.xcu
+
+MY_DEPS_ctl = main
+MY_FILES_ctl = \
+ $(MY_MOD)/org/openoffice/Office/Common-ctl.xcu
+
+MY_DEPS_draw = main
+MY_FILES_draw = \
+ $(MY_XCS)/Office/UI/DrawWindowState.xcs \
+ $(MY_XCU)/Office/UI/DrawWindowState.xcu \
+ $(MY_MOD)/fcfg_draw_filters.xcu \
+ $(MY_MOD)/fcfg_draw_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-draw.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-draw.xcu \
+ $(MY_MOD)/org/openoffice/Setup-draw.xcu
+
+MY_DEPS_graphicfilter = main
+MY_FILES_graphicfilter = \
+ $(MY_MOD)/fcfg_drawgraphics_filters.xcu \
+ $(MY_MOD)/fcfg_drawgraphics_types.xcu \
+ $(MY_MOD)/fcfg_impressgraphics_filters.xcu \
+ $(MY_MOD)/fcfg_impressgraphics_types.xcu
+
+MY_DEPS_impress = main
+MY_FILES_impress = \
+ $(MY_XCS)/Office/UI/Effects.xcs \
+ $(MY_XCS)/Office/UI/ImpressWindowState.xcs \
+ $(MY_XCU)/Office/UI/Effects.xcu \
+ $(MY_XCU)/Office/UI/ImpressWindowState.xcu \
+ $(MY_MOD)/fcfg_impress_filters.xcu \
+ $(MY_MOD)/fcfg_impress_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-impress.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-impress.xcu \
+ $(MY_MOD)/org/openoffice/Setup-impress.xcu
+
+MY_FILES_korea = \
+ $(MY_MOD)/org/openoffice/Office/Common-korea.xcu
+
+MY_DEPS_lingucomponent = main
+MY_FILES_lingucomponent = \
+ $(MY_XCU)/Office/Linguistic-lingucomponent-hyphenator.xcu \
+ $(MY_XCU)/Office/Linguistic-lingucomponent-spellchecker.xcu \
+ $(MY_XCU)/Office/Linguistic-lingucomponent-thesaurus.xcu \
+
+MY_FILES_main = \
+ $(MY_XCS)/FirstStartWizard.xcs \
+ $(MY_XCS)/Inet.xcs \
+ $(MY_XCS)/LDAP.xcs \
+ $(MY_XCS)/Office/Accelerators.xcs \
+ $(MY_XCS)/Office/Addons.xcs \
+ $(MY_XCS)/Office/Calc.xcs \
+ $(MY_XCS)/Office/CalcAddIns.xcs \
+ $(MY_XCS)/Office/Canvas.xcs \
+ $(MY_XCS)/Office/Chart.xcs \
+ $(MY_XCS)/Office/Commands.xcs \
+ $(MY_XCS)/Office/Common.xcs \
+ $(MY_XCS)/Office/Compatibility.xcs \
+ $(MY_XCS)/Office/DataAccess/Drivers.xcs \
+ $(MY_XCS)/Office/DataAccess.xcs \
+ $(MY_XCS)/Office/Draw.xcs \
+ $(MY_XCS)/Office/Embedding.xcs \
+ $(MY_XCS)/Office/Events.xcs \
+ $(MY_XCS)/Office/ExtendedColorScheme.xcs \
+ $(MY_XCS)/Office/ExtensionManager.xcs \
+ $(MY_XCS)/Office/FormWizard.xcs \
+ $(MY_XCS)/Office/Histories.xcs \
+ $(MY_XCS)/Office/Impress.xcs \
+ $(MY_XCS)/Office/Java.xcs \
+ $(MY_XCS)/Office/Jobs.xcs \
+ $(MY_XCS)/Office/Labels.xcs \
+ $(MY_XCS)/Office/Linguistic.xcs \
+ $(MY_XCS)/Office/Logging.xcs \
+ $(MY_XCS)/Office/Math.xcs \
+ $(MY_XCS)/Office/OOoImprovement/Settings.xcs \
+ $(MY_XCS)/Office/OptionsDialog.xcs \
+ $(MY_XCS)/Office/Paths.xcs \
+ $(MY_XCS)/Office/ProtocolHandler.xcs \
+ $(MY_XCS)/Office/Recovery.xcs \
+ $(MY_XCS)/Office/SFX.xcs \
+ $(MY_XCS)/Office/Scripting.xcs \
+ $(MY_XCS)/Office/Security.xcs \
+ $(MY_XCS)/Office/Substitution.xcs \
+ $(MY_XCS)/Office/TabBrowse.xcs \
+ $(MY_XCS)/Office/TableWizard.xcs \
+ $(MY_XCS)/Office/TypeDetection.xcs \
+ $(MY_XCS)/Office/UI/BaseWindowState.xcs \
+ $(MY_XCS)/Office/UI/BasicIDECommands.xcs \
+ $(MY_XCS)/Office/UI/BasicIDEWindowState.xcs \
+ $(MY_XCS)/Office/UI/BibliographyCommands.xcs \
+ $(MY_XCS)/Office/UI/BibliographyWindowState.xcs \
+ $(MY_XCS)/Office/UI/Category.xcs \
+ $(MY_XCS)/Office/UI/ChartCommands.xcs \
+ $(MY_XCS)/Office/UI/ChartWindowState.xcs \
+ $(MY_XCS)/Office/UI/Commands.xcs \
+ $(MY_XCS)/Office/UI/Controller.xcs \
+ $(MY_XCS)/Office/UI/DbBrowserWindowState.xcs \
+ $(MY_XCS)/Office/UI/DbQueryWindowState.xcs \
+ $(MY_XCS)/Office/UI/DbRelationWindowState.xcs \
+ $(MY_XCS)/Office/UI/DbTableDataWindowState.xcs \
+ $(MY_XCS)/Office/UI/DbTableWindowState.xcs \
+ $(MY_XCS)/Office/UI/DbuCommands.xcs \
+ $(MY_XCS)/Office/UI/DrawImpressCommands.xcs \
+ $(MY_XCS)/Office/UI/Factories.xcs \
+ $(MY_XCS)/Office/UI/GenericCategories.xcs \
+ $(MY_XCS)/Office/UI/GenericCommands.xcs \
+ $(MY_XCS)/Office/UI/GlobalSettings.xcs \
+ $(MY_XCS)/Office/UI/StartModuleCommands.xcs \
+ $(MY_XCS)/Office/UI/StartModuleWindowState.xcs \
+ $(MY_XCS)/Office/UI/WindowContentFactories.xcs \
+ $(MY_XCS)/Office/UI/WindowState.xcs \
+ $(MY_XCS)/Office/UI.xcs \
+ $(MY_XCS)/Office/Views.xcs \
+ $(MY_XCS)/Office/WebWizard.xcs \
+ $(MY_XCS)/Office/Writer.xcs \
+ $(MY_XCS)/Office/WriterWeb.xcs \
+ $(MY_XCS)/Setup.xcs \
+ $(MY_XCS)/System.xcs \
+ $(MY_XCS)/TypeDetection/Filter.xcs \
+ $(MY_XCS)/TypeDetection/GraphicFilter.xcs \
+ $(MY_XCS)/TypeDetection/Misc.xcs \
+ $(MY_XCS)/TypeDetection/Types.xcs \
+ $(MY_XCS)/TypeDetection/UISort.xcs \
+ $(MY_XCS)/UserProfile.xcs \
+ $(MY_XCS)/VCL.xcs \
+ $(MY_XCS)/ucb/Configuration.xcs \
+ $(MY_XCS)/ucb/Hierarchy.xcs \
+ $(MY_XCS)/ucb/InteractionHandler.xcs \
+ $(MY_XCS)/ucb/Store.xcs \
+ $(MY_XCU)/FirstStartWizard.xcu \
+ $(MY_XCU)/Inet.xcu \
+ $(MY_XCU)/Office/Accelerators.xcu \
+ $(MY_XCU)/Office/Calc.xcu \
+ $(MY_XCU)/Office/Canvas.xcu \
+ $(MY_XCU)/Office/Common.xcu \
+ $(MY_XCU)/Office/DataAccess.xcu \
+ $(MY_XCU)/Office/Embedding.xcu \
+ $(MY_XCU)/Office/ExtensionManager.xcu \
+ $(MY_XCU)/Office/FormWizard.xcu \
+ $(MY_XCU)/Office/Histories.xcu \
+ $(MY_XCU)/Office/Impress.xcu \
+ $(MY_XCU)/Office/Jobs.xcu \
+ $(MY_XCU)/Office/Labels.xcu \
+ $(MY_XCU)/Office/Logging.xcu \
+ $(MY_XCU)/Office/Math.xcu \
+ $(MY_XCU)/Office/Paths.xcu \
+ $(MY_XCU)/Office/ProtocolHandler.xcu \
+ $(MY_XCU)/Office/SFX.xcu \
+ $(MY_XCU)/Office/Scripting.xcu \
+ $(MY_XCU)/Office/Security.xcu \
+ $(MY_XCU)/Office/TableWizard.xcu \
+ $(MY_XCU)/Office/UI/BaseWindowState.xcu \
+ $(MY_XCU)/Office/UI/BasicIDECommands.xcu \
+ $(MY_XCU)/Office/UI/BasicIDEWindowState.xcu \
+ $(MY_XCU)/Office/UI/BibliographyCommands.xcu \
+ $(MY_XCU)/Office/UI/ChartCommands.xcu \
+ $(MY_XCU)/Office/UI/ChartWindowState.xcu \
+ $(MY_XCU)/Office/UI/Controller.xcu \
+ $(MY_XCU)/Office/UI/DbBrowserWindowState.xcu \
+ $(MY_XCU)/Office/UI/DbQueryWindowState.xcu \
+ $(MY_XCU)/Office/UI/DbRelationWindowState.xcu \
+ $(MY_XCU)/Office/UI/DbTableDataWindowState.xcu \
+ $(MY_XCU)/Office/UI/DbTableWindowState.xcu \
+ $(MY_XCU)/Office/UI/DbuCommands.xcu \
+ $(MY_XCU)/Office/UI/DrawImpressCommands.xcu \
+ $(MY_XCU)/Office/UI/Factories.xcu \
+ $(MY_XCU)/Office/UI/GenericCategories.xcu \
+ $(MY_XCU)/Office/UI/GenericCommands.xcu \
+ $(MY_XCU)/Office/UI/StartModuleCommands.xcu \
+ $(MY_XCU)/Office/UI/StartModuleWindowState.xcu \
+ $(MY_XCU)/Office/UI.xcu \
+ $(MY_XCU)/Office/Views.xcu \
+ $(MY_XCU)/Office/WebWizard.xcu \
+ $(MY_XCU)/Office/Writer.xcu \
+ $(MY_XCU)/Setup.xcu \
+ $(MY_XCU)/System.xcu \
+ $(MY_XCU)/TypeDetection/UISort.xcu \
+ $(MY_XCU)/UserProfile.xcu \
+ $(MY_XCU)/VCL.xcu \
+ $(MY_XCU)/ucb/Configuration.xcu \
+ $(MY_MOD)/DataAccess/dbase.xcu \
+ $(MY_MOD)/DataAccess/flat.xcu \
+ $(MY_MOD)/DataAccess/mysql.xcu \
+ $(MY_MOD)/DataAccess/odbc.xcu \
+ $(MY_MOD)/fcfg_base_filters.xcu \
+ $(MY_MOD)/fcfg_base_others.xcu \
+ $(MY_MOD)/fcfg_base_types.xcu \
+ $(MY_MOD)/fcfg_chart_filters.xcu \
+ $(MY_MOD)/fcfg_chart_others.xcu \
+ $(MY_MOD)/fcfg_chart_types.xcu \
+ $(MY_MOD)/fcfg_internalgraphics_filters.xcu \
+ $(MY_MOD)/fcfg_internalgraphics_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-chart.xcu \
+ $(MY_MOD)/org/openoffice/Office/Writer-javamail.xcu \
+ $(MY_MOD)/org/openoffice/Setup-start.xcu \
+ $(MY_MOD)/org/openoffice/TypeDetection/UISort-calc.xcu \
+ $(MY_MOD)/org/openoffice/TypeDetection/UISort-draw.xcu \
+ $(MY_MOD)/org/openoffice/TypeDetection/UISort-impress.xcu \
+ $(MY_MOD)/org/openoffice/TypeDetection/UISort-math.xcu \
+ $(MY_MOD)/org/openoffice/TypeDetection/UISort-writer.xcu
+.IF "$(GUIBASE)" == "aqua"
+MY_FILES_main += \
+ $(MY_MOD)/DataAccess/macab.xcu \
+ $(MY_MOD)/org/openoffice/Inet-macosx.xcu \
+ $(MY_MOD)/org/openoffice/Office/Accelerators-macosx.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-macosx.xcu \
+ $(MY_MOD)/org/openoffice/Office/Paths-macosx.xcu
+ # Inet-macosx.xcu must come after Inet.xcu
+.ELIF "$(GUIBASE)" == "unx"
+MY_FILES_main += \
+ $(MY_MOD)/org/openoffice/Inet-unixdesktop.xcu \
+ $(MY_MOD)/org/openoffice/Office/Accelerators-unxwnt.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-UseOOoFileDialogs.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-unixdesktop.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-unx.xcu \
+ $(MY_MOD)/org/openoffice/Office/Paths-unixdesktop.xcu \
+ $(MY_MOD)/org/openoffice/Office/Paths-unxwnt.xcu \
+ $(MY_MOD)/org/openoffice/VCL-unixdesktop.xcu
+ # Inet-unixdesktop.xcu must come after Inet.xcu
+ # VCL-unixdesktop.xcu must come after VCL.xcu
+.ELIF "$(GUIBASE)" == "WIN"
+MY_FILES_main += \
+ $(MY_MOD)/DataAccess/ado.xcu \
+ $(MY_MOD)/org/openoffice/Inet-wnt.xcu \
+ $(MY_MOD)/org/openoffice/Office/Accelerators-unxwnt.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-wnt.xcu \
+ $(MY_MOD)/org/openoffice/Office/Linguistic-ForceDefaultLanguage.xcu \
+ $(MY_MOD)/org/openoffice/Office/Paths-unxwnt.xcu
+ # Inet-wnt.xcu must come after Inet.xcu
+.ELSE
+ERROR : unknown-GUIBASE
+.END
+.IF "$(OS)" == "WNT" || "$(OS)" == "LINUX" || \
+ ("$(OS)" == "SOLARIS" && "$(CPU)" == "S") || "$(OS)" == "NETBSD"
+MY_FILES_main += $(MY_MOD)/DataAccess/adabas.xcu
+.END
+.IF "$(ENABLE_EVOAB2)" == "TRUE"
+MY_FILES_main += $(MY_MOD)/DataAccess/evoab2.xcu
+.END
+.IF "$(SOLAR_JAVA)" == "TRUE"
+MY_FILES_main += \
+ $(MY_MOD)/DataAccess/hsqldb.xcu \
+ $(MY_MOD)/DataAccess/jdbc.xcu
+.END
+.IF "$(ENABLE_KAB)" == "TRUE"
+MY_FILES_main += $(MY_MOD)/DataAccess/kab.xcu
+.END
+.IF "$(SYSTEM_MOZILLA)" != "YES" && "$(WITH_MOZILLA)" != "NO" && \
+ "$(OS)" != "MACOSX"
+.IF "$(OS)" == "WNT"
+MY_FILES_main += $(MY_MOD)/DataAccess/mozab.xcu
+.ELSE
+MY_FILES_main += $(MY_MOD)/DataAccess/mozab2.xcu
+.END
+.END
+
+MY_DEPS_math = main
+MY_FILES_math = \
+ $(MY_XCS)/Office/UI/MathCommands.xcs \
+ $(MY_XCS)/Office/UI/MathWindowState.xcs \
+ $(MY_XCU)/Office/UI/MathCommands.xcu \
+ $(MY_XCU)/Office/UI/MathWindowState.xcu \
+ $(MY_MOD)/fcfg_math_filters.xcu \
+ $(MY_MOD)/fcfg_math_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-math.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-math.xcu \
+ $(MY_MOD)/org/openoffice/Setup-math.xcu
+
+MY_DEPS_onlineupdate = main
+MY_FILES_onlineupdate = \
+ $(MY_MOD)/org/openoffice/Office/Addons/Addons-onlineupdate.xcu \
+ $(MY_MOD)/org/openoffice/Office/Jobs/Jobs-onlineupdate.xcu
+
+MY_DEPS_oooimprovement = main
+MY_FILES_oooimprovement = \
+ $(MY_MOD)/org/openoffice/Office/Jobs/Jobs-oooimprovement.xcu \
+ $(MY_MOD)/org/openoffice/Office/Logging/Logging-oooimprovement.xcu
+
+MY_DEPS_palm = main
+MY_FILES_palm = \
+ $(MY_MOD)/fcfg_palm_filters.xcu \
+ $(MY_MOD)/fcfg_palm_types.xcu
+
+MY_DEPS_pocketexcel = main
+MY_FILES_pocketexcel = \
+ $(MY_MOD)/fcfg_pocketexcel_filters.xcu \
+ $(MY_MOD)/fcfg_pocketexcel_types.xcu
+
+MY_DEPS_pocketword = main
+MY_FILES_pocketword = \
+ $(MY_MOD)/fcfg_pocketword_filters.xcu \
+ $(MY_MOD)/fcfg_pocketword_types.xcu
+
+MY_DEPS_pyuno = main
+MY_FILES_pyuno = \
+ $(MY_MOD)/org/openoffice/Office/Scripting-python.xcu
+
+MY_DEPS_w4w = main
+MY_FILES_w4w = \
+ $(MY_MOD)/fcfg_w4w_filters.xcu \
+ $(MY_MOD)/fcfg_w4w_types.xcu
+
+MY_DEPS_writer = main
+MY_FILES_writer = \
+ $(MY_XCS)/Office/UI/WriterCommands.xcs \
+ $(MY_XCS)/Office/UI/WriterFormWindowState.xcs \
+ $(MY_XCS)/Office/UI/WriterGlobalWindowState.xcs \
+ $(MY_XCS)/Office/UI/WriterReportWindowState.xcs \
+ $(MY_XCS)/Office/UI/WriterWebWindowState.xcs \
+ $(MY_XCS)/Office/UI/WriterWindowState.xcs \
+ $(MY_XCS)/Office/UI/XFormsWindowState.xcs \
+ $(MY_XCU)/Office/UI/WriterCommands.xcu \
+ $(MY_XCU)/Office/UI/WriterFormWindowState.xcu \
+ $(MY_XCU)/Office/UI/WriterGlobalWindowState.xcu \
+ $(MY_XCU)/Office/UI/WriterReportWindowState.xcu \
+ $(MY_XCU)/Office/UI/WriterWebWindowState.xcu \
+ $(MY_XCU)/Office/UI/WriterWindowState.xcu \
+ $(MY_XCU)/Office/UI/XFormsWindowState.xcu \
+ $(MY_MOD)/fcfg_global_filters.xcu \
+ $(MY_MOD)/fcfg_global_types.xcu \
+ $(MY_MOD)/fcfg_web_filters.xcu \
+ $(MY_MOD)/fcfg_web_types.xcu \
+ $(MY_MOD)/fcfg_writer_filters.xcu \
+ $(MY_MOD)/fcfg_writer_types.xcu \
+ $(MY_MOD)/org/openoffice/Office/Common-writer.xcu \
+ $(MY_MOD)/org/openoffice/Office/Embedding-writer.xcu \
+ $(MY_MOD)/org/openoffice/Setup-writer.xcu
+
+MY_DEPS_xsltfilter = main
+MY_FILES_xsltfilter = \
+ $(MY_MOD)/fcfg_xslt_filters.xcu \
+ $(MY_MOD)/fcfg_xslt_types.xcu
+
+.IF "$(WITH_BINFILTER)" != "NO"
+MY_XCDS += $(MISC)/binfilter.xcd
+MY_DEPS_binfilter = main
+MY_FILES_binfilter = \
+ $(MY_MOD)/fcfg_chart_bf_filters.xcu \
+ $(MY_MOD)/fcfg_chart_bf_types.xcu \
+ $(MY_MOD)/fcfg_calc_bf_filters.xcu \
+ $(MY_MOD)/fcfg_calc_bf_types.xcu \
+ $(MY_MOD)/fcfg_draw_bf_filters.xcu \
+ $(MY_MOD)/fcfg_draw_bf_types.xcu \
+ $(MY_MOD)/fcfg_global_bf_filters.xcu \
+ $(MY_MOD)/fcfg_global_bf_types.xcu \
+ $(MY_MOD)/fcfg_impress_bf_filters.xcu \
+ $(MY_MOD)/fcfg_impress_bf_types.xcu \
+ $(MY_MOD)/fcfg_math_bf_filters.xcu \
+ $(MY_MOD)/fcfg_math_bf_types.xcu \
+ $(MY_MOD)/fcfg_web_bf_filters.xcu \
+ $(MY_MOD)/fcfg_web_bf_types.xcu \
+ $(MY_MOD)/fcfg_writer_bf_filters.xcu \
+ $(MY_MOD)/fcfg_writer_bf_types.xcu
+.END
+
+.IF "$(GUIBASE)" == "unx" && \
+ (("$(ENABLE_GCONF)" == "TRUE" && "$(ENABLE_LOCKDOWN)" == "YES") || \
+ "$(ENABLE_GIO)" == "TRUE")
+MY_XCDS += $(MISC)/gnome.xcd
+MY_DEPS_gnome = main
+.IF "$(ENABLE_GCONF)" == "TRUE" && "$(ENABLE_LOCKDOWN)" == "YES"
+MY_FILES_gnome += \
+ $(MY_MOD)/org/openoffice/Office/Common-gconflockdown.xcu \
+ $(MY_MOD)/org/openoffice/Office/Recovery-gconflockdown.xcu \
+ $(MY_MOD)/org/openoffice/UserProfile-gconflockdown.xcu \
+ $(MY_MOD)/org/openoffice/VCL-gconflockdown.xcu
+.END
+.IF "$(ENABLE_GIO)" == "TRUE"
+MY_FILES_gnome += \
+ $(MY_MOD)/org/openoffice/ucb/Configuration-gio.xcu
+.END
+.END
+
+.IF "$(ENABLE_OPENGL)" == "TRUE"
+MY_XCDS += $(MISC)/ogltrans.xcd
+MY_DEPS_ogltrans = main
+MY_FILES_ogltrans = \
+ $(MY_MOD)/org/openoffice/Office/Impress-ogltrans.xcu
+.END
+
+.INCLUDE : settings.mk
+.INCLUDE : target.mk
+
+ALLTAR : \
+ $(MY_XCDS) \
+ $(MISC)/lang/Langpack-{$(alllangiso)}.xcd \
+ $(MISC)/lang/fcfg_langpack_{$(alllangiso)}.xcd \
+ $(MISC)/lang/registry_{$(alllangiso)}.xcd
+
+{$(MY_XCDS)} : $$(MY_FILES_$$(@:b))
+
+$(MISC)/%.xcd .ERRREMOVE : $(MISC)/%.list
+ $(XSLTPROC) --nonet -o $@ $(SOLARENV)/bin/packregistry.xslt $<
+
+$(MISC)/%.list : makefile.mk
+ - $(RM) $@
+ echo '<list>' $(foreach,i,$(MY_DEPS_$(@:b)) '<dependency file="$i"/>') \
+ $(foreach,i,$(MY_FILES_$(@:b)) '<filename>$i</filename>') '</list>' > $@
+
+$(MISC)/lang/Langpack-{$(alllangiso)}.xcd : $(MY_MOD)/$$(@:b).xcu
+
+$(MISC)/lang/Langpack-%.xcd .ERRREMOVE :
+ $(MKDIRHIER) $(@:d)
+ - $(RM) $(MISC)/$(@:b).list
+ echo '<list><dependency file="main"/>\
+ <filename>$(MY_MOD)/$(@:b).xcu</filename></list>' > $(MISC)/$(@:b).list
+ $(XSLTPROC) --nonet -o $@ $(SOLARENV)/bin/packregistry.xslt \
+ $(MISC)/$(@:b).list
+
+$(MISC)/lang/fcfg_langpack_{$(alllangiso)}.xcd : $(SOLARPCKDIR)/$$(@:b).zip
+
+$(MISC)/lang/fcfg_langpack_%.xcd .ERRREMOVE :
+ $(MKDIRHIER) $(@:d)
+ rm -rf $(MISC)/$(@:b).unzip
+ mkdir $(MISC)/$(@:b).unzip
+ cd $(MISC)/$(@:b).unzip && unzip $(SOLARPCKDIR)/$(@:b).zip
+ - $(RM) $(MISC)/$(@:b).list
+ echo '<list>' $(foreach,i,$(shell cd $(MISC) && \
+ find $(@:b).unzip -name \*.xcu -print) \
+ '<filename>$i</filename>') '</list>' > $(MISC)/$(@:b).list
+ $(XSLTPROC) --nonet -o $@ $(SOLARENV)/bin/packregistry.xslt \
+ $(MISC)/$(@:b).list
+
+$(MISC)/lang/registry_{$(alllangiso)}.xcd : $(SOLARPCKDIR)/$$(@:b).zip \
+ $(SOLARPCKDIR)/fcfg_drivers_$$(@:b:s/registry_//).zip
+
+$(MISC)/lang/registry_%.xcd .ERRREMOVE :
+ $(MKDIRHIER) $(@:d)
+ rm -rf $(MISC)/$(@:b).unzip
+ mkdir $(MISC)/$(@:b).unzip
+ cd $(MISC)/$(@:b).unzip && unzip $(SOLARPCKDIR)/$(@:b).zip
+ rm -rf $(MISC)/fcfg_drivers_$*.unzip
+ mkdir $(MISC)/fcfg_drivers_$*.unzip
+ cd $(MISC)/fcfg_drivers_$*.unzip && \
+ unzip $(SOLARPCKDIR)/fcfg_drivers_$*.zip
+ - $(RM) $(MISC)/$(@:b).list
+ echo '<list>' $(foreach,i,$(shell cd $(MISC) && \
+ find $(@:b).unzip fcfg_drivers_$*.unzip -name \*.xcu -print) \
+ '<filename>$i</filename>') '</list>' > $(MISC)/$(@:b).list
+ $(XSLTPROC) --nonet -o $@ $(SOLARENV)/bin/packregistry.xslt \
+ $(MISC)/$(@:b).list
diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst
index e025835b6b69..4c30df96f2c6 100644
--- a/postprocess/prj/build.lst
+++ b/postprocess/prj/build.lst
@@ -3,5 +3,6 @@ po postprocess usr1 - all po_mkout NULL
po postprocess\checkxml nmake - all po_checkxml NULL
po postprocess\checkdeliver nmake - all po_checkdlv NULL
po postprocess\packconfig nmake - all po_packconfig po_checkxml NULL
+po postprocess\packregistry nmake - all po_packregistry NULL
po postprocess\rebase nmake - w po_rebase NULL
po postprocess\signing nmake - w,sign po_signing po_rebase.w NULL
diff --git a/postprocess/prj/d.lst b/postprocess/prj/d.lst
index afd5d3b86b1c..fd8a49d4f8a0 100644
--- a/postprocess/prj/d.lst
+++ b/postprocess/prj/d.lst
@@ -1,2 +1,3 @@
..\%__SRC%\bin\uiconfig.zip %_DEST%\bin%_EXT%\uiconfig.zip
-
+..\%__SRC%\misc\*.xcd %_DEST%\xml%_EXT%\
+..\%__SRC%\misc\lang\*.xcd %_DEST%\xml%_EXT%\
diff --git a/qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.ConfigurationProvider.csv b/qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.ConfigurationProvider.csv
new file mode 100644
index 000000000000..4a56a474016c
--- /dev/null
+++ b/qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.ConfigurationProvider.csv
@@ -0,0 +1,45 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+# In addition to the interfaces of css.configuration.ConfigurationProvider also
+# test the additional, optional (but implemented) interfaces of
+# css.configuration.DefaultProvider:
+
+"ConfigurationProvider";"com::sun::star::lang::XComponent";"addEventListener()"
+"ConfigurationProvider";"com::sun::star::lang::XComponent";"dispose()"
+"ConfigurationProvider";"com::sun::star::lang::XComponent";"removeEventListener()"
+"ConfigurationProvider";"com::sun::star::lang::XLocalizable";"getLocale()"
+"ConfigurationProvider";"com::sun::star::lang::XLocalizable";"setLocale()"
+"ConfigurationProvider";"com::sun::star::lang::XMultiServiceFactory";"createInstance()"
+"ConfigurationProvider";"com::sun::star::lang::XMultiServiceFactory";"createInstanceWithArguments()"
+"ConfigurationProvider";"com::sun::star::lang::XMultiServiceFactory";"getAvailableServiceNames()"
+"ConfigurationProvider";"com::sun::star::util::XFlushable";"addFlushListener()"
+"ConfigurationProvider";"com::sun::star::util::XFlushable";"flush()"
+"ConfigurationProvider";"com::sun::star::util::XFlushable";"removeFlushListener()"
+"ConfigurationProvider";"com::sun::star::util::XRefreshable";"addRefreshListener()"
+"ConfigurationProvider";"com::sun::star::util::XRefreshable";"refresh()"
+"ConfigurationProvider";"com::sun::star::util::XRefreshable";"removeRefreshListener()"
diff --git a/configmgr/source/api/makefile.mk b/qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.DefaultProvider.csv
index eb3f348bbb5e..fb668750f670 100644
--- a/configmgr/source/api/makefile.mk
+++ b/qadevOOo/objdsc/configmgr/com.sun.star.comp.configuration.DefaultProvider.csv
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,27 +23,11 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=api
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/confevents.obj \
- $(SLO)$/confsvccomponent.obj
-
-# --- Targets ----------------------------------
+#***********************************************************************/
-.INCLUDE : target.mk
+# Only test non-modifying functionality of css.configuration.DefaultProvider:
+"DefaultProvider";"com::sun::star::lang::XLocalizable";"getLocale()"
+"DefaultProvider";"com::sun::star::lang::XMultiServiceFactory";"createInstance()"
+"DefaultProvider";"com::sun::star::lang::XMultiServiceFactory";"createInstanceWithArguments()"
+"DefaultProvider";"com::sun::star::lang::XMultiServiceFactory";"getAvailableServiceNames()"
diff --git a/qadevOOo/runner/base/basic_fat.java b/qadevOOo/runner/base/basic_fat.java
index cfb19d0b1edd..74a6708cf801 100644
--- a/qadevOOo/runner/base/basic_fat.java
+++ b/qadevOOo/runner/base/basic_fat.java
@@ -26,7 +26,6 @@
************************************************************************/
package base;
-import base.TestBase;
import basicrunner.BasicIfcTest;
import basicrunner.BasicTestCase;
@@ -69,7 +68,7 @@ public class basic_fat implements TestBase
/**
* Execute a test.
* @param param The test parameters.
- * @param return True, if the test was executed.
+ * @return True, if the test was executed.
*/
public boolean executeTest(TestParameters param)
{
diff --git a/qadevOOo/runner/base/java_cmp.java b/qadevOOo/runner/base/java_cmp.java
index 1c37b5e16724..c25de6efc4a9 100644
--- a/qadevOOo/runner/base/java_cmp.java
+++ b/qadevOOo/runner/base/java_cmp.java
@@ -28,11 +28,6 @@
package base;
-import com.sun.star.uno.UnoRuntime;
-
-import helper.APIDescGetter;
-import helper.AppProvider;
-import base.TestBase;
/**
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java
index b330e1c597fc..1d75c48ed43e 100644
--- a/qadevOOo/runner/base/java_fat.java
+++ b/qadevOOo/runner/base/java_fat.java
@@ -59,43 +59,43 @@ import util.DynamicClassLoader;
public class java_fat implements TestBase
{
- private static boolean debug = false;
+ private static boolean m_isDebug = false;
private static boolean keepdocument = false;
private static boolean logging = true;
private static boolean newOffice = false;
- private DynamicClassLoader dcl = null;
+ private DynamicClassLoader m_aDynamicClassLoader = null;
private lib.TestParameters m_aParams;
private AppProvider m_aOffice;
- public boolean executeTest(lib.TestParameters param)
+ public boolean executeTest(lib.TestParameters _aParams)
{
- m_aParams = param;
+ m_aParams = _aParams;
- dcl = new DynamicClassLoader();
+ m_aDynamicClassLoader = new DynamicClassLoader();
DescGetter dg = new APIDescGetter();
- String job = (String) param.get("TestJob");
- String ExclusionFile = (String) param.get("ExclusionList");
+ String job = (String) m_aParams.get("TestJob");
+ String ExclusionFile = (String) m_aParams.get("ExclusionList");
Vector exclusions = null;
boolean retValue = true;
- debug = param.getBool("DebugIsActive");
- logging = param.getBool("LoggingIsActive");
- keepdocument = param.getBool("KeepDocument");
- newOffice = param.getBool(util.PropertyName.NEW_OFFICE_INSTANCE);
+ m_isDebug = m_aParams.getBool("DebugIsActive");
+ logging = m_aParams.getBool("LoggingIsActive");
+ keepdocument = m_aParams.getBool("KeepDocument");
+ newOffice = m_aParams.getBool(util.PropertyName.NEW_OFFICE_INSTANCE);
if (keepdocument)
{
System.setProperty("KeepDocument", "true");
}
if (ExclusionFile != null)
{
- exclusions = getExclusionList(ExclusionFile, debug);
+ exclusions = getExclusionList(ExclusionFile, m_isDebug);
}
//get Job-Descriptions
- System.out.println("Getting Descriptions for Job: " + job);
+ // System.out.println("Getting Descriptions for Job: " + job);
- String sDescriptionPath = (String) param.get("DescriptionPath");
- DescEntry[] entries = dg.getDescriptionFor(job, sDescriptionPath, debug);
+ String sDescriptionPath = (String) m_aParams.get("DescriptionPath");
+ DescEntry[] entries = dg.getDescriptionFor(job, sDescriptionPath, m_isDebug);
// System.out.println();
@@ -106,8 +106,8 @@ public class java_fat implements TestBase
return false;
}
-// String officeProviderName = (String) param.get("OfficeProvider");
-// AppProvider office = (AppProvider) dcl.getInstance(officeProviderName);
+// String officeProviderName = (String) m_aParams.get("OfficeProvider");
+// AppProvider office = (AppProvider) m_aDynamicClassLoader.getInstance(officeProviderName);
//
// if (office == null) {
// System.out.println("ERROR: Wrong parameter 'OfficeProvider', " +
@@ -115,18 +115,22 @@ public class java_fat implements TestBase
// System.exit(-1);
// }
- m_aOffice = startOffice(param);
+ m_aOffice = startOffice(m_aParams);
boolean firstRun = true;
+ // Run through all entries (e.g. sw.SwXBookmark.*)
+
for (int l = 0; l < entries.length; l++)
{
- if (entries[l] == null)
+ DescEntry entry = entries[l];
+
+ if (entry == null)
{
continue;
}
- if (entries[l].hasErrorMsg)
+ if (entry.hasErrorMsg)
{
System.out.println(entries[l].ErrorMsg);
retValue = false;
@@ -135,145 +139,86 @@ public class java_fat implements TestBase
if (!firstRun && newOffice)
{
- if (!m_aOffice.closeExistingOffice(param, true))
+ if (!m_aOffice.closeExistingOffice(m_aParams, true))
{
- m_aOffice.disposeManager(param);
+ m_aOffice.disposeManager(m_aParams);
}
- startOffice(param);
+ startOffice(m_aParams);
}
firstRun = false;
-// XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
-// param);
-
- XMultiServiceFactory msf = (XMultiServiceFactory) param.getMSF();
+ XMultiServiceFactory msf = (XMultiServiceFactory) m_aParams.getMSF();
if (msf == null)
{
retValue = false;
-
continue;
}
-// param.put("ServiceFactory", msf);
-
- DescEntry entry = entries[l];
-
//get some helper classes
Summarizer sumIt = new Summarizer();
-
- TestCase tCase = null;
-
- try
- {
- tCase = (TestCase) dcl.getInstance("mod._" + entry.entryName);
- }
- catch (java.lang.IllegalArgumentException ie)
- {
- entry.ErrorMsg = ie.getMessage();
- entry.hasErrorMsg = true;
- }
- catch (java.lang.NoClassDefFoundError ie)
- {
- entry.ErrorMsg = ie.getMessage();
- entry.hasErrorMsg = true;
- }
-
+ TestCase tCase = getTestCase(entry);
if (tCase == null)
{
- Summarizer.summarizeDown(entry, entry.ErrorMsg);
-
- LogWriter sumObj = OutProducerFactory.createOutProducer(param);
- entry.UserDefinedParams = param;
- sumObj.initialize(entry, logging);
- sumObj.summary(entry);
-
continue;
}
- if (debug)
- {
- System.out.println("sleeping 5 seconds..");
- }
- util.utils.shortWait(5000);
+// if (m_isDebug)
+// {
+// System.out.println("sleeping 2 seconds..");
+// }
+ util.utils.shortWait(2000);
System.out.println("Creating: " + entry.entryName);
- LogWriter log = (LogWriter) dcl.getInstance((String) param.get("LogWriter"));
+ LogWriter log = (LogWriter) m_aDynamicClassLoader.getInstance((String) m_aParams.get("LogWriter"));
log.initialize(entry, logging);
- entry.UserDefinedParams = param;
-
- TestEnvironment tEnv = null;
+ entry.UserDefinedParams = m_aParams;
- try
- {
- tCase.setLogWriter((PrintWriter) log);
- tCase.initializeTestCase(param);
- tEnv = tCase.getTestEnvironment(param);
- }
- catch (Exception e)
- {
- System.out.println("Exception while creating " + tCase.getObjectName());
- System.out.println("Message " + e.getMessage());
- e.printStackTrace();
- tEnv = null;
- }
- catch (java.lang.UnsatisfiedLinkError e)
- {
- System.out.println("Exception while creating " + tCase.getObjectName());
- System.out.println("Message " + e.getMessage());
- tEnv = null;
- }
- catch (java.lang.NoClassDefFoundError e)
- {
- System.out.println("Exception while creating " + tCase.getObjectName());
- System.out.println("Message " + e.getMessage());
- tEnv = null;
- }
+ tCase.setLogWriter((PrintWriter) log);
+ tCase.initializeTestCase(m_aParams);
+ TestEnvironment tEnv = getTestEnvironment(tCase, entry);
if (tEnv == null)
{
- Summarizer.summarizeDown(entry, "Couldn't create " + tCase.getObjectName());
-
- LogWriter sumObj = OutProducerFactory.createOutProducer(param);
- entry.UserDefinedParams = param;
- sumObj.initialize(entry, logging);
- sumObj.summary(entry);
-
continue;
}
- System.out.println(tCase.getObjectName() + " recreated ");
+ final String sObjectName = tCase.getObjectName();
+ // System.out.println(sObjectName + " recreated ");
for (int j = 0; j < entry.SubEntryCount; j++)
{
DescEntry aSubEntry = entry.SubEntries[j];
- if (!aSubEntry.isToTest)
+ final boolean bIsToTest = aSubEntry.isToTest;
+ if (!bIsToTest)
{
Summarizer.summarizeDown(aSubEntry, "not part of the job");
-
continue;
}
- if ((exclusions != null) && (exclusions.contains(aSubEntry.longName)))
+ // final String sEntryName = aSubEntry.entryName;
+ final String sLongEntryName = aSubEntry.longName;
+
+ if ((exclusions != null) && (exclusions.contains(sLongEntryName)))
{
Summarizer.summarizeDown(aSubEntry, "known issue");
-
continue;
}
- System.out.println("running: '" + aSubEntry.entryName + "'");
+ // System.out.println("running: '" + sLongEntryName + "' testcode: [" + sEntryName + "]");
+ // this will shown in test itself
- LogWriter ifclog = (LogWriter) dcl.getInstance( (String) param.get("LogWriter"));
+ LogWriter ifclog = (LogWriter) m_aDynamicClassLoader.getInstance( (String) m_aParams.get("LogWriter"));
ifclog.initialize(aSubEntry, logging);
- aSubEntry.UserDefinedParams = param;
+ aSubEntry.UserDefinedParams = m_aParams;
aSubEntry.Logger = ifclog;
if ((tEnv == null) || tEnv.isDisposed())
{
closeExistingOffice();
- tEnv = getEnv(entry, param);
+ tEnv = getEnv(entry, m_aParams);
}
// MultiMethodTest ifc = null;
@@ -288,7 +233,7 @@ public class java_fat implements TestBase
{
countInterfaceTestRun++;
finished = true;
- res = executeInterfaceTest(aSubEntry, tEnv, param);
+ res = executeInterfaceTest(aSubEntry, tEnv, m_aParams);
}
catch (IllegalArgumentException iae)
{
@@ -305,7 +250,7 @@ public class java_fat implements TestBase
catch (java.lang.RuntimeException e)
{
closeExistingOffice();
- tEnv = getEnv(entry, param);
+ tEnv = getEnv(entry, m_aParams);
if (countInterfaceTestRun < 2)
{
finished = false;
@@ -320,8 +265,8 @@ public class java_fat implements TestBase
sumIt.summarizeUp(aSubEntry);
- LogWriter sumIfc = OutProducerFactory.createOutProducer(param);
- aSubEntry.UserDefinedParams = param;
+ LogWriter sumIfc = OutProducerFactory.createOutProducer(m_aParams);
+ aSubEntry.UserDefinedParams = m_aParams;
sumIfc.initialize(aSubEntry, logging);
sumIfc.summary(aSubEntry);
}
@@ -330,7 +275,7 @@ public class java_fat implements TestBase
{
if (!keepdocument)
{
- tCase.cleanupTestCase(param);
+ tCase.cleanupTestCase(m_aParams);
}
}
catch (Exception e)
@@ -344,7 +289,7 @@ public class java_fat implements TestBase
sumIt.summarizeUp(entry);
- LogWriter sumObj = OutProducerFactory.createOutProducer(param);
+ LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams);
sumObj.initialize(entry, logging);
sumObj.summary(entry);
@@ -359,7 +304,8 @@ public class java_fat implements TestBase
for (int i = 0; i < entries.length; i++)
{
- if (!entries[i].State.endsWith("OK"))
+ final String sState = entries[i].State;
+ if (!sState.endsWith("OK"))
{
System.out.println("\t " + entries[i].longName);
counter++;
@@ -373,6 +319,78 @@ public class java_fat implements TestBase
return retValue;
}
+//
+ private TestEnvironment getTestEnvironment(TestCase tCase, DescEntry entry)
+ {
+ TestEnvironment tEnv = null;
+
+ try
+ {
+ tEnv = tCase.getTestEnvironment(m_aParams);
+ }
+ catch (Exception e)
+ {
+ System.out.println("Exception while creating " + tCase.getObjectName());
+ System.out.println("Message " + e.getMessage());
+ e.printStackTrace();
+ tEnv = null;
+ }
+ catch (java.lang.UnsatisfiedLinkError e)
+ {
+ System.out.println("Exception while creating " + tCase.getObjectName());
+ System.out.println("Message " + e.getMessage());
+ tEnv = null;
+ }
+ catch (java.lang.NoClassDefFoundError e)
+ {
+ System.out.println("Exception while creating " + tCase.getObjectName());
+ System.out.println("Message " + e.getMessage());
+ tEnv = null;
+ }
+
+ if (tEnv == null)
+ {
+ Summarizer.summarizeDown(entry, "Couldn't create " + tCase.getObjectName());
+
+ LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams);
+ entry.UserDefinedParams = m_aParams;
+ sumObj.initialize(entry, logging);
+ sumObj.summary(entry);
+ }
+ return tEnv;
+ }
+ // -------------------------------------------------------------------------
+ private TestCase getTestCase(DescEntry _aEntry)
+ {
+ TestCase tCase = null;
+
+ try
+ {
+ tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + _aEntry.entryName);
+ }
+ catch (java.lang.IllegalArgumentException ie)
+ {
+ _aEntry.ErrorMsg = ie.getMessage();
+ _aEntry.hasErrorMsg = true;
+ }
+ catch (java.lang.NoClassDefFoundError ie)
+ {
+ _aEntry.ErrorMsg = ie.getMessage();
+ _aEntry.hasErrorMsg = true;
+ }
+
+ if (tCase == null)
+ {
+ Summarizer.summarizeDown(_aEntry, _aEntry.ErrorMsg);
+
+ LogWriter sumObj = OutProducerFactory.createOutProducer(m_aParams);
+ _aEntry.UserDefinedParams = m_aParams;
+ sumObj.initialize(_aEntry, logging);
+ sumObj.summary(_aEntry);
+ }
+ return tCase;
+}
+
private void setState(DescEntry aSubEntry, lib.TestResult res)
{
if (res != null)
@@ -390,10 +408,10 @@ public class java_fat implements TestBase
private TestEnvironment getEnv(DescEntry entry, TestParameters param)
{
-// if (dcl == null)
-// dcl = new DynamicClassLoader();
-// String officeProviderName = (String) param.get("OfficeProvider");
-// AppProvider office = (AppProvider) dcl.getInstance(officeProviderName);
+// if (m_aDynamicClassLoader == null)
+// m_aDynamicClassLoader = new DynamicClassLoader();
+// String officeProviderName = (String) m_aParams.get("OfficeProvider");
+// AppProvider office = (AppProvider) m_aDynamicClassLoader.getInstance(officeProviderName);
//
// if (office == null) {
// System.out.println("ERROR: Wrong parameter 'OfficeProvider', " +
@@ -402,21 +420,21 @@ public class java_fat implements TestBase
// }
//
// XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
-// param);
+// m_aParams);
//
// if (msf == null) {
// return null;
// }
//
-// param.put("ServiceFactory", msf);
+// m_aParams.put("ServiceFactory", msf);
- // AppProvider office = startOffice(param);
+ // AppProvider office = startOffice(m_aParams);
TestCase tCase = null;
try
{
- tCase = (TestCase) dcl.getInstance("mod._" + entry.entryName);
+ tCase = (TestCase) m_aDynamicClassLoader.getInstance("mod._" + entry.entryName);
}
catch (java.lang.IllegalArgumentException ie)
{
@@ -433,7 +451,7 @@ public class java_fat implements TestBase
entry.UserDefinedParams = param;
- LogWriter log = (LogWriter) dcl.getInstance((String) param.get("LogWriter"));
+ LogWriter log = (LogWriter) m_aDynamicClassLoader.getInstance((String) param.get("LogWriter"));
log.initialize(entry, logging);
tCase.setLogWriter((PrintWriter) log);
@@ -469,21 +487,21 @@ public class java_fat implements TestBase
if (ph != null)
{
m_aOffice.closeExistingOffice(m_aParams, true);
- shortWait(5000);
+ util.utils.shortWait(5000);
}
}
- private void shortWait(int millis)
- {
- try
- {
- Thread.sleep(millis);
- }
- catch (java.lang.InterruptedException ie)
- {
- }
- }
+// private void shortWait(int millis)
+// {
+// try
+// {
+// Thread.sleep(millis);
+// }
+// catch (java.lang.InterruptedException ie)
+// {
+// }
+// }
private Vector getExclusionList(String url, boolean debug)
{
@@ -548,20 +566,20 @@ public class java_fat implements TestBase
DescEntry entry, TestEnvironment tEnv, TestParameters param)
throws IllegalArgumentException, java.lang.NoClassDefFoundError
{
- MultiMethodTest ifc = (MultiMethodTest) dcl.getInstance(entry.entryName);
+ MultiMethodTest ifc = (MultiMethodTest) m_aDynamicClassLoader.getInstance(entry.entryName);
return ifc.run(entry, tEnv, param);
}
private AppProvider startOffice(lib.TestParameters param)
{
- if (dcl == null)
+ if (m_aDynamicClassLoader == null)
{
- dcl = new DynamicClassLoader();
+ m_aDynamicClassLoader = new DynamicClassLoader();
}
String officeProviderName = (String) param.get("OfficeProvider");
- AppProvider office = (AppProvider) dcl.getInstance(officeProviderName);
+ AppProvider office = (AppProvider) m_aDynamicClassLoader.getInstance(officeProviderName);
if (office == null)
{
diff --git a/qadevOOo/runner/base/java_fat_service.java b/qadevOOo/runner/base/java_fat_service.java
index 151a31dadeb0..0c8fd17e43ec 100644
--- a/qadevOOo/runner/base/java_fat_service.java
+++ b/qadevOOo/runner/base/java_fat_service.java
@@ -41,7 +41,6 @@ import com.sun.star.lang.XMultiServiceFactory;
import share.DescEntry;
import share.DescGetter;
import helper.APIDescGetter;
-import base.TestBase;
import share.LogWriter;
import stats.Summarizer;
@@ -174,7 +173,11 @@ public class java_fat_service implements TestBase {
entry.SubEntries[j].entryName);
if ((tEnv != null) && (ifc != null)) {
res = ifc.run(entry.SubEntries[j],tEnv,param);
- } else res = null;
+ }
+ else
+ {
+ res = null;
+ }
}
if (res != null) {
for (int k=0;k<entry.SubEntries[j].SubEntryCount;k++) {
@@ -227,34 +230,38 @@ public class java_fat_service implements TestBase {
TestCase tCase = null;
- try {
- tCase = (TestCase)
- dcl.getInstance("mod._"+entry.entryName);
- } catch (java.lang.IllegalArgumentException ie) {
+ try
+ {
+ tCase = (TestCase) dcl.getInstance("mod._"+entry.entryName);
+ }
+ catch (java.lang.IllegalArgumentException ie)
+ {
entry.ErrorMsg=ie.getMessage();
entry.hasErrorMsg=true;
}
log.println("Creating: "+tCase.getObjectName());
- LogWriter log = (LogWriter)dcl.getInstance(
- (String)param.get("LogWriter"));
+ // LogWriter log = (LogWriter)dcl.getInstance( (String)param.get("LogWriter"));
log.initialize(entry,true);
entry.UserDefinedParams = param;
tCase.setLogWriter((PrintWriter) log);
TestEnvironment tEnv = null;
- try {
+ try
+ {
tCase.initializeTestCase(param);
tEnv = tCase.getTestEnvironment(param);
- } catch (com.sun.star.lang.DisposedException de) {
+ }
+ catch (com.sun.star.lang.DisposedException de)
+ {
log.println("Office disposed");
}
return tEnv;
}
- protected void shortWait(int millis) {
- try {
- Thread.sleep(millis);
- } catch (java.lang.InterruptedException ie) {}
- }
+// protected void shortWait(int millis) {
+// try {
+// Thread.sleep(millis);
+// } catch (java.lang.InterruptedException ie) {}
+// }
}
diff --git a/qadevOOo/runner/basicrunner/basichelper/Filter.java b/qadevOOo/runner/basicrunner/basichelper/Filter.java
index dd45e1fddc81..d9616d30e5b2 100644
--- a/qadevOOo/runner/basicrunner/basichelper/Filter.java
+++ b/qadevOOo/runner/basicrunner/basichelper/Filter.java
@@ -32,7 +32,6 @@ import com.sun.star.lang.XTypeProvider;
import com.sun.star.uno.Type;
import com.sun.star.container.XNameAccess;
import com.sun.star.container.NoSuchElementException;
-import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.document.XFilter;
@@ -224,7 +223,8 @@ class FilterImpl implements XInitialization, XTypeProvider, XNameAccess {
public void initialize(Object[] parm1) throws com.sun.star.uno.Exception {
XFilter oFilter = (XFilter)UnoRuntime.queryInterface(
XFilter.class, parm1[0]);
- PropertyValue[] FilterDesc = (PropertyValue[])AnyConverter.toArray(parm1[1]);
+//? PropertyValue[] FilterDesc = (PropertyValue[])AnyConverter.toArray(parm1[1]);
+ PropertyValue[] FilterDesc = (PropertyValue[])UnoRuntime.queryInterface(PropertyValue[].class, parm1[1]);
aState = "just initialized";
FilterThread aThread = new FilterThread(oFilter, FilterDesc);
aThread.start();
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index 8f67cd959f28..b15224bc503f 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -44,8 +44,6 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
protected static TestParameters param = null;
/** Log writer **/
protected static LogWriter log = null;
- /** Description entry **/
- protected DescEntry subEntry = null;
/**
* The method name which will be written into f.e. the data base
**/
@@ -53,42 +51,33 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
/** Maximal time one method is allowed to execute
* Can be set with parameter 'ThreadTimeOut'
**/
- protected int mThreadTimeOut = 0;
+ protected int m_nThreadTimeOut = 0;
/** Continue a test even if it did fail **/
// public static final boolean CONTINUE = true;
/** End a test if it did fail **/
public static final boolean BREAK = true;
+ private boolean m_bBeforeCalled;
+
/**
- * Call test. It is expected, that an environment is
- * given to this test.
- *
- * @param entry The name of the test method that should be called.
- * @param environment The environment for the test.
+ * is called before the real test starts
*/
- public void executeMethods(DescEntry entry, TestParameters environment)
+ private void before()
{
-
- // get the environment
- param = environment;
- log = entry.Logger;
-
- mThreadTimeOut = param.getInt("ThreadTimeOut");
- if (mThreadTimeOut == 0)
- {
- mThreadTimeOut = 300000;
- }
- // start with the before() method
- boolean beforeWorked = true;
try
{
Method before = this.getClass().getMethod("before", new Class[] {} );
before.invoke(this, new Object[] {} );
+
+ // beforeWorked = false;
+ m_bBeforeCalled = true;
}
catch (java.lang.NoSuchMethodException e)
{
// simply ignore
+ int dummy = 0;
+ m_bBeforeCalled = true;
}
catch (java.lang.IllegalAccessException e)
{
@@ -96,7 +85,6 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
}
catch (java.lang.reflect.InvocationTargetException e)
{
- beforeWorked = false;
Throwable t = e.getTargetException();
if (!(t instanceof RuntimeException) || state)
{
@@ -110,12 +98,25 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
}
}
+ }
- //executeMethodTests
- for (int i = 0; i < entry.SubEntries.length; i++)
+ /** Description entry **/
+ // protected DescEntry subEntry = null;
+
+ private void test_method(DescEntry _entry)
+ {
+
+ m_nThreadTimeOut = param.getInt("ThreadTimeOut");
+ if (m_nThreadTimeOut == 0)
{
- subEntry = entry.SubEntries[i];
- if (beforeWorked)
+ m_nThreadTimeOut = 300000;
+ }
+
+ for (int i = 0; i < _entry.SubEntries.length; i++)
+ {
+
+ DescEntry subEntry = _entry.SubEntries[i];
+ if (m_bBeforeCalled)
{
state = true;
message = "";
@@ -138,10 +139,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
{
String sParameter = (entryName.substring(entryName.indexOf("(") + 1, entryName.indexOf(")")));
mTestMethodName = entryName;
- parameter = new String[]
- {
- sParameter
- };
+ parameter = new String[] { sParameter };
entryName = entryName.substring(0, entryName.indexOf("("));
testMethod = this.getClass().getMethod(entryName, new Class[] { String.class });
}
@@ -170,7 +168,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
int sleepingStep = 1000;
int factor = 0;
- while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < mThreadTimeOut))
+ while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < m_nThreadTimeOut))
{
Thread.sleep(sleepingStep);
factor++;
@@ -193,7 +191,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
{
log.println("Destroy " + mTestMethodName);
th.destroy();
- subEntry.State = "Test did sleep for " + (mThreadTimeOut / 1000) + " seconds and has been killed!";
+ subEntry.State = "Test did sleep for " + (m_nThreadTimeOut / 1000) + " seconds and has been killed!";
subEntry.hasErrorMsg = true;
subEntry.ErrorMsg = subEntry.State;
continue;
@@ -225,8 +223,14 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
subEntry.hasErrorMsg = !state;
subEntry.ErrorMsg = message;
}
+ }
- if (beforeWorked)
+ /**
+ * after() is called after the test is done
+ */
+ private void after()
+ {
+ if (m_bBeforeCalled)
{
// the after() method
try
@@ -261,8 +265,38 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
}
}
}
+
+ }
+
+
+
+ /**
+ * Call test. It is expected, that an environment is
+ * given to this test.
+ *
+ * @param entry The name of the test method that should be called.
+ * @param environment The environment for the test.
+ */
+ public void executeMethods(DescEntry entry, TestParameters environment)
+ {
+ m_bBeforeCalled = false;
+
+ // get the environment
+ param = environment;
+ log = entry.Logger;
+
+
+ // start with the before() method
+ before();
+
+ //executeMethodTests
+ test_method(entry);
+
+ // cleanup
+ after();
}
+
/**
* Implement this method in the Complex test.
* @return All test method names.
diff --git a/qadevOOo/runner/convwatch/BuildID.java b/qadevOOo/runner/convwatch/BuildID.java
index a1ef08f118f8..efb091d160f9 100644
--- a/qadevOOo/runner/convwatch/BuildID.java
+++ b/qadevOOo/runner/convwatch/BuildID.java
@@ -136,28 +136,28 @@ public class BuildID
}
return sBuildID;
}
- public static void main(String[] args)
- {
- String sApp;
- sApp = "/opt/staroffice8_m116/program/soffice -headless -accept=socket,host=localhost,port=8100;urp;";
- String sBuildID;
- sBuildID = getBuildID(sApp);
- System.out.println("BuildID is: " + sBuildID);
-
- Date aDate = new Date();
- long nStart = aDate.getTime();
- System.out.println("Time:" + nStart);
- // LLA: Just some more tests for getBuildID
- // sApp = "/opt/staroffice8_net/program/soffice";
- // sBuildID = getBuildID(sApp);
- // System.out.println("BuildID is: " + sBuildID);
- //
- // sApp = "\"/opt/staroffice8_net/program/soffice\" test blah";
- // sBuildID = getBuildID(sApp);
- //
- // System.out.println("BuildID is: " + sBuildID);
- System.exit(1);
- }
+// public static void main(String[] args)
+// {
+// String sApp;
+// sApp = "/opt/staroffice8_m116/program/soffice -headless -accept=socket,host=localhost,port=8100;urp;";
+// String sBuildID;
+// sBuildID = getBuildID(sApp);
+// System.out.println("BuildID is: " + sBuildID);
+//
+// Date aDate = new Date();
+// long nStart = aDate.getTime();
+// System.out.println("Time:" + nStart);
+// // LLA: Just some more tests for getBuildID
+// // sApp = "/opt/staroffice8_net/program/soffice";
+// // sBuildID = getBuildID(sApp);
+// // System.out.println("BuildID is: " + sBuildID);
+// //
+// // sApp = "\"/opt/staroffice8_net/program/soffice\" test blah";
+// // sBuildID = getBuildID(sApp);
+// //
+// // System.out.println("BuildID is: " + sBuildID);
+// System.exit(1);
+// }
}
diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java
index 27b815e81302..fbcaaea0b33b 100644
--- a/qadevOOo/runner/convwatch/IniFile.java
+++ b/qadevOOo/runner/convwatch/IniFile.java
@@ -435,18 +435,18 @@ class IniFile
/**
* some tests for this class
*/
- public static void main(String[] args)
- {
- IniFile aIniFile = new IniFile("/tmp/inifile");
- String sValue = aIniFile.getValue("Section","Key");
- // insert a new value to a already exist section
- aIniFile.insertValue("Section","Key2","a new value in a existing section");
- // replace a value
- aIniFile.insertValue("Section","Key","replaced value");
- // create a new value
- aIniFile.insertValue("New Section", "Key", "a new key value pair");
-
- String sValue2 = aIniFile.getValue("Section2","Key");
- aIniFile.store();
- }
+// public static void main(String[] args)
+// {
+// IniFile aIniFile = new IniFile("/tmp/inifile");
+// String sValue = aIniFile.getValue("Section","Key");
+// // insert a new value to a already exist section
+// aIniFile.insertValue("Section","Key2","a new value in a existing section");
+// // replace a value
+// aIniFile.insertValue("Section","Key","replaced value");
+// // create a new value
+// aIniFile.insertValue("New Section", "Key", "a new key value pair");
+//
+// String sValue2 = aIniFile.getValue("Section2","Key");
+// aIniFile.store();
+// }
}
diff --git a/qadevOOo/runner/convwatch/OfficePrint.java b/qadevOOo/runner/convwatch/OfficePrint.java
index adf75f093c50..7f9b86f2f920 100644
--- a/qadevOOo/runner/convwatch/OfficePrint.java
+++ b/qadevOOo/runner/convwatch/OfficePrint.java
@@ -108,7 +108,8 @@ public class OfficePrint {
}
catch (com.sun.star.lang.IllegalArgumentException e)
{
- GlobalLogWriter.get().println("showProperty: can't convert a object to string.");
+ // GlobalLogWriter.get().println("showProperty: can't convert a object to string.");
+ GlobalLogWriter.get().println("Property " + sName + ":= a Object which can't convert by AnyConverter()");
}
}
@@ -627,11 +628,12 @@ public class OfficePrint {
{
XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aSettings );
xPropSet.setPropertyValue( "PrintAllSheets", new Boolean( true ) );
+ GlobalLogWriter.get().println("PrintAllSheets := true");
}
}
ArrayList aPrintProps = new ArrayList();
- GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
+ // GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
// PropertyValue [] aPrintProps = new PropertyValue[nProperties];
PropertyValue Arg = new PropertyValue();
@@ -639,7 +641,7 @@ public class OfficePrint {
Arg.Value = _sPrintFileURL;
// aPrintProps[nPropsCount ++] = Arg;
aPrintProps.add(Arg);
- // showProperty(Arg);
+ showProperty(Arg);
if (_aGTA.printAllPages() == false)
{
@@ -661,8 +663,8 @@ public class OfficePrint {
Arg.Name = "Pages";
Arg.Value = sPages;
aPrintProps.add(Arg);
+ showProperty(Arg);
}
- showProperty(Arg);
// GlobalLogWriter.get().println("Start printing.");
diff --git a/qadevOOo/runner/convwatch/PerformanceContainer.java b/qadevOOo/runner/convwatch/PerformanceContainer.java
index 7a3c39398165..d0c1e0fb5ed1 100644
--- a/qadevOOo/runner/convwatch/PerformanceContainer.java
+++ b/qadevOOo/runner/convwatch/PerformanceContainer.java
@@ -232,18 +232,19 @@ public class PerformanceContainer /* extends *//* implements */ {
}
}
- public static void main(String[] args) {
+// public static void main(String[] args) {
+//
+///*
+// BorderRemover a = new BorderRemover();
+// try
+// {
+// a.createNewImageWithoutBorder(args[0], args[1]);
+// }
+// catch(java.io.IOException e)
+// {
+// System.out.println("Exception caught.");
+// }
+// */
+// }
-/*
- BorderRemover a = new BorderRemover();
- try
- {
- a.createNewImageWithoutBorder(args[0], args[1]);
- }
- catch(java.io.IOException e)
- {
- System.out.println("Exception caught.");
- }
- */
- }
}
diff --git a/qadevOOo/runner/convwatch/PixelCounter.java b/qadevOOo/runner/convwatch/PixelCounter.java
index 3398db89df33..116b07e48d8e 100644
--- a/qadevOOo/runner/convwatch/PixelCounter.java
+++ b/qadevOOo/runner/convwatch/PixelCounter.java
@@ -184,22 +184,23 @@ public class PixelCounter {
// -----------------------------------------------------------------------------
- public static void main(String[] args) {
+// public static void main(String[] args) {
+//
+// String a = helper.StringHelper.createValueString(10, 4);
+// int dummy = 1;
+///*
+// BorderRemover a = new BorderRemover();
+// try
+// {
+// a.createNewImageWithoutBorder(args[0], args[1]);
+// }
+// catch(java.io.IOException e)
+// {
+// System.out.println("Exception caught.");
+// }
+// */
+// }
- String a = helper.StringHelper.createValueString(10, 4);
- int dummy = 1;
-/*
- BorderRemover a = new BorderRemover();
- try
- {
- a.createNewImageWithoutBorder(args[0], args[1]);
- }
- catch(java.io.IOException e)
- {
- System.out.println("Exception caught.");
- }
- */
- }
}
diff --git a/qadevOOo/runner/graphical/BuildID.java b/qadevOOo/runner/graphical/BuildID.java
index a2cbf63cf8cf..4c5907ff34ad 100644
--- a/qadevOOo/runner/graphical/BuildID.java
+++ b/qadevOOo/runner/graphical/BuildID.java
@@ -32,20 +32,23 @@ import helper.OSHelper;
public class BuildID
{
- public static String getBuildID(String _sApp)
+ private static String getOfficePath(String _sApp)
+ {
+ String sOfficePath = "";
+ // TODO: StringHelper.removeQuote?
+ if (_sApp.startsWith("\""))
{
- String sOfficePath = "";
- // TODO: StringHelper.removeQuote?
- if (_sApp.startsWith("\""))
+ int nIdx = _sApp.indexOf("\"", 1);
+ if (nIdx != -1)
{
- int nIdx = _sApp.indexOf("\"", 1);
- if (nIdx != -1)
- {
- // leave double qoute out.
- sOfficePath = _sApp.substring(1, nIdx);
- }
+ // leave double qoute out.
+ sOfficePath = _sApp.substring(1, nIdx);
}
- else
+ }
+ else
+ {
+ // check if _sApp ends with the office executable, if not
+ if (! (_sApp.endsWith("soffice.exe") || _sApp.endsWith("soffice")))
{
// check if a space exist, so we get all until space
int nIdx = _sApp.indexOf(" ", 1);
@@ -58,19 +61,34 @@ public class BuildID
sOfficePath = _sApp.substring(0, nIdx);
}
}
- GlobalLogWriter.get().println("Office path: " + sOfficePath);
+ else
+ {
+ sOfficePath = _sApp;
+ }
+ }
+ // GlobalLogWriter.get().println("Office path: " + sOfficePath);
+ return sOfficePath;
+ }
- // String fs = System.getProperty("file.separator");
+ public static String getBuildID(String _sApp)
+ {
+ final String sOfficePath = getOfficePath(_sApp);
+ final String sBuildID = getBuildID(sOfficePath, "buildid");
+ return sBuildID;
+ }
+
+ private static String getBuildID(String _sOfficePath, String _sIniSection)
+ {
+ File aSOfficeFile = new File(_sOfficePath);
String sBuildID = "";
- File aSOfficeFile = new File(sOfficePath);
if (aSOfficeFile.exists())
{
- sOfficePath = FileHelper.getPath(sOfficePath);
+ String sOfficePath = FileHelper.getPath(_sOfficePath);
// ok. System.out.println("directory: " + sOfficePath);
- sBuildID = getBuildIDFromBootstrap(sOfficePath);
+ sBuildID = getBuildIDFromBootstrap(sOfficePath, _sIniSection);
if (sBuildID.length() == 0)
{
- sBuildID = getBuildIDFromVersion(sOfficePath);
+ sBuildID = getBuildIDFromVersion(sOfficePath, _sIniSection);
}
}
else
@@ -82,7 +100,7 @@ public class BuildID
return sBuildID;
}
- private static String getBuildIDFromBootstrap(String _sOfficePath)
+ private static String getBuildIDFromBootstrap(String _sOfficePath, String _sIniSection)
{
String sBuildID = "";
String sOfficePath;
@@ -97,7 +115,7 @@ public class BuildID
IniFile aIniFile = new IniFile(sOfficePath);
if (aIniFile.is())
{
- sBuildID = aIniFile.getValue("Bootstrap", "buildid");
+ sBuildID = aIniFile.getValue("Bootstrap", /*"buildid"*/ _sIniSection);
}
else
{
@@ -106,7 +124,7 @@ public class BuildID
return sBuildID;
}
- private static String getBuildIDFromVersion(String _sOfficePath)
+ private static String getBuildIDFromVersion(String _sOfficePath, String _sIniSection)
{
// String fs = System.getProperty("file.separator");
String sBuildID = "";
@@ -122,7 +140,7 @@ public class BuildID
IniFile aIniFile = new IniFile(sOfficePath);
if (aIniFile.is())
{
- sBuildID = aIniFile.getValue("Version", "buildid");
+ sBuildID = aIniFile.getValue("Version", /*"buildid"*/ _sIniSection);
}
else
{
@@ -154,5 +172,55 @@ public class BuildID
// System.exit(1);
// }
-}
+ public static String getMaster(String _sOfficePath)
+ {
+ final String sOfficePath = getOfficePath(_sOfficePath);
+ final String sMaster = getBuildID(sOfficePath, "ProductSource");
+ return sMaster;
+ }
+ public static String getMinor(String _sOfficePath)
+ {
+ final String sOfficePath = getOfficePath(_sOfficePath);
+ final String sMinor = "m" + getBuildID(sOfficePath, "ProductMinor");
+ return sMinor;
+ }
+
+ public static String getCWSName(String _sOfficePath)
+ {
+ final String sOfficePath = getOfficePath(_sOfficePath);
+ final String sBuildID = getBuildID(sOfficePath, "buildid");
+ String sCWSName = "MWS";
+ int nIdx = sBuildID.indexOf("[CWS:");
+ if (nIdx > 0)
+ {
+ int nIdx2 = sBuildID.indexOf("]", nIdx);
+ sCWSName = sBuildID.substring(nIdx + 5, nIdx2);
+ }
+ return sCWSName;
+ }
+
+// public static void main(String[] args)
+// {
+// String sApp;
+// sApp = "D:/staroffice9_m63/Sun/StarOffice 9/program/soffice.exe";
+// String sBuildID;
+// sBuildID = getBuildID(sApp);
+// System.out.println("BuildID is: " + sBuildID);
+//
+// String sMaster;
+// sMaster = getMaster(sApp);
+// System.out.println("Master is: " + sMaster);
+//
+// String sMinor;
+// sMinor = getMinor(sApp);
+// System.out.println("Minor is: " + sMinor);
+//
+// String sCWSName;
+// sCWSName = getCWSName(sApp);
+// System.out.println("CWSName is: " + sCWSName);
+//
+// System.exit(1);
+// }
+
+}
diff --git a/qadevOOo/runner/graphical/IniFile.java b/qadevOOo/runner/graphical/IniFile.java
index 5173c493f46a..832aef795e71 100644
--- a/qadevOOo/runner/graphical/IniFile.java
+++ b/qadevOOo/runner/graphical/IniFile.java
@@ -588,29 +588,29 @@ public class IniFile implements Enumeration
/**
* some tests for this class
*/
- public static void main(String[] args)
- {
- String sTempFile = System.getProperty("java.io.tmpdir");
- sTempFile += "inifile";
-
-
- IniFile aIniFile = new IniFile(sTempFile);
- String sValue = aIniFile.getValue("Section", "Key");
- // insert a new value to a already exist section
- aIniFile.insertValue("Section", "Key2", "a new value in a existing section");
- // replace a value
- aIniFile.insertValue("Section", "Key", "replaced value");
- // create a new value
- aIniFile.insertValue("New Section", "Key", "a new key value pair");
- aIniFile.insertValue("New Section", "Key2", "a new second key value pair");
-
- String sValue2 = aIniFile.getValue("Section2", "Key");
-
- aIniFile.removeSection("Section");
- aIniFile.removeSection("New Section");
-
- aIniFile.close();
- }
+// public static void main(String[] args)
+// {
+// String sTempFile = System.getProperty("java.io.tmpdir");
+// sTempFile += "inifile";
+//
+//
+// IniFile aIniFile = new IniFile(sTempFile);
+// String sValue = aIniFile.getValue("Section", "Key");
+// // insert a new value to a already exist section
+// aIniFile.insertValue("Section", "Key2", "a new value in a existing section");
+// // replace a value
+// aIniFile.insertValue("Section", "Key", "replaced value");
+// // create a new value
+// aIniFile.insertValue("New Section", "Key", "a new key value pair");
+// aIniFile.insertValue("New Section", "Key2", "a new second key value pair");
+//
+// String sValue2 = aIniFile.getValue("Section2", "Key");
+//
+// aIniFile.removeSection("Section");
+// aIniFile.removeSection("New Section");
+//
+// aIniFile.close();
+// }
/**
* Enumeration Interface
diff --git a/qadevOOo/runner/graphical/JPEGComparator.java b/qadevOOo/runner/graphical/JPEGComparator.java
index 851d129141ea..ed3417e04c9c 100644
--- a/qadevOOo/runner/graphical/JPEGComparator.java
+++ b/qadevOOo/runner/graphical/JPEGComparator.java
@@ -338,6 +338,8 @@ public class JPEGComparator extends EnhancedComplexTestCase
String sDestination = FileHelper.appendPath(sDestinationPath, sNewSourceBasename);
FileHelper.copy(sSource, sDestination);
sSourceBasename = sNewSourceBasename;
+ //
+ JPEGCreator.convertToNearSameFileWithWidth340(sDestination);
}
String sDifferenceBasename = "Difference_between_" + FileHelper.getNameNoSuffix(sSourceBasename) + "_and_" + FileHelper.getNameNoSuffix(sDestinationBasename) + ".jpg";
// String sDifferencePath = sDestinationPath;
@@ -643,30 +645,30 @@ public class JPEGComparator extends EnhancedComplexTestCase
- public static void main(String [] _args)
- {
-// give an index.ini file, ok
-// give a directory, where exist jpeg files ok
-// inputpath (given file) doesn't exists
-// give a jpeg file.
-
- String args[] = {
- "-TimeOut", "3600000",
- "-tb", "java_complex",
- "-o", "graphical.JPEGComparator",
- "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\index.ini",
- "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output2",
-// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\GroupReport.odt.pdf_180DPI_0001.jpg",
-// "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output2\\Report1.odt.pdf_180DPI_0001.jpg",
- "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
-// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
-// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
-// "-OFFICE_VIEWABLE", "false",
-// "-AppExecutionCommand", "\"C:/Programme/sun/staroffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
- "-NoOffice"
- };
-
- org.openoffice.Runner.main(args);
- }
+// public static void main(String [] _args)
+// {
+//// give an index.ini file, ok
+//// give a directory, where exist jpeg files ok
+//// inputpath (given file) doesn't exists
+//// give a jpeg file.
+//
+// String args[] = {
+// "-TimeOut", "3600000",
+// "-tb", "java_complex",
+// "-o", "graphical.JPEGComparator",
+// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\index.ini",
+// "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output2",
+//// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\GroupReport.odt.pdf_180DPI_0001.jpg",
+//// "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output2\\Report1.odt.pdf_180DPI_0001.jpg",
+// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
+//// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
+//// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
+//// "-OFFICE_VIEWABLE", "false",
+//// "-AppExecutionCommand", "\"C:/Programme/sun/staroffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
+// "-NoOffice"
+// };
+//
+// org.openoffice.Runner.main(args);
+// }
}
diff --git a/qadevOOo/runner/graphical/JPEGCreator.java b/qadevOOo/runner/graphical/JPEGCreator.java
index c35f89b39da8..5f6343d9780d 100644
--- a/qadevOOo/runner/graphical/JPEGCreator.java
+++ b/qadevOOo/runner/graphical/JPEGCreator.java
@@ -124,9 +124,14 @@ public class JPEGCreator extends EnhancedComplexTestCase
*/
public static void convertToNearSameFileWithWidth340(String _sJPEGFilename)
{
+ String sJPEGFilename = _sJPEGFilename.replaceAll("\\\\", "/");
+// if (OSHelper.isWindows())
+// {
+// sJPEGFilename = sJPEGFilename.replaceAll("/", "\\\\");
+// }
String sNewJPEGFilename;
- sNewJPEGFilename = util.utils.replaceAll13(_sJPEGFilename, ".jpg", "_w340.jpg");
- convertToWidth340(_sJPEGFilename, sNewJPEGFilename);
+ sNewJPEGFilename = util.utils.replaceAll13(sJPEGFilename, ".jpg", "_w340.jpg");
+ convertToWidth340(sJPEGFilename, sNewJPEGFilename);
}
/**
@@ -153,7 +158,9 @@ private static void convertToWidth340(String _sFrom, String _To)
}
if (OSHelper.isWindows())
{
- sConvertEXE = "convert.exe";
+ // TODO!
+ // HACK Hard coded!
+ sConvertEXE = "C:\\Programme\\ImageMagick-6.0.3-q8\\convert.exe";
}
String[] sCommandArray =
@@ -378,14 +385,34 @@ private static void convertToWidth340(String _sFrom, String _To)
return nPages;
}
- public static void main(String [] _args)
- {
-// DONE: give an index.ini file ok
+// public static void main(String [] _args)
+// {
+//// DONE: give an index.ini file ok
+//// String args[] = {
+//// "-TimeOut", "3600000",
+//// "-tb", "java_complex",
+//// "-o", "graphical.JPEGCreator",
+//// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\index.ini",
+//// "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output",
+//// "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
+//// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
+//// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
+////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
+////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
+////// "-OFFICE_VIEWABLE", "false",
+//// "-AppExecutionCommand", "\"C:/Programme/sun/staroffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
+//// "-NoOffice"
+//// };
+//
+//// Done: give a directory, where exist pdf/ps files ok.
+//// Done: inputpath (given file) doesn't exists, ok.
+//// Done: give a ps/pdf file. ok.
+//
// String args[] = {
// "-TimeOut", "3600000",
// "-tb", "java_complex",
// "-o", "graphical.JPEGCreator",
-// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\index.ini",
+// "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\Names7.odt.pdf",
// "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output",
// "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
@@ -396,28 +423,8 @@ private static void convertToWidth340(String _sFrom, String _To)
// "-AppExecutionCommand", "\"C:/Programme/sun/staroffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
// "-NoOffice"
// };
-
-// Done: give a directory, where exist pdf/ps files ok.
-// Done: inputpath (given file) doesn't exists, ok.
-// Done: give a ps/pdf file. ok.
-
- String args[] = {
- "-TimeOut", "3600000",
- "-tb", "java_complex",
- "-o", "graphical.JPEGCreator",
- "-DOC_COMPARATOR_INPUT_PATH", "C:\\CWS\\temp\\output\\Names7.odt.pdf",
- "-DOC_COMPARATOR_OUTPUT_PATH", "C:\\CWS\\temp\\output",
- "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
- "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
- "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
-// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
-// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
-// "-OFFICE_VIEWABLE", "false",
- "-AppExecutionCommand", "\"C:/Programme/sun/staroffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
- "-NoOffice"
- };
-
- org.openoffice.Runner.main(args);
- }
+//
+// org.openoffice.Runner.main(args);
+// }
}
diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
index 9c9d7375fd60..8a85c6b32afd 100644
--- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java
@@ -980,8 +980,8 @@ public class MSOfficePostscriptCreator implements IOffice
return sType;
}
- public static void main(String [] _args)
- {
- String sTest = getXMLDocumentFormat("c:/cws/temp/input/Blah Fasel.xml");
- }
+// public static void main(String [] _args)
+// {
+// String sTest = getXMLDocumentFormat("c:/cws/temp/input/Blah Fasel.xml");
+// }
}
diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
index 9db2f390a317..06330a06d9ab 100644
--- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
@@ -599,11 +599,12 @@ public class OpenOfficePostscriptCreator implements IOffice
{
XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aSettings );
xPropSet.setPropertyValue( "PrintAllSheets", new Boolean( true ) );
+ GlobalLogWriter.get().println("PrintAllSheets := true");
}
}
ArrayList aPrintProps = new ArrayList();
- GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
+ // GlobalLogWriter.get().println("Property FileName:=" + _sPrintFileURL);
// PropertyValue [] aPrintProps = new PropertyValue[nProperties];
PropertyValue Arg = new PropertyValue();
@@ -611,7 +612,7 @@ public class OpenOfficePostscriptCreator implements IOffice
Arg.Value = _sPrintFileURL;
// aPrintProps[nPropsCount ++] = Arg;
aPrintProps.add(Arg);
- // showProperty(Arg);
+ showProperty(Arg);
// generate pages string
@@ -635,8 +636,8 @@ public class OpenOfficePostscriptCreator implements IOffice
Arg.Name = "Pages";
Arg.Value = sPages;
aPrintProps.add(Arg);
+ showProperty(Arg);
}
- showProperty(Arg);
// GlobalLogWriter.get().println("Start printing.");
@@ -666,6 +667,8 @@ public class OpenOfficePostscriptCreator implements IOffice
throw new com.sun.star.uno.Exception("Convwatch exception, wait too long for printing.");
}
}
+ // TimeHelper.waitInSeconds(40, "Start waiting after print ready.");
+
_aGTA.getPerformance().stopTime(PerformanceContainer.Print);
GlobalLogWriter.get().println(DateHelper.getDateTimeForHumanreadableLog() + " Print document done.");
diff --git a/qadevOOo/runner/graphical/PostscriptCreator.java b/qadevOOo/runner/graphical/PostscriptCreator.java
index f67977115bcd..ab7ad4536fa6 100644
--- a/qadevOOo/runner/graphical/PostscriptCreator.java
+++ b/qadevOOo/runner/graphical/PostscriptCreator.java
@@ -98,40 +98,40 @@ public class PostscriptCreator extends EnhancedComplexTestCase
- public static void main(String [] _args)
- {
- String args[] = {
- "-TimeOut", "3600000",
- "-tb", "java_complex",
- "-o", "graphical.PostscriptCreator",
-// "-DOC_COMPARATOR_INPUT_PATH", "D:\\temp\\input",
-// "-DOC_COMPARATOR_OUTPUT_PATH", "D:\\temp\\output",
-// "-DOC_COMPARATOR_REFERENCE_PATH", "D:\\temp\\output\\ref",
-// "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
-// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
-// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
-//// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
-//// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
-//// "-OFFICE_VIEWABLE", "false",
-// "-AppExecutionCommand", "\"C:/home/ll93751/staroffice9_DEV300_m25/Sun/StarOffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
-//// "-NoOffice"
- "-DOC_COMPARATOR_PRINT_MAX_PAGE","9999",
- "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION","180",
- "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX","http://so-gfxcmp.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
- "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE","OOo",
- "-DOC_COMPARATOR_DB_INFO_STRING","p:DEV300_m18,c:,d:LLA_test,src:DEV300_m18,dest:,doc:LLA_test,id:34715,distinct:2008-06-27_13-39-09_d6f22d4c-958d-10",
- "-DISTINCT","2008-06-27_13-39-09_d6f22d4c-958d-10",
- "-TEMPPATH","//so-gfxcmp-lin/gfxcmp-data/wntmsci/temp/2008-06-27_13-39-09_d6f22d4c-958d-10/34715",
-// "ConnectionString","socket,host=localhost,port=8101",
- "-OFFICE_VIEWABLE","true",
- "-wntmsci.DOC_COMPARATOR_INPUT_PATH","\\\\so-gfxcmp-lin\\doc-pool\\LLA_test\\issue_79214.odb",
- "-wntmsci.DOC_COMPARATOR_OUTPUT_PATH","\\\\so-gfxcmp-lin\\gfxcmp-data\\wntmsci\\convwatch-output\\LLA_test\\DEV300_m11",
- "-wntmsci.AppExecutionCommand","\"C:\\gfxcmp\\programs\\staroffice8_DEV300_m11\\Sun\\StarOffice 9\\program\\soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
- "-wntmsci.AppKillCommand","\"C:\\bin\\pskill.exe soffice.bin;C:\\bin\\pskill.exe winword;C:\\bin\\pskill.exe excel\"",
-
- };
-
- org.openoffice.Runner.main(args);
- }
+// public static void main(String [] _args)
+// {
+// String args[] = {
+// "-TimeOut", "3600000",
+// "-tb", "java_complex",
+// "-o", "graphical.PostscriptCreator",
+//// "-DOC_COMPARATOR_INPUT_PATH", "D:\\temp\\input",
+//// "-DOC_COMPARATOR_OUTPUT_PATH", "D:\\temp\\output",
+//// "-DOC_COMPARATOR_REFERENCE_PATH", "D:\\temp\\output\\ref",
+//// "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999",
+//// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180",
+//// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
+////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */
+////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */
+////// "-OFFICE_VIEWABLE", "false",
+//// "-AppExecutionCommand", "\"C:/home/ll93751/staroffice9_DEV300_m25/Sun/StarOffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
+////// "-NoOffice"
+// "-DOC_COMPARATOR_PRINT_MAX_PAGE","9999",
+// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION","180",
+// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX","http://so-gfxcmp.germany.sun.com/gfxcmp_ui/cw.php?inifile=",
+// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE","OOo",
+// "-DOC_COMPARATOR_DB_INFO_STRING","p:DEV300_m18,c:,d:LLA_test,src:DEV300_m18,dest:,doc:LLA_test,id:34715,distinct:2008-06-27_13-39-09_d6f22d4c-958d-10",
+// "-DISTINCT","2008-06-27_13-39-09_d6f22d4c-958d-10",
+// "-TEMPPATH","//so-gfxcmp-lin/gfxcmp-data/wntmsci/temp/2008-06-27_13-39-09_d6f22d4c-958d-10/34715",
+//// "ConnectionString","socket,host=localhost,port=8101",
+// "-OFFICE_VIEWABLE","true",
+// "-wntmsci.DOC_COMPARATOR_INPUT_PATH","\\\\so-gfxcmp-lin\\doc-pool\\LLA_test\\issue_79214.odb",
+// "-wntmsci.DOC_COMPARATOR_OUTPUT_PATH","\\\\so-gfxcmp-lin\\gfxcmp-data\\wntmsci\\convwatch-output\\LLA_test\\DEV300_m11",
+// "-wntmsci.AppExecutionCommand","\"C:\\gfxcmp\\programs\\staroffice8_DEV300_m11\\Sun\\StarOffice 9\\program\\soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;",
+// "-wntmsci.AppKillCommand","\"C:\\bin\\pskill.exe soffice.bin;C:\\bin\\pskill.exe winword;C:\\bin\\pskill.exe excel\"",
+//
+// };
+//
+// org.openoffice.Runner.main(args);
+// }
}
diff --git a/qadevOOo/runner/helper/PropertyHelper.java b/qadevOOo/runner/helper/PropertyHelper.java
index a517f6c0ae41..1b2bdbb9f175 100755
--- a/qadevOOo/runner/helper/PropertyHelper.java
+++ b/qadevOOo/runner/helper/PropertyHelper.java
@@ -63,6 +63,18 @@ public class PropertyHelper
// {
// aSaveProperties = new PropertyValue[0];
// }
+
+// show properties?
+// if (_aPropertyList.size() > 0)
+// {
+// // aSaveProperties = new PropertyValue[_aPropertyList.size()];
+// for (int i = 0;i<_aPropertyList.size(); i++)
+// {
+// PropertyValue aProp = (PropertyValue) _aPropertyList.get(i);
+// showProperty(aProp);
+// }
+// }
+
}
return aSaveProperties;
}
diff --git a/qadevOOo/runner/lib/MultiMethodTest.java b/qadevOOo/runner/lib/MultiMethodTest.java
index 5a64357401f6..884059bcfd88 100644
--- a/qadevOOo/runner/lib/MultiMethodTest.java
+++ b/qadevOOo/runner/lib/MultiMethodTest.java
@@ -164,7 +164,8 @@ public class MultiMethodTest
if (! entry.entryName.equals("ifc.qadevooo._SelfTest"))
{
String ifcName = getInterfaceName();
- System.out.println("checking : " + ifcName);
+ // System.out.println("checking : " + ifcName);
+ System.out.print("checking: [" + entry.longName + "]");
// defining a name of the class corresponding to the tested interface
// or service
@@ -183,12 +184,12 @@ public class MultiMethodTest
}
catch (ClassNotFoundException cnfE)
{
-
+ System.out.println();
cnfE.printStackTrace(log);
log.println("could not find a class : " + getTestedClassName());
return null;
-
}
+ System.out.println(" is iface: [" + testedClassName + "] testcode: [" + entry.entryName + "]");
// quering the tested interface from the tested object
XInterface tCase = tEnv.getTestObject();
@@ -231,7 +232,8 @@ public class MultiMethodTest
DescEntry aSubEntry = entry.SubEntries[i];
try
{
- executeMethod(aSubEntry.entryName);
+ final String sEntryName = aSubEntry.entryName;
+ executeMethod(sEntryName);
}
catch (Exception e)
{
@@ -255,7 +257,7 @@ public class MultiMethodTest
* Is called before calling method tests, but after initialization.
* Subclasses may override to perform actions before method tests.
*/
- protected void before() throws Exception
+ protected void before()
{
}
@@ -318,13 +320,15 @@ public class MultiMethodTest
/**
* Checks if the <code>method</code> is optional in the service.
*/
- protected boolean isOptional(String method)
+ protected boolean isOptional(String _method)
{
for (int k = 0; k < entry.SubEntryCount; k++)
{
- if (entry.SubEntries[k].entryName.equals(method))
+ final String sName = entry.SubEntries[k].entryName;
+ if (sName.equals(_method))
{
- return entry.SubEntries[k].isOptional;
+ final boolean bIsOptional = entry.SubEntries[k].isOptional;
+ return bIsOptional;
}
}
return false;
@@ -367,6 +371,7 @@ public class MultiMethodTest
log.println("Execute: " + method);
callMethod(method);
log.println(method + ": " + tRes.getStatusFor(method));
+ log.println();
}
}
diff --git a/qadevOOo/runner/lib/MultiPropertyTest.java b/qadevOOo/runner/lib/MultiPropertyTest.java
index f4973eb94251..286ddf1600a9 100644
--- a/qadevOOo/runner/lib/MultiPropertyTest.java
+++ b/qadevOOo/runner/lib/MultiPropertyTest.java
@@ -155,7 +155,8 @@ public class MultiPropertyTest extends MultiMethodTest
if (info != null)
{
- if (!info.hasPropertyByName(propName))
+ final boolean bHasProperty = info.hasPropertyByName(propName);
+ if (!bHasProperty)
{
if (isOptional(propName) || optionalService)
{
diff --git a/qadevOOo/runner/org/openoffice/Runner.java b/qadevOOo/runner/org/openoffice/Runner.java
index 993f18018c4b..979fc527f775 100644
--- a/qadevOOo/runner/org/openoffice/Runner.java
+++ b/qadevOOo/runner/org/openoffice/Runner.java
@@ -184,7 +184,7 @@ public class Runner
public static void main(String[] args)
{
- System.out.println("OOoRunner Main() version from 20090825 (yyyymmdd)");
+ System.out.println("OOoRunner Main() version from 20100125 (yyyymmdd)");
setStartTime(getTime());
diff --git a/qadevOOo/runner/stats/Summarizer.java b/qadevOOo/runner/stats/Summarizer.java
index eaa44a432361..b1fe5fe61dd3 100644
--- a/qadevOOo/runner/stats/Summarizer.java
+++ b/qadevOOo/runner/stats/Summarizer.java
@@ -24,7 +24,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package stats;
import java.util.Vector;
@@ -35,57 +34,81 @@ import share.DescEntry;
* this class summs up the results of the subentries of a given DescEntry<br>
* and fills the subentries in cases of SKIPPED states
*/
-public class Summarizer {
+public class Summarizer
+{
/**
*
* gets the state for a SuperEntry according to its subentries
* @param entry
*/
- public void summarizeUp(DescEntry entry) {
- if ( ( entry.State != null ) && !entry.State.equals("UNKNOWN")) return;
+ public void summarizeUp(DescEntry entry)
+ {
+ if ((entry.State != null) && !entry.State.equals("UNKNOWN"))
+ {
+ return;
+ }
int count = entry.SubEntryCount;
int knownIssues = 0;
Vector failures = new Vector();
Vector states = new Vector();
- for (int i=0; i<count; i++) {
- if (entry.SubEntries[i].State == null) {
+ for (int i = 0; i < count; i++)
+ {
+ if (entry.SubEntries[i].State == null)
+ {
entry.SubEntries[i].State = "PASSED.FAILED";
}
- if (entry.SubEntries[i].State.equals("known issue")) {
+ if (entry.SubEntries[i].State.equals("known issue"))
+ {
entry.SubEntries[i].State = "PASSED.OK";
knownIssues++;
}
- if (!entry.SubEntries[i].State.endsWith("OK")) {
- failures.add(entry.SubEntries[i].entryName);
+ if (!entry.SubEntries[i].State.endsWith("OK"))
+ {
+ String sFailure = "[" + entry.SubEntries[i].longName + "]" + " is testcode: [" + entry.SubEntries[i].entryName + "]";
+ failures.add(sFailure);
states.add(entry.SubEntries[i].State);
}
}
- if (failures.size()>0) {
+ if (failures.size() > 0)
+ {
String errMsg = "";
String state = "PASSED.FAILED";
- for (int j=0; j<failures.size();j++) {
- if (states.elementAt(j).equals("not part of the job")) {
+ for (int j = 0; j < failures.size(); j++)
+ {
+ if (states.elementAt(j).equals("not part of the job"))
+ {
state = "Not possible since not all Interfaces/Services have been checked";
- } else errMsg +=
- failures.elementAt(j)+" - "+states.elementAt(j)+"\r\n";
+ }
+ else
+ {
+ errMsg +=
+ failures.elementAt(j) + " - " + states.elementAt(j) + "\r\n";
+ }
}
- entry.hasErrorMsg=true;
+ entry.hasErrorMsg = true;
entry.ErrorMsg = errMsg;
entry.State = state;
- } else if (entry.EntryType.equals("component") && knownIssues > 0) {
+ }
+ else if (entry.EntryType.equals("component") && knownIssues > 0)
+ {
entry.State = "PASSED(with known issues).OK";
- } else {
+ }
+ else
+ {
entry.State = "PASSED.OK";
}
}
- public static void summarizeDown(DescEntry entry, String state) {
- if ( ( entry.State == null ) || entry.State.equals("UNKNOWN"))
+ public static void summarizeDown(DescEntry entry, String state)
+ {
+ if ((entry.State == null) || entry.State.equals("UNKNOWN"))
+ {
entry.State = state;
- for (int i=0; i<entry.SubEntryCount; i++) {
+ }
+ for (int i = 0; i < entry.SubEntryCount; i++)
+ {
summarizeDown(entry.SubEntries[i], entry.State);
}
}
-
}
diff --git a/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/configuration_XTemplateContainer.xba b/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/configuration_XTemplateContainer.xba
deleted file mode 100644
index 53ff24bf2a88..000000000000
--- a/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/configuration_XTemplateContainer.xba
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="XTemplateContainer" script:language="StarBasic">
-
-'*************************************************************************
-'
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'*************************************************************************
-'*************************************************************************
-
-' Be sure that all variables are dimensioned:
-option explicit
-
-Sub RunTest()
-
-'*************************************************************************
-' INTERFACE:
-' com.sun.star.configuration.XTemplateContainer
-'*************************************************************************
-On Error Goto ErrHndl
- Dim bOK As Boolean
-
- Test.StartMethod("getElementTemplateName()")
- bOK = TRUE
- Dim cResult as String
- cResult = oObj.getElementTemplateName()
- bOK = bOK AND (Len(cResult) &gt; 0)
-
- Test.MethodTested("getElementTemplateName()", bOK)
-
-Exit Sub
-ErrHndl:
- Test.Exception()
- bOK = false
- resume next
-End Sub
-</script:module>
diff --git a/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/script.xlb b/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/script.xlb
deleted file mode 100644
index e430e80ad9e8..000000000000
--- a/qadevOOo/tests/basic/ifc/configuration/XTemplateContainer/script.xlb
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
- <library:library xmlns:library="http://openoffice.org/2000/library" library:name="configuration_XTemplateContainer" library:readonly="false" library:passwordprotected="false">
- <library:element library:name="configuration_XTemplateContainer"/>
- </library:library>
diff --git a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/cfgmgr2_OInnerTreeSetUpdateAccess.xba b/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/cfgmgr2_OInnerTreeSetUpdateAccess.xba
deleted file mode 100644
index f0fb28a88941..000000000000
--- a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/cfgmgr2_OInnerTreeSetUpdateAccess.xba
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="OInnerTreeSetUpdateAccess" script:language="StarBasic">
-
-'*************************************************************************
-'
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'*************************************************************************
-'*************************************************************************
-
-' Be sure that all variables are dimensioned:
-option explicit
-
-
-' REQUIRED VARIABLES for interface/service tests:
-
-' "com::sun::star::container::XNameReplace"
- ' needs the following Global variables:
- Global cNameToReplace As String 'name of instance to be replased
- Global oReplaceInstance As Object 'instance, that will be inserted
-
-' "com::sun::star::container::XNameContainer"
- ' needs the following Global variables:
- Global oInstance As Object 'instance to insert
-
-' "com::sun::star::lang::XComponent#optional"
- ' needs the following Global variables:
- Global oComponentInstance As Object ' it will be disposed
-
-' "com::sun::star::lang::XMultiServiceFactory#optional"
- ' needs the following Global variables:
-' - Global cServiceName As String ie. "com.sun.star.drawing.RectangleShape"
-' - Global bCreateInstanceWithoutArguments As Boolean
-' - Global aArguments() As Variant
-
-' "com::sun::star::container::XContainer#optional"
- ' needs the following Global variables:
- Global oElementToInsert As Object
- Global oContainer As Object 'in case if the component tested does
-
-' "com::sun::star::container::XNamed"
- ' needs the following Global variables:
- Global cNameToSet As String
- '"fixed" if name is fixed
-
-' "com::sun::star::lang::XSingleServiceFactory#optional"
- ' needs the following Global variables:
- Global aArguments As Variant '[optional]
- Global aMustSupportInterface As Variant '[optional]
-
-
-Sub CreateObj()
-
-'*************************************************************************
-' COMPONENT:
-' OInnerTreeSetUpdateAccess
-'*************************************************************************
-On Error Goto ErrHndl
-
- Dim nodeArgs(1) as new com.sun.star.beans.PropertyValue
- Dim nodepath as new com.sun.star.beans.PropertyValue
- nodepath.Name = "nodepath"
- nodepath.Value = "org.openoffice.Office.Jobs"
- nodepath.Handle = -1
- nodepath.State = com.sun.star.beans.PropertyState.DEFAULT_VALUE
- nodeArgs(0) = nodepath
-
- Dim oProvider as Object
- oProvider = createUnoservice(_
- "com.sun.star.comp.configuration.ConfigurationProvider"
- Dim oObjectNames as Object
- Dim oComponentNames as Object
- oObjectNames = oProvider.createInstanceWithArguments(_
- "com.sun.star.configuration.ConfigurationUpdateAccess",_
- nodeArgs())
- oComponentNames = oProvider.createInstanceWithArguments(_
- "com.sun.star.configuration.ConfigurationUpdateAccess",_
- nodeArgs())
-
-
- oComponentInstance = oComponentNames.getByHierarchicalName("Jobs")
- oObj = oObjectNames.getByHierarchicalName("Jobs")
-
- Dim cNames() as String
- cNames = oObj.getElementNames()
-
- cNameToReplace = cNames(0) 'name of instance to be replased
- oReplaceInstance = oObj.createInstance()'instance, that will be inserted
- oInstance = oObj.createInstance()
- cNameToSet = "fixed"
- oElementToInsert = oObj.createInstance()
- oContainer = oObj
- oObjRelation(0).Name = "cannotSwitchParent"
- oObjRelation(0).Value = "configmgr: BasicElement::setParent: cannot move Entry"
- oObjRelation(1).Name = "ElementName"
- oObjRelation(1).Value = cNames(0)
- oObjRelation(2).Name = "HierarchicalName"
- oObjRelation(2).Value = "/org.openoffice.Office"
- oObjRelation(3).Name = "expectedName"
- oObjRelation(3).Value = cNames(0)
-
-Exit Sub
-ErrHndl:
- Test.Exception()
-End Sub
-</script:module>
diff --git a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/script.xlb b/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/script.xlb
deleted file mode 100644
index 1b35dd20c108..000000000000
--- a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerTreeSetUpdateAccess/script.xlb
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
- <library:library xmlns:library="http://openoffice.org/2000/library" library:name="cfgmgr2_OInnerTreeSetUpdateAccess" library:readonly="false" library:passwordprotected="false">
- <library:element library:name="cfgmgr2_OInnerTreeSetUpdateAccess"/>
- </library:library>
diff --git a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/cfgmgr2_OInnerValueSetUpdateAccess.xba b/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/cfgmgr2_OInnerValueSetUpdateAccess.xba
deleted file mode 100644
index 702a832bdf71..000000000000
--- a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/cfgmgr2_OInnerValueSetUpdateAccess.xba
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="OInnerValueSetUpdateAccess" script:language="StarBasic">
-
-'*************************************************************************
-'
-' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-'
-' Copyright 2000, 2010 Oracle and/or its affiliates.
-'
-' OpenOffice.org - a multi-platform office productivity suite
-'
-' This file is part of OpenOffice.org.
-'
-' OpenOffice.org is free software: you can redistribute it and/or modify
-' it under the terms of the GNU Lesser General Public License version 3
-' only, as published by the Free Software Foundation.
-'
-' OpenOffice.org is distributed in the hope that it will be useful,
-' but WITHOUT ANY WARRANTY; without even the implied warranty of
-' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-' GNU Lesser General Public License version 3 for more details
-' (a copy is included in the LICENSE file that accompanied this code).
-'
-' You should have received a copy of the GNU Lesser General Public License
-' version 3 along with OpenOffice.org. If not, see
-' <http://www.openoffice.org/license.html>
-' for a copy of the LGPLv3 License.
-'
-'*************************************************************************
-'*************************************************************************
-
-' Be sure that all variables are dimensioned:
-option explicit
-
-
-' REQUIRED VARIABLES for interface/service tests:
-
-' "com::sun::star::container::XNameReplace"
- ' needs the following object relation:
- Global cNameToReplace As String 'name of instance to be replased
- Global oReplaceInstance As Variant 'instance, that will be inserted
-
-' "com::sun::star::container::XNameContainer"
- ' needs the following object relation:
- Global oInstance As Variant 'instance to insert
-
-' "com::sun::star::lang::XComponent#optional"
- ' needs the following object relation:
- Global oComponentInstance As Variant 'it will be disposed
-
-' "com::sun::star::container::XHierarchicalNameAccess"
- ' needs the following object relation:
-' ObjectRelation: oObjRelation(0).Name = "ElementName"
-' ObjectRelation: oObjRelation(0).Value = "MyAccessibleElementName"
-
-' "com::sun::star::lang::XMultiServiceFactory#optional"
- ' needs the following object relation:
-' - Global cServiceName As String ie. "com.sun.star.drawing.RectangleShape"
-' - Global bCreateInstanceWithoutArguments As Boolean
-' - Global aArguments() As Variant
-
-' "com::sun::star::beans::XExactName"
- ' needs the following object relation:
-' ObjectRelation: oObjRelation(0).Name = "expectedName"
-' ObjectRelation: oObjRelation(0).Value = "MyExpectedName"
-
-' "com::sun::star::container::XContainer#optional"
- ' needs the following object relation:
- Global oElementToInsert As Variant
- Global oContainer As Variant ' in case if the component tested does
-
-' "com::sun::star::container::XNamed"
- ' needs the following object relation:
- Global cNameToSet As String '"fixed" if name is fixed
-
-' "com::sun::star::lang::XSingleServiceFactory#optional"
- ' needs the following object relation:
-' - Global aArguments As Variant [optional]
-' Global aMustSupportInterface As Variant [optional]
-
-' "com::sun::star::container::XChild#optional"
- ' needs the following object relation:
-' ObjectRelation: oObjRelation(0).Name = "cannotSwitchParent"
-' ObjectRelation: oObjRelation(0).Value = "configmgr: BasicElement::setParent: cannot move Entry"
-
-' "com::sun::star::container::XHierarchicalName"
- ' needs the following object relation:
-' ObjectRelation: oObjRelation(0).Name = "ElementName"
-' ObjectRelation: oObjRelation(0).Value = "MyAccessibleElementName"
-' ObjectRelation: oObjRelation(1).Name = "HierarchicalName"
-' ObjectRelation: oObjRelation(1).Value = "MyHierachicalName"
-
-
-Sub CreateObj()
-
-'*************************************************************************
-' COMPONENT:
-' com.sun.star.OInnerValueSetUpdateAccess
-'*************************************************************************
-On Error Goto ErrHndl
-
- Dim nodeArgs(1) as new com.sun.star.beans.PropertyValue
- Dim nodepath as new com.sun.star.beans.PropertyValue
- nodepath.Name = "nodepath"
- nodepath.Value = "org.openoffice.Office.Common"
- nodepath.Handle = -1
- nodepath.State = com.sun.star.beans.PropertyState.DEFAULT_VALUE
-
- oObj = oDoc
- nodeArgs(0) = nodepath
-
- Dim oProvider as Object
- oProvider = createUnoservice(_
- "com.sun.star.comp.configuration.ConfigurationProvider"
- Dim oObjectNames as Object
- Dim oComponentNames as Object
- oObjectNames = oProvider.createInstanceWithArguments(_
- "com.sun.star.configuration.ConfigurationUpdateAccess",_
- nodeArgs())
- oComponentNames = oProvider.createInstanceWithArguments(_
- "com.sun.star.configuration.ConfigurationUpdateAccess",_
- nodeArgs())
-
-
- oComponentInstance = oComponentNames.getByName("ExternalApps")
- oObj = oObjectNames.getByName("ExternalApps")
-
-
- 'Dim cNames() as String
- 'cNames = oObj.getElementNames()
-
- cNameToReplace = "file" 'name of instance to be replased
- oReplaceInstance = "NewOne"' oObj.createInstance()'instance, that will be inserted
- oInstance = "AnotherOne"
- cNameToSet = "fixed"
- oElementToInsert = "JustAnotherOne"
- oObjRelation(0).Name = "ElementName"
- oObjRelation(0).Value = "file"
- oObjRelation(1).Name = "HierarchicalName"
- oObjRelation(1).Value = "/org.openoffice.Office"
- oObjRelation(2).Name = "expectedName"
- oObjRelation(2).Value = "file"
- oObjRelation(3).Name = "cannotSwitchParent"
- oObjRelation(3).Value = "configmgr: BasicElement::setParent: cannot move Entry"
-
-Exit Sub
-ErrHndl:
- Test.Exception()
-End Sub
-</script:module>
diff --git a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/script.xlb b/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/script.xlb
deleted file mode 100644
index 1c1ea9721f42..000000000000
--- a/qadevOOo/tests/basic/mod/cfgmgr2/OInnerValueSetUpdateAccess/script.xlb
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
- <library:library xmlns:library="http://openoffice.org/2000/library" library:name="cfgmgr2_OInnerValueSetUpdateAccess" library:readonly="false" library:passwordprotected="false">
- <library:element library:name="cfgmgr2_OInnerValueSetUpdateAccess"/>
- </library:library>
diff --git a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java
index 3ca8794b87f4..bf05553bcb6d 100644
--- a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java
+++ b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java
@@ -423,8 +423,6 @@ public class CheckModuleAPI extends ComplexTestCase
* fwk -> framework
* fwl -> framework
* sch -> chart2
- * sysmgr1 -> configmgr
- * cfgmgr2 -> configmgr
* lnn -> lingu
* lng -> linguistic
* sfx -> sfx2
@@ -438,8 +436,6 @@ public class CheckModuleAPI extends ComplexTestCase
aModuleHashMap.put("fwk", "framework");
aModuleHashMap.put("fwl", "framework");
aModuleHashMap.put("sch", "chart2");
- aModuleHashMap.put("sysmgr1", "configmgr");
- aModuleHashMap.put("cfgmag2", "configmgr");
aModuleHashMap.put("lnn", "lingu");
aModuleHashMap.put("lng", "linguistic");
aModuleHashMap.put("sfx", "sfx2");
diff --git a/qadevOOo/tests/java/ifc/io/_XOutputStream.java b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
index 3f5b00fde4e7..c49aa479ee38 100644
--- a/qadevOOo/tests/java/ifc/io/_XOutputStream.java
+++ b/qadevOOo/tests/java/ifc/io/_XOutputStream.java
@@ -93,9 +93,8 @@ public class _XOutputStream extends MultiMethodTest {
XInputStream xInStream = checker.getInStream();
byte[][] readData = new byte[1][data.length];
- int iReadBytes = 0;
try {
- iReadBytes = xInStream.readBytes(readData, data.length);
+ xInStream.readBytes(readData, data.length);
} catch(com.sun.star.io.IOException e) {
log.println("Couldn't read data:" + e);
res = false;
diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java
index 8e0ccdcc5ffd..e7493e377141 100644
--- a/qadevOOo/tests/java/ifc/lang/_XComponent.java
+++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java
@@ -82,7 +82,9 @@ public class _XComponent extends MultiMethodTest {
XEventListener listener2 = new MyEventListener2();
/**
- * For the cfgmgr2.OSetElement tests: dispose the owner element.
+ * For the (no longer existing) cfgmgr2.OSetElement tests: dispose the owner
+ * element. TODO: Is this needed for anything else, too, or should it be
+ * removed?
*/
protected void before() {
// do not dispose this component, but parent instead
diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java
index 08d77ccc0ee3..b11659265441 100644
--- a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java
+++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java
@@ -78,7 +78,7 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
* @see om.sun.star.sdb.XSingleSelectQueryAnalyzer
* @see com.sun.star.beans.XPropertySet
*/
- protected void before() throws Exception {
+ protected void before() /* throws Exception*/ {
xQueryAna = (XSingleSelectQueryAnalyzer)
UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class,
@@ -100,7 +100,14 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
}
- colName = AnyConverter.toString(tEnv.getObjRelation("colName"));
+ try
+ {
+ colName = AnyConverter.toString(tEnv.getObjRelation("colName"));
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ colName = null;
+ }
if (colName == null) {
throw new StatusException(Status.failed(
diff --git a/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java b/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java
index 014152d79193..cbca4c600a4a 100644
--- a/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java
+++ b/qadevOOo/tests/java/ifc/sdbc/_XWarningsSupplier.java
@@ -136,4 +136,4 @@ public class _XWarningsSupplier extends MultiMethodTest {
tRes.tested("clearWarnings()", res);
}
-} \ No newline at end of file
+}
diff --git a/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java
index 7ae71682bb91..64ce14d88417 100644
--- a/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java
+++ b/qadevOOo/tests/java/mod/_acceptor.uno/Acceptor.java
@@ -45,9 +45,6 @@ import util.utils;
* @see ifc.connection._XAcceptor
*/
public class Acceptor extends TestCase {
-
- private XInterface acceptor = null ;
-
/**
* Acceptor chooses the first port after <code>basePort</code>
* which is free.
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/AdministrationProvider.java b/qadevOOo/tests/java/mod/_cfgmgr2/AdministrationProvider.java
deleted file mode 100644
index 386b8b3b4562..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/AdministrationProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-
-public class AdministrationProvider extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects.
- *
- * For this an instance of com.sun.star.comp.configuration.AdministrationProvider
- * is created at the MultiServiceFactory of the Office
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.AdministrationProvider");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- util.dbg.printInterfaces(oObj);
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Setup";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- Vector args = new Vector();
-
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("XMSF.Args",
- args.toArray(new Object[args.size()][]));
- tEnv.addObjRelation("needArgs", "AdministrationProvider");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/BootstrapContext.java b/qadevOOo/tests/java/mod/_cfgmgr2/BootstrapContext.java
deleted file mode 100644
index a0e79bd27127..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/BootstrapContext.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-public class BootstrapContext extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
-
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.bootstrap.BootstrapContext");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- System.out.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
-
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProvider.java b/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProvider.java
deleted file mode 100644
index 15c05a4317af..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-
-public class ConfigurationProvider extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects.
- *
- * For this an instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- util.dbg.printInterfaces(oObj);
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Setup";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- Vector args = new Vector();
-
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("XMSF.Args",
- args.toArray(new Object[args.size()][]));
- tEnv.addObjRelation("needArgs", "ConfigurationProvider");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProviderWrapper.java b/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProviderWrapper.java
deleted file mode 100644
index 006b719d787e..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ConfigurationProviderWrapper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-import java.util.Vector;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-public class ConfigurationProviderWrapper extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
-
- XInterface oObj = null;
-
- try {
- PropertyValue[] cArgs = new PropertyValue[2];
- cArgs[0] = new PropertyValue();
- cArgs[0].Name = "Locale";
- cArgs[0].Value = "DE";
- cArgs[1] = new PropertyValue();
- cArgs[1].Name = "EnableAsync";
- cArgs[1].Value = new Boolean(true);
-
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstanceWithArguments("com.sun.star.comp.configuration.ConfigurationProvider",cArgs);
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Setup";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- Vector args = new Vector();
-
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
- args.add(0, nodeArgs);
-
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("XMSF.Args",
- args.toArray(new Object[args.size()][]));
- tEnv.addObjRelation("needArgs", "ConfigurationProvider");
-
- return tEnv;
-
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/CopyImporter.java b/qadevOOo/tests/java/mod/_cfgmgr2/CopyImporter.java
deleted file mode 100644
index 173d6579e0ad..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/CopyImporter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-public class CopyImporter extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
-
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.backend.CopyImporter");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
-
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LayerParser.java b/qadevOOo/tests/java/mod/_cfgmgr2/LayerParser.java
deleted file mode 100644
index 984df1094207..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LayerParser.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import com.sun.star.io.XActiveDataSink;
-import com.sun.star.io.XInputStream;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-/**
- *
- * @author sw93809
- */
-public class LayerParser extends TestCase {
-
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
- Object Pipe = null;
- XSimpleFileAccess simpleAccess = null;
- XInputStream xStream = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.backend.xml.LayerParser");
- Object fileacc = ((XMultiServiceFactory)tParam.getMSF()).createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
- simpleAccess = (XSimpleFileAccess)
- UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
- String filename = util.utils.getOfficeURL((XMultiServiceFactory)tParam.getMSF())+"/../share/registry/data/org/openoffice/Setup.xcu";
- log.println("Going to parse: "+filename);
- xStream = simpleAccess.openFileRead(filename);
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- XActiveDataSink xSink = (XActiveDataSink) UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
- xSink.setInputStream(xStream);
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("InputStream", xStream);
-
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LayerUpdateMerger.java b/qadevOOo/tests/java/mod/_cfgmgr2/LayerUpdateMerger.java
deleted file mode 100644
index e9b035fa3c21..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LayerUpdateMerger.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import com.sun.star.configuration.backend.XLayer;
-import com.sun.star.configuration.backend.XLayerHandler;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.XLayerHandlerImpl;
-import util.XLayerImpl;
-
-public class LayerUpdateMerger extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- XLayerHandler xLayerHandler = null;
- XLayer xLayer = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.configuration.backend.LayerUpdateMerger");
-
- XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(
- XInitialization.class, oObj);
- xLayerHandler = new XLayerHandlerImpl();
- xLayer = new XLayerImpl();
-
- xInit.initialize(new Object[] { xLayerHandler,xLayer });
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("LayerHandler", xLayerHandler);
- tEnv.addObjRelation("Layer", xLayer);
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LayerWriter.java b/qadevOOo/tests/java/mod/_cfgmgr2/LayerWriter.java
deleted file mode 100644
index 7a2714c86042..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LayerWriter.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import com.sun.star.io.XActiveDataSource;
-import com.sun.star.io.XOutputStream;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-
-public class LayerWriter extends TestCase {
- public XOutputStream xStream = null;
-
- /**
- * Just clears flag which indicates that port is free now.
- */
- public synchronized void disposeTestEnvironment(TestEnvironment tEnv,
- TestParameters tParam) {
-
-
- try {
- xStream.closeOutput();
- } catch (com.sun.star.io.NotConnectedException e) {
- } catch (com.sun.star.io.BufferSizeExceededException e) {
- } catch (com.sun.star.io.IOException e) {
- }
- }
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- XSimpleFileAccess simpleAccess = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.configuration.backend.xml.LayerWriter");
-
- Object fileacc = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.ucb.SimpleFileAccess");
- simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(
- XSimpleFileAccess.class, fileacc);
-
- String filename = util.utils.getOfficeTemp(
- (XMultiServiceFactory) tParam.getMSF()) +
- "LayerWriter.xcu";
- log.println("Going to parse: " + filename);
-
- xStream = simpleAccess.openFileWrite(filename);
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- XActiveDataSource xSource = (XActiveDataSource) UnoRuntime.queryInterface(
- XActiveDataSource.class, oObj);
- xSource.setOutputStream(xStream);
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("OutputStream", xStream);
-
- return tEnv;
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LocalDataImporter.java b/qadevOOo/tests/java/mod/_cfgmgr2/LocalDataImporter.java
deleted file mode 100644
index 25e3b2020482..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LocalDataImporter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import com.sun.star.beans.NamedValue;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-
-public class LocalDataImporter extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.configuration.backend.LocalDataImporter");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- String filename = util.utils.getOfficeURL(
- (XMultiServiceFactory) tParam.getMSF()) +
- "/../share/registry/data/org/openoffice/Setup.xcs";
-
- Object[] vXJobArgs = new Object[1];
- NamedValue[] vXJobArg0 = new NamedValue[1];
- vXJobArg0[0] = new NamedValue("LayerDataUrl", filename);
- vXJobArgs[0] = vXJobArg0;
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
- tEnv.addObjRelation("XJobArgs", vXJobArgs);
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LocalHierarchyBrowser.java b/qadevOOo/tests/java/mod/_cfgmgr2/LocalHierarchyBrowser.java
deleted file mode 100644
index e1428d460016..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LocalHierarchyBrowser.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import com.sun.star.beans.NamedValue;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class LocalHierarchyBrowser extends TestCase {
-
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.configuration.backend.LocalHierarchyBrowser");
- } catch (com.sun.star.uno.Exception e) {
- }
-
- String filename = util.utils.getOfficeURL(
- (XMultiServiceFactory) tParam.getMSF()) +
- "/../share/registry/data/org/openoffice";
-
- String filename2 = util.utils.getOfficeURL(
- (XMultiServiceFactory) tParam.getMSF()) +
- "/../share/registry/schema/org/openoffice/";
-
- Object[] vXJobArgs = new Object[2];
- NamedValue[] vXJobArg0 = new NamedValue[1];
- vXJobArg0[0] = new NamedValue("LayerDataUrl", filename);
- NamedValue[] vXJobArg1 = new NamedValue[1];
- vXJobArg1[0] = new NamedValue("SchemaDataUrl", filename2);
- vXJobArgs[0] = vXJobArg0;
- vXJobArgs[1] = vXJobArg1;
-
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
- tEnv.addObjRelation("XJobArgs", vXJobArgs);
-
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSchemaSupplier.java b/qadevOOo/tests/java/mod/_cfgmgr2/LocalSchemaSupplier.java
deleted file mode 100644
index df8e51095f99..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSchemaSupplier.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class LocalSchemaSupplier extends TestCase {
-
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
-
- try {
- Object[] args = new Object[1];
- args[0] = ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstanceWithArguments("com.sun.star.comp.configuration.backend.LocalSchemaSupplier",args);
-
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleBackend.java b/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleBackend.java
deleted file mode 100644
index 3f8b88551146..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleBackend.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class LocalSingleBackend extends TestCase {
-
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
-
- try {
- Object[] args = new Object[1];
- args[0] = ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstanceWithArguments("com.sun.star.comp.configuration.backend.LocalSingleBackend",args);
-
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
- }
-
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleStratum.java b/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleStratum.java
deleted file mode 100644
index 39aad3cac3a2..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/LocalSingleStratum.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XStringSubstitution;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-
-public class LocalSingleStratum extends TestCase {
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- String AdminURL = "";
-
- try {
- Object[] args = new Object[1];
- XStringSubstitution sts = createStringSubstitution(
- (XMultiServiceFactory) tParam.getMSF());
- String userURL = sts.getSubstituteVariableValue("$(user)");
- args[0] = userURL + "/registry";
- AdminURL = sts.getSubstituteVariableValue("$(inst)") +
- "/share/registry";
- log.println("Using: " + args[0]);
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstanceWithArguments(
- "com.sun.star.comp.configuration.backend.LocalSingleStratum",
- args);
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("NoAdmin", AdminURL);
-
- return tEnv;
- }
-
- public static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF) {
- Object xPathSubst = null;
-
- try {
- xPathSubst = xMSF.createInstance(
- "com.sun.star.util.PathSubstitution");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- if (xPathSubst != null) {
- return (XStringSubstitution) UnoRuntime.queryInterface(
- XStringSubstitution.class, xPathSubst);
- } else {
- return null;
- }
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/MergeImporter.java b/qadevOOo/tests/java/mod/_cfgmgr2/MergeImporter.java
deleted file mode 100644
index 0a69f6e34e82..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/MergeImporter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class MergeImporter extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance(
- "com.sun.star.comp.configuration.backend.MergeImporter");
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("Implementation name: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/MultiStratumBackend.java b/qadevOOo/tests/java/mod/_cfgmgr2/MultiStratumBackend.java
deleted file mode 100644
index 737a08145974..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/MultiStratumBackend.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * MultiStratumBackend.java
- *
- * Created on 24. March 2004, 13:48
- */
-
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XStringSubstitution;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class MultiStratumBackend extends TestCase {
-
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
-
- Object[] args = new Object[1];
- String AdminURL = "";
-
- try {
- XStringSubstitution sts = createStringSubstitution(
- (XMultiServiceFactory) tParam.getMSF());
- AdminURL = sts.getSubstituteVariableValue("$(inst)") +
- "/share/registry";
- args[0] = ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstanceWithArguments("com.sun.star.comp.configuration.backend.MultiStratumBackend",args);
-
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- //objRelation for XInitialization
- tEnv.addObjRelation("XInitialization.args", args);
-
- //objRelation for XBackendEntities
- tEnv.addObjRelation("NoAdmin", AdminURL);
- tEnv.addObjRelation("MSB", Boolean.TRUE);
-
- return tEnv;
- }
-
- public static XStringSubstitution createStringSubstitution(XMultiServiceFactory xMSF) {
- Object xPathSubst = null;
-
- try {
- xPathSubst = xMSF.createInstance(
- "com.sun.star.util.PathSubstitution");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- if (xPathSubst != null) {
- return (XStringSubstitution) UnoRuntime.queryInterface(
- XStringSubstitution.class, xPathSubst);
- } else {
- return null;
- }
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OConfigurationRegistry.java b/qadevOOo/tests/java/mod/_cfgmgr2/OConfigurationRegistry.java
deleted file mode 100644
index 7bc0e87daab8..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OConfigurationRegistry.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.XInterface;
-
-
-public class OConfigurationRegistry extends TestCase {
- protected static int uniq = 0;
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects.
- *
- * For this an instance of com.sun.star.configuration.ConfigurationRegistry
- * is created at the MultiServiceFactory of the Office
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.configuration.ConfigurationRegistry");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- System.out.println("IName: " + util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("XSimpleRegistry.open", "org.openoffice.Setup") ;
- tEnv.addObjRelation("XSimpleRegistry.merge", "org.openoffice.Inet") ;
- tEnv.addObjRelation("XSimpleRegistry.destroy", "org.openoffice.Setup") ;
-
- tEnv.addObjRelation("configuration", new Boolean(true));
-
- return tEnv;
- }
-
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupInfoAccess.java
deleted file mode 100644
index 4dd5fa567be3..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupInfoAccess.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OInnerGroupInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XNameReplace updateAccess = null;
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
- oObj = (XInterface) names.getByName(names.getElementNames()[0]);
-
- names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- oObj);
-
- String[] theNames = names.getElementNames();
-
- log.println("Contains " + theNames.length + " elements");
-
- // create a changeable view on the element for XContainer interface
- names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess", nodeArgs));
- updateAccess = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class,
- names.getByName(names.getElementNames()[0]));
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- String[] pNames = new String[] {
- "AutoDetectSystemHC", "HelpTipSeconds", "IsAllowAnimatedGraphics",
- "IsAllowAnimatedText", "IsAutomaticFontColor", "IsForPagePreviews",
- "IsHelpTipsDisappear", "IsSelectionInReadonly", "IsSystemFont"
- };
-
- String[] pTypes = new String[] {
- "Boolean", "Short", "Boolean", "Boolean", "Boolean", "Boolean",
- "Boolean", "Boolean", "Boolean"
- };
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
-
- tEnv.addObjRelation("XContainer.Container", updateAccess);
- // create an unlikely value for "HelpTipSeconds"
- tEnv.addObjRelation("XContainer.NewValue", new Short((short)300000));
- tEnv.addObjRelation("XContainer.ElementName", pNames[1]);
-
- tEnv.addObjRelation("ElementName", "AutoDetectSystemHC");
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("allReadOnly",
- "all Properties of OInnerGroupInfoAccess are read Only");
-
- tEnv.addObjRelation("expectedName", "IsSelectionInReadonly");
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("NoSetName", "OInnerGroupInfoAccess");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupUpdateAccess.java
deleted file mode 100644
index f93dade2ba45..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerGroupUpdateAccess.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OInnerGroupUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
- oObj = (XInterface) names.getByName(names.getElementNames()[0]);
-
- names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- oObj);
-
- String[] theNames = names.getElementNames();
-
- log.println("Contains " + theNames.length + " elements");
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- String[] pNames = new String[] {
- "AutoDetectSystemHC", "HelpTipSeconds", "IsAllowAnimatedGraphics",
- "IsAllowAnimatedText", "IsAutomaticFontColor", "IsForPagePreviews",
- "IsHelpTipsDisappear", "IsSelectionInReadonly", "IsSystemFont"
- };
-
- String[] pTypes = new String[] {
- "Boolean", "Short", "Boolean", "Boolean", "Boolean", "Boolean",
- "Boolean", "Boolean", "Boolean"
- };
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
-
- tEnv.addObjRelation("ElementName", "AutoDetectSystemHC");
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("expectedName", "IsSelectionInReadonly");
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
-
- Short val = new Short((short)3);
- tEnv.addObjRelation("INSTANCE1", val);
- tEnv.addObjRelation("NAMEREPLACE", pNames[1]);
- tEnv.addObjRelation("XContainer.NewValue", val);
- tEnv.addObjRelation("XContainer.ElementName", pNames[1]);
- tEnv.addObjRelation("XContainer.Container", (XNameReplace)
- UnoRuntime.queryInterface(XNameReplace.class, oObj));
- tEnv.addObjRelation("NoSetName", "OInnerGroupInfoAccess");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerSetInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OInnerSetInfoAccess.java
deleted file mode 100644
index 5053e9fbdfc1..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerSetInfoAccess.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XHierarchicalNameAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OInnerSetInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Jobs";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XNameReplace updateAccess = null;
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XHierarchicalNameAccess names = (XHierarchicalNameAccess) UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
- oObj = (XInterface) names.getByHierarchicalName("Jobs");
-
- // create a changeable view on the element for XContainer interface
- XNameAccess access = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess", nodeArgs));
- updateAccess = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, access.getByName("Jobs"));
-
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- updateAccess);
- instance = jobsFac.createInstance();
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class, oObj);
-
- String[] pNames = names.getElementNames();
-
- tEnv.addObjRelation("ElementName", pNames[0]);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("XContainer.Container", updateAccess) ;
- tEnv.addObjRelation("XContainer.NewValue", instance);
- tEnv.addObjRelation("XContainer.ElementName", pNames[0]);
-
- tEnv.addObjRelation("expectedName", pNames[0]);
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("NoSetName", "OInnerTreeSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Jobs/Job");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerTreeSetUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OInnerTreeSetUpdateAccess.java
deleted file mode 100644
index 67beffbb4bbf..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerTreeSetUpdateAccess.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XHierarchicalNameAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OInnerTreeSetUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- Object instance1 = null;
- Object instance2 = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Jobs";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XHierarchicalNameAccess names = (XHierarchicalNameAccess) UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
- oObj = (XInterface) names.getByHierarchicalName("Jobs");
-
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- oObj);
- instance = jobsFac.createInstance();
- instance1 = jobsFac.createInstance();
- instance2 = jobsFac.createInstance();
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class, oObj);
-
- String[] pNames = names.getElementNames();
-
- tEnv.addObjRelation("ElementName", pNames[0]);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("expectedName", pNames[0]);
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("INSTANCE", instance);
- tEnv.addObjRelation("INSTANCE1", instance1);
- tEnv.addObjRelation("INSTANCE2", instance1);
- tEnv.addObjRelation("NAMEREPLACE", pNames[0]);
- tEnv.addObjRelation("NoSetName", "OInnerTreeSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Jobs/Job");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerValueSetUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OInnerValueSetUpdateAccess.java
deleted file mode 100644
index 229869a0753e..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OInnerValueSetUpdateAccess.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameContainer;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class OInnerValueSetUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
-
- log.println("creating the Environment");
-
- // create some entries for testing, use the ORootElementValueSetUpdateAccess
- // service for this: see cfgmgr2.ORootElementValueSetUpdateAccess
- createSomeEntries((XMultiServiceFactory)tParam.getMSF());
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "/org.openoffice.Office.Common";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- oObj = (XInterface) names.getByName("ExternalApps");
-
- names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- oObj);
-
- String[] theNames = names.getElementNames();
-
- log.println("Contains " + theNames.length + " elements");
-
-// for (int k = 0; k < theNames.length; k++) {
-// System.out.println("child " + theNames[k]);
-// }
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- String[] pNames = new String[] {
- "file", "ftp", "http", "https", "mailto"
- };
-
- String[] pTypes = new String[] {
- "String", "String", "String", "String", "String"
- };
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- String overwriteString = "NewOne";
- tEnv.addObjRelation("INSTANCE1", overwriteString);
- tEnv.addObjRelation("NAMEREPLACE", pNames[1]);
- // for XContainer
- tEnv.addObjRelation("INSTANCE", overwriteString);
-
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("ElementName", "file");
- tEnv.addObjRelation("NoSetName", "OInnerValueSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "cfg:value/cfg:any");
- tEnv.addObjRelation("expectedName", "file");
-
- return tEnv;
- }
-
- /**
- * Create entries in the ExternalApps layer, so there is something to test
- * @param oObj The test object: used to create some entries.
- */
- private void createSomeEntries(XMultiServiceFactory xMSF) {
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common/ExternalApps";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- Object oObj = null;
- try {
- XInterface Provider = (XInterface) xMSF.createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
- XNameContainer xCont = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, oObj);
- insertOrUpdate(xCont, "file", "just");
- insertOrUpdate(xCont, "ftp", "some");
- insertOrUpdate(xCont, "dummy", "arbitrary");
- insertOrUpdate(xCont, "http", "value");
- // write the changes into the user layer.
- XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, oObj);
- try {
- xBatch.commitChanges();
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- }
-
- /**
- * Insert a value in a name container or else update it
- * @param xCont The name conationer to insert or update.
- * @param name The name of the value.
- * @param value The value itself.
- */
- private void insertOrUpdate(XNameContainer xCont, String name, String value) {
- boolean update = false;
- try {
- xCont.insertByName(name, value);
- System.out.println("##### No Exception!");
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.ElementExistException e) {
- update = true;
- }
- try {
- if (update)
- xCont.replaceByName(name, value);
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.NoSuchElementException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupInfoAccess.java
deleted file mode 100644
index dcc6d48226e8..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupInfoAccess.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class ORootElementGroupInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XInterface changeView = null;
- XInterface alternateObject = null;
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
- // create a view on a different object that can change something, so listeners can be triggered.
- // this is done for XContainer test
- nodepath.Value = "org.openoffice.Office.Common/Internal";
- changeView = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
- alternateObject = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, oObj);
- util.dbg.printPropertiesNames(prop);
-
- String[] pNames = new String[] {
- "Accessibility", "AddXMLToStorage", "AsianLayout", "AutoCorrect",
- "Cache", "DateFormat", "ExternalApps", "ExternalMailer", "Filter",
- "Font", "Gallery", "Help", "History", "I18N", "Image", "Internal",
- "InternalMSExport", "Java", "Load", "Menus", "Misc",
- "OfficeObjects", "Passwords", "Path", "Print", "Save",
- "SearchOptions", "Security", "Setup", "Startup", "Undo",
- "Vectorize", "View", "WorkingSet", "_3D_Engine"
- };
-
- String[] pTypes = new String[36];
-
- for (int k = 0; k < pTypes.length; k++) {
- pTypes[k] = "XInterface";
- }
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
-
- tEnv.addObjRelation("ElementName", "Accessibility");
-
- tEnv.addObjRelation("XLocalizable.ReadOnly", "Locale of ORootElementGroupInfoAccess is read Only");
- tEnv.addObjRelation("allReadOnly",
- "all Properties of ORootElementGroupInfoAccess are read Only");
-
- tEnv.addObjRelation("XContainer.NewValue", "SenselessString");
- tEnv.addObjRelation("XContainer.ElementName", "CurrentTempURL");
- tEnv.addObjRelation("XContainer.Container", changeView);
- tEnv.addObjRelation("XContainer.AlternateObject", alternateObject);
-
- tEnv.addObjRelation("XChangesNotifier.ChangesBatch", (XChangesBatch)UnoRuntime.queryInterface(
- XChangesBatch.class, changeView));
-
- // set a new temp directory: use java.io.tmpdir as substitute, for XChangesNotifier test
- // get a XPropertySet from the sub element
- XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, changeView);
- String newTempURL = util.utils.getFullURL(util.utils.getUsersTempDir());
- String curTempURL = "";
- try {
- curTempURL = (String)xProp.getPropertyValue("CurrentTempURL");
- }
- catch(Exception e) {
- log.println("Cannot get property for XChangesNotifier test: this test is bound to fail.");
- e.printStackTrace((PrintWriter)log);
- }
- // fallback 1: get user home
- if (newTempURL.equalsIgnoreCase(curTempURL)) {
- newTempURL = util.utils.getFullURL(System.getProperty("user.home"));
- // fallback 2: get user dir
- if (newTempURL.equalsIgnoreCase(curTempURL)) {
- newTempURL = util.utils.getFullURL(System.getProperty("user.dir"));
- }
- }
- tEnv.addObjRelation("XChangesNotifier.ChangeElement", newTempURL);
- tEnv.addObjRelation("XChangesNotifier.OriginalElement", curTempURL);
- tEnv.addObjRelation("XChangesNotifier.PropertyName", "CurrentTempURL");
- tEnv.addObjRelation("XChangesNotifier.PropertySet", xProp);
-
- tEnv.addObjRelation("expectedName", "OfficeObjects");
- tEnv.addObjRelation("HierachicalName", "/org.openoffice");
-
- tEnv.addObjRelation("NoSetName", "ORootElementGroupInfoAccess");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupUpdateAccess.java
deleted file mode 100644
index dc04b7a29e11..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementGroupUpdateAccess.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class ORootElementGroupUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common/Internal";
-
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
-/* helper.ConfigurationRead read = new helper.ConfigurationRead(pMSF, "org.openoffice.Office.Common");
- String[] subs = read.getRootNodeNames();
- for (int i=0; i<subs.length; i++)
- System.out.println("Rootnodes " + subs[i]);
- subs = read.getSubNodeNames("Internal");
- for (int i=0; i<subs.length; i++)
- System.out.println("Rootnodes " + subs[i]);
- Object subNode = read.getByHierarchicalName("Internal/RecoveryList");
- util.dbg.getSuppServices(subNode); */
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, oObj);
-
- Object instance = null;
-
- String[] pNames = new String[] {
- "CurrentTempURL",
- "DevelopmentChart",
- "SendCrashMail",
- "Slot",
- "UseMailUI"//, "RecoveryList"
- };
-
- String[] pTypes = new String[]{
- "String",
- "Boolean",
- "Boolean",
- "Boolean",
- "Boolean"
- };
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
-
- // for XHierarchicalNameAccess
- tEnv.addObjRelation("ElementName", "Slot");
-
- tEnv.addObjRelation("XLocalizable.ReadOnly", "Localization is final and can't be changed");
-
- tEnv.addObjRelation("XChangesNotifier.ChangesBatch", (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, oObj));
-
- // set a new temp directory: use java.io.tmpdir as substitute
- String newTempURL = util.utils.getFullURL(util.utils.getUsersTempDir());
- String curTempURL = "";
- try {
- curTempURL = (String)prop.getPropertyValue("CurrentTempURL");
- }
- catch(Exception e) {
- log.println("Cannot get property for XChangesBatch test: this test is bound to fail.");
- e.printStackTrace((PrintWriter)log);
- }
- // fallback 1: get user home
- if (newTempURL.equalsIgnoreCase(curTempURL)) {
- newTempURL = util.utils.getFullURL(System.getProperty("user.home"));
- // fallback 2: get user dir
- if (newTempURL.equalsIgnoreCase(curTempURL)) {
- newTempURL = util.utils.getFullURL(System.getProperty("user.dir"));
- }
- }
-
- tEnv.addObjRelation("XChangesBatch.ChangeElement", newTempURL);
- tEnv.addObjRelation("XChangesBatch.OriginalElement", curTempURL);
- tEnv.addObjRelation("XChangesBatch.PropertyName", "CurrentTempURL");
- tEnv.addObjRelation("XChangesBatch.PropertySet", prop);
- tEnv.addObjRelation("XChangesNotifier.ChangeElement", newTempURL);
- tEnv.addObjRelation("XChangesNotifier.OriginalElement", curTempURL);
- tEnv.addObjRelation("XChangesNotifier.PropertyName", "CurrentTempURL");
- tEnv.addObjRelation("XChangesNotifier.PropertySet", prop);
-
- tEnv.addObjRelation("expectedName", "RecoveryList");
- tEnv.addObjRelation("HierachicalName", "/org.openoffice");
-
- String overwriteString = new String("ThisIsSenselessForSure");
- tEnv.addObjRelation("INSTANCE1", overwriteString);
- tEnv.addObjRelation("NAMEREPLACE", pNames[0]);
-
- tEnv.addObjRelation("XContainer.NewValue", overwriteString);
- tEnv.addObjRelation("XContainer.ElementName", pNames[0]);
- tEnv.addObjRelation("XContainer.Container", (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, oObj));
-
- tEnv.addObjRelation("NoSetName", "ORootElementGroupInfoAccess");
-
- return tEnv;
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementSetInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementSetInfoAccess.java
deleted file mode 100644
index 6126e2d156c5..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementSetInfoAccess.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class ORootElementSetInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Jobs/Jobs";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XInterface changeView = null;
- Object instance = null;
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
- changeView = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- changeView);
- instance = jobsFac.createInstance();
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
- log.println("ChangeView: " + utils.getImplName(changeView));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameReplace container = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, changeView);
- tEnv.addObjRelation("XContainer.NewValue", instance);
- tEnv.addObjRelation("XContainer.ElementName", "RegistrationRequest");
- tEnv.addObjRelation("XContainer.Container", container);
-
- tEnv.addObjRelation("XChangesNotifier.ChangesBatch", (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, changeView));
- tEnv.addObjRelation("XChangesNotifier.ChangeElement", instance);
- tEnv.addObjRelation("XChangesNotifier.PropertyName", "RegistrationRequest");
- tEnv.addObjRelation("XChangesNotifier.NameReplace", container);
-
- tEnv.addObjRelation("XLocalizable.ReadOnly", "Locale of ORootElementSetInfoAccess is read Only");
- tEnv.addObjRelation("allReadOnly",
- "all Properties of ORootElementSetInfoAccess are read Only");
- tEnv.addObjRelation("NoSetName", "ORootElementSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Jobs/Job");
- tEnv.addObjRelation("HierachicalName", "/org.openoffice");
- tEnv.addObjRelation("ElementName", "RegistrationRequest");
- tEnv.addObjRelation("expectedName", "RegistrationRequest");
-
- return tEnv;
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementTreeSetUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementTreeSetUpdateAccess.java
deleted file mode 100644
index 31d451c97bd9..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementTreeSetUpdateAccess.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class ORootElementTreeSetUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- Object instance1 = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Jobs/Jobs";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- oObj);
- instance = jobsFac.createInstance();
- instance1 = jobsFac.createInstance();
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("NAMEREPLACE","RegistrationRequest");
- tEnv.addObjRelation("INSTANCE", instance);
- tEnv.addObjRelation("INSTANCE1", instance1);
- tEnv.addObjRelation("INSTANCE2", instance1);
-
- tEnv.addObjRelation("XChangesBatch.ChangeElement", instance);
- tEnv.addObjRelation("XChangesBatch.PropertyName", "RegistrationRequest");
- tEnv.addObjRelation("XChangesBatch.NameReplace", (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, oObj));
-
- tEnv.addObjRelation("XChangesNotifier.ChangeElement", instance);
- tEnv.addObjRelation("XChangesNotifier.PropertyName", "RegistrationRequest");
- tEnv.addObjRelation("XChangesNotifier.NameReplace", (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, oObj));
- tEnv.addObjRelation("XChangesNotifier.ChangesBatch", (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, oObj));
-
- tEnv.addObjRelation("XLocalizable.ReadOnly", "Locale of ORootElementTreeSetUpdateAccess is read Only");
- tEnv.addObjRelation("NoSetName", "ORootElementTreeSetUpdateAccess");
-
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("ElementName","RegistrationRequest");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Jobs/Job");
-
- tEnv.addObjRelation("expectedName","RegistrationRequest");
- return tEnv;
- }
-
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementValueSetUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementValueSetUpdateAccess.java
deleted file mode 100644
index 48bfa8f489c0..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/ORootElementValueSetUpdateAccess.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameContainer;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-/**
- * Check the ORootElementValueSetUpdateAccess service.
- * For this, the ExternalApss layer is used. Since this layer is empty (since
- * cws cfgapi), some own values are created and written to the current user
- * layer. The tests are then executed on these values.
- */
-public class ORootElementValueSetUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- Object instance1 = null;
- Object instance2 = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common/ExternalApps";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- oObj = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- String[] pNames = new String[] {
- "file", "ftp", "dummy", "http"
- };
-
- String[] pTypes = new String[] {
- "String", "String", "String", "String"
- };
-
- createSomeEntries(oObj);
-
- tEnv.addObjRelation("INSTANCE1", "NewOne1");
- tEnv.addObjRelation("NAMEREPLACE", pNames[0]);
-
- // for XContainer
- tEnv.addObjRelation("INSTANCE", "NewOne2");
-
- tEnv.addObjRelation("XChangesBatch.PropertyName", pNames[0]);
- tEnv.addObjRelation("XChangesBatch.ChangeElement", "NewOne3");
- tEnv.addObjRelation("XChangesBatch.NameReplace", (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, oObj));
-
- tEnv.addObjRelation("XChangesNotifier.PropertyName", pNames[0]);
- tEnv.addObjRelation("XChangesNotifier.ChangeElement", "NewOne4");
- tEnv.addObjRelation("XChangesNotifier.ChangesBatch" , (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, oObj));
- tEnv.addObjRelation("XChangesNotifier.NameReplace", (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, oObj));
-
- tEnv.addObjRelation("XLocalizable.ReadOnly", "Locale of ORootElementValueSetUpdateAccess is read Only");
- tEnv.addObjRelation("NoSetName", "ORootElementValueSetUpdateAccess");
-
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("ElementName","http");
- tEnv.addObjRelation("TemplateName", "cfg:value/cfg:any");
-
- tEnv.addObjRelation("expectedName","http");
- return tEnv;
- }
-
- /**
- * Create entries in the ExternalApps layer, so there is something to test
- * @param oObj The test object: used to create some entries.
- */
- private void createSomeEntries(XInterface oObj) {
- XNameContainer xCont = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, oObj);
- insertOrUpdate(xCont, "file", "just");
- insertOrUpdate(xCont, "ftp", "some");
- insertOrUpdate(xCont, "dummy", "arbitrary");
- insertOrUpdate(xCont, "http", "value");
- // write the changes into the user layer.
- XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, oObj);
- try {
- xBatch.commitChanges();
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- }
-
- /**
- * Insert a value in a name container or else update it
- * @param xCont The name conationer to insert or update.
- * @param name The name of the value.
- * @param value The value itself.
- */
- private void insertOrUpdate(XNameContainer xCont, String name, String value) {
- boolean update = false;
- try {
- xCont.insertByName(name, value);
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.ElementExistException e) {
- update = true;
- }
- try {
- if (update)
- xCont.replaceByName(name, value);
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.NoSuchElementException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupInfoAccess.java
deleted file mode 100644
index ad31d2228968..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupInfoAccess.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameContainer;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import com.sun.star.util.XChangesBatch;
-
-
-public class OSetElementGroupInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Common/Menus";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XNameAccess xHierachNameAccess = null;
- XNameReplace xChangeView = null;
- XComponent xDisposeComponent = null;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
-
- xHierachNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess", nodeArgs));
-
- XInterface oInnerSetInfoAccess = (XInterface) xHierachNameAccess.getByName("New");
-
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- oInnerSetInfoAccess);
-
- String[] theNames = names.getElementNames();
-
- log.println("Contains " + theNames.length + " elements");
-
- xDisposeComponent = (XComponent)
- UnoRuntime.queryInterface(XComponent.class, xHierachNameAccess);
-
- String[] elnames = names.getElementNames();
-
- log.println("use node 'm0'");
- oObj = (XInterface) names.getByName("m0");
-
-
-
- log.println("create ConfigurationUpdateAccess to modify the object...");
-
- xHierachNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- oInnerSetInfoAccess = (XInterface) xHierachNameAccess.getByName("New");
-
- names = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
- oInnerSetInfoAccess);
-
- log.println("use node 'm0'");
-
- XInterface xInt = (XInterface) names.getByName("m0");
- xChangeView = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class,
- xInt);
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- String[] pNames = new String[] { "ImageIdentifier", "Title", "URL", "TargetName" };
-
- String[] pTypes = new String[] { "String", "String", "String", "String" };
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("ElementName", "Title");
- tEnv.addObjRelation("NoSetName", "OInnerValueSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "cfg:value/cfg:any");
- tEnv.addObjRelation("expectedName", "ImageIdentifier");
-
- tEnv.addObjRelation("XContainer.NewValue", "aValue");
- tEnv.addObjRelation("XContainer.ElementName", "TargetName");
- tEnv.addObjRelation("XContainer.Container", xChangeView);
-
- // dispose the owner of the test object
- tEnv.addObjRelation("XComponent.DisposeThis", xDisposeComponent);
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
- tEnv.addObjRelation("allReadOnly",
- "all Properties of OSetElementGroupInfoAccess are read Only");
-
- tEnv.addObjRelation("TemplateInstance", "org.openoffice.Office.Common/MenuType");
-
- return tEnv;
- }
- /**
- * Create entries in the ExternalApps layer, so there is something to test
- * @param oObj The test object: used to create some entries.
- */
- private void createSomeEntries(XInterface xObj) {
- XNameContainer xCont = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, xObj);
- insertOrUpdate(xCont, "file", xObj);
-// insertOrUpdate(xCont, "ftp", "some");
-// insertOrUpdate(xCont, "dummy", "arbitrary");
-// insertOrUpdate(xCont, "http", "value");
- // write the changes into the user layer.
- XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface(XChangesBatch.class, xObj);
- try {
- xBatch.commitChanges();
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- }
-
- /**
- * Insert a value in a name container or else update it
- * @param xCont The name conationer to insert or update.
- * @param name The name of the value.
- * @param value The value itself.
- */
- private void insertOrUpdate(XNameContainer xCont, String name, XInterface value) {
- boolean update = false;
- XSingleServiceFactory xFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- value);
-
- try {
- xCont.insertByName(name, xFac.createInstance());
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- log.println("ERROR: " + e.toString());
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- log.println("ERROR: " + e.toString());
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.ElementExistException e) {
- update = true;
- }
- catch(com.sun.star.uno.Exception e) {
- log.println("could not create Instance: " + e.toString());
- }
-
- try {
- if (update)
- xCont.replaceByName(name, xFac.createInstance());
- }
- catch(com.sun.star.lang.IllegalArgumentException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.container.NoSuchElementException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.lang.WrappedTargetException e) {
- // ignore: bug will be found with the interface test
- }
- catch(com.sun.star.uno.Exception e) {
- log.println("could not create Instance: " + e.toString());
- }
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupUpdateAccess.java
deleted file mode 100644
index 45132f890185..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementGroupUpdateAccess.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XHierarchicalNameAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OSetElementGroupUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Jobs";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- XHierarchicalNameAccess names = (XHierarchicalNameAccess) UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- names.getByHierarchicalName("Jobs"));
- oObj = (XInterface) jobsFac.createInstance();
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class, oObj);
-
- String[] pNames = names.getElementNames();
- String[] pTypes = new String[pNames.length];
-
- for (int k=0;k<pNames.length;k++) {
- pTypes[k] = "boolean";
- }
-
-
- tEnv.addObjRelation("ElementName", pNames[0]);
-
- tEnv.addObjRelation("PropertyNames", pNames);
- tEnv.addObjRelation("PropertyTypes", pTypes);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("expectedName", pNames[0]);
- tEnv.addObjRelation("INSTANCE1", "newValue");
- tEnv.addObjRelation("HierachicalName", "//Job");
- tEnv.addObjRelation("NoSetName", "OSetElementGroupUpdateAccess");
-
- tEnv.addObjRelation("XContainer.NewValue", "aValue");
- tEnv.addObjRelation("XContainer.ElementName", pNames[0]);
- tEnv.addObjRelation("XContainer.Container", (XNameReplace)
- UnoRuntime.queryInterface(XNameReplace.class, oObj));
-
- tEnv.addObjRelation("TemplateInstance", (String)nodepath.Value + "/Job");
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementSetInfoAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementSetInfoAccess.java
deleted file mode 100644
index 255698e14cd8..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementSetInfoAccess.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XHierarchicalNameAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.container.XNameContainer;
-import com.sun.star.container.XNameReplace;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OSetElementSetInfoAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- Object instance1 = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Labels/Manufacturer";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- String hierarchicalElementName = "Labels['Avery A4']";
- String elementName = "Avery A4";
-
- XNameReplace xChangeView = null;
- XNameContainer xContainer = null;
- XHierarchicalNameAccess xHierachNameAccess = null;
- try {
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- xHierachNameAccess = (XHierarchicalNameAccess) UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- nodeArgs));
-
- oObj = (XInterface) xHierachNameAccess.getByHierarchicalName(hierarchicalElementName);
-
- // craete a changeable view.
- XHierarchicalNameAccess changeableNames = (XHierarchicalNameAccess) UnoRuntime.queryInterface(XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", nodeArgs));
-
- XInterface xInt = (XInterface) changeableNames.getByHierarchicalName(hierarchicalElementName);
- xChangeView = (XNameReplace)UnoRuntime.queryInterface(XNameReplace.class, xInt);
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class, xChangeView);
- instance1 = jobsFac.createInstance();
-
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class, oObj);
-
- String[] pNames = xNameAccess.getElementNames();
-
- tEnv.addObjRelation("ElementName", pNames[0]);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- tEnv.addObjRelation("XContainer.NewValue", instance1);
- tEnv.addObjRelation("XContainer.ElementName", "L0");
- tEnv.addObjRelation("XContainer.Container", xChangeView);
-
- // dispose the owner of the test object
- tEnv.addObjRelation("XComponent.DisposeThis", (XComponent)
- UnoRuntime.queryInterface(XComponent.class, xHierachNameAccess));
-
- tEnv.addObjRelation("expectedName", pNames[0]);
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("NAMEREPLACE", pNames[0]);
- tEnv.addObjRelation("NoSetName", "OInnerTreeSetInfoAccess");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Labels/LabelType");
- tEnv.addObjRelation("TemplateInstance", "org.openoffice.Office.Labels/Labels");
-
- return tEnv;
- }
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementTreeSetUpdateAccess.java b/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementTreeSetUpdateAccess.java
deleted file mode 100644
index de39c8d9868d..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/OSetElementTreeSetUpdateAccess.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package mod._cfgmgr2;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.utils;
-
-import com.sun.star.beans.PropertyState;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.container.XHierarchicalNameAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-
-public class OSetElementTreeSetUpdateAccess extends TestCase {
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. <br>
- *
- * An instance of com.sun.star.comp.configuration.ConfigurationProvider
- * is created at the MultiServiceFactory of the Office<br>
- * At this an instance of com.sun.star.configuration.ConfigurationAccess is created
- * and from the resulting XNameAccess the first element is taken.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam,
- PrintWriter log) {
- XInterface oObj = null;
- Object instance = null;
- Object instance1 = null;
- Object instance2 = null;
- log.println("creating the Environment");
-
- PropertyValue[] nodeArgs = new PropertyValue[1];
- PropertyValue nodepath = new PropertyValue();
- nodepath.Name = "nodepath";
- nodepath.Value = "org.openoffice.Office.Labels/Manufacturer";
- nodepath.Handle = -1;
- nodepath.State = PropertyState.DEFAULT_VALUE;
- nodeArgs[0] = nodepath;
-
- XHierarchicalNameAccess xHierachNameAccess = null;
- try {
-
- XInterface Provider = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.ConfigurationProvider");
- XMultiServiceFactory pMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
- XMultiServiceFactory.class,
- Provider);
- xHierachNameAccess = (XHierarchicalNameAccess) UnoRuntime.queryInterface(
- XHierarchicalNameAccess.class,
- pMSF.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- nodeArgs));
-
- oObj = (XInterface) xHierachNameAccess.getByHierarchicalName("Labels['Avery A4']");
-
- XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(
- XSingleServiceFactory.class,
- oObj);
- instance = jobsFac.createInstance();
- instance1 = jobsFac.createInstance();
- instance2 = jobsFac.createInstance();
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("ImplementationName: " + utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- XNameAccess names = (XNameAccess) UnoRuntime.queryInterface(
- XNameAccess.class, oObj);
-
- String[] pNames = names.getElementNames();
-
- tEnv.addObjRelation("ElementName", pNames[0]);
-
- tEnv.addObjRelation("cannotSwitchParent",
- "configmgr: BasicElement::setParent: cannot move Entry");
-
- // dispose the owner of the test object
- tEnv.addObjRelation("XComponent.DisposeThis", (XComponent)
- UnoRuntime.queryInterface(XComponent.class, xHierachNameAccess));
-
- tEnv.addObjRelation("expectedName", pNames[0]);
- tEnv.addObjRelation("HierachicalName", "/org.openoffice.Office");
- tEnv.addObjRelation("INSTANCE", instance);
- tEnv.addObjRelation("INSTANCE1", instance1);
- tEnv.addObjRelation("INSTANCE2", instance1);
- tEnv.addObjRelation("NAMEREPLACE", pNames[0]);
- tEnv.addObjRelation("NoSetName", "OSetElementTreeSetUpdateAccess");
- tEnv.addObjRelation("TemplateName", "org.openoffice.Office.Labels/LabelType");
- tEnv.addObjRelation("TemplateInstance", "org.openoffice.Office.Labels/Labels");
-
- return tEnv;
- }
-} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/SchemaParser.java b/qadevOOo/tests/java/mod/_cfgmgr2/SchemaParser.java
deleted file mode 100644
index 73315eabebd0..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/SchemaParser.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-package mod._cfgmgr2;
-
-import com.sun.star.io.XActiveDataSink;
-import com.sun.star.io.XInputStream;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.XSimpleFileAccess;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class SchemaParser extends TestCase {
-
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
-
- XInterface oObj = null;
- XSimpleFileAccess simpleAccess = null;
- XInputStream xStream = null;
- String filename = null;
-
- try {
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.backend.xml.SchemaParser");
- Object fileacc = ((XMultiServiceFactory)tParam.getMSF()).createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
- simpleAccess = (XSimpleFileAccess)
- UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
- filename = util.utils.getOfficeURL((XMultiServiceFactory)tParam.getMSF())+"/../share/registry/schema/org/openoffice/Setup.xcs";
-
- log.println("Going to parse: "+filename);
- xStream = simpleAccess.openFileRead(filename);
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- XActiveDataSink xSink = (XActiveDataSink) UnoRuntime.queryInterface(XActiveDataSink.class, oObj);
- xSink.setInputStream(xStream);
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- tEnv.addObjRelation("InputStream", xStream);
- tEnv.addObjRelation("ParsedFileName", filename);
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_cfgmgr2/SingleBackendAdapter.java b/qadevOOo/tests/java/mod/_cfgmgr2/SingleBackendAdapter.java
deleted file mode 100644
index 7e0d757b6b94..000000000000
--- a/qadevOOo/tests/java/mod/_cfgmgr2/SingleBackendAdapter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._cfgmgr2;
-
-import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class SingleBackendAdapter extends TestCase {
-
- /** Called to create an instance of <code>TestEnvironment</code> with an
- * object to test and related objects. Subclasses should implement this
- * method to provide the implementation and related objects. The method is
- * called from <code>getTestEnvironment()</code>.
- *
- * @param tParam test parameters
- * @param log writer to log information while testing
- *
- * @see TestEnvironment
- * @see #getTestEnvironment()
- *
- */
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
- XInterface backend = null;
-
- try {
- Object[] args = new Object[1];
- args[0] = ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
- backend = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstanceWithArguments("com.sun.star.comp.configuration.backend.LocalSingleBackend",args);
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.backend.SingleBackendAdapter");
- XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(
- XInitialization.class, oObj);
-
- xInit.initialize(new Object[] { backend });
- } catch (com.sun.star.uno.Exception e) {
- e.printStackTrace();
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- return tEnv;
- }
-
-}
diff --git a/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java b/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java
new file mode 100644
index 000000000000..6626ceaa3a9b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/ConfigurationProvider.java
@@ -0,0 +1,57 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.uno.XComponentContext;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import java.io.PrintWriter;
+
+public final class ConfigurationProvider extends TestCase {
+ public ConfigurationProvider() {}
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log)
+ {
+ // Create a non-default ConfigurationProvider instance, so that testing
+ // its XComponent.dispose does not accidentally dispose the
+ // DefaultProvider:
+ XComponentContext ctxt = tParam.getComponentContext();
+ try {
+ return ProviderTestEnvironment.create(
+ ctxt.getServiceManager().createInstanceWithArgumentsAndContext(
+ "com.sun.star.configuration.ConfigurationProvider",
+ new Object[] { new NamedValue("Locale", "*") },
+ ctxt));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java b/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java
new file mode 100644
index 000000000000..f8a023ea2f12
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/DefaultProvider.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.XInterface;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import java.io.PrintWriter;
+
+public final class DefaultProvider extends TestCase {
+ public DefaultProvider() {}
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters tParam, PrintWriter log)
+ {
+ try {
+ return ProviderTestEnvironment.create(
+ AnyConverter.toObject(
+ XInterface.class,
+ tParam.getComponentContext().getValueByName(
+ "/singletons/" +
+ "com.sun.star.configuration.theDefaultProvider")));
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java b/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java
new file mode 100644
index 000000000000..ebd487305f3b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_configmgr/ProviderTestEnvironment.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package mod._configmgr;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.uno.XInterface;
+import lib.TestEnvironment;
+
+final class ProviderTestEnvironment {
+ private ProviderTestEnvironment() {}
+
+ public static TestEnvironment create(Object provider) {
+ TestEnvironment env = new TestEnvironment((XInterface) provider);
+ env.addObjRelation(
+ "XMSF.serviceNamesWithArgs",
+ new String[] {
+ "com.sun.star.configuration.ConfigurationAccess",
+ "com.sun.star.configuration.ConfigurationUpdateAccess" });
+ Object[] args = new Object[] {
+ new NamedValue("nodepath", "/org.openoffice.Setup") };
+ env.addObjRelation("XMSF.Args", new Object[][] { args, args });
+ env.addObjRelation(
+ "needArgs", "com.sun.star.configuration.ConfigurationProvider");
+ return env;
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java b/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java
index de082c380da5..7e9a5f68f5a7 100644
--- a/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java
+++ b/qadevOOo/tests/java/mod/_javaloader.uno/JavaComponentLoader.java
@@ -84,7 +84,6 @@ public class JavaComponentLoader extends TestCase {
tEnv.addObjRelation("ImplementationLoader",
"com.sun.star.loader.JavaComponentLoader") ;
- String jarname = "MyPersistentObjectImpl.jar";
String implURL = utils.getFullTestURL("qadevlibs/MyPersistObjectImpl.jar");
tEnv.addObjRelation("ImplementationUrl", implURL) ;
log.println("looking for shared lib: " + implURL);
diff --git a/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java b/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java
index 7bb057435f82..6c5f7dc53997 100644
--- a/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java
+++ b/qadevOOo/tests/java/mod/_nestedreg.uno/NestedRegistry.java
@@ -136,7 +136,6 @@ public class NestedRegistry extends TestCase {
protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
Object oInterface = null;
- Object fileAcc = null;
final String tmpDir = utils.getOfficeTempDirSys(
(XMultiServiceFactory)Param.getMSF()) ;
diff --git a/qadevOOo/tests/java/mod/_remotebridge.uno/various.java b/qadevOOo/tests/java/mod/_remotebridge.uno/various.java
index 76f5cab28e85..0bcaecc361db 100644
--- a/qadevOOo/tests/java/mod/_remotebridge.uno/various.java
+++ b/qadevOOo/tests/java/mod/_remotebridge.uno/various.java
@@ -160,7 +160,7 @@ public class various extends TestCase {
public void run() {
try {
acceptedCall = acc.accept(connectString) ;
- XBridge xBridge = xBrdgFctr.createBridge("MyBridge", "urp",
+ xBrdgFctr.createBridge("MyBridge", "urp",
acceptedCall, xInstProv);
} catch (com.sun.star.lang.IllegalArgumentException e) {
ex = e ;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java b/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java
index ad16c00bc7a2..a7bcb00a2087 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/MarkableInputStream.java
@@ -110,9 +110,6 @@ public class MarkableInputStream extends TestCase {
XActiveDataSource xdSmo = (XActiveDataSource)
UnoRuntime.queryInterface(XActiveDataSource.class, mostream);
- XOutputStream moStream = (XOutputStream)
- UnoRuntime.queryInterface(XOutputStream.class, mostream);
-
XOutputStream PipeOut = (XOutputStream)
UnoRuntime.queryInterface(XOutputStream.class, aPipe);
XInputStream PipeIn = (XInputStream)
diff --git a/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
index 5f9aeac2a598..d7bfd8efbb96 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/MarkableOutputStream.java
@@ -96,10 +96,6 @@ public class MarkableOutputStream extends TestCase {
protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
- Object ostream = null;
-
- Object istream = null ;
- XOutputStream moStream = null ;
XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF();
Object aPipe = null;
diff --git a/qadevOOo/tests/java/mod/_streams.uno/Pipe.java b/qadevOOo/tests/java/mod/_streams.uno/Pipe.java
index d501febc0017..440550a5b444 100644
--- a/qadevOOo/tests/java/mod/_streams.uno/Pipe.java
+++ b/qadevOOo/tests/java/mod/_streams.uno/Pipe.java
@@ -88,7 +88,6 @@ public class Pipe extends TestCase {
TestEnvironment tEnv = new TestEnvironment( oObj );
//add relation for io.XOutputStream
- final XMultiServiceFactory msf = (XMultiServiceFactory)Param.getMSF();
final XInputStream iStream = (XInputStream)
UnoRuntime.queryInterface(XInputStream.class, oObj);
@@ -97,7 +96,6 @@ public class Pipe extends TestCase {
tEnv.addObjRelation("XOutputStream.StreamChecker",
new ifc.io._XOutputStream.StreamChecker() {
- XInputStream inStream = null;
public void resetStreams() {
}
diff --git a/qadevOOo/tests/java/mod/_sysmgr1/SystemIntegration.java b/qadevOOo/tests/java/mod/_sysmgr1/SystemIntegration.java
deleted file mode 100644
index cfec26dd61f1..000000000000
--- a/qadevOOo/tests/java/mod/_sysmgr1/SystemIntegration.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-package mod._sysmgr1;
-
-import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-import java.io.PrintWriter;
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-public class SystemIntegration extends TestCase {
-
- protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
- XInterface oObj = null;
- Object[] args = new Object[0];
-
- try {
-
- oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
- .createInstance("com.sun.star.comp.configuration.backend.SystemIntegration");
- XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(XInitialization.class,oObj);
- xInit.initialize(args);
-
- } catch (com.sun.star.uno.Exception e) {
- }
-
- log.println("Implementation name: "+ util.utils.getImplName(oObj));
-
- TestEnvironment tEnv = new TestEnvironment(oObj);
-
- //objRelation for XBackend
- tEnv.addObjRelation("noUpdate", "SystemIntegrationManager: No Update Operation allowed, Read Only access -- OK");
-
- return tEnv;
- }
-
-}
diff --git a/reportbuilder/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu b/reportbuilder/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
index 9e7b00669c45..1cde8649d07a 100644
--- a/reportbuilder/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
+++ b/reportbuilder/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,90 +36,90 @@
<node oor:name="Entries">
<node oor:name="ReportHeader" oor:op="replace">
<prop oor:name="Color">
- <value>0x007Fa04C</value>
+ <value>8364108</value> <!-- 0x007Fa04C -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x007Fa04C</value>
+ <value>8364108</value> <!-- 0x007Fa04C -->
</prop>
</node>
<node oor:name="ReportFooter" oor:op="replace">
<prop oor:name="Color">
- <value>0x007Fa04C</value>
+ <value>8364108</value> <!-- 0x007Fa04C -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x007Fa04C</value>
+ <value>8364108</value> <!-- 0x007Fa04C -->
</prop>
</node>
<node oor:name="PageHeader" oor:op="replace">
<prop oor:name="Color">
- <value>0x00F0C158/</value>
+ <value>15778136</value> <!-- 0x00F0C158 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00F0C158/</value>
+ <value>15778136</value> <!-- 0x00F0C158 -->
</prop>
</node>
<node oor:name="PageFooter" oor:op="replace">
<prop oor:name="Color">
- <value>0x00F0C158</value>
+ <value>15778136</value> <!-- 0x00F0C158 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00F0C158</value>
+ <value>15778136</value> <!-- 0x00F0C158 -->
</prop>
</node>
<node oor:name="GroupHeader" oor:op="replace">
<prop oor:name="Color">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
</node>
<node oor:name="GroupFooter" oor:op="replace">
<prop oor:name="Color">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
</node>
<node oor:name="ColumnHeader" oor:op="replace">
<prop oor:name="Color">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
</node>
<node oor:name="ColumnFooter" oor:op="replace">
<prop oor:name="Color">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00AAC1D2</value>
+ <value>11190738</value> <!-- 0x00AAC1D2 -->
</prop>
</node>
<node oor:name="Detail" oor:op="replace">
<prop oor:name="Color">
- <value>0x00F1C4A2</value>
+ <value>15844514</value> <!-- 0x00F1C4A2 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00F1C4A2</value>
+ <value>15844514</value> <!-- 0x00F1C4A2 -->
</prop>
</node>
<node oor:name="OverlappedControl" oor:op="replace">
<prop oor:name="Color">
- <value>0x00FF3366</value>
+ <value>16724838</value> <!-- 0x00FF3366 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00FF3366</value>
+ <value>16724838</value> <!-- 0x00FF3366 -->
</prop>
</node>
<node oor:name="TextBoxBoundContent" oor:op="replace">
<prop oor:name="Color">
- <value>0x00808080</value>
+ <value>8421504</value> <!-- 0x00808080 -->
</prop>
<prop oor:name="DefaultColor">
- <value>0x00808080</value>
+ <value>8421504</value> <!-- 0x00808080 -->
</prop>
</node>
</node>
diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 72883d994d4a..e7360e93349e 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -125,19 +125,17 @@ public:
VoidPointerSet::const_iterator iPos(m_data.m_addresses.begin());
VoidPointerSet::const_iterator const iEnd(m_data.m_addresses.end());
for ( ; iPos != iEnd; ++iPos ) {
- T const* pLeakingObj = static_cast<T const*>(*iPos);
- OSL_ASSERT( pLeakingObj != 0 );
- static_cast<void>(pLeakingObj);
+ OSL_ASSERT( *iPos != 0 );
}
}
return bRet;
}
- void registerObject( T const* pObj ) {
+ void registerObject( void const* pObj ) {
osl_detail_ObjectRegistry_registerObject(m_data, pObj);
}
- void revokeObject( T const* pObj ) {
+ void revokeObject( void const* pObj ) {
osl_detail_ObjectRegistry_revokeObject(m_data, pObj);
}
@@ -188,12 +186,10 @@ public:
protected:
DebugBase() {
- StaticObjectRegistry::get().registerObject(
- static_cast<InheritingClassT const*>(this) );
+ StaticObjectRegistry::get().registerObject( this );
}
~DebugBase() {
- StaticObjectRegistry::get().revokeObject(
- static_cast<InheritingClassT const*>(this) );
+ StaticObjectRegistry::get().revokeObject( this );
}
private:
diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index 1320a6f68ae5..29196469fa61 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -811,6 +811,14 @@ oslFileError SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64 *pSize )
*/
#define osl_File_MapFlag_RandomAccess ((sal_uInt32)(0x1))
+/** Map flag denoting that the mapped address space will be accessed by the
+ process soon (and it is advantageous for the operating system to already
+ start paging in the data).
+
+ @since UDK 3.2.12
+ */
+#define osl_File_MapFlag_WillNeed ((sal_uInt32)(0x2))
+
/** Map a shared file into memory.
@since UDK 3.2.10
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 216162e616d6..cc0c041bc328 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1079,6 +1079,29 @@ SAL_CALL osl_mapFile (
}
}
}
+ if (uFlags & osl_File_MapFlag_WillNeed)
+ {
+ // On Linux, madvise(..., MADV_WILLNEED) appears to have the undesirable
+ // effect of not returning until the data has actually been paged in, so
+ // that its net effect would typically be to slow down the process
+ // (which could start processing at the beginning of the data while the
+ // OS simultaneously pages in the rest); on other platforms, it remains
+ // to be evaluated whether madvise or equivalent is available and
+ // actually useful:
+#if defined MACOSX
+ int e = posix_madvise(p, nLength, POSIX_MADV_WILLNEED);
+ if (e != 0)
+ {
+ OSL_TRACE(
+ "posix_madvise(..., POSIX_MADV_WILLNEED) failed with %d", e);
+ }
+#elif defined SOLARIS
+ if (madvise(static_cast< caddr_t >(p), nLength, MADV_WILLNEED) != 0)
+ {
+ OSL_TRACE("madvise(..., MADV_WILLNEED) failed with %d", errno);
+ }
+#endif
+ }
return osl_File_E_None;
}
diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index df9ad8f27515..c5141fa02260 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -199,6 +199,7 @@ static sal_Bool InitSignal()
int i;
struct sigaction act;
struct sigaction oact;
+ sigset_t unset;
if (is_soffice_Impl())
{
@@ -280,6 +281,16 @@ static sal_Bool InitSignal()
}
}
+ /* Clear signal mask inherited from parent process (on Mac OS X, upon a
+ crash soffice re-execs itself from within the signal handler, so the
+ second soffice would have the guilty signal blocked and would freeze upon
+ encountering a similar crash again): */
+ if (sigemptyset(&unset) < 0 ||
+ pthread_sigmask(SIG_SETMASK, &unset, NULL) < 0)
+ {
+ OSL_TRACE("sigemptyset or pthread_sigmask failed");
+ }
+
return sal_True;
}
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index c901aa7b505d..c8faf6c028f5 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -1858,6 +1858,9 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket)
pSocket->m_nLastError=0;
nFD = pSocket->m_Socket;
+ if (nFD == OSL_INVALID_SOCKET)
+ return;
+
pSocket->m_Socket = OSL_INVALID_SOCKET;
#if defined(LINUX)
@@ -1904,6 +1907,7 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket)
#endif /* OSL_DEBUG_LEVEL */
close(nConnFD);
}
+ pSocket->m_bIsAccepting = sal_False;
}
#endif /* LINUX */
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index d74f78fb30e2..734824d63e57 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -34,6 +34,7 @@
#include "file_url.h"
#include "file_error.h"
+
#include "path_helper.hxx"
#include "osl/diagnose.h"
@@ -291,7 +292,7 @@ struct DirectoryItem_Impl
WIN32_FIND_DATA FindData;
TCHAR cDriveString[MAX_PATH];
};
- TCHAR szFullPath[MAX_PATH];
+ rtl_uString* m_pFullPath;
BOOL bFullPathNormalized;
int nRefCount;
};
@@ -310,7 +311,7 @@ struct Directory_Impl
HANDLE hDirectory;
HANDLE hEnumDrives;
};
- TCHAR szDirectoryPath[MAX_PATH];
+ rtl_uString* m_pDirectoryPath;
};
//#####################################################
@@ -395,34 +396,48 @@ typedef struct tagDIRECTORY
} DIRECTORY, *PDIRECTORY, FAR *LPDIRECTORY;
//#####################################################
-static HANDLE WINAPI OpenDirectory(LPCTSTR lpszPath)
+static HANDLE WINAPI OpenDirectory( rtl_uString* pPath)
{
- LPDIRECTORY pDirectory = (LPDIRECTORY)HeapAlloc(GetProcessHeap(), 0, sizeof(DIRECTORY));
+ LPDIRECTORY pDirectory = NULL;
- if (pDirectory)
+ if ( pPath )
{
- TCHAR szFileMask[MAX_PATH];
- int nLen;
+ sal_uInt32 nLen = rtl_uString_getLength( pPath );
+ if ( nLen )
+ {
+ TCHAR* pSuffix = 0;
+ sal_uInt32 nSuffLen = 0;
+
+ if ( pPath->buffer[nLen - 1] != L'\\' )
+ {
+ pSuffix = L"\\*.*";
+ nSuffLen = 4;
+ }
+ else
+ {
+ pSuffix = L"*.*";
+ nSuffLen = 3;
+ }
- _tcscpy( szFileMask, lpszPath );
- nLen = _tcslen( szFileMask );
+ TCHAR* szFileMask = reinterpret_cast< TCHAR* >( rtl_allocateMemory( sizeof( TCHAR ) * ( nLen + nSuffLen + 1 ) ) );
- if (nLen && szFileMask[nLen-1] != '\\')
- _tcscat(szFileMask, TEXT("\\*.*"));
- else
- _tcscat(szFileMask, TEXT("*.*"));
+ _tcscpy( szFileMask, reinterpret_cast<LPCTSTR>( rtl_uString_getStr( pPath ) ) );
+ _tcscat( szFileMask, pSuffix );
- pDirectory->hFind = FindFirstFile(szFileMask, &pDirectory->aFirstData);
+ pDirectory = (LPDIRECTORY)HeapAlloc(GetProcessHeap(), 0, sizeof(DIRECTORY));
+ pDirectory->hFind = FindFirstFile(szFileMask, &pDirectory->aFirstData);
- if (!IsValidHandle(pDirectory->hFind))
- {
- if ( GetLastError() != ERROR_NO_MORE_FILES )
+ if (!IsValidHandle(pDirectory->hFind))
{
- HeapFree(GetProcessHeap(), 0, pDirectory);
- pDirectory = NULL;
+ if ( GetLastError() != ERROR_NO_MORE_FILES )
+ {
+ HeapFree(GetProcessHeap(), 0, pDirectory);
+ pDirectory = NULL;
+ }
}
}
}
+
return (HANDLE)pDirectory;
}
@@ -499,15 +514,26 @@ static oslFileError osl_openLocalRoot(
Directory_Impl *pDirImpl;
pDirImpl = reinterpret_cast<Directory_Impl*>(rtl_allocateMemory( sizeof(Directory_Impl)));
- _tcscpy( pDirImpl->szDirectoryPath, reinterpret_cast<LPCTSTR>(rtl_uString_getStr(strSysPath)) );
+ ZeroMemory( pDirImpl, sizeof(Directory_Impl) );
+ rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strSysPath );
/* Append backslash if neccessary */
/* @@@ToDo
use function ensure backslash
*/
- if ( pDirImpl->szDirectoryPath[_tcslen(pDirImpl->szDirectoryPath) - 1] != L'\\' )
- _tcscat( pDirImpl->szDirectoryPath, L"\\" );
+ sal_uInt32 nLen = rtl_uString_getLength( pDirImpl->m_pDirectoryPath );
+ if ( nLen && pDirImpl->m_pDirectoryPath->buffer[nLen - 1] != L'\\' )
+ {
+ rtl_uString* pCurDir = 0;
+ rtl_uString* pBackSlash = 0;
+
+ rtl_uString_assign( &pCurDir, pDirImpl->m_pDirectoryPath );
+ rtl_uString_newFromStr( &pBackSlash, L"\\" );
+ rtl_uString_newConcat( &pDirImpl->m_pDirectoryPath, pCurDir, pBackSlash );
+ rtl_uString_release( pBackSlash );
+ rtl_uString_release( pCurDir );
+ }
pDirImpl->uType = DIRECTORYTYPE_LOCALROOT;
pDirImpl->hEnumDrives = OpenLogicalDrivesEnum();
@@ -523,7 +549,16 @@ static oslFileError osl_openLocalRoot(
else
{
if ( pDirImpl )
+ {
+ if ( pDirImpl->m_pDirectoryPath )
+ {
+ rtl_uString_release( pDirImpl->m_pDirectoryPath );
+ pDirImpl->m_pDirectoryPath = 0;
+ }
+
rtl_freeMemory(pDirImpl);
+ pDirImpl = 0;
+ }
error = oslTranslateFileError( GetLastError() );
}
@@ -544,23 +579,41 @@ static oslFileError SAL_CALL osl_openFileDirectory(
*pDirectory = NULL;
Directory_Impl *pDirImpl = reinterpret_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl)));
- _tcscpy( pDirImpl->szDirectoryPath, reinterpret_cast<LPCTSTR>(rtl_uString_getStr(strDirectoryPath)) );
+ ZeroMemory( pDirImpl, sizeof(Directory_Impl) );
+ rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strDirectoryPath );
/* Append backslash if neccessary */
/* @@@ToDo
use function ensure backslash
*/
- if ( pDirImpl->szDirectoryPath[_tcslen(pDirImpl->szDirectoryPath) - 1] != L'\\' )
- _tcscat( pDirImpl->szDirectoryPath, L"\\" );
+ sal_uInt32 nLen = rtl_uString_getLength( pDirImpl->m_pDirectoryPath );
+ if ( nLen && pDirImpl->m_pDirectoryPath->buffer[nLen - 1] != L'\\' )
+ {
+ rtl_uString* pCurDir = 0;
+ rtl_uString* pBackSlash = 0;
+
+ rtl_uString_assign( &pCurDir, pDirImpl->m_pDirectoryPath );
+ rtl_uString_newFromStr( &pBackSlash, L"\\" );
+ rtl_uString_newConcat( &pDirImpl->m_pDirectoryPath, pCurDir, pBackSlash );
+ rtl_uString_release( pBackSlash );
+ rtl_uString_release( pCurDir );
+ }
+
pDirImpl->uType = DIRECTORYTYPE_FILESYSTEM;
- pDirImpl->hDirectory = OpenDirectory( pDirImpl->szDirectoryPath );
+ pDirImpl->hDirectory = OpenDirectory( pDirImpl->m_pDirectoryPath );
if ( !pDirImpl->hDirectory )
{
error = oslTranslateFileError( GetLastError() );
+ if ( pDirImpl->m_pDirectoryPath )
+ {
+ rtl_uString_release( pDirImpl->m_pDirectoryPath );
+ pDirImpl->m_pDirectoryPath = 0;
+ }
+
rtl_freeMemory(pDirImpl), pDirImpl = 0;
}
@@ -592,6 +645,7 @@ static oslFileError SAL_CALL osl_openNetworkServer(
Directory_Impl *pDirImpl;
pDirImpl = reinterpret_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl)));
+ ZeroMemory( pDirImpl, sizeof(Directory_Impl) );
pDirImpl->uType = DIRECTORYTYPE_NETROOT;
pDirImpl->hDirectory = hEnum;
*pDirectory = (oslDirectory)pDirImpl;
@@ -609,7 +663,11 @@ static DWORD create_dir_with_callback(
// user specified callback function. On success
// the function returns ERROR_SUCCESS else a Win32 error code.
- if (CreateDirectory(reinterpret_cast<LPCTSTR>(dir_path->buffer), NULL))
+ BOOL bCreated = FALSE;
+
+ bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( dir_path )), NULL );
+
+ if ( bCreated )
{
if (aDirectoryCreationCallbackFunc)
{
@@ -705,15 +763,18 @@ oslFileError SAL_CALL osl_createDirectory(rtl_uString* strPath)
if ( osl_File_E_None == error )
{
- if ( CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( strSysPath )), NULL ) )
- error = osl_File_E_None;
-/*@@@ToDo
- The else case is a hack because the ucb or the webtop had some
- problems with the error code that CreateDirectory returns in
- case the path is only a logical drive, should be removed!
-*/
- else
+ BOOL bCreated = FALSE;
+
+ bCreated = CreateDirectoryW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( strSysPath )), NULL );
+
+ if ( !bCreated )
{
+ /*@@@ToDo
+ The following case is a hack because the ucb or the webtop had some
+ problems with the error code that CreateDirectory returns in
+ case the path is only a logical drive, should be removed!
+ */
+
const sal_Unicode *pBuffer = rtl_uString_getStr( strSysPath );
sal_Int32 nLen = rtl_uString_getLength( strSysPath );
@@ -862,6 +923,12 @@ static oslFileError SAL_CALL osl_getNextDrive(
}
else
{
+ if ( pItemImpl->m_pFullPath )
+ {
+ rtl_uString_release( pItemImpl->m_pFullPath );
+ pItemImpl->m_pFullPath = 0;
+ }
+
rtl_freeMemory( pItemImpl );
return oslTranslateFileError( GetLastError() );
}
@@ -895,14 +962,24 @@ static oslFileError SAL_CALL osl_getNextFileItem(
{
pItemImpl->uType = DIRECTORYITEM_FILE;
pItemImpl->nRefCount = 1;
- _tcscpy( pItemImpl->szFullPath, pDirImpl->szDirectoryPath );
- _tcscat( pItemImpl->szFullPath, pItemImpl->FindData.cFileName );
+
+ rtl_uString* pTmpFileName = 0;
+ rtl_uString_newFromStr( &pTmpFileName, pItemImpl->FindData.cFileName );
+ rtl_uString_newConcat( &pItemImpl->m_pFullPath, pDirImpl->m_pDirectoryPath, pTmpFileName );
+ rtl_uString_release( pTmpFileName );
+
pItemImpl->bFullPathNormalized = FALSE;
*pItem = (oslDirectoryItem)pItemImpl;
return osl_File_E_None;
}
else
{
+ if ( pItemImpl->m_pFullPath )
+ {
+ rtl_uString_release( pItemImpl->m_pFullPath );
+ pItemImpl->m_pFullPath = 0;
+ }
+
rtl_freeMemory( pItemImpl );
return oslTranslateFileError( GetLastError() );
}
@@ -963,6 +1040,12 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory Directory)
break;
}
+ if ( pDirImpl->m_pDirectoryPath )
+ {
+ rtl_uString_release( pDirImpl->m_pDirectoryPath );
+ pDirImpl->m_pDirectoryPath = 0;
+ }
+
rtl_freeMemory(pDirImpl);
}
return eError;
@@ -1024,8 +1107,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector
pItemImpl->uType = DIRECTORYITEM_SERVER;
osl_acquireDirectoryItem( (oslDirectoryItem)pItemImpl );
-
- _tcscpy( pItemImpl->szFullPath, reinterpret_cast<LPCTSTR>(strSysFilePath->buffer) );
+ rtl_uString_newFromString( &pItemImpl->m_pFullPath, strSysFilePath );
// Assign a title anyway
{
@@ -1088,7 +1170,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector
osl_acquireDirectoryItem( (oslDirectoryItem)pItemImpl );
CopyMemory( &pItemImpl->FindData, &aFindData, sizeof(WIN32_FIND_DATA) );
- _tcscpy( pItemImpl->szFullPath, reinterpret_cast<LPCTSTR>(rtl_uString_getStr(strSysFilePath)) );
+ rtl_uString_newFromString( &pItemImpl->m_pFullPath, strSysFilePath );
// MT: This costs 600ms startup time on fast v60x!
// GetCaseCorrectPathName( pItemImpl->szFullPath, pItemImpl->szFullPath, sizeof(pItemImpl->szFullPath) );
@@ -1130,7 +1212,16 @@ oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item )
return osl_File_E_INVAL;
if ( ! --pItemImpl->nRefCount )
+ {
+ if ( pItemImpl->m_pFullPath )
+ {
+ rtl_uString_release( pItemImpl->m_pFullPath );
+ pItemImpl->m_pFullPath = 0;
+ }
+
rtl_freeMemory( pItemImpl );
+ }
+
return osl_File_E_None;
}
@@ -1344,18 +1435,22 @@ static oslFileError get_filesystem_attributes(
}
if (is_filesystem_attributes_request(field_mask))
{
- WCHAR vn[MAX_PATH];
- WCHAR fsn[MAX_PATH];
+ /* the following two parameters can not be longer than MAX_PATH+1 */
+ WCHAR vn[MAX_PATH+1];
+ WCHAR fsn[MAX_PATH+1];
+
DWORD serial;
DWORD mcl;
DWORD flags;
LPCTSTR pszPath = reinterpret_cast<LPCTSTR>(path.getStr());
- if (GetVolumeInformation(pszPath, vn, MAX_PATH, &serial, &mcl, &flags, fsn, MAX_PATH))
+ if (GetVolumeInformation(pszPath, vn, MAX_PATH+1, &serial, &mcl, &flags, fsn, MAX_PATH+1))
{
+ // Currently sal does not use this value, instead MAX_PATH is used
pInfo->uValidFields |= osl_VolumeInfo_Mask_MaxNameLength;
pInfo->uMaxNameLength = mcl;
+ // Should the uMaxPathLength be set to 32767, "\\?\" prefix allowes it
pInfo->uValidFields |= osl_VolumeInfo_Mask_MaxPathLength;
pInfo->uMaxPathLength = MAX_PATH;
@@ -1558,11 +1653,7 @@ static oslFileError SAL_CALL osl_getServerInfo(
if ( uFieldMask & osl_FileStatus_Mask_FileURL )
{
- rtl_uString *ustrSystemPath = NULL;
-
- rtl_uString_newFromStr( &ustrSystemPath, reinterpret_cast<const sal_Unicode*>(pItemImpl->szFullPath) );
- osl_getFileURLFromSystemPath( ustrSystemPath, &pStatus->ustrFileURL );
- rtl_uString_release( ustrSystemPath );
+ osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL );
pStatus->uValidFields |= osl_FileStatus_Mask_FileURL;
}
return osl_File_E_None;
@@ -1591,7 +1682,7 @@ oslFileError SAL_CALL osl_getFileStatus(
if ( uFieldMask & osl_FileStatus_Mask_Validate )
{
- HANDLE hFind = FindFirstFile( pItemImpl->szFullPath, &pItemImpl->FindData );
+ HANDLE hFind = FindFirstFile( reinterpret_cast<LPCTSTR>( rtl_uString_getStr( pItemImpl->m_pFullPath ) ), &pItemImpl->FindData );
if ( hFind != INVALID_HANDLE_VALUE )
FindClose( hFind );
@@ -1651,28 +1742,30 @@ oslFileError SAL_CALL osl_getFileStatus(
if ( uFieldMask & osl_FileStatus_Mask_LinkTargetURL )
{
- rtl_uString *ustrFullPath = NULL;
-
- rtl_uString_newFromStr( &ustrFullPath, reinterpret_cast<const sal_Unicode*>(pItemImpl->szFullPath) );
- osl_getFileURLFromSystemPath( ustrFullPath, &pStatus->ustrLinkTargetURL );
- rtl_uString_release( ustrFullPath );
+ osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrLinkTargetURL );
pStatus->uValidFields |= osl_FileStatus_Mask_LinkTargetURL;
}
if ( uFieldMask & osl_FileStatus_Mask_FileURL )
{
- rtl_uString *ustrFullPath = NULL;
-
-
if ( !pItemImpl->bFullPathNormalized )
{
- GetCaseCorrectPathName( pItemImpl->szFullPath, pItemImpl->szFullPath, sizeof(pItemImpl->szFullPath) );
- pItemImpl->bFullPathNormalized = TRUE;
+ sal_uInt32 nLen = rtl_uString_getLength( pItemImpl->m_pFullPath );
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ sal_uInt32 nNewLen = GetCaseCorrectPathName( reinterpret_cast<LPCTSTR>( rtl_uString_getStr( pItemImpl->m_pFullPath ) ),
+ aBuffer,
+ aBuffer.getBufSizeInSymbols(),
+ sal_True );
+
+ if ( nNewLen )
+ {
+ rtl_uString_newFromStr( &pItemImpl->m_pFullPath, aBuffer );
+ pItemImpl->bFullPathNormalized = TRUE;
+ }
}
- rtl_uString_newFromStr( &ustrFullPath, reinterpret_cast<const sal_Unicode*>(pItemImpl->szFullPath) );
- osl_getFileURLFromSystemPath( ustrFullPath, &pStatus->ustrFileURL );
- rtl_uString_release( ustrFullPath );
+
+ osl_getFileURLFromSystemPath( pItemImpl->m_pFullPath, &pStatus->ustrFileURL );
pStatus->uValidFields |= osl_FileStatus_Mask_FileURL;
}
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index f87f02b093d6..8e11be1d6a5c 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -38,6 +38,8 @@
#include "osl/file.h"
#include "osl/mutex.h"
+#include "path_helper.hxx"
+
#include <stdio.h>
#include <tchar.h>
@@ -49,6 +51,11 @@
#define ELEMENTS_OF_ARRAY(arr) (sizeof(arr)/(sizeof((arr)[0])))
+#define WSTR_SYSTEM_ROOT_PATH L"\\\\.\\"
+#define WSTR_LONG_PATH_PREFIX L"\\\\?\\"
+#define WSTR_LONG_PATH_PREFIX_UNC L"\\\\?\\UNC\\"
+
+
//##################################################################
// FileURL functions
//##################################################################
@@ -65,7 +72,7 @@ static BOOL IsValidFilePathComponent(
BOOL fValid = TRUE; /* Assume success */
TCHAR cLast = 0;
- /* Path component length must not exceed MAX_PATH */
+ /* Path component length must not exceed MAX_PATH even if long path with "\\?\" prefix is used */
while ( !lpComponentEnd && lpCurrent && lpCurrent - lpComponent < MAX_PATH )
{
@@ -232,31 +239,56 @@ static BOOL IsValidFilePathComponent(
DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_uString **corrected)
{
LPCTSTR lpszPath = reinterpret_cast< LPCTSTR >(path->buffer);
- LPCTSTR lpComponent;
+ LPCTSTR lpComponent = lpszPath;
BOOL fValid = TRUE;
DWORD dwPathType = PATHTYPE_ERROR;
+ sal_Int32 nLength = rtl_uString_getLength( path );
if ( dwFlags & VALIDATEPATH_ALLOW_RELATIVE )
dwFlags |= VALIDATEPATH_ALLOW_ELLIPSE;
if ( !lpszPath )
- {
fValid = FALSE;
- lpComponent = lpszPath;
- }
- /* Test for UNC path notation */
- if ( 2 == _tcsspn( lpszPath, CHARSET_SEPARATOR ) )
+ DWORD dwCandidatPathType = PATHTYPE_ERROR;
+
+ if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, WSTR_LONG_PATH_PREFIX_UNC, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX_UNC) - 1, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX_UNC) - 1 ) )
+ {
+ /* This is long path in UNC notation */
+ lpComponent = lpszPath + ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX_UNC) - 1;
+ dwCandidatPathType = PATHTYPE_ABSOLUTE_UNC | PATHTYPE_IS_LONGPATH;
+ }
+ else if ( 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( path->buffer, nLength, WSTR_LONG_PATH_PREFIX, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX) - 1, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX) - 1 ) )
{
- /* Place the pointer behind the leading to backslashes */
+ /* This is long path */
+ lpComponent = lpszPath + ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX) - 1;
+ if ( _istalpha( lpComponent[0] ) && ':' == lpComponent[1] )
+ {
+ lpComponent += 2;
+ dwCandidatPathType = PATHTYPE_ABSOLUTE_LOCAL | PATHTYPE_IS_LONGPATH;
+ }
+ }
+ else if ( 2 == _tcsspn( lpszPath, CHARSET_SEPARATOR ) )
+ {
+ /* The UNC path notation */
lpComponent = lpszPath + 2;
+ dwCandidatPathType = PATHTYPE_ABSOLUTE_UNC;
+ }
+ else if ( _istalpha( lpszPath[0] ) && ':' == lpszPath[1] )
+ {
+ /* Local path verification. Must start with <drive>: */
+ lpComponent = lpszPath + 2;
+ dwCandidatPathType = PATHTYPE_ABSOLUTE_LOCAL;
+ }
+ if ( ( dwCandidatPathType & PATHTYPE_MASK_TYPE ) == PATHTYPE_ABSOLUTE_UNC )
+ {
fValid = IsValidFilePathComponent( lpComponent, &lpComponent, VALIDATEPATH_ALLOW_ELLIPSE );
/* So far we have a valid servername. Now let's see if we also have a network resource */
- dwPathType = PATHTYPE_ABSOLUTE_UNC;
+ dwPathType = dwCandidatPathType;
if ( fValid )
{
@@ -291,20 +323,14 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u
}
}
}
-
- /* Local path verification. Must start with <drive>: */
- else if ( _istalpha( lpszPath[0] ) && ':' == lpszPath[1] )
+ else if ( ( dwCandidatPathType & PATHTYPE_MASK_TYPE ) == PATHTYPE_ABSOLUTE_LOCAL )
{
- /* Place pointer behind correct drive specification */
-
- lpComponent = lpszPath + 2;
-
if ( 1 == _tcsspn( lpComponent, CHARSET_SEPARATOR ) )
lpComponent++;
else if ( *lpComponent )
fValid = FALSE;
- dwPathType = PATHTYPE_ABSOLUTE_LOCAL;
+ dwPathType = dwCandidatPathType;
/* Now we are behind the backslash or it was a simple drive without backslash */
@@ -314,10 +340,9 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u
dwPathType |= PATHTYPE_IS_VOLUME;
}
}
-
- /* Can be a relative path */
else if ( dwFlags & VALIDATEPATH_ALLOW_RELATIVE )
{
+ /* Can be a relative path */
lpComponent = lpszPath;
/* Relative path can start with a backslash */
@@ -331,10 +356,9 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u
dwPathType = PATHTYPE_RELATIVE;
}
-
- /* Anything else is an error */
else
{
+ /* Anything else is an error */
fValid = FALSE;
lpComponent = lpszPath;
}
@@ -364,7 +388,8 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u
}
}
- if ( fValid && _tcslen( lpszPath ) >= MAX_PATH )
+ /* The path can be longer than MAX_PATH only in case it has the longpath prefix */
+ if ( fValid && !( dwPathType & PATHTYPE_IS_LONGPATH ) && _tcslen( lpszPath ) >= MAX_PATH )
{
fValid = FALSE;
lpComponent = lpszPath + MAX_PATH;
@@ -376,38 +401,45 @@ DWORD IsValidFilePath(rtl_uString *path, LPCTSTR *lppError, DWORD dwFlags, rtl_u
return fValid ? dwPathType : PATHTYPE_ERROR;
}
-//#############################################
//#####################################################
-//Undocumented in SHELL32.DLL ordinal 35
-static BOOL PathRemoveFileSpec(LPTSTR lpPath)
+static sal_Int32 PathRemoveFileSpec(LPTSTR lpPath, LPTSTR lpFileName, sal_Int32 nFileBufLen )
{
- BOOL fSuccess = FALSE; // Assume failure
- LPTSTR lpLastBkSlash = _tcsrchr( lpPath, '\\' );
- LPTSTR lpLastSlash = _tcsrchr( lpPath, '/' );
- LPTSTR lpLastDelimiter = lpLastSlash > lpLastBkSlash ? lpLastSlash : lpLastBkSlash;
+ sal_Int32 nRemoved = 0;
- if ( lpLastDelimiter )
+ if ( nFileBufLen )
{
- if ( 0 == *(lpLastDelimiter + 1) )
- {
- if ( lpLastDelimiter > lpPath && *(lpLastDelimiter - 1) != ':' )
+ lpFileName[0] = 0;
+ LPTSTR lpLastBkSlash = _tcsrchr( lpPath, '\\' );
+ LPTSTR lpLastSlash = _tcsrchr( lpPath, '/' );
+ LPTSTR lpLastDelimiter = lpLastSlash > lpLastBkSlash ? lpLastSlash : lpLastBkSlash;
+
+ if ( lpLastDelimiter )
+ {
+ sal_Int32 nDelLen = _tcslen( lpLastDelimiter );
+ if ( 1 == nDelLen )
{
- *lpLastDelimiter = 0;
- fSuccess = TRUE;
+ if ( lpLastDelimiter > lpPath && *(lpLastDelimiter - 1) != ':' )
+ {
+ *lpLastDelimiter = 0;
+ *lpFileName = 0;
+ nRemoved = nDelLen;
+ }
}
- }
- else
- {
- *(++lpLastDelimiter) = 0;
- fSuccess = TRUE;
- }
+ else if ( nDelLen && nDelLen - 1 < nFileBufLen )
+ {
+ _tcscpy( lpFileName, lpLastDelimiter + 1 );
+ *(++lpLastDelimiter) = 0;
+ nRemoved = nDelLen - 1;
+ }
+ }
}
- return fSuccess;
+
+ return nRemoved;
}
//#####################################################
// Undocumented in SHELL32.DLL ordinal 32
-static LPTSTR PathAddBackslash(LPTSTR lpPath)
+static LPTSTR PathAddBackslash(LPTSTR lpPath, sal_Int32 nBufLen)
{
LPTSTR lpEndPath = NULL;
@@ -415,7 +447,7 @@ static LPTSTR PathAddBackslash(LPTSTR lpPath)
{
int nLen = _tcslen(lpPath);
- if ( !nLen || lpPath[nLen-1] != '\\' && lpPath[nLen-1] != '/' && nLen < MAX_PATH - 1 )
+ if ( !nLen || lpPath[nLen-1] != '\\' && lpPath[nLen-1] != '/' && nLen < nBufLen - 1 )
{
lpEndPath = lpPath + nLen;
*lpEndPath++ = '\\';
@@ -428,37 +460,31 @@ static LPTSTR PathAddBackslash(LPTSTR lpPath)
//#####################################################
// Same as GetLongPathName but also 95/NT4
static DWORD GetCaseCorrectPathNameEx(
- LPCTSTR lpszShortPath, // file name
- LPTSTR lpszLongPath, // path buffer
+ LPTSTR lpszPath, // path buffer to convert
DWORD cchBuffer, // size of path buffer
- DWORD nSkipLevels
-)
+ DWORD nSkipLevels,
+ BOOL bCheckExistence )
{
- TCHAR szPath[MAX_PATH];
- BOOL fSuccess;
-
- cchBuffer = cchBuffer; /* avoid warnings */
-
- _tcscpy( szPath, lpszShortPath );
-
- fSuccess = PathRemoveFileSpec( szPath );
+ ::osl::LongPathBuffer< sal_Unicode > szFile( MAX_PATH + 1 );
+ sal_Int32 nRemoved = PathRemoveFileSpec( lpszPath, szFile, MAX_PATH + 1 );
+ sal_Int32 nLastStepRemoved = nRemoved;
+ while ( nLastStepRemoved && szFile[0] == 0 )
+ {
+ // remove separators
+ nLastStepRemoved = PathRemoveFileSpec( lpszPath, szFile, MAX_PATH + 1 );
+ nRemoved += nLastStepRemoved;
+ }
- if ( fSuccess )
+ if ( nRemoved )
{
- int nLen = _tcslen( szPath );
- LPCTSTR lpszFileSpec = lpszShortPath + nLen;
- BOOL bSkipThis;
+ BOOL bSkipThis = FALSE;
- if ( 0 == _tcscmp( lpszFileSpec, TEXT("..") ) )
+ if ( 0 == _tcscmp( szFile, TEXT("..") ) )
{
bSkipThis = TRUE;
nSkipLevels += 1;
}
- else if (
- 0 == _tcscmp( lpszFileSpec, TEXT(".") ) ||
- 0 == _tcscmp( lpszFileSpec, TEXT("\\") ) ||
- 0 == _tcscmp( lpszFileSpec, TEXT("/") )
- )
+ else if ( 0 == _tcscmp( szFile, TEXT(".") ) )
{
bSkipThis = TRUE;
}
@@ -470,24 +496,36 @@ static DWORD GetCaseCorrectPathNameEx(
else
bSkipThis = FALSE;
- GetCaseCorrectPathNameEx( szPath, szPath, MAX_PATH, nSkipLevels );
+ GetCaseCorrectPathNameEx( lpszPath, cchBuffer, nSkipLevels, bCheckExistence );
- PathAddBackslash( szPath );
+ PathAddBackslash( lpszPath, cchBuffer );
/* Analyze parent if not only a trailing backslash was cutted but a real file spec */
if ( !bSkipThis )
{
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( lpszShortPath, &aFindFileData );
-
- if ( IsValidHandle(hFind) )
+ if ( bCheckExistence )
{
- _tcscat( szPath, aFindFileData.cFileName[0] ? aFindFileData.cFileName : aFindFileData.cAlternateFileName );
+ ::osl::LongPathBuffer< sal_Unicode > aShortPath( MAX_LONG_PATH );
+ _tcscpy( aShortPath, lpszPath );
+ _tcscat( aShortPath, szFile );
- FindClose( hFind );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( aShortPath, &aFindFileData );
+
+ if ( IsValidHandle(hFind) )
+ {
+ _tcscat( lpszPath, aFindFileData.cFileName[0] ? aFindFileData.cFileName : aFindFileData.cAlternateFileName );
+
+ FindClose( hFind );
+ }
+ else
+ lpszPath[0] = 0;
}
else
- return 0;
+ {
+ /* add the segment name back */
+ _tcscat( lpszPath, szFile );
+ }
}
}
else
@@ -496,14 +534,12 @@ static DWORD GetCaseCorrectPathNameEx(
or a network share. If still levels to skip are left, the path specification
tries to travel below the file system root */
if ( nSkipLevels )
- return 0;
-
- _tcsupr( szPath );
+ lpszPath[0] = 0;
+ else
+ _tcsupr( lpszPath );
}
- _tcscpy( lpszLongPath, szPath );
-
- return _tcslen( lpszLongPath );
+ return _tcslen( lpszPath );
}
//#####################################################
@@ -512,7 +548,8 @@ static DWORD GetCaseCorrectPathNameEx(
DWORD GetCaseCorrectPathName(
LPCTSTR lpszShortPath, // file name
LPTSTR lpszLongPath, // path buffer
- DWORD cchBuffer // size of path buffer
+ DWORD cchBuffer, // size of path buffer
+ BOOL bCheckExistence
)
{
/* Special handling for "\\.\" as system root */
@@ -528,12 +565,19 @@ DWORD GetCaseCorrectPathName(
return ELEMENTS_OF_ARRAY(WSTR_SYSTEM_ROOT_PATH) - 1;
}
}
- else
+ else if ( lpszShortPath )
{
- return GetCaseCorrectPathNameEx( lpszShortPath, lpszLongPath, cchBuffer, 0 );
+ if ( _tcslen( lpszShortPath ) <= cchBuffer )
+ {
+ _tcscpy( lpszLongPath, lpszShortPath );
+ return GetCaseCorrectPathNameEx( lpszLongPath, cchBuffer, 0, bCheckExistence );
+ }
}
+
+ return 0;
}
+
//#############################################
static sal_Bool _osl_decodeURL( rtl_String* strUTF8, rtl_uString** pstrDecodedURL )
{
@@ -667,7 +711,6 @@ static void _osl_encodeURL( rtl_uString *strURL, rtl_String **pstrEncodedURL )
}
//#############################################
-#define WSTR_SYSTEM_ROOT_PATH L"\\\\.\\"
oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **pustrPath, sal_Bool bAllowRelative )
{
@@ -725,13 +768,60 @@ oslFileError _osl_getSystemPathFromFileURL( rtl_uString *strURL, rtl_uString **p
if ( nDecodedLen == nSkip )
rtl_uString_newFromStr_WithLength( &strTempPath, reinterpret_cast<const sal_Unicode*>(WSTR_SYSTEM_ROOT_PATH), ELEMENTS_OF_ARRAY(WSTR_SYSTEM_ROOT_PATH) - 1 );
else
- rtl_uString_newFromStr_WithLength( &strTempPath, pDecodedURL + nSkip, nDecodedLen - nSkip );
+ {
+ /* do not separate the directory and file case, so the maximal path lengs without prefix is MAX_PATH-12 */
+ if ( nDecodedLen - nSkip <= MAX_PATH - 12 )
+ {
+ rtl_uString_newFromStr_WithLength( &strTempPath, pDecodedURL + nSkip, nDecodedLen - nSkip );
+ }
+ else
+ {
+ ::osl::LongPathBuffer< sal_Unicode > aBuf( MAX_LONG_PATH );
+ sal_uInt32 nNewLen = GetCaseCorrectPathName( pDecodedURL + nSkip,
+ aBuf,
+ aBuf.getBufSizeInSymbols(),
+ sal_False );
+
+ if ( nNewLen <= MAX_PATH - 12
+ || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, WSTR_SYSTEM_ROOT_PATH, ELEMENTS_OF_ARRAY(WSTR_SYSTEM_ROOT_PATH) - 1, ELEMENTS_OF_ARRAY(WSTR_SYSTEM_ROOT_PATH) - 1 )
+ || 0 == rtl_ustr_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL + nSkip, nDecodedLen - nSkip, WSTR_LONG_PATH_PREFIX, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX) - 1, ELEMENTS_OF_ARRAY(WSTR_LONG_PATH_PREFIX) - 1 ) )
+ {
+ rtl_uString_newFromStr_WithLength( &strTempPath, aBuf, nNewLen );
+ }
+ else if ( pDecodedURL[nSkip] == (sal_Unicode)'\\' && pDecodedURL[nSkip+1] == (sal_Unicode)'\\' )
+ {
+ /* it should be an UNC path, use the according prefix */
+ rtl_uString *strSuffix = NULL;
+ rtl_uString *strPrefix = NULL;
+ rtl_uString_newFromStr_WithLength( &strPrefix, WSTR_LONG_PATH_PREFIX_UNC, ELEMENTS_OF_ARRAY( WSTR_LONG_PATH_PREFIX_UNC ) - 1 );
+ rtl_uString_newFromStr_WithLength( &strSuffix, aBuf + 2, nNewLen - 2 );
+
+ rtl_uString_newConcat( &strTempPath, strPrefix, strSuffix );
+
+ rtl_uString_release( strPrefix );
+ rtl_uString_release( strSuffix );
+ }
+ else
+ {
+ rtl_uString *strSuffix = NULL;
+ rtl_uString *strPrefix = NULL;
+ rtl_uString_newFromStr_WithLength( &strPrefix, WSTR_LONG_PATH_PREFIX, ELEMENTS_OF_ARRAY( WSTR_LONG_PATH_PREFIX ) - 1 );
+ rtl_uString_newFromStr_WithLength( &strSuffix, aBuf, nNewLen );
+
+ rtl_uString_newConcat( &strTempPath, strPrefix, strSuffix );
+
+ rtl_uString_release( strPrefix );
+ rtl_uString_release( strSuffix );
+ }
+ }
+ }
if ( IsValidFilePath( strTempPath, NULL, VALIDATEPATH_ALLOW_ELLIPSE, &strTempPath ) )
nError = osl_File_E_None;
}
else if ( bAllowRelative ) /* This maybe a relative file URL */
{
+ /* In future the relative path could be converted to absolute if it is too long */
rtl_uString_assign( &strTempPath, strDecodedURL );
if ( IsValidFilePath( strTempPath, NULL, VALIDATEPATH_ALLOW_RELATIVE | VALIDATEPATH_ALLOW_ELLIPSE, &strTempPath ) )
@@ -774,8 +864,51 @@ oslFileError _osl_getFileURLFromSystemPath( rtl_uString* strPath, rtl_uString**
{
rtl_uString *strTempPath = NULL;
- /* Replace backslashes */
- rtl_uString_newReplace( &strTempPath, strPath, '\\', '/' );
+ if ( dwPathType & PATHTYPE_IS_LONGPATH )
+ {
+ rtl_uString *strBuffer = NULL;
+ sal_uInt32 nIgnore = 0;
+ sal_uInt32 nLength = 0;
+
+ /* the path has the longpath prefix, lets remove it */
+ switch ( dwPathType & PATHTYPE_MASK_TYPE )
+ {
+ case PATHTYPE_ABSOLUTE_UNC:
+ nIgnore = ELEMENTS_OF_ARRAY( WSTR_LONG_PATH_PREFIX_UNC ) - 1;
+ OSL_ENSURE( nIgnore == 8, "Unexpected long path UNC prefix!" );
+
+ /* generate the normal UNC path */
+ nLength = rtl_uString_getLength( strPath );
+ rtl_uString_newFromStr_WithLength( &strBuffer, strPath->buffer + nIgnore - 2, nLength - nIgnore + 2 );
+ strBuffer->buffer[0] = '\\';
+
+ rtl_uString_newReplace( &strTempPath, strBuffer, '\\', '/' );
+ rtl_uString_release( strBuffer );
+ break;
+
+ case PATHTYPE_ABSOLUTE_LOCAL:
+ nIgnore = ELEMENTS_OF_ARRAY( WSTR_LONG_PATH_PREFIX ) - 1;
+ OSL_ENSURE( nIgnore == 4, "Unexpected long path prefix!" );
+
+ /* generate the normal path */
+ nLength = rtl_uString_getLength( strPath );
+ rtl_uString_newFromStr_WithLength( &strBuffer, strPath->buffer + nIgnore, nLength - nIgnore );
+
+ rtl_uString_newReplace( &strTempPath, strBuffer, '\\', '/' );
+ rtl_uString_release( strBuffer );
+ break;
+
+ default:
+ OSL_ASSERT( "Unexpected long path format!" );
+ rtl_uString_newReplace( &strTempPath, strPath, '\\', '/' );
+ break;
+ }
+ }
+ else
+ {
+ /* Replace backslashes */
+ rtl_uString_newReplace( &strTempPath, strPath, '\\', '/' );
+ }
switch ( dwPathType & PATHTYPE_MASK_TYPE )
{
@@ -944,8 +1077,8 @@ oslFileError SAL_CALL osl_getAbsoluteFileURL( rtl_uString* ustrBaseURL, rtl_uStr
if ( !eError )
{
- TCHAR szBuffer[MAX_PATH];
- TCHAR szCurrentDir[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ ::osl::LongPathBuffer< sal_Unicode > aCurrentDir( MAX_LONG_PATH );
LPTSTR lpFilePart = NULL;
DWORD dwResult;
@@ -960,28 +1093,28 @@ oslFileError SAL_CALL osl_getAbsoluteFileURL( rtl_uString* ustrBaseURL, rtl_uStr
{
osl_acquireMutex( g_CurrentDirectoryMutex );
- GetCurrentDirectory( MAX_PATH, szCurrentDir );
- SetCurrentDirectory( reinterpret_cast<LPCTSTR>(ustrBaseSysPath->buffer) );
+ GetCurrentDirectoryW( aCurrentDir.getBufSizeInSymbols(), aCurrentDir );
+ SetCurrentDirectoryW( reinterpret_cast<LPCTSTR>(ustrBaseSysPath->buffer) );
}
- dwResult = GetFullPathName( reinterpret_cast<LPCTSTR>(ustrRelSysPath->buffer), MAX_PATH, szBuffer, &lpFilePart );
+ dwResult = GetFullPathNameW( reinterpret_cast<LPCTSTR>(ustrRelSysPath->buffer), aBuffer.getBufSizeInSymbols(), aBuffer, &lpFilePart );
if ( ustrBaseSysPath )
{
- SetCurrentDirectory( szCurrentDir );
+ SetCurrentDirectoryW( aCurrentDir );
osl_releaseMutex( g_CurrentDirectoryMutex );
}
if ( dwResult )
{
- if ( dwResult >= MAX_PATH )
+ if ( dwResult >= aBuffer.getBufSizeInSymbols() )
eError = osl_File_E_INVAL;
else
{
rtl_uString *ustrAbsSysPath = NULL;
- rtl_uString_newFromStr( &ustrAbsSysPath, reinterpret_cast<const sal_Unicode*>(szBuffer) );
+ rtl_uString_newFromStr( &ustrAbsSysPath, aBuffer );
eError = osl_getFileURLFromSystemPath( ustrAbsSysPath, pustrAbsoluteURL );
diff --git a/sal/osl/w32/file_url.h b/sal/osl/w32/file_url.h
index 55b7145ec5cf..d9137c8c2fcc 100644
--- a/sal/osl/w32/file_url.h
+++ b/sal/osl/w32/file_url.h
@@ -54,6 +54,7 @@ extern "C" {
#define PATHTYPE_MASK_TYPE 0xFF
#define PATHTYPE_IS_VOLUME 0x0100
#define PATHTYPE_IS_SERVER 0x0200
+#define PATHTYPE_IS_LONGPATH 0x0400
#define VALIDATEPATH_NORMAL 0x0000
#define VALIDATEPATH_ALLOW_WILDCARDS 0x0001
@@ -61,6 +62,8 @@ extern "C" {
#define VALIDATEPATH_ALLOW_RELATIVE 0x0004
#define VALIDATEPATH_ALLOW_UNC 0x0008
+#define MAX_LONG_PATH 32767
+
DWORD IsValidFilePath (
rtl_uString * path,
LPCTSTR * lppError,
@@ -71,7 +74,8 @@ DWORD IsValidFilePath (
DWORD GetCaseCorrectPathName (
LPCTSTR lpszShortPath, // file name
LPTSTR lpszLongPath, // path buffer
- DWORD cchBuffer // size of path buffer
+ DWORD cchBuffer, // size of path buffer
+ BOOL bCheckExistence
);
oslFileError _osl_getSystemPathFromFileURL (
diff --git a/sal/osl/w32/module.c b/sal/osl/w32/module.cxx
index 902bab0726b0..98ffd0bc09d4 100644
--- a/sal/osl/w32/module.c
+++ b/sal/osl/w32/module.cxx
@@ -1,39 +1,42 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
#include "system.h"
#include <tlhelp32.h>
+#include "file_url.h"
+#include "path_helper.hxx"
+
#include <osl/module.h>
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <osl/file.h>
#include <rtl/logfile.h>
+
/*
under WIN32, we use the void* oslModule
as a WIN32 HANDLE (which is also a 32-bit value)
@@ -309,22 +312,22 @@ static sal_Bool SAL_CALL _osl_addressGetModuleURL_NT4( void *pv, rtl_uString **p
if ( lpfnSymInitialize && lpfnSymCleanup && lpfnSymGetModuleInfo )
{
IMAGEHLP_MODULE ModuleInfo;
- CHAR szModuleFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aModuleFileName( MAX_LONG_PATH );
LPSTR lpSearchPath = NULL;
- if ( GetModuleFileNameA( NULL, szModuleFileName, sizeof(szModuleFileName) ) )
+ if ( GetModuleFileNameA( NULL, aModuleFileName, aModuleFileName.getBufSizeInSymbols() ) )
{
- char *pLastBkSlash = strrchr( szModuleFileName, '\\' );
+ char *pLastBkSlash = strrchr( aModuleFileName, '\\' );
if (
pLastBkSlash &&
- pLastBkSlash > szModuleFileName
+ pLastBkSlash > (sal_Char*)aModuleFileName
&& *(pLastBkSlash - 1) != ':'
&& *(pLastBkSlash - 1) != '\\'
)
{
*pLastBkSlash = 0;
- lpSearchPath = szModuleFileName;
+ lpSearchPath = aModuleFileName;
}
}
@@ -423,12 +426,12 @@ static sal_Bool SAL_CALL _osl_addressGetModuleURL_NT( void *pv, rtl_uString **pu
if ( (BYTE *)pv >= (BYTE *)modinfo.lpBaseOfDll && (BYTE *)pv < (BYTE *)modinfo.lpBaseOfDll + modinfo.SizeOfImage )
{
- WCHAR szBuffer[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
rtl_uString *ustrSysPath = NULL;
- GetModuleFileNameW( lpModules[iModule], szBuffer, bufsizeof(szBuffer) );
+ GetModuleFileNameW( lpModules[iModule], aBuffer, aBuffer.getBufSizeInSymbols() );
- rtl_uString_newFromStr( &ustrSysPath, szBuffer );
+ rtl_uString_newFromStr( &ustrSysPath, aBuffer );
osl_getFileURLFromSystemPath( ustrSysPath, pustrURL );
rtl_uString_release( ustrSysPath );
diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx
index 106f2a76f043..64b0ac573da3 100644
--- a/sal/osl/w32/path_helper.hxx
+++ b/sal/osl/w32/path_helper.hxx
@@ -34,6 +34,7 @@
#include "path_helper.h"
#include <rtl/ustring.hxx>
+#include <rtl/allocator.hxx>
namespace osl
{
@@ -70,6 +71,45 @@ inline bool systemPathIsLogicalDrivePattern(/*in*/ const rtl::OUString& path)
return osl_systemPathIsLogicalDrivePattern(path.pData);
}
+/*******************************************************************
+ LongPathBuffer
+ ******************************************************************/
+template< class T >
+class LongPathBuffer
+{
+ T* m_pBuffer;
+ sal_uInt32 m_nCharNum;
+
+ LongPathBuffer();
+ LongPathBuffer( const LongPathBuffer& );
+ LongPathBuffer& operator=( const LongPathBuffer& );
+
+public:
+ LongPathBuffer( sal_uInt32 nCharNum )
+ : m_pBuffer( reinterpret_cast<T*>( rtl_allocateMemory( nCharNum * sizeof( T ) ) ) )
+ , m_nCharNum( nCharNum )
+ {
+ OSL_ENSURE( m_pBuffer, "Can not allocate the buffer!" );
+ }
+
+ ~LongPathBuffer()
+ {
+ if ( m_pBuffer )
+ rtl_freeMemory( m_pBuffer );
+ m_pBuffer = 0;
+ }
+
+ sal_uInt32 getBufSizeInSymbols()
+ {
+ return m_nCharNum;
+ }
+
+ operator T* ()
+ {
+ return m_pBuffer;
+ }
+};
+
} // end namespace osl
#endif
diff --git a/sal/osl/w32/process.c b/sal/osl/w32/process.cxx
index 334ae7aef726..12eda6658033 100644
--- a/sal/osl/w32/process.c
+++ b/sal/osl/w32/process.cxx
@@ -1,29 +1,29 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
#define UNICODE
#include "system.h"
@@ -43,6 +43,8 @@
#include "procimpl.h"
#include "sockimpl.h"
+#include "file_url.h"
+#include "path_helper.hxx"
#include <rtl/ustrbuf.h>
#include <rtl/alloc.h>
@@ -72,7 +74,7 @@ oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident)
if (hProcess)
{
- pProcImpl = rtl_allocateMemory(sizeof(oslProcessImpl));
+ pProcImpl = reinterpret_cast< oslProcessImpl*>( rtl_allocateMemory(sizeof(oslProcessImpl)) );
pProcImpl->m_hProcess = hProcess;
pProcImpl->m_IdProcess = Ident;
}
@@ -216,19 +218,19 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti
*
***************************************************************************/
-oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
+extern "C" oslProcessError SAL_CALL osl_bootstrap_getExecutableFile_Impl (
rtl_uString ** ppFileURL
) SAL_THROW_EXTERN_C()
{
oslProcessError result = osl_Process_E_NotFound;
- TCHAR buffer[MAX_PATH];
- DWORD buflen;
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ DWORD buflen = 0;
- if ((buflen = GetModuleFileNameW (0, buffer, MAX_PATH)) > 0)
+ if ((buflen = GetModuleFileNameW (0, aBuffer, aBuffer.getBufSizeInSymbols())) > 0)
{
rtl_uString * pAbsPath = 0;
- rtl_uString_newFromStr_WithLength (&(pAbsPath), buffer, buflen);
+ rtl_uString_newFromStr_WithLength (&(pAbsPath), aBuffer, buflen);
if (pAbsPath)
{
/* Convert from path to url. */
@@ -282,16 +284,16 @@ static rtl_uString ** osl_createCommandArgs_Impl (int argc, char ** argv)
if (ppArgs[0] != 0)
{
/* Ensure absolute path */
- DWORD dwResult;
- TCHAR szBuffer[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ DWORD dwResult = 0;
dwResult = SearchPath (
- 0, ppArgs[0]->buffer, L".exe", MAX_PATH, szBuffer, 0);
- if ((0 < dwResult) && (dwResult < MAX_PATH))
+ 0, ppArgs[0]->buffer, L".exe", aBuffer.getBufSizeInSymbols(), aBuffer, 0);
+ if ((0 < dwResult) && (dwResult < aBuffer.getBufSizeInSymbols()))
{
/* Replace argv[0] with it's absolute path */
rtl_uString_newFromStr_WithLength(
- &(ppArgs[0]), szBuffer, dwResult);
+ &(ppArgs[0]), aBuffer, dwResult);
}
}
if (ppArgs[0] != 0)
@@ -411,24 +413,24 @@ oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *ustrVar, rtl_uString **
* Current Working Directory.
***************************************************************************/
-extern oslMutex g_CurrentDirectoryMutex;
+extern "C" oslMutex g_CurrentDirectoryMutex;
oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir )
{
- TCHAR szBuffer[MAX_PATH];
- DWORD dwLen;
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ DWORD dwLen = 0;
osl_acquireMutex( g_CurrentDirectoryMutex );
- dwLen = GetCurrentDirectory( sizeof(szBuffer) / sizeof(TCHAR), szBuffer );
+ dwLen = GetCurrentDirectory( aBuffer.getBufSizeInSymbols(), aBuffer );
osl_releaseMutex( g_CurrentDirectoryMutex );
- if ( dwLen )
+ if ( dwLen && dwLen < aBuffer.getBufSizeInSymbols() )
{
oslFileError eError;
rtl_uString *ustrTemp = NULL;;
- rtl_uString_newFromStr_WithLength( &ustrTemp, szBuffer, dwLen );
+ rtl_uString_newFromStr_WithLength( &ustrTemp, aBuffer, dwLen );
eError = osl_getFileURLFromSystemPath( ustrTemp, pustrWorkingDir );
rtl_uString_release( ustrTemp );
@@ -446,7 +448,7 @@ oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir
* Process Locale.
***************************************************************************/
-extern void _imp_getProcessLocale( rtl_Locale ** ppLocale );
+extern "C" void _imp_getProcessLocale( rtl_Locale ** ppLocale );
static rtl_Locale * g_theProcessLocale = NULL;
diff --git a/sal/osl/w32/profile.c b/sal/osl/w32/profile.cxx
index 5a709cddc3f5..f30ac7ce3348 100644
--- a/sal/osl/w32/profile.c
+++ b/sal/osl/w32/profile.cxx
@@ -1,33 +1,35 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
#include "system.h"
+#include "file_url.h"
+#include "path_helper.hxx"
+
#include <osl/diagnose.h>
#include <osl/profile.h>
#include <osl/process.h>
@@ -499,10 +501,10 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
}
else
{
- CHAR szFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aFileName( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, szFileName, MAX_PATH, NULL, NULL);
- GetPrivateProfileString(pszSection, pszEntry, pszDefault, pszString, MaxLen, szFileName);
+ WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, aFileName, aFileName.getBufSizeInSymbols(), NULL, NULL);
+ GetPrivateProfileString(pszSection, pszEntry, pszDefault, pszString, MaxLen, aFileName);
}
releaseProfile(pProfile);
@@ -680,10 +682,10 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
}
else
{
- CHAR szFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aFileName( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, szFileName, MAX_PATH, NULL, NULL);
- WritePrivateProfileString(pszSection, pszEntry, pszString, szFileName);
+ WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, aFileName, aFileName.getBufSizeInSymbols(), NULL, NULL);
+ WritePrivateProfileString(pszSection, pszEntry, pszString, aFileName);
}
bRet = releaseProfile(pProfile);
@@ -791,10 +793,10 @@ sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
}
else
{
- CHAR szFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aFileName( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, szFileName, MAX_PATH, NULL, NULL);
- WritePrivateProfileString(pszSection, pszEntry, NULL, szFileName);
+ WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, aFileName, aFileName.getBufSizeInSymbols(), NULL, NULL);
+ WritePrivateProfileString(pszSection, pszEntry, NULL, aFileName);
}
bRet = releaseProfile(pProfile);
@@ -865,10 +867,10 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_C
}
else
{
- CHAR szFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aFileName( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, szFileName, MAX_PATH, NULL, NULL);
- n = GetPrivateProfileString(pszSection, NULL, NULL, pszBuffer, MaxLen, szFileName);
+ WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, aFileName, aFileName.getBufSizeInSymbols(), NULL, NULL);
+ n = GetPrivateProfileString(pszSection, NULL, NULL, pszBuffer, MaxLen, aFileName);
}
releaseProfile(pProfile);
@@ -884,9 +886,9 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_C
sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName, rtl_uString** strProfileName)
{
sal_Bool bFailed;
- sal_Unicode wcsFile[MAX_PATH];
- sal_Unicode wcsPath[MAX_PATH];
- sal_uInt32 nFileLen;
+ ::osl::LongPathBuffer< sal_Unicode > aFile( MAX_LONG_PATH );
+ ::osl::LongPathBuffer< sal_Unicode > aPath( MAX_LONG_PATH );
+ sal_uInt32 nFileLen = 0;
sal_uInt32 nPathLen = 0;
rtl_uString * strTmp = NULL;
@@ -895,19 +897,19 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
/* build file name */
if (strName && strName->length)
{
- if(strName->length >= MAX_PATH)
+ if( ::sal::static_int_cast< sal_uInt32 >( strName->length ) >= aFile.getBufSizeInSymbols() )
return sal_False;
- wcscpy(wcsFile, strName->buffer);
+ wcscpy( aFile, strName->buffer);
nFileLen = strName->length;
- if (rtl_ustr_indexOfChar( wcsFile, L'.' ) == -1)
+ if (rtl_ustr_indexOfChar( aFile, L'.' ) == -1)
{
- if (nFileLen + wcslen(STR_INI_EXTENSION) >= MAX_PATH)
+ if (nFileLen + wcslen(STR_INI_EXTENSION) >= aFile.getBufSizeInSymbols())
return sal_False;
/* add default extension */
- wcscpy(wcsFile + nFileLen, STR_INI_EXTENSION);
+ wcscpy( aFile + nFileLen, STR_INI_EXTENSION);
nFileLen += wcslen(STR_INI_EXTENSION);
}
}
@@ -934,22 +936,22 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
if ((nPos = rtl_ustr_lastIndexOfChar( pProgName, L'.' )) != -1 )
nLen -= 4;
- if ((nFileLen = nLen - nOffset) >= MAX_PATH)
+ if ((nFileLen = nLen - nOffset) >= aFile.getBufSizeInSymbols())
return sal_False;
- wcsncpy(wcsFile, pProgName + nOffset, nFileLen);
+ wcsncpy(aFile, pProgName + nOffset, nFileLen);
- if (nFileLen + wcslen(STR_INI_EXTENSION) >= MAX_PATH)
+ if (nFileLen + wcslen(STR_INI_EXTENSION) >= aFile.getBufSizeInSymbols())
return sal_False;
/* add default extension */
- wcscpy(wcsFile + nFileLen, STR_INI_EXTENSION);
+ wcscpy(aFile + nFileLen, STR_INI_EXTENSION);
nFileLen += wcslen(STR_INI_EXTENSION);
rtl_uString_release( strProgName );
}
- if (wcsFile[0] == 0)
+ if (aFile[0] == 0)
return sal_False;
/* build directory path */
@@ -969,10 +971,10 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
if (bFailed) return (sal_False);
- if (strHome->length >= MAX_PATH)
+ if ( ::sal::static_int_cast< sal_uInt32 >( strHome->length ) >= aPath.getBufSizeInSymbols())
return sal_False;
- wcscpy( wcsPath, strHome->buffer);
+ wcscpy( aPath, strHome->buffer);
nPathLen = strHome->length;
if (nLen > RTL_CONSTASCII_LENGTH(STR_INI_METAHOME))
@@ -980,10 +982,10 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
pPath += RTL_CONSTASCII_LENGTH(STR_INI_METAHOME);
nLen -= RTL_CONSTASCII_LENGTH(STR_INI_METAHOME);
- if (nLen + nPathLen >= MAX_PATH)
+ if (nLen + nPathLen >= aPath.getBufSizeInSymbols())
return sal_False;
- wcscpy(wcsPath + nPathLen, pPath);
+ wcscpy(aPath + nPathLen, pPath);
nPathLen += nLen;
}
@@ -1001,10 +1003,10 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
if (bFailed) return (sal_False);
- if (strConfig->length >= MAX_PATH)
+ if ( ::sal::static_int_cast< sal_uInt32 >( strConfig->length ) >= aPath.getBufSizeInSymbols())
return sal_False;
- wcscpy( wcsPath, strConfig->buffer);
+ wcscpy( aPath, strConfig->buffer);
nPathLen = strConfig->length;
if (nLen > RTL_CONSTASCII_LENGTH(STR_INI_METACFG))
@@ -1012,10 +1014,10 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
pPath += RTL_CONSTASCII_LENGTH(STR_INI_METACFG);
nLen -= RTL_CONSTASCII_LENGTH(STR_INI_METACFG);
- if (nLen + nPathLen >= MAX_PATH)
+ if (nLen + nPathLen >= aPath.getBufSizeInSymbols())
return sal_False;
- wcscpy(wcsPath + nPathLen, pPath);
+ wcscpy(aPath + nPathLen, pPath);
nPathLen += nLen;
}
@@ -1025,7 +1027,7 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
else if ((rtl_ustr_ascii_compare_WithLength(pPath, RTL_CONSTASCII_LENGTH(STR_INI_METASYS), STR_INI_METASYS) == 0) &&
((nLen == RTL_CONSTASCII_LENGTH(STR_INI_METASYS)) || (pPath[RTL_CONSTASCII_LENGTH(STR_INI_METASYS)] == '/')))
{
- if (((nPathLen = GetWindowsDirectoryW(wcsPath, MAX_PATH)) == 0) || (nPathLen >= MAX_PATH))
+ if (((nPathLen = GetWindowsDirectoryW(aPath, aPath.getBufSizeInSymbols())) == 0) || (nPathLen >= aPath.getBufSizeInSymbols()))
return (sal_False);
if (nLen > RTL_CONSTASCII_LENGTH(STR_INI_METASYS))
@@ -1033,10 +1035,10 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
pPath += RTL_CONSTASCII_LENGTH(STR_INI_METASYS);
nLen -= RTL_CONSTASCII_LENGTH(STR_INI_METASYS);
- if (nLen + nPathLen >= MAX_PATH)
+ if (nLen + nPathLen >= aPath.getBufSizeInSymbols())
return sal_False;
- wcscpy(wcsPath + nPathLen, pPath);
+ wcscpy(aPath + nPathLen, pPath);
nPathLen += nLen;
}
}
@@ -1045,16 +1047,16 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
((nLen == RTL_CONSTASCII_LENGTH(STR_INI_METAINS)) || (pPath[RTL_CONSTASCII_LENGTH(STR_INI_METAINS)] == '/') ||
(pPath[RTL_CONSTASCII_LENGTH(STR_INI_METAINS)] == '"') ) )
{
- if (! lookupProfile(pPath + RTL_CONSTASCII_LENGTH(STR_INI_METAINS), wcsFile, wcsPath))
+ if (! lookupProfile(pPath + RTL_CONSTASCII_LENGTH(STR_INI_METAINS), aFile, aPath))
return (sal_False);
- nPathLen = wcslen(wcsPath);
+ nPathLen = wcslen(aPath);
}
- else if(nLen < MAX_PATH)
+ else if( ::sal::static_int_cast< sal_uInt32 >( nLen ) < aPath.getBufSizeInSymbols())
{
- wcscpy(wcsPath, pPath);
- nPathLen = wcslen(wcsPath);
+ wcscpy(aPath, pPath);
+ nPathLen = wcslen(aPath);
}
else
return sal_False;
@@ -1068,28 +1070,28 @@ sal_Bool SAL_CALL osl_getProfileName(rtl_uString* strPath, rtl_uString* strName,
osl_freeSecurityHandle(security);
if (bFailed) return (sal_False);
- if (strConfigDir->length >= MAX_PATH)
+ if ( ::sal::static_int_cast< sal_uInt32 >( strConfigDir->length ) >= aPath.getBufSizeInSymbols() )
return sal_False;
- wcscpy(wcsPath, strConfigDir->buffer);
+ wcscpy(aPath, strConfigDir->buffer);
nPathLen = strConfigDir->length;
}
- if (nPathLen && (wcsPath[nPathLen - 1] != L'/') && (wcsPath[nPathLen - 1] != L'\\'))
+ if (nPathLen && (aPath[nPathLen - 1] != L'/') && (aPath[nPathLen - 1] != L'\\'))
{
- wcsPath[nPathLen++] = L'\\';
- wcsPath[nPathLen] = 0;
+ aPath[nPathLen++] = L'\\';
+ aPath[nPathLen] = 0;
}
- if (nPathLen + nFileLen >= MAX_PATH)
+ if (nPathLen + nFileLen >= aPath.getBufSizeInSymbols())
return sal_False;
/* append file name */
- wcscpy(wcsPath + nPathLen, wcsFile);
+ wcscpy(aPath + nPathLen, aFile);
nPathLen += nFileLen;
/* copy filename */
- rtl_uString_newFromStr_WithLength(&strTmp, wcsPath, nPathLen);
+ rtl_uString_newFromStr_WithLength(&strTmp, aPath, nPathLen);
nError = osl_getFileURLFromSystemPath(strTmp, strProfileName);
rtl_uString_release(strTmp);
@@ -1137,10 +1139,10 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, sal_Char* pszBuff
}
else
{
- CHAR szFileName[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aFileName( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, szFileName, MAX_PATH, NULL, NULL);
- n = GetPrivateProfileSectionNames(pszBuffer, MaxLen, szFileName);
+ WideCharToMultiByte(CP_ACP,0, pProfile->m_strFileName->buffer, -1, aFileName, aFileName.getBufSizeInSymbols(), NULL, NULL);
+ n = GetPrivateProfileSectionNames(pszBuffer, MaxLen, aFileName);
}
releaseProfile(pProfile);
@@ -1151,35 +1153,6 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, sal_Char* pszBuff
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*****************************************************************************/
/* Static Module Functions */
/*****************************************************************************/
@@ -1284,7 +1257,7 @@ static sal_Bool lockFile(const osl_TFile* pFile, osl_TLockMode eMode)
static osl_TFile* openFileImpl(rtl_uString * strFileName, oslProfileOption ProfileFlags )
{
- osl_TFile* pFile = calloc(1, sizeof(osl_TFile));
+ osl_TFile* pFile = reinterpret_cast< osl_TFile*>( calloc( 1, sizeof(osl_TFile) ) );
sal_Bool bWriteable = sal_False;
/* if ( ProfileFlags & ( osl_Profile_WRITELOCK | osl_Profile_FLUSHWRITE | osl_Profile_READWRITE ) )*/
@@ -2223,7 +2196,7 @@ static osl_TProfileImpl* acquireProfile(oslProfile Profile, sal_Bool bWriteable)
- if ((pProfile = osl_openProfile(NULL, PFlags)) != NULL )
+ if ( ( pProfile = (osl_TProfileImpl*)osl_openProfile( NULL, PFlags ) ) != NULL )
{
pProfile->m_Flags |= FLG_AUTOOPEN;
}
@@ -2330,7 +2303,8 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
sal_Char Buffer[4096] = "";
sal_Char Product[132] = "";
- WCHAR wcsPath[MAX_PATH] = L"";
+ ::osl::LongPathBuffer< sal_Unicode > aPath( MAX_LONG_PATH );
+ aPath[0] = 0;
DWORD dwPathLen = 0;
if (*strPath == L'"')
@@ -2364,7 +2338,7 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
rtl_uString * strSVFallback = NULL;
rtl_uString * strSVLocation = NULL;
rtl_uString * strSVName = NULL;
- sal_Char Dir[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aDir( MAX_LONG_PATH );
oslProfile hProfile;
rtl_uString_newFromAscii(&strSVFallback, SVERSION_FALLBACK);
@@ -2390,11 +2364,11 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
&& (stricmp(Product, pChr) < 0))
{
osl_readProfileString(
- hProfile, SVERSION_SECTION, pChr, Dir,
- sizeof(Dir), "");
+ hProfile, SVERSION_SECTION, pChr, aDir,
+ aDir.getBufSizeInSymbols(), "");
/* check for existence of path */
- if (access(Dir, 0) >= 0)
+ if (access(aDir, 0) >= 0)
strcpy(Product, pChr);
}
}
@@ -2425,11 +2399,11 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
&& (stricmp(Product, pChr) < 0))
{
osl_readProfileString(
- hProfile, SVERSION_SECTION, pChr, Dir,
- sizeof(Dir), "");
+ hProfile, SVERSION_SECTION, pChr, aDir,
+ aDir.getBufSizeInSymbols(), "");
/* check for existence of path */
- if (access(Dir, 0) >= 0)
+ if (access(aDir, 0) >= 0)
strcpy(Product, pChr);
}
}
@@ -2469,31 +2443,31 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
((nEnd = rtl_ustr_indexOfChar(pCommandArg + nStart + 1, L']')) != -1))
{
dwPathLen = nEnd;
- wcsncpy(wcsPath, pCommandArg + nStart + 1, dwPathLen );
- wcsPath[dwPathLen] = 0;
+ wcsncpy(aPath, pCommandArg + nStart + 1, dwPathLen );
+ aPath[dwPathLen] = 0;
/* build full path */
- if ((wcsPath[dwPathLen - 1] != L'/') && (wcsPath[dwPathLen - 1] != L'\\'))
+ if ((aPath[dwPathLen - 1] != L'/') && (aPath[dwPathLen - 1] != L'\\'))
{
- wcscpy(wcsPath + dwPathLen++, L"/");
+ wcscpy(aPath + dwPathLen++, L"/");
}
if (*strPath)
{
- wcscpy(wcsPath + dwPathLen, strPath);
+ wcscpy(aPath + dwPathLen, strPath);
dwPathLen += wcslen(strPath);
}
else
{
- CHAR szPath[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH );
int n;
- if ((n = WideCharToMultiByte(CP_ACP,0, wcsPath, -1, szPath, MAX_PATH, NULL, NULL)) > 0)
+ if ((n = WideCharToMultiByte(CP_ACP,0, aPath, -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), NULL, NULL)) > 0)
{
- strcpy(szPath + n, SVERSION_USER);
- if (access(szPath, 0) >= 0)
+ strcpy(aTmpPath + n, SVERSION_USER);
+ if (access(aTmpPath, 0) >= 0)
{
- dwPathLen += MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, wcsPath + dwPathLen, MAX_PATH - dwPathLen );
+ dwPathLen += MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, aPath + dwPathLen, aPath.getBufSizeInSymbols() - dwPathLen );
}
}
}
@@ -2533,16 +2507,16 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
}
else
{
- wcsncpy(wcsPath, strExecutable->buffer, nPos );
- wcsPath[nPos] = 0;
+ wcsncpy(aPath, strExecutable->buffer, nPos );
+ aPath[nPos] = 0;
dwPathLen = nPos;
}
}
else
{
- wcsncpy(wcsPath, strExecutable->buffer, nPos );
+ wcsncpy(aPath, strExecutable->buffer, nPos );
dwPathLen = nPos;
- wcsPath[dwPathLen] = 0;
+ aPath[dwPathLen] = 0;
}
/* if we have no product identification use the executable file name */
@@ -2558,30 +2532,30 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
rtl_uString_release(strExecutable);
/* remember last subdir */
- nPos = rtl_ustr_lastIndexOfChar(wcsPath, L'\\');
+ nPos = rtl_ustr_lastIndexOfChar(aPath, L'\\');
- wcscpy(wcsPath + dwPathLen++, L"\\");
+ wcscpy(aPath + dwPathLen++, L"\\");
if (*strPath)
{
- wcscpy(wcsPath + dwPathLen, strPath);
+ wcscpy(aPath + dwPathLen, strPath);
dwPathLen += wcslen(strPath);
}
{
- CHAR szPath[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, wcsPath, -1, szPath, MAX_PATH, NULL, NULL);
+ WideCharToMultiByte(CP_ACP,0, aPath, -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), NULL, NULL);
/* if file not exists, remove any specified subdirectories
like "bin" or "program" */
- if (((access(szPath, 0) < 0) && (nPos != -1)) || (*strPath == 0))
+ if (((access(aTmpPath, 0) < 0) && (nPos != -1)) || (*strPath == 0))
{
static sal_Char *SubDirs[] = SVERSION_DIRS;
int i = 0;
- pStr = szPath + nPos;
+ pStr = aTmpPath + nPos;
for (i = 0; i < (sizeof(SubDirs) / sizeof(SubDirs[0])); i++)
if (strnicmp(pStr + 1, SubDirs[i], strlen(SubDirs[i])) == 0)
@@ -2589,18 +2563,18 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
if ( *strPath == 0)
{
strcpy(pStr + 1,SVERSION_USER);
- if ( access(szPath, 0) < 0 )
+ if ( access(aTmpPath, 0) < 0 )
{
*(pStr+1)='\0';
}
else
{
- dwPathLen = nPos + MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, wcsPath + nPos + 1, MAX_PATH - (nPos + 1) );
+ dwPathLen = nPos + MultiByteToWideChar( CP_ACP, 0, SVERSION_USER, -1, aPath + nPos + 1, aPath.getBufSizeInSymbols() - (nPos + 1) );
}
}
else
{
- wcscpy(wcsPath + nPos + 1, strPath);
+ wcscpy(aPath + nPos + 1, strPath);
dwPathLen = nPos + 1 + wcslen(strPath);
}
@@ -2609,20 +2583,20 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
}
}
- if ((wcsPath[dwPathLen - 1] != L'/') && (wcsPath[dwPathLen - 1] != L'\\'))
+ if ((aPath[dwPathLen - 1] != L'/') && (aPath[dwPathLen - 1] != L'\\'))
{
- wcsPath[dwPathLen++] = L'\\';
- wcsPath[dwPathLen] = 0;
+ aPath[dwPathLen++] = L'\\';
+ aPath[dwPathLen] = 0;
}
- wcscpy(wcsPath + dwPathLen, strFile);
+ wcscpy(aPath + dwPathLen, strFile);
{
- CHAR szPath[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH );
- WideCharToMultiByte(CP_ACP,0, wcsPath, -1, szPath, MAX_PATH, NULL, NULL);
+ WideCharToMultiByte(CP_ACP,0, aPath, -1, aTmpPath, aTmpPath.getBufSizeInSymbols(), NULL, NULL);
- if ((access(szPath, 0) < 0) && (strlen(Product) > 0))
+ if ((access(aTmpPath, 0) < 0) && (strlen(Product) > 0))
{
rtl_uString * strSVFallback = NULL;
rtl_uString * strSVProfile = NULL;
@@ -2671,38 +2645,38 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
if (strlen(Buffer) > 0)
{
dwPathLen = MultiByteToWideChar(
- CP_ACP, 0, Buffer, -1, wcsPath, MAX_PATH );
+ CP_ACP, 0, Buffer, -1, aPath, aPath.getBufSizeInSymbols() );
dwPathLen -=1;
/* build full path */
- if ((wcsPath[dwPathLen - 1] != L'/')
- && (wcsPath[dwPathLen - 1] != L'\\'))
+ if ((aPath[dwPathLen - 1] != L'/')
+ && (aPath[dwPathLen - 1] != L'\\'))
{
- wcscpy(wcsPath + dwPathLen++, L"\\");
+ wcscpy(aPath + dwPathLen++, L"\\");
}
if (*strPath)
{
- wcscpy(wcsPath + dwPathLen, strPath);
+ wcscpy(aPath + dwPathLen, strPath);
dwPathLen += wcslen(strPath);
}
else
{
- CHAR szPath[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aTmpPath( MAX_LONG_PATH );
int n;
if ((n = WideCharToMultiByte(
- CP_ACP,0, wcsPath, -1, szPath,
- MAX_PATH, NULL, NULL))
+ CP_ACP,0, aPath, -1, aTmpPath,
+ aTmpPath.getBufSizeInSymbols(), NULL, NULL))
> 0)
{
- strcpy(szPath + n, SVERSION_USER);
- if (access(szPath, 0) >= 0)
+ strcpy(aTmpPath + n, SVERSION_USER);
+ if (access(aTmpPath, 0) >= 0)
{
dwPathLen += MultiByteToWideChar(
CP_ACP, 0, SVERSION_USER, -1,
- wcsPath + dwPathLen,
- MAX_PATH - dwPathLen );
+ aPath + dwPathLen,
+ aPath.getBufSizeInSymbols() - dwPathLen );
}
}
}
@@ -2718,11 +2692,11 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
}
}
- wcsPath[dwPathLen] = 0;
+ aPath[dwPathLen] = 0;
}
/* copy filename */
- wcscpy(strProfile, wcsPath);
+ wcscpy(strProfile, aPath);
return sal_True;
}
diff --git a/sal/osl/w32/signal.c b/sal/osl/w32/signal.cxx
index 3e1f6d8105b7..f893f7520d40 100644
--- a/sal/osl/w32/signal.c
+++ b/sal/osl/w32/signal.cxx
@@ -1,34 +1,37 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
/* system headers */
#include "system.h"
#include <tchar.h>
+#include "file_url.h"
+#include "path_helper.hxx"
+
#include <osl/diagnose.h>
#include <osl/mutex.h>
#include <osl/signal.h>
@@ -112,7 +115,7 @@ static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP )
BOOL fSuccess = FALSE;
BOOL fAutoReport = FALSE;
TCHAR szBuffer[1024];
- TCHAR szPath[MAX_PATH];
+ ::osl::LongPathBuffer< sal_Char > aPath( MAX_LONG_PATH );
LPTSTR lpFilePart;
PROCESS_INFORMATION ProcessInfo;
STARTUPINFO StartupInfo;
@@ -164,11 +167,11 @@ static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP )
value_len = quote - value;
}
- lpVariable = _alloca( variable_len + 1 );
+ lpVariable = reinterpret_cast< CHAR* >( _alloca( variable_len + 1 ) );
memcpy( lpVariable, variable, variable_len );
lpVariable[variable_len] = 0;
- lpValue = _alloca( value_len + 1);
+ lpValue = reinterpret_cast< CHAR* >( _alloca( value_len + 1) );
memcpy( lpValue, value, value_len );
lpValue[value_len] = 0;
@@ -177,7 +180,7 @@ static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP )
}
}
- if ( SearchPath( NULL, TEXT("crashrep.exe"), NULL, MAX_PATH, szPath, &lpFilePart ) )
+ if ( SearchPath( NULL, TEXT( "crashrep.exe" ), NULL, aPath.getBufSizeInSymbols(), aPath, &lpFilePart ) )
{
ZeroMemory( &StartupInfo, sizeof(StartupInfo) );
StartupInfo.cb = sizeof(StartupInfo.cb);
@@ -185,7 +188,7 @@ static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP )
sntprintf( szBuffer, elementsof(szBuffer),
_T("%s -p %u -excp 0x%p -t %u%s"),
- szPath,
+ aPath,
GetCurrentProcessId(),
lpEP,
GetCurrentThreadId(),
@@ -314,6 +317,8 @@ static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
SetErrorMode(SEM_NOGPFAULTERRORBOX);
exit(255);
break;
+ default:
+ break;
}
return (EXCEPTION_CONTINUE_EXECUTION);
@@ -331,7 +336,7 @@ oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction Handler,
if (! bInitSignal)
bInitSignal = InitSignal();
- pHandler = calloc(1, sizeof(oslSignalHandlerImpl));
+ pHandler = reinterpret_cast< oslSignalHandlerImpl* >( calloc( 1, sizeof(oslSignalHandlerImpl) ) );
if (pHandler != NULL)
{
diff --git a/sal/osl/w32/system.h b/sal/osl/w32/system.h
index cc3ebd47d574..1bd86994e6ce 100644
--- a/sal/osl/w32/system.h
+++ b/sal/osl/w32/system.h
@@ -105,10 +105,22 @@
#endif // #ifdef GCC
#ifdef _DLL_
+
+#ifdef __cplusplus
+ extern "C" DWORD g_dwPlatformId;
+#else
extern DWORD g_dwPlatformId;
+#endif // #ifdef __cplusplus
+
#define IS_NT (g_dwPlatformId == VER_PLATFORM_WIN32_NT)
#else
+
+#ifdef __cplusplus
+ extern "C" DWORD GetPlatformId(void);
+#else
extern DWORD GetPlatformId(void);
+#endif // #ifdef __cplusplus
+
#define IS_NT (GetPlatformId() == VER_PLATFORM_WIN32_NT)
#endif // #ifdef _DLL_
diff --git a/sal/osl/w32/tempfile.cxx b/sal/osl/w32/tempfile.cxx
index f5b7f32fea8f..4bf136b6b0e0 100644
--- a/sal/osl/w32/tempfile.cxx
+++ b/sal/osl/w32/tempfile.cxx
@@ -34,6 +34,7 @@
#include "file_error.h"
#include "file_url.h"
+#include "path_helper.hxx"
#include "osl/diagnose.h"
@@ -212,7 +213,7 @@ oslFileError SAL_CALL osl_createTempFile(
if (osl_File_E_None != osl_error)
return osl_error;
- /* allocate enough space on the stack */
+ /* allocate enough space on the stack, the file name can not be longer than MAX_PATH */
STACK_ALLOC(tmp_name, WCHAR, (rtl_uString_getLength(base_directory) + MAX_PATH));
if (tmp_name)
@@ -238,25 +239,21 @@ oslFileError SAL_CALL osl_createTempFile(
//#############################################
oslFileError SAL_CALL osl_getTempDirURL(rtl_uString** pustrTempDir)
{
- WCHAR szBuffer[MAX_PATH];
- LPWSTR lpBuffer = szBuffer;
- DWORD nBufferLength = ELEMENTS_OF_ARRAY(szBuffer) - 1;
+ ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
+ LPWSTR lpBuffer = aBuffer;
+ DWORD nBufferLength = aBuffer.getBufSizeInSymbols() - 1;
DWORD nLength;
oslFileError error;
- do
+ nLength = GetTempPathW( aBuffer.getBufSizeInSymbols(), lpBuffer );
+
+ if ( nLength > nBufferLength )
{
- nLength = GetTempPathW( ELEMENTS_OF_ARRAY(szBuffer), lpBuffer );
- if ( nLength > nBufferLength )
- {
- nLength++;
- lpBuffer = reinterpret_cast<WCHAR*>(alloca( sizeof(WCHAR) * nLength ));
- nBufferLength = nLength - 1;
- }
- } while ( nLength > nBufferLength );
-
- if ( nLength )
+ // the provided path has invalid length
+ error = osl_File_E_NOENT;
+ }
+ else if ( nLength )
{
rtl_uString *ustrTempPath = NULL;
@@ -274,3 +271,4 @@ oslFileError SAL_CALL osl_getTempDirURL(rtl_uString** pustrTempDir)
return error;
}
+
diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx
index ec5229002c4b..7caa2341ca11 100644
--- a/sal/rtl/source/hash.cxx
+++ b/sal/rtl/source/hash.cxx
@@ -36,52 +36,51 @@
#include <hash_set>
namespace {
- struct UStringHash
- {
- size_t operator()(rtl_uString * const &rString) const
- { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); }
- };
- struct UStringEqual
- {
- sal_Bool operator() ( rtl_uString * const &pStringA,
- rtl_uString * const &pStringB) const
- {
- if (pStringA == pStringB)
- return true;
- if (pStringA->length != pStringB->length)
- return false;
- return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length,
- pStringB->buffer, pStringB->length);
- }
- };
-}
-typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual,
- rtl::Allocator<rtl_uString *> > UniqueHash;
+struct UStringHash
+{
+ size_t operator()(rtl_uString * const &rString) const
+ { return (size_t)rtl_ustr_hashCode_WithLength( rString->buffer, rString->length ); }
+};
-struct StringHashTableImpl : public UniqueHash
+struct UStringEqual
{
- StringHashTableImpl(sal_uInt32 nSize) : UniqueHash( nSize ) {}
+ sal_Bool operator() ( rtl_uString * const &pStringA,
+ rtl_uString * const &pStringB) const
+ {
+ if (pStringA == pStringB)
+ return true;
+ if (pStringA->length != pStringB->length)
+ return false;
+ return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length,
+ pStringB->buffer, pStringB->length);
+ }
};
+typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual,
+ rtl::Allocator<rtl_uString *> > StringHashTable;
+
StringHashTable *
-rtl_str_hash_new (sal_uInt32 nSize)
+getHashTable ()
{
- return new StringHashTableImpl (nSize);
+ static StringHashTable *pInternPool = NULL;
+ if (pInternPool == NULL) {
+ static StringHashTable aImpl(1024);
+ pInternPool = &aImpl;
+ }
+ return pInternPool;
}
-void
-rtl_str_hash_free (StringHashTable *pHash)
-{
- delete pHash;
}
+extern "C" {
+
rtl_uString *
-rtl_str_hash_intern (StringHashTable *pHash,
- rtl_uString *pString,
+rtl_str_hash_intern (rtl_uString *pString,
int can_return)
{
- UniqueHash::iterator aIter;
+ StringHashTable *pHash = getHashTable();
+ StringHashTable::iterator aIter;
aIter = pHash->find(pString);
if (aIter != pHash->end())
{
@@ -106,8 +105,9 @@ rtl_str_hash_intern (StringHashTable *pHash,
}
void
-rtl_str_hash_remove (StringHashTable *pHash,
- rtl_uString *pString)
+rtl_str_hash_remove (rtl_uString *pString)
{
- pHash->erase(pString);
+ getHashTable()->erase(pString);
+}
+
}
diff --git a/sal/rtl/source/hash.h b/sal/rtl/source/hash.h
index 63f3e99c8495..2aadfb33efcd 100644
--- a/sal/rtl/source/hash.h
+++ b/sal/rtl/source/hash.h
@@ -8,15 +8,11 @@
extern "C" {
#endif /* __cplusplus */
-typedef struct StringHashTableImpl StringHashTable;
+/* These functions are not multi-thread safe: */
-StringHashTable *rtl_str_hash_new (sal_uInt32 nSize);
-void rtl_str_hash_free (StringHashTable *pHash);
-rtl_uString *rtl_str_hash_intern (StringHashTable *pHash,
- rtl_uString *pString,
+rtl_uString *rtl_str_hash_intern (rtl_uString *pString,
int can_return);
-void rtl_str_hash_remove (StringHashTable *pHash,
- rtl_uString *pString);
+void rtl_str_hash_remove (rtl_uString *pString);
#if defined __cplusplus
}
diff --git a/sal/rtl/source/ustring.c b/sal/rtl/source/ustring.c
index e4bf28408af1..b0bdd2d98e73 100644
--- a/sal/rtl/source/ustring.c
+++ b/sal/rtl/source/ustring.c
@@ -555,7 +555,12 @@ static void rtl_string2UString_status( rtl_uString** ppThis,
"rtl_string2UString_status() - Wrong TextEncoding" );
if ( !nLen )
+ {
rtl_uString_new( ppThis );
+ if (pInfo != NULL) {
+ *pInfo = 0;
+ }
+ }
else
{
if ( *ppThis )
@@ -586,6 +591,9 @@ static void rtl_string2UString_status( rtl_uString** ppThis,
nLen--;
}
while ( nLen );
+ if (pInfo != NULL) {
+ *pInfo = 0;
+ }
}
else
{
@@ -753,8 +761,6 @@ getInternMutex()
return pPoolGuard;
}
-static StringHashTable *pInternPool = NULL;
-
/* returns true if we found a dup in the pool */
static void rtl_ustring_intern_internal( rtl_uString ** newStr,
rtl_uString * str,
@@ -766,9 +772,7 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr,
osl_acquireMutex( pPoolMutex );
- if (!pInternPool)
- pInternPool = rtl_str_hash_new (1024);
- *newStr = rtl_str_hash_intern (pInternPool, str, can_return);
+ *newStr = rtl_str_hash_intern (str, can_return);
osl_releaseMutex( pPoolMutex );
@@ -856,7 +860,7 @@ internRelease (rtl_uString *pThis)
pPoolMutex = getInternMutex();
osl_acquireMutex( pPoolMutex );
- rtl_str_hash_remove (pInternPool, pThis);
+ rtl_str_hash_remove (pThis);
/* May have been separately acquired */
if ( SAL_STRING_REFCOUNT(
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index b5e0f25f516c..bba1543dd403 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -200,8 +200,6 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
UINT16 nExcTabCount = rTabInfo.GetXclTabCount();
UINT16 nCodenames = static_cast< UINT16 >( GetExtDocOptions().GetCodeNameCount() );
- rR.pObjRecs = NULL; // per sheet
-
sal_uInt16 nWriteProtHash = 0;
if( SfxObjectShell* pDocShell = GetDocShell() )
{
@@ -416,7 +414,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList )
Add( new XclExpRecalcId );
// MSODRAWINGGROUP per-document data
- Add( new XclMsodrawinggroup( rR, ESCHER_DggContainer ) );
+ aRecList.AppendRecord( GetObjectManager().CreateDrawingGroup() );
// Shared string table: SST, EXTSST
aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) );
@@ -438,9 +436,8 @@ void ExcTable::FillAsTable( size_t nCodeNameIdx )
DBG_ASSERT( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" );
DBG_ASSERT( nExcTab <= static_cast<sal_uInt16>(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" );
- if ( eBiff == EXC_BIFF8 )
- // list holding OBJ records and creating MSODRAWING per-sheet data
- rR.pObjRecs = new XclObjList( GetRoot() );
+ // create a new OBJ list for this sheet (may be used by notes, autofilter, data validation)
+ GetObjectManager().StartSheet();
// cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records
mxCellTable.reset( new XclExpCellTable( GetRoot() ) );
@@ -512,13 +509,8 @@ void ExcTable::FillAsTable( size_t nCodeNameIdx )
if( eBiff == EXC_BIFF8 )
{
- rR.pEscher->AddSdrPage();
- //! close Escher group shape and ESCHER_DgContainer
- //! opened by XclObjList ctor MSODRAWING
- rR.pObjRecs->EndSheet();
// all MSODRAWING and OBJ stuff of this sheet goes here
- Add( rR.pObjRecs );
-
+ aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) );
// pivot tables
aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) );
}
@@ -590,12 +582,13 @@ void ExcTable::FillAsXmlTable( size_t nCodeNameIdx )
// label ranges
Add( new XclExpLabelranges( GetRoot() ) );
- rR.pEscher->AddSdrPage();
- //! close Escher group shape and ESCHER_DgContainer
- //! opened by XclObjList ctor MSODRAWING
- rR.pObjRecs->EndSheet();
- // all MSODRAWING and OBJ stuff of this sheet goes here
- Add( rR.pObjRecs );
+ // DFF not needed in MSOOXML export
+// GetObjectManager().AddSdrPage();
+// //! close Escher group shape and ESCHER_DgContainer
+// //! opened by XclExpObjList ctor MSODRAWING
+// rR.pObjRecs->EndSheet();
+// // all MSODRAWING and OBJ stuff of this sheet goes here
+// Add( rR.pObjRecs );
// pivot tables
aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) );
@@ -756,7 +749,7 @@ void ExcDocument::ReadDoc( void )
if ( GetBiff() == EXC_BIFF8 )
{
// complete temporary Escher stream
- GetOldRoot().pEscher->GetEx()->EndDocument();
+ GetObjectManager().EndDocument();
// change tracking
if ( GetDoc().GetChangeTrack() )
@@ -771,9 +764,6 @@ void ExcDocument::Write( SvStream& rSvStrm )
{
InitializeSave();
- if ( GetBiff() == EXC_BIFF8 )
- GetOldRoot().pEscher->GetStrm().Seek(0); // ready for take off
-
XclExpStream aXclStrm( rSvStrm, GetRoot() );
aHeader.Write( aXclStrm );
@@ -807,8 +797,6 @@ void ExcDocument::WriteXml( SvStream& rStrm )
XclExpXmlStream aStrm( ::comphelper::getProcessServiceFactory(), rStrm, GetRoot() );
- GetOldRoot().pEscher->GetStrm().Seek(0); // ready for take off
-
sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream();
rWorkbook->startElement( XML_workbook,
XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index d49c04624cdf..9a66325db419 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -88,6 +88,7 @@
#include "formula/errorcodes.hxx"
#include "excdoc.hxx"
+#include "xeescher.hxx"
#include "xeformula.hxx"
#include "xelink.hxx"
#include "xename.hxx"
@@ -976,8 +977,8 @@ void ExcAutoFilterRecs::AddObjRecs()
ScAddress aAddr( pFilterInfo->GetStartPos() );
for( SCCOL nObj = 0, nCount = pFilterInfo->GetColCount(); nObj < nCount; nObj++ )
{
- XclObjDropDown* pObj = new XclObjDropDown( GetRoot(), aAddr, IsFiltered( nObj ) );
- GetOldRoot().pObjRecs->Add( pObj );
+ XclObj* pObjRec = new XclObjDropDown( GetObjectManager(), aAddr, IsFiltered( nObj ) );
+ GetObjectManager().AddObj( pObjRec );
aAddr.IncCol( 1 );
}
}
diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx
index ba4a8339c829..e6453c2f11e2 100644
--- a/sc/source/filter/excel/exctools.cxx
+++ b/sc/source/filter/excel/exctools.cxx
@@ -76,9 +76,6 @@ RootData::RootData( void )
pTabId = NULL;
pUserBViewList = NULL;
- pObjRecs = NULL;
- pEscher = NULL;
-
pIR = NULL;
pER = NULL;
}
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index d28fa2063c91..dbe70ae6a0ee 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -141,14 +141,11 @@ ExportBiff8::ExportBiff8( XclExpRootData& rExpData, SvStream& rStrm ) :
ExportBiff5( rExpData, rStrm )
{
pExcRoot->eDateiTyp = Biff8;
- pExcRoot->pEscher = new XclEscher( GetRoot(), GetDoc().GetTableCount() );
}
ExportBiff8::~ExportBiff8()
{
- delete pExcRoot->pEscher;
- pExcRoot->pEscher = NULL;
}
@@ -159,16 +156,12 @@ ExportXml2007::ExportXml2007( XclExpRootData& rExpData, SvStream& rStrm )
pExcRoot = &GetOldRoot();
pExcRoot->pER = this;
pExcRoot->eDateiTyp = Biff8;
- pExcRoot->pEscher = new XclEscher( *pExcRoot->pER, GetDoc().GetTableCount() );
pExcDoc = new ExcDocument( *this );
}
ExportXml2007::~ExportXml2007()
{
- delete pExcRoot->pEscher;
- pExcRoot->pEscher = NULL;
-
delete pExcDoc;
}
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index dfb3a69c219a..e62f050f2351 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1241,7 +1241,7 @@ void ImportExcel::PostDocLoad( void )
}
// #111099# open forms in alive mode (has no effect, if no controls in document)
- pDocObj->setPropertyValue( CREATE_OUSTRING( SC_UNO_APPLYFMDES ), ::comphelper::makeBoolAny( sal_False ) );
+ pDocObj->setPropertyValue( CREATE_OUSTRING( SC_UNO_APPLYFMDES ), uno::Any( false ) );
}
// enables extended options to be set to the view after import
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 91b749030dd7..637a4777c8ed 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -64,6 +64,8 @@ FltError ImportExcel::Read( void )
XclImpXFBuffer& rXFBfr = GetXFBuffer();
XclImpNameManager& rNameMgr = GetNameManager();
XclImpObjectManager& rObjMgr = GetObjectManager();
+ (void)rObjMgr;
+ // call to GetCurrSheetDrawing() cannot be cached (changes in new sheets)
enum Zustand {
Z_BiffNull, // Nicht in gueltigem Biff-Format
@@ -246,7 +248,7 @@ FltError ImportExcel::Read( void )
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x18: rNameMgr.ReadName( maStrm ); break;
- case 0x1C: rObjMgr.ReadNote( maStrm ); break;
+ case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
case 0x20: Columndefault(); break; // COLUMNDEFAULT[ 2 ]
@@ -309,7 +311,7 @@ FltError ImportExcel::Read( void )
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: rObjMgr.ReadNote( maStrm ); break;
+ case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x1E: rNumFmtBfr.ReadFormat( maStrm ); break;
case 0x22: Rec1904(); break; // 1904 [ 2345]
@@ -328,7 +330,7 @@ FltError ImportExcel::Read( void )
case 0x41: rTabViewSett.ReadPane( maStrm ); break;
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
- case 0x5D: rObjMgr.ReadObj( maStrm ); break;
+ case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x92: rPal.ReadPalette( maStrm ); break;
@@ -380,7 +382,7 @@ FltError ImportExcel::Read( void )
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: rObjMgr.ReadNote( maStrm ); break;
+ case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x22: Rec1904(); break; // 1904 [ 2345]
case 0x26:
@@ -399,7 +401,7 @@ FltError ImportExcel::Read( void )
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x55: DefColWidth(); break;
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
- case 0x5D: rObjMgr.ReadObj( maStrm ); break;
+ case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x92: rPal.ReadPalette( maStrm ); break;
@@ -496,7 +498,7 @@ FltError ImportExcel::Read( void )
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x1A:
case 0x1B: rPageSett.ReadPageBreaks( maStrm ); break;
- case 0x1C: rObjMgr.ReadNote( maStrm ); break;
+ case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x2F: // FILEPASS [ 2345]
eLastErr = XclImpDecryptHelper::ReadFilepass( maStrm );
@@ -507,7 +509,7 @@ FltError ImportExcel::Read( void )
case 0x42: Codepage(); break; // CODEPAGE [ 2345]
case 0x55: DefColWidth(); break;
case 0x56: Builtinfmtcnt(); break; // BUILTINFMTCNT[ 34 ]
- case 0x5D: rObjMgr.ReadObj( maStrm ); break;
+ case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
case 0x7D: Colinfo(); break; // COLINFO [ 345]
case 0x8C: Country(); break; // COUNTRY [ 345]
case 0x8F: Bundleheader(); break; // BUNDLEHEADER [ 4 ]
@@ -666,7 +668,7 @@ FltError ImportExcel::Read( void )
case 0x14:
case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break;
case 0x17: Externsheet(); break; // EXTERNSHEET [ 2345]
- case 0x1C: rObjMgr.ReadNote( maStrm ); break;
+ case 0x1C: GetCurrSheetDrawing().ReadNote( maStrm );break;
case 0x1D: rTabViewSett.ReadSelection( maStrm ); break;
case 0x23: Externname25(); break; // EXTERNNAME [ 2 5]
case 0x26:
@@ -680,7 +682,7 @@ FltError ImportExcel::Read( void )
if( eLastErr != ERRCODE_NONE )
eAkt = Z_Ende;
break;
- case 0x5D: rObjMgr.ReadObj( maStrm ); break;
+ case 0x5D: GetCurrSheetDrawing().ReadObj( maStrm );break;
case 0x83:
case 0x84: rPageSett.ReadCenter( maStrm ); break;
case 0xA0: rTabViewSett.ReadScl( maStrm ); break;
@@ -714,7 +716,7 @@ FltError ImportExcel::Read( void )
aIn.StoreGlobalPosition(); // und Position merken
break;
case Biff5C: // chart sheet
- GetObjectManager().ReadTabChart( maStrm );
+ GetCurrSheetDrawing().ReadTabChart( maStrm );
Eof();
GetTracer().TraceChartOnlySheet();
break;
@@ -799,6 +801,7 @@ FltError ImportExcel8::Read( void )
XclImpNameManager& rNameMgr = GetNameManager();
XclImpLinkManager& rLinkMgr = GetLinkManager();
XclImpObjectManager& rObjMgr = GetObjectManager();
+ // call to GetCurrSheetDrawing() cannot be cached (changes in new sheets)
XclImpCondFormatManager& rCondFmtMgr = GetCondFormatManager();
XclImpPivotTableManager& rPTableMgr = GetPivotTableManager();
XclImpWebQueryBuffer& rWQBfr = GetWebQueryBuffer();
@@ -1040,7 +1043,7 @@ FltError ImportExcel8::Read( void )
aIn.StoreGlobalPosition();
break;
case Biff8C: // chart sheet
- rObjMgr.ReadTabChart( maStrm );
+ GetCurrSheetDrawing().ReadTabChart( maStrm );
Eof();
GetTracer().TraceChartOnlySheet();
break;
@@ -1161,10 +1164,10 @@ FltError ImportExcel8::Read( void )
case EXC_ID_SETUP: rPageSett.ReadSetup( maStrm ); break;
case EXC_ID8_IMGDATA: rPageSett.ReadImgData( maStrm ); break;
- case EXC_ID_MSODRAWING: rObjMgr.ReadMsoDrawing( maStrm ); break;
+ case EXC_ID_MSODRAWING: GetCurrSheetDrawing().ReadMsoDrawing( maStrm ); break;
// #i61786# weird documents: OBJ without MSODRAWING -> read in BIFF5 format
- case EXC_ID_OBJ: rObjMgr.ReadObj( maStrm ); break;
- case EXC_ID_NOTE: rObjMgr.ReadNote( maStrm ); break;
+ case EXC_ID_OBJ: GetCurrSheetDrawing().ReadObj( maStrm ); break;
+ case EXC_ID_NOTE: GetCurrSheetDrawing().ReadNote( maStrm ); break;
case EXC_ID_HLINK: XclImpHyperlink::ReadHlink( maStrm ); break;
case EXC_ID_LABELRANGES: XclImpLabelranges::ReadLabelranges( maStrm ); break;
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 637aacd4e722..1564b2db834e 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -63,6 +64,7 @@
#include "compiler.hxx"
#include "tokenarray.hxx"
#include "token.hxx"
+#include "xeescher.hxx"
#include "xeformula.hxx"
#include "xehelper.hxx"
#include "xepage.hxx"
@@ -77,6 +79,7 @@ using ::com::sun::star::uno::Exception;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::i18n::XBreakIterator;
using ::com::sun::star::frame::XModel;
+using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::chart2::XChartDocument;
using ::com::sun::star::chart2::XDiagram;
using ::com::sun::star::chart2::XCoordinateSystemContainer;
@@ -97,7 +100,6 @@ using ::com::sun::star::chart2::XTitled;
using ::com::sun::star::chart2::XTitle;
using ::com::sun::star::chart2::XFormattedString;
using ::com::sun::star::chart2::XColorScheme;
-
using ::com::sun::star::chart2::data::XDataSource;
using ::com::sun::star::chart2::data::XLabeledDataSequence;
using ::com::sun::star::chart2::data::XDataSequence;
@@ -2766,6 +2768,15 @@ XclExpChAxesSet::XclExpChAxesSet( const XclExpChRoot& rRoot, sal_uInt16 nAxesSet
{
maData.mnAxesSetId = nAxesSetId;
SetFutureRecordContext( 0, nAxesSetId );
+
+ /* Need to set a reasonable size for the plot area, otherwise Excel will
+ move away embedded shapes while auto-sizing the plot area. This is just
+ a wild guess, but will be fixed with implementing manual positioning of
+ chart elements. */
+ maData.maRect.mnX = 262;
+ maData.maRect.mnY = 626;
+ maData.maRect.mnWidth = 3187;
+ maData.maRect.mnHeight = 2633;
}
sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > xDiagram, sal_uInt16 nFirstGroupIdx )
@@ -2904,6 +2915,14 @@ bool XclExpChAxesSet::Is3dChart() const
void XclExpChAxesSet::WriteSubRecords( XclExpStream& rStrm )
{
+ /* Need to set a reasonable size for the plot area, otherwise Excel will
+ move away embedded shapes while auto-sizing the plot area. This is just
+ a wild guess, but will be fixed with implementing manual positioning of
+ chart elements. */
+ rStrm.StartRecord( EXC_ID_CHFRAMEPOS, 20 );
+ rStrm << sal_uInt16(2) << sal_uInt16(2) << sal_uInt32(66) << sal_uInt32(626) << sal_uInt32(3384) << sal_uInt32(3231);
+ rStrm.EndRecord();
+
lclSaveRecord( rStrm, mxXAxis );
lclSaveRecord( rStrm, mxYAxis );
lclSaveRecord( rStrm, mxZAxis );
@@ -2965,8 +2984,8 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
maRect.mnHeight = static_cast< sal_Int32 >( aPtSize.Height() << 16 );
// global chart properties (default values)
- ::set_flag( maProps.mnFlags, EXC_CHPROPS_MANSERIES );
::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISIBLEONLY, false );
+ ::set_flag( maProps.mnFlags, EXC_CHPROPS_MANPLOTAREA );
maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP;
// always create both axes set objects
@@ -3073,12 +3092,49 @@ void XclExpChChart::WriteBody( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
+XclExpChartDrawing::XclExpChartDrawing( const XclExpRoot& rRoot,
+ const Reference< XModel >& rxModel, const Size& rChartSize ) :
+ XclExpRoot( rRoot )
+{
+ if( (rChartSize.Width() > 0) && (rChartSize.Height() > 0) )
+ {
+ ScfPropertySet aPropSet( rxModel );
+ Reference< XShapes > xShapes;
+ if( aPropSet.GetProperty( xShapes, EXC_CHPROP_ADDITIONALSHAPES ) && xShapes.is() && (xShapes->getCount() > 0) )
+ {
+ /* Create a new independent object manager with own DFF stream for the
+ DGCONTAINER, pass global manager as parent for shared usage of
+ global DFF data (picture container etc.). */
+ mxObjMgr.reset( new XclExpEmbeddedObjectManager( GetObjectManager(), rChartSize, EXC_CHART_UNIT, EXC_CHART_UNIT ) );
+ // initialize the drawing object list
+ mxObjMgr->StartSheet();
+ // process the draw page (convert all shapes)
+ mxObjRecs = mxObjMgr->ProcessDrawing( xShapes );
+ // finalize the DFF stream
+ mxObjMgr->EndDocument();
+ }
+ }
+}
+
+XclExpChartDrawing::~XclExpChartDrawing()
+{
+}
+
+void XclExpChartDrawing::Save( XclExpStream& rStrm )
+{
+ if( mxObjRecs.is() )
+ mxObjRecs->Save( rStrm );
+}
+
+// ----------------------------------------------------------------------------
+
XclExpChart::XclExpChart( const XclExpRoot& rRoot, Reference< XModel > xModel, const Size& rSize ) :
XclExpSubStream( EXC_BOF_CHART ),
XclExpRoot( rRoot )
{
AppendNewRecord( new XclExpChartPageSettings( rRoot ) );
AppendNewRecord( new XclExpBoolRecord( EXC_ID_PROTECT, false ) );
+ AppendNewRecord( new XclExpChartDrawing( rRoot, xModel, rSize ) );
AppendNewRecord( new XclExpUInt16Record( EXC_ID_CHUNITS, EXC_CHUNITS_TWIPS ) );
Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY );
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 1f46bdb66178..2df531a9b932 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -28,9 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-#include <set>
-#include <iterator>
-
#include "xeescher.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -45,12 +42,15 @@
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <set>
#include <rtl/ustrbuf.h>
#include <vcl/bmpacc.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdocapt.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/editobj.hxx>
+#include <unotools/tempfile.hxx>
+#include <unotools/ucbstreamhelper.hxx>
#include "editutil.hxx"
#include "unonames.hxx"
@@ -75,6 +75,7 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::lang::XServiceInfo;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::drawing::XShape;
+using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::frame::XModel;
using ::com::sun::star::embed::XEmbeddedObject;
using ::com::sun::star::awt::XControlModel;
@@ -86,6 +87,163 @@ using ::com::sun::star::script::ScriptEventDescriptor;
using ::com::sun::star::table::CellAddress;
using ::com::sun::star::table::CellRangeAddress;
+// Escher client anchor =======================================================
+
+XclExpDffAnchorBase::XclExpDffAnchorBase( const XclExpRoot& rRoot, sal_uInt16 nFlags ) :
+ XclExpRoot( rRoot ),
+ mnFlags( nFlags )
+{
+}
+
+void XclExpDffAnchorBase::SetFlags( const SdrObject& rSdrObj )
+{
+ ImplSetFlags( rSdrObj );
+}
+
+void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj )
+{
+ ImplSetFlags( rSdrObj );
+ ImplCalcAnchorRect( rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM );
+}
+
+void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
+{
+ rEscherEx.AddAtom( 18, ESCHER_ClientAnchor );
+ rEscherEx.GetStream() << mnFlags << maAnchor;
+}
+
+void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect )
+{
+ // the passed rectangle is in twips
+ ImplCalcAnchorRect( rRect, MAP_TWIP );
+ WriteDffData( rEscherEx );
+}
+
+void XclExpDffAnchorBase::ImplSetFlags( const SdrObject& )
+{
+ OSL_ENSURE( false, "XclExpDffAnchorBase::ImplSetFlags - not implemented" );
+}
+
+void XclExpDffAnchorBase::ImplCalcAnchorRect( const Rectangle&, MapUnit )
+{
+ OSL_ENSURE( false, "XclExpDffAnchorBase::ImplCalcAnchorRect - not implemented" );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpDffSheetAnchor::XclExpDffSheetAnchor( const XclExpRoot& rRoot ) :
+ XclExpDffAnchorBase( rRoot ),
+ mnScTab( rRoot.GetCurrScTab() )
+{
+}
+
+void XclExpDffSheetAnchor::ImplSetFlags( const SdrObject& rSdrObj )
+{
+ // Special case "page anchor" (X==0,Y==1) -> lock pos and size.
+ const Point& rPos = rSdrObj.GetAnchorPos();
+ mnFlags = ((rPos.X() == 0) && (rPos.Y() == 1)) ? EXC_ESC_ANCHOR_LOCKED : 0;
+}
+
+void XclExpDffSheetAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit )
+{
+ maAnchor.SetRect( GetDoc(), mnScTab, rRect, eMapUnit );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpDffEmbeddedAnchor::XclExpDffEmbeddedAnchor( const XclExpRoot& rRoot,
+ const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
+ XclExpDffAnchorBase( rRoot ),
+ maPageSize( rPageSize ),
+ mnScaleX( nScaleX ),
+ mnScaleY( nScaleY )
+{
+}
+
+void XclExpDffEmbeddedAnchor::ImplSetFlags( const SdrObject& /*rSdrObj*/ )
+{
+ // TODO (unsupported feature): fixed size
+}
+
+void XclExpDffEmbeddedAnchor::ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit )
+{
+ maAnchor.SetRect( maPageSize, mnScaleX, mnScaleY, rRect, eMapUnit, true );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
+ XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
+{
+ maAnchor.SetRect( GetDoc(), rRoot.GetCurrScTab(), rRect, MAP_100TH_MM );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpDffDropDownAnchor::XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) :
+ XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_POSLOCKED )
+{
+ GetAddressConverter().ConvertAddress( maAnchor.maFirst, rScPos, true );
+ maAnchor.maLast.mnCol = maAnchor.maFirst.mnCol + 1;
+ maAnchor.maLast.mnRow = maAnchor.maFirst.mnRow + 1;
+ maAnchor.mnLX = maAnchor.mnTY = maAnchor.mnRX = maAnchor.mnBY = 0;
+}
+
+// MSODRAWING* records ========================================================
+
+XclExpMsoDrawingBase::XclExpMsoDrawingBase( XclEscherEx& rEscherEx, sal_uInt16 nRecId ) :
+ XclExpRecord( nRecId ),
+ mrEscherEx( rEscherEx ),
+ mnFragmentKey( rEscherEx.InitNextDffFragment() )
+{
+}
+
+void XclExpMsoDrawingBase::WriteBody( XclExpStream& rStrm )
+{
+ OSL_ENSURE( mrEscherEx.GetStreamPos() == mrEscherEx.GetDffFragmentPos( mnFragmentKey ),
+ "XclExpMsoDrawingBase::WriteBody - DFF stream position mismatch" );
+ rStrm.CopyFromStream( mrEscherEx.GetStream(), mrEscherEx.GetDffFragmentSize( mnFragmentKey ) );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpMsoDrawingGroup::XclExpMsoDrawingGroup( XclEscherEx& rEscherEx ) :
+ XclExpMsoDrawingBase( rEscherEx, EXC_ID_MSODRAWINGGROUP )
+{
+ SvStream& rDffStrm = mrEscherEx.GetStream();
+
+ // write the DGGCONTAINER with some default settings
+ mrEscherEx.OpenContainer( ESCHER_DggContainer );
+
+ // TODO: stuff the OPT atom with our own document defaults?
+ static const sal_uInt8 spnDffOpt[] = {
+ 0xBF, 0x00, 0x08, 0x00, 0x08, 0x00, 0x81, 0x01,
+ 0x09, 0x00, 0x00, 0x08, 0xC0, 0x01, 0x40, 0x00,
+ 0x00, 0x08
+ };
+ mrEscherEx.AddAtom( sizeof( spnDffOpt ), ESCHER_OPT, 3, 3 );
+ rDffStrm.Write( spnDffOpt, sizeof( spnDffOpt ) );
+
+ // SPLITMENUCOLORS contains colors in toolbar
+ static const sal_uInt8 spnDffSplitMenuColors[] = {
+ 0x0D, 0x00, 0x00, 0x08, 0x0C, 0x00, 0x00, 0x08,
+ 0x17, 0x00, 0x00, 0x08, 0xF7, 0x00, 0x00, 0x10
+ };
+ mrEscherEx.AddAtom( sizeof( spnDffSplitMenuColors ), ESCHER_SplitMenuColors, 0, 4 );
+ rDffStrm.Write( spnDffSplitMenuColors, sizeof( spnDffSplitMenuColors ) );
+
+ // close the DGGCONTAINER
+ mrEscherEx.CloseContainer();
+ mrEscherEx.UpdateDffFragmentEnd();
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpMsoDrawing::XclExpMsoDrawing( XclEscherEx& rEscherEx ) :
+ XclExpMsoDrawingBase( rEscherEx, EXC_ID_MSODRAWING )
+{
+}
+
// ============================================================================
XclExpImgData::XclExpImgData( const Graphic& rGraphic, sal_uInt16 nRecId ) :
@@ -221,10 +379,10 @@ void XclExpControlHelper::WriteFormulaSubRec( XclExpStream& rStrm, sal_uInt16 nS
#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XShape > xShape,
- const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
- XclObj( rRoot, EXC_OBJTYPE_PICTURE, true ),
- XclExpControlHelper( rRoot ),
+XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape,
+ const Rectangle* pChildAnchor, const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
+ XclExpControlHelper( rObjMgr.GetRoot() ),
maClassName( rClassName ),
mnStrmStart( nStrmStart ),
mnStrmSize( nStrmSize )
@@ -238,11 +396,10 @@ XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XS
SetAutoLine( FALSE );
// fill DFF property set
- XclEscherEx& rEscherEx = *pMsodrawing->GetEscherEx();
- rEscherEx.OpenContainer( ESCHER_SpContainer );
- rEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
+ mrEscherEx.OpenContainer( ESCHER_SpContainer );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE );
Rectangle aDummyRect;
- EscherPropertyContainer aPropOpt( rEscherEx, rEscherEx.QueryPicStream(), aDummyRect );
+ EscherPropertyContainer aPropOpt( mrEscherEx, mrEscherEx.QueryPicStream(), aDummyRect );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x08000040 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
@@ -263,15 +420,14 @@ XclExpOcxControlObj::XclExpOcxControlObj( const XclExpRoot& rRoot, Reference< XS
}
// write DFF property set to stream
- aPropOpt.Commit( rEscherEx.GetStream() );
+ aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
- XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
- rEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
- rEscherEx.CloseContainer(); // ESCHER_SpContainer
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
- pMsodrawing->UpdateStopPos();
+ mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
+ mrEscherEx.CloseContainer(); // ESCHER_SpContainer
+ mrEscherEx.UpdateDffFragmentEnd();
// spreadsheet links
ConvertSheetLinks( xShape );
@@ -328,9 +484,9 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm )
#else
-XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XShape > xShape ) :
- XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ),
- XclExpControlHelper( rRoot ),
+XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
+ XclExpControlHelper( rObjMgr.GetRoot() ),
mnHeight( 0 ),
mnState( 0 ),
mnLineCount( 0 ),
@@ -384,9 +540,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
SetAutoLine( FALSE );
// fill DFF property set
- XclEscherEx& rEscherEx = *pMsodrawing->GetEscherEx();
- rEscherEx.OpenContainer( ESCHER_SpContainer );
- rEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.OpenContainer( ESCHER_SpContainer );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
EscherPropertyContainer aPropOpt;
bool bVisible = aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "EnableVisible" ) );
aPropOpt.AddOpt( ESCHER_Prop_fPrint, bVisible ? 0x00080000 : 0x00080002 ); // visible flag
@@ -404,13 +559,13 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
aPropOpt.AddOpt( ESCHER_Prop_wzName, aCtrlName );
// write DFF property set to stream
- aPropOpt.Commit( rEscherEx.GetStream() );
+ aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
- XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
- rEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
- pMsodrawing->UpdateStopPos();
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
+
+ mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
+ mrEscherEx.UpdateDffFragmentEnd();
// control label
OUString aString;
@@ -419,9 +574,9 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
/* Be sure to construct the MSODRAWING record containing the
ClientTextbox atom after the base OBJ's MSODRAWING record data is
completed. */
- pClientTextbox = new XclMsodrawing( GetRoot() );
- pClientTextbox->GetEscherEx()->AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
- pClientTextbox->UpdateStopPos();
+ pClientTextbox = new XclExpMsoDrawing( mrEscherEx );
+ mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
+ mrEscherEx.UpdateDffFragmentEnd();
sal_uInt16 nXclFont = EXC_FONT_APP;
if( aString.getLength() > 0 )
@@ -437,7 +592,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( const XclExpRoot& rRoot, Reference< XS
pTxo->SetVerAlign( EXC_OBJ_VER_CENTER );
}
- rEscherEx.CloseContainer(); // ESCHER_SpContainer
+ mrEscherEx.CloseContainer(); // ESCHER_SpContainer
// other properties
aCtrlProp.GetProperty( mnLineCount, CREATE_OUSTRING( "LineCount" ) );
@@ -763,14 +918,13 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
-XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xShape ) :
- XclObj( rRoot, EXC_OBJTYPE_CHART ),
- XclExpRoot( rRoot )
+XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
+ XclExpRoot( rObjMgr.GetRoot() )
{
// create the MSODRAWING record contents for the chart object
- XclEscherEx& rEscherEx = *pMsodrawing->GetEscherEx();
- rEscherEx.OpenContainer( ESCHER_SpContainer );
- rEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.OpenContainer( ESCHER_SpContainer );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 );
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 );
@@ -781,17 +935,16 @@ XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xSh
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080008 );
aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00020000 );
aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x00080000 );
- aPropOpt.Commit( rEscherEx.GetStream() );
+ aPropOpt.Commit( mrEscherEx.GetStream() );
- // client anchor
+ // anchor
SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape );
- if( pSdrObj )
- XclExpDffAnchor( rRoot, *pSdrObj ).WriteData( rEscherEx );
+ ImplWriteAnchor( GetRoot(), pSdrObj, pChildAnchor );
// client data (the following OBJ record)
- rEscherEx.AddAtom( 0, ESCHER_ClientData );
- rEscherEx.CloseContainer(); // ESCHER_SpContainer
- pMsodrawing->UpdateStopPos();
+ mrEscherEx.AddAtom( 0, ESCHER_ClientData );
+ mrEscherEx.CloseContainer(); // ESCHER_SpContainer
+ mrEscherEx.UpdateDffFragmentEnd();
// load the chart OLE object
if( SdrOle2Obj* pSdrOleObj = dynamic_cast< SdrOle2Obj* >( pSdrObj ) )
@@ -804,7 +957,7 @@ XclExpChartObj::XclExpChartObj( const XclExpRoot& rRoot, Reference< XShape > xSh
::com::sun::star::awt::Rectangle aBoundRect;
aShapeProp.GetProperty( aBoundRect, CREATE_OUSTRING( "BoundRect" ) );
Size aSize( aBoundRect.Width, aBoundRect.Height );
- mxChart.reset( new XclExpChart( rRoot, xModel, aSize ) );
+ mxChart.reset( new XclExpChart( GetRoot(), xModel, aSize ) );
}
XclExpChartObj::~XclExpChartObj()
@@ -849,7 +1002,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
if( pScNote )
if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() )
- mnObjId = rRoot.GetOldRoot().pObjRecs->Add( new XclObjComment( rRoot, pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible ) );
+ mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible ) );
SetRecSize( 9 + maAuthor.GetSize() );
}
@@ -1007,5 +1160,125 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
rStrm.PopStream();
}
+// object manager =============================================================
+
+XclExpObjectManager::XclExpObjectManager( const XclExpRoot& rRoot ) :
+ XclExpRoot( rRoot )
+{
+ InitStream( true );
+ mxEscherEx.reset( new XclEscherEx( GetRoot(), *this, *mxDffStrm ) );
+}
+
+XclExpObjectManager::XclExpObjectManager( const XclExpObjectManager& rParent ) :
+ XclExpRoot( rParent.GetRoot() )
+{
+ InitStream( false );
+ mxEscherEx.reset( new XclEscherEx( GetRoot(), *this, *mxDffStrm, rParent.mxEscherEx.get() ) );
+}
+
+XclExpObjectManager::~XclExpObjectManager()
+{
+}
+
+XclExpDffAnchorBase* XclExpObjectManager::CreateDffAnchor() const
+{
+ return new XclExpDffSheetAnchor( GetRoot() );
+}
+
+ScfRef< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
+{
+ return ScfRef< XclExpRecordBase >( new XclExpMsoDrawingGroup( *mxEscherEx ) );
+}
+
+void XclExpObjectManager::StartSheet()
+{
+ mxObjList.reset( new XclExpObjList( GetRoot(), *mxEscherEx ) );
+}
+
+ScfRef< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( SdrPage* pSdrPage )
+{
+ if( pSdrPage )
+ mxEscherEx->AddSdrPage( *pSdrPage );
+ // #106213# the first dummy object may still be open
+ DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
+ while( mxEscherEx->GetGroupLevel() )
+ mxEscherEx->LeaveGroup();
+ mxObjList->EndSheet();
+ return mxObjList;
+}
+
+ScfRef< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const Reference< XShapes >& rxShapes )
+{
+ if( rxShapes.is() )
+ mxEscherEx->AddUnoShapes( rxShapes );
+ // #106213# the first dummy object may still be open
+ DBG_ASSERT( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
+ while( mxEscherEx->GetGroupLevel() )
+ mxEscherEx->LeaveGroup();
+ mxObjList->EndSheet();
+ return mxObjList;
+}
+
+void XclExpObjectManager::EndDocument()
+{
+ mxEscherEx->EndDocument();
+}
+
+XclExpMsoDrawing* XclExpObjectManager::GetMsodrawingPerSheet()
+{
+ return mxObjList->GetMsodrawingPerSheet();
+}
+
+bool XclExpObjectManager::HasObj() const
+{
+ return mxObjList->Count() > 0;
+}
+
+sal_uInt16 XclExpObjectManager::AddObj( XclObj* pObjRec )
+{
+ return mxObjList->Add( pObjRec );
+}
+
+XclObj* XclExpObjectManager::RemoveLastObj()
+{
+ XclObj* pLastObj = static_cast< XclObj* >( mxObjList->Last() );
+ mxObjList->Remove(); // remove current, which is the Last()
+ return pLastObj;
+}
+
+void XclExpObjectManager::InitStream( bool bTempFile )
+{
+ if( bTempFile )
+ {
+ mxTempFile.reset( new ::utl::TempFile );
+ if( mxTempFile->IsValid() )
+ {
+ mxTempFile->EnableKillingFile();
+ mxDffStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxTempFile->GetURL(), STREAM_STD_READWRITE ) );
+ }
+ }
+
+ if( !mxDffStrm.get() )
+ mxDffStrm.reset( new SvMemoryStream );
+
+ mxDffStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+}
+
+// ----------------------------------------------------------------------------
+
+XclExpEmbeddedObjectManager::XclExpEmbeddedObjectManager(
+ const XclExpObjectManager& rParent, const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY ) :
+ XclExpObjectManager( rParent ),
+ maPageSize( rPageSize ),
+ mnScaleX( nScaleX ),
+ mnScaleY( nScaleY )
+{
+}
+
+XclExpDffAnchorBase* XclExpEmbeddedObjectManager::CreateDffAnchor() const
+{
+ return new XclExpDffEmbeddedAnchor( GetRoot(), maPageSize, mnScaleX, mnScaleY );
+}
+
// ============================================================================
diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx
index 853a0e52bc8b..fed58411aa5c 100644
--- a/sc/source/filter/excel/xerecord.cxx
+++ b/sc/source/filter/excel/xerecord.cxx
@@ -46,16 +46,10 @@ void XclExpRecordBase::SaveXml( XclExpXmlStream& /*rStrm*/ )
{
}
-//UNUSED2008-05 void XclExpRecordBase::SaveRepeated( XclExpStream& rStrm, size_t nCount )
-//UNUSED2008-05 {
-//UNUSED2008-05 for( size_t nIndex = 0; nIndex < nCount; ++nIndex )
-//UNUSED2008-05 Save( rStrm );
-//UNUSED2008-05 }
-
// ----------------------------------------------------------------------------
-XclExpDelegatingRecord::XclExpDelegatingRecord( XclExpRecordBase* pRecord )
- : mpRecord( pRecord )
+XclExpDelegatingRecord::XclExpDelegatingRecord( XclExpRecordBase* pRecord ) :
+ mpRecord( pRecord )
{
}
@@ -67,9 +61,8 @@ XclExpDelegatingRecord::~XclExpDelegatingRecord()
void XclExpDelegatingRecord::SaveXml( XclExpXmlStream& rStrm )
{
- if( !mpRecord )
- return;
- mpRecord->SaveXml( rStrm );
+ if( mpRecord )
+ mpRecord->SaveXml( rStrm );
}
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 922adceb061b..834873740d68 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
+
#include <sfx2/docfile.hxx>
#include <sfx2/sfxsids.hrc>
#include <unotools/saveopt.hxx>
@@ -35,12 +36,13 @@
#include <svl/eitem.hxx>
#include "xecontent.hxx"
#include "xltracer.hxx"
-#include "xehelper.hxx"
+#include "xeescher.hxx"
#include "xeformula.hxx"
+#include "xehelper.hxx"
#include "xelink.hxx"
#include "xename.hxx"
-#include "xestyle.hxx"
#include "xepivot.hxx"
+#include "xestyle.hxx"
#include "xeroot.hxx"
#include "excrecds.hxx" // for filter manager
@@ -142,6 +144,12 @@ XclExpNameManager& XclExpRoot::GetNameManager() const
return *mrExpData.mxNameMgr;
}
+XclExpObjectManager& XclExpRoot::GetObjectManager() const
+{
+ DBG_ASSERT( mrExpData.mxObjMgr.is(), "XclExpRoot::GetObjectManager - missing object (wrong BIFF?)" );
+ return *mrExpData.mxObjMgr;
+}
+
XclExpFilterManager& XclExpRoot::GetFilterManager() const
{
DBG_ASSERT( mrExpData.mxFilterMgr.is(), "XclExpRoot::GetFilterManager - missing object (wrong BIFF?)" );
@@ -181,6 +189,7 @@ void XclExpRoot::InitializeGlobals()
if( GetBiff() == EXC_BIFF8 )
{
mrExpData.mxSst.reset( new XclExpSst );
+ mrExpData.mxObjMgr.reset( new XclExpObjectManager( GetRoot() ) );
mrExpData.mxFilterMgr.reset( new XclExpFilterManager( GetRoot() ) );
mrExpData.mxPTableMgr.reset( new XclExpPivotTableManager( GetRoot() ) );
// BIFF8: only one link manager for all sheets
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 4470bf789412..6734f90948e4 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
@@ -63,6 +64,8 @@
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <sfx2/objsh.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unoapi.hxx>
#include "document.hxx"
#include "drwlayer.hxx"
@@ -79,7 +82,6 @@
#include "xistyle.hxx"
#include "xipage.hxx"
#include "xiview.hxx"
-#include "xiescher.hxx"
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -88,11 +90,14 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::frame::XModel;
using ::com::sun::star::util::XNumberFormatsSupplier;
+using ::com::sun::star::drawing::XDrawPage;
+using ::com::sun::star::drawing::XDrawPageSupplier;
using ::com::sun::star::chart2::XChartDocument;
using ::com::sun::star::chart2::XDiagram;
@@ -123,8 +128,6 @@ using ::com::sun::star::chart2::data::XDataSequence;
using ::formula::FormulaToken;
using ::formula::StackVar;
-using ::std::vector;
-
// Helpers ====================================================================
namespace {
@@ -248,14 +251,14 @@ void XclImpChRoot::InitConversion( Reference< XChartDocument > xChartDoc ) const
}
}
-void XclImpChRoot::FinishConversion( ScfProgressBar& rProgress ) const
+void XclImpChRoot::FinishConversion( XclImpDffConverter& rDffConv ) const
{
- rProgress.Progress( EXC_CHART_PROGRESS_SIZE );
+ rDffConv.Progress( EXC_CHART_PROGRESS_SIZE );
// unlock the model
Reference< XModel > xModel( mxChData->GetChartDoc(), UNO_QUERY );
if( xModel.is() )
xModel->unlockControllers();
- rProgress.Progress( EXC_CHART_PROGRESS_SIZE );
+ rDffConv.Progress( EXC_CHART_PROGRESS_SIZE );
mxChData->FinishConversion();
}
@@ -793,9 +796,9 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen
return ScfApiHelper::VectorToSequence( aStringVec );
}
-void XclImpChSourceLink::FillSourceLink(vector<ScSharedTokenRef>& rTokens) const
+void XclImpChSourceLink::FillSourceLink( ::std::vector< ScSharedTokenRef >& rTokens ) const
{
- if (!mxTokenArray.is())
+ if( !mxTokenArray.is() )
// no links to fill.
return;
@@ -1855,16 +1858,16 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
return xDataSeries;
}
-void XclImpChSeries::FillAllSourceLinks(vector<ScSharedTokenRef>& rTokens) const
+void XclImpChSeries::FillAllSourceLinks( ::std::vector< ScSharedTokenRef >& rTokens ) const
{
- if (mxValueLink.is())
- mxValueLink->FillSourceLink(rTokens);
- if (mxCategLink.is())
- mxCategLink->FillSourceLink(rTokens);
- if (mxTitleLink.is())
- mxTitleLink->FillSourceLink(rTokens);
- if (mxBubbleLink.is())
- mxBubbleLink->FillSourceLink(rTokens);
+ if( mxValueLink.is() )
+ mxValueLink->FillSourceLink( rTokens );
+ if( mxCategLink.is() )
+ mxCategLink->FillSourceLink( rTokens );
+ if( mxTitleLink.is() )
+ mxTitleLink->FillSourceLink( rTokens );
+ if( mxBubbleLink.is() )
+ mxBubbleLink->FillSourceLink( rTokens );
}
void XclImpChSeries::ReadChSourceLink( XclImpStream& rStrm )
@@ -3513,7 +3516,7 @@ XclImpChTextRef XclImpChChart::GetDefaultText( XclChTextType eTextType ) const
return maDefTexts.get( nDefTextId );
}
-void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressBar& rProgress, const OUString& rObjName ) const
+void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, XclImpDffConverter& rDffConv, const OUString& rObjName ) const
{
// initialize conversion (locks the model to suppress any internal updates)
InitConversion( xChartDoc );
@@ -3555,27 +3558,21 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
}
// unlock the model
- FinishConversion( rProgress );
+ FinishConversion( rDffConv );
- ScDocument* pDoc = &GetRoot().GetDoc();
- ScChartListenerCollection* pChartCollection = pDoc->GetChartListenerCollection();
- if (pChartCollection)
+ // start listening to this chart
+ ScDocument& rDoc = GetRoot().GetDoc();
+ if( ScChartListenerCollection* pChartCollection = rDoc.GetChartListenerCollection() )
{
- // Now, start listening to this chart.
- ::std::auto_ptr< vector<ScSharedTokenRef> > pRefTokens(new vector<ScSharedTokenRef>);
- for (XclImpChSeriesVec::const_iterator itr = maSeries.begin(), itrEnd = maSeries.end(); itr != itrEnd; ++itr)
- {
- const XclImpChSeriesRef& rSeries = *itr;
- rSeries->FillAllSourceLinks(*pRefTokens);
- }
- if (!pRefTokens->empty())
+ ::std::auto_ptr< ::std::vector< ScSharedTokenRef > > xRefTokens( new ::std::vector< ScSharedTokenRef > );
+ for( XclImpChSeriesVec::const_iterator aIt = maSeries.begin(), aEnd = maSeries.end(); aIt != aEnd; ++aIt )
+ (*aIt)->FillAllSourceLinks( *xRefTokens );
+ if( !xRefTokens->empty() )
{
- ::std::auto_ptr<ScChartListener> pListener(
- new ScChartListener(rObjName, pDoc, pRefTokens.release()));
- pListener->SetUsed(true);
- pListener->StartListeningTo();
- pChartCollection->Insert(pListener.release());
-
+ ::std::auto_ptr< ScChartListener > xListener( new ScChartListener( rObjName, &rDoc, xRefTokens.release() ) );
+ xListener->SetUsed( true );
+ xListener->StartListeningTo();
+ pChartCollection->Insert( xListener.release() );
}
}
}
@@ -3733,6 +3730,68 @@ Reference< XDiagram > XclImpChChart::CreateDiagram() const
// ----------------------------------------------------------------------------
+XclImpChartDrawing::XclImpChartDrawing( const XclImpRoot& rRoot, bool bOwnTab ) :
+ XclImpDrawing( rRoot, bOwnTab ), // sheet charts may contain OLE objects
+ mnScTab( rRoot.GetCurrScTab() ),
+ mbOwnTab( bOwnTab )
+{
+}
+
+void XclImpChartDrawing::ConvertObjects( XclImpDffConverter& rDffConv,
+ const Reference< XModel >& rxModel, const Rectangle& rChartRect )
+{
+ maChartRect = rChartRect; // needed in CalcAnchorRect() callback
+
+ SdrModel* pSdrModel = 0;
+ SdrPage* pSdrPage = 0;
+ if( mbOwnTab )
+ {
+ // chart sheet: insert all shapes into the sheet, not into the chart object
+ pSdrModel = GetDoc().GetDrawLayer();
+ pSdrPage = GetSdrPage( mnScTab );
+ }
+ else
+ {
+ // embedded chart object: insert all shapes into the chart
+ try
+ {
+ Reference< XDrawPageSupplier > xDrawPageSupp( rxModel, UNO_QUERY_THROW );
+ Reference< XDrawPage > xDrawPage( xDrawPageSupp->getDrawPage(), UNO_SET_THROW );
+ pSdrPage = ::GetSdrPageFromXDrawPage( xDrawPage );
+ pSdrModel = pSdrPage ? pSdrPage->GetModel() : 0;
+ }
+ catch( Exception& )
+ {
+ }
+ }
+
+ if( pSdrModel && pSdrPage )
+ ImplConvertObjects( rDffConv, *pSdrModel, *pSdrPage );
+}
+
+Rectangle XclImpChartDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const
+{
+ /* In objects with DFF client anchor, the position of the shape is stored
+ in the cell address components of the client anchor. In old BIFF3-BIFF5
+ objects, the position is stored in the offset components of the anchor. */
+ Rectangle aRect(
+ static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnCol : rAnchor.mnLX ) / EXC_CHART_UNIT * maChartRect.GetWidth() + 0.5 ),
+ static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnRow : rAnchor.mnTY ) / EXC_CHART_UNIT * maChartRect.GetHeight() + 0.5 ),
+ static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnCol : rAnchor.mnRX ) / EXC_CHART_UNIT * maChartRect.GetWidth() + 0.5 ),
+ static_cast< long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnRow : rAnchor.mnBY ) / EXC_CHART_UNIT * maChartRect.GetHeight() + 0.5 ) );
+ aRect.Justify();
+ // move shapes into chart area for sheet charts
+ if( mbOwnTab )
+ aRect.Move( maChartRect.Left(), maChartRect.Top() );
+ return aRect;
+}
+
+void XclImpChartDrawing::OnObjectInserted( const XclImpDrawObjBase& )
+{
+}
+
+// ----------------------------------------------------------------------------
+
XclImpChart::XclImpChart( const XclImpRoot& rRoot, bool bOwnTab ) :
XclImpRoot( rRoot ),
mbOwnTab( bOwnTab ),
@@ -3740,6 +3799,10 @@ XclImpChart::XclImpChart( const XclImpRoot& rRoot, bool bOwnTab ) :
{
}
+XclImpChart::~XclImpChart()
+{
+}
+
void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
{
XclImpPageSettings& rPageSett = GetPageSettings();
@@ -3770,6 +3833,7 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
case EXC_ID_SCL: rTabViewSett.ReadScl( rStrm ); break;
}
+ // common records
switch( rStrm.GetRecId() )
{
case EXC_ID_EOF: bLoop = false; break;
@@ -3781,12 +3845,29 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
case EXC_ID5_BOF: XclTools::SkipSubStream( rStrm ); break;
case EXC_ID_CHCHART: ReadChChart( rStrm ); break;
- case EXC_ID_OBJ: GetTracer().TraceChartEmbeddedObj(); break;
case EXC_ID8_CHPIVOTREF:
GetTracer().TracePivotChartExists();
mbIsPivotChart = true;
break;
+
+ // BIFF specific records
+ default: switch( GetBiff() )
+ {
+ case EXC_BIFF5: switch( rStrm.GetRecId() )
+ {
+ case EXC_ID_OBJ: GetChartDrawing().ReadObj( rStrm ); break;
+ }
+ break;
+ case EXC_BIFF8: switch( rStrm.GetRecId() )
+ {
+ case EXC_ID_MSODRAWING: GetChartDrawing().ReadMsoDrawing( rStrm ); break;
+ // #i61786# weird documents: OBJ without MSODRAWING -> read in BIFF5 format
+ case EXC_ID_OBJ: GetChartDrawing().ReadObj( rStrm ); break;
+ }
+ break;
+ default:;
+ }
}
}
}
@@ -3800,14 +3881,28 @@ void XclImpChart::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjF
sal_Size XclImpChart::GetProgressSize() const
{
- return mxChartData.is() ? mxChartData->GetProgressSize() : 0;
+ return
+ (mxChartData.is() ? mxChartData->GetProgressSize() : 0) +
+ (mxChartDrawing.is() ? mxChartDrawing->GetProgressSize() : 0);
}
-void XclImpChart::Convert( Reference< XModel > xModel, ScfProgressBar& rProgress, const OUString& rObjName ) const
+void XclImpChart::Convert( Reference< XModel > xModel, XclImpDffConverter& rDffConv, const OUString& rObjName, const Rectangle& rChartRect ) const
{
Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY );
- if( mxChartData.is() && xChartDoc.is() )
- mxChartData->Convert( xChartDoc, rProgress, rObjName );
+ if( xChartDoc.is() )
+ {
+ if( mxChartData.is() )
+ mxChartData->Convert( xChartDoc, rDffConv, rObjName );
+ if( mxChartDrawing.is() )
+ mxChartDrawing->ConvertObjects( rDffConv, xModel, rChartRect );
+ }
+}
+
+XclImpChartDrawing& XclImpChart::GetChartDrawing()
+{
+ if( !mxChartDrawing )
+ mxChartDrawing.reset( new XclImpChartDrawing( GetRoot(), mbOwnTab ) );
+ return *mxChartDrawing;
}
void XclImpChart::ReadChChart( XclImpStream& rStrm )
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 9c130d2ebb78..e095ef987615 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -710,7 +710,7 @@ void XclImpValidation::ReadDval( XclImpStream& rStrm )
if( nObjId != EXC_DVAL_NOOBJ )
{
DBG_ASSERT( nObjId <= 0xFFFF, "XclImpValidation::ReadDval - invalid object ID" );
- rRoot.GetObjectManager().SetSkipObj( rRoot.GetCurrScTab(), static_cast< sal_uInt16 >( nObjId ) );
+ rRoot.GetCurrSheetDrawing().SetSkipObj( static_cast< sal_uInt16 >( nObjId ) );
}
}
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index e963495a3f4b..64ed79e3d3b2 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -118,13 +118,13 @@
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::beans::NamedValue;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::container::XIndexContainer;
@@ -193,10 +193,11 @@ typedef TSdrObjectPtr< SdrObject > SdrObjectPtr;
XclImpDrawObjBase::XclImpDrawObjBase( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot ),
- maObjId( rRoot.GetCurrScTab(), EXC_OBJ_INVALID_ID ),
+ mnObjId( EXC_OBJ_INVALID_ID ),
mnObjType( EXC_OBJTYPE_UNKNOWN ),
mnDffShapeId( 0 ),
mnDffFlags( 0 ),
+ mbHasAnchor( false ),
mbHidden( false ),
mbVisible( true ),
mbPrintable( true ),
@@ -213,9 +214,8 @@ XclImpDrawObjBase::~XclImpDrawObjBase()
{
}
-XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( XclImpStream& rStrm )
+/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
- const XclImpRoot& rRoot = rStrm.GetRoot();
XclImpDrawObjRef xDrawObj;
if( rStrm.GetRecLeft() >= 30 )
@@ -245,9 +245,8 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( XclImpStream& rStrm )
return xDrawObj;
}
-XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( XclImpStream& rStrm )
+/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
- const XclImpRoot& rRoot = rStrm.GetRoot();
XclImpDrawObjRef xDrawObj;
if( rStrm.GetRecLeft() >= 30 )
@@ -278,9 +277,8 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( XclImpStream& rStrm )
return xDrawObj;
}
-XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( XclImpStream& rStrm )
+/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
- const XclImpRoot& rRoot = rStrm.GetRoot();
XclImpDrawObjRef xDrawObj;
if( rStrm.GetRecLeft() >= 34 )
@@ -321,9 +319,8 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( XclImpStream& rStrm )
return xDrawObj;
}
-XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( XclImpStream& rStrm )
+/*static*/ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
- const XclImpRoot& rRoot = rStrm.GetRoot();
XclImpDrawObjRef xDrawObj;
if( rStrm.GetRecLeft() >= 10 )
@@ -380,6 +377,12 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( XclImpStream& rStrm )
return xDrawObj;
}
+void XclImpDrawObjBase::SetAnchor( const XclObjAnchor& rAnchor )
+{
+ maAnchor = rAnchor;
+ mbHasAnchor = true;
+}
+
void XclImpDrawObjBase::SetDffData( const DffObjData& rDffObjData, const String& rObjName, const String& rHyperlink, bool bVisible, bool bAutoMargin )
{
mnDffShapeId = rDffObjData.nShapeId;
@@ -390,11 +393,6 @@ void XclImpDrawObjBase::SetDffData( const DffObjData& rDffObjData, const String&
mbAutoMargin = bAutoMargin;
}
-void XclImpDrawObjBase::SetAnchor( const XclObjAnchor& rAnchor )
-{
- mxAnchor.reset( new XclObjAnchor( rAnchor ) );
-}
-
String XclImpDrawObjBase::GetObjName() const
{
/* #118053# #i51348# Always return a non-empty name. Create English
@@ -404,6 +402,11 @@ String XclImpDrawObjBase::GetObjName() const
return (maObjName.Len() > 0) ? maObjName : GetObjectManager().GetDefaultObjName( *this );
}
+const XclObjAnchor* XclImpDrawObjBase::GetAnchor() const
+{
+ return mbHasAnchor ? &maAnchor : 0;
+}
+
bool XclImpDrawObjBase::IsValidSize( const Rectangle& rAnchorRect ) const
{
// XclObjAnchor rounds up the width, width of 3 is the result of an Excel width of 0
@@ -412,56 +415,45 @@ bool XclImpDrawObjBase::IsValidSize( const Rectangle& rAnchorRect ) const
((rAnchorRect.GetWidth() > 3) || (rAnchorRect.GetHeight() > 1));
}
-ScRange XclImpDrawObjBase::GetUsedArea() const
+ScRange XclImpDrawObjBase::GetUsedArea( SCTAB nScTab ) const
{
ScRange aScUsedArea( ScAddress::INITIALIZE_INVALID );
- if( mxAnchor.is() )
+ // #i44077# object inserted -> update used area for OLE object import
+ if( mbHasAnchor && GetAddressConverter().ConvertRange( aScUsedArea, maAnchor, nScTab, nScTab, false ) )
{
- // #i44077# object inserted -> update used area for OLE object import
- if( GetAddressConverter().ConvertRange( aScUsedArea, *mxAnchor, GetScTab(), GetScTab(), false ) )
- {
- // reduce range, if object ends directly on borders between two columns or rows
- if( (mxAnchor->mnRX == 0) && (aScUsedArea.aStart.Col() < aScUsedArea.aEnd.Col()) )
- aScUsedArea.aEnd.IncCol( -1 );
- if( (mxAnchor->mnBY == 0) && (aScUsedArea.aStart.Row() < aScUsedArea.aEnd.Row()) )
- aScUsedArea.aEnd.IncRow( -1 );
- }
+ // reduce range, if object ends directly on borders between two columns or rows
+ if( (maAnchor.mnRX == 0) && (aScUsedArea.aStart.Col() < aScUsedArea.aEnd.Col()) )
+ aScUsedArea.aEnd.IncCol( -1 );
+ if( (maAnchor.mnBY == 0) && (aScUsedArea.aStart.Row() < aScUsedArea.aEnd.Row()) )
+ aScUsedArea.aEnd.IncRow( -1 );
}
return aScUsedArea;
}
-Rectangle XclImpDrawObjBase::GetAnchorRect() const
-{
- Rectangle aAnchorRect;
- if( mxAnchor.is() )
- aAnchorRect = mxAnchor->GetRect( GetDoc(), MAP_100TH_MM );
- return aAnchorRect;
-}
-
sal_Size XclImpDrawObjBase::GetProgressSize() const
{
return DoGetProgressSize();
}
-SdrObject* XclImpDrawObjBase::CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress, bool bDffImport ) const
+SdrObject* XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect, bool bIsDff ) const
{
SdrObjectPtr xSdrObj;
- if( bDffImport && !mbCustomDff )
+ if( bIsDff && !mbCustomDff )
{
- rProgress.Progress( GetProgressSize() );
+ rDffConv.Progress( GetProgressSize() );
}
else
{
- xSdrObj.reset( DoCreateSdrObj( rAnchorRect, rProgress ) );
+ xSdrObj.reset( DoCreateSdrObj( rDffConv, rAnchorRect ) );
if( xSdrObj.is() )
- xSdrObj->SetModel( GetDoc().GetDrawLayer() );
+ xSdrObj->SetModel( rDffConv.GetModel() );
}
return xSdrObj.release();
}
-void XclImpDrawObjBase::ProcessSdrObject( SdrObject& rSdrObj ) const
+void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
- // default: front layer, derived classes may have to set other layer in DoProcessSdrObj()
+ // default: front layer, derived classes may have to set other layer in DoPreProcessSdrObj()
rSdrObj.NbcSetLayer( SC_LAYER_FRONT );
// set object name (GetObjName() will always return a non-empty name)
@@ -473,7 +465,7 @@ void XclImpDrawObjBase::ProcessSdrObject( SdrObject& rSdrObj ) const
// automatic text margin
if( mbAutoMargin )
{
- sal_Int32 nMargin = GetObjectManager().GetDffManager().GetDefaultTextMargin();
+ sal_Int32 nMargin = rDffConv.GetDefaultTextMargin();
rSdrObj.SetMergedItem( SdrTextLeftDistItem( nMargin ) );
rSdrObj.SetMergedItem( SdrTextRightDistItem( nMargin ) );
rSdrObj.SetMergedItem( SdrTextUpperDistItem( nMargin ) );
@@ -497,7 +489,13 @@ void XclImpDrawObjBase::ProcessSdrObject( SdrObject& rSdrObj ) const
#endif
// call virtual function for object type specific processing
- DoProcessSdrObj( rSdrObj );
+ DoPreProcessSdrObj( rDffConv, rSdrObj );
+}
+
+void XclImpDrawObjBase::PostProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
+{
+ // call virtual function for object type specific processing
+ DoPostProcessSdrObj( rDffConv, rSdrObj );
}
// protected ------------------------------------------------------------------
@@ -759,68 +757,69 @@ sal_Size XclImpDrawObjBase::DoGetProgressSize() const
return 1;
}
-SdrObject* XclImpDrawObjBase::DoCreateSdrObj( const Rectangle&, ScfProgressBar& rProgress ) const
+SdrObject* XclImpDrawObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& ) const
{
- rProgress.Progress( GetProgressSize() );
+ rDffConv.Progress( GetProgressSize() );
return 0;
}
-void XclImpDrawObjBase::DoProcessSdrObj( SdrObject& /*rSdrObj*/ ) const
+void XclImpDrawObjBase::DoPreProcessSdrObj( XclImpDffConverter&, SdrObject& ) const
{
// trace if object is not printable
if( !IsPrintable() )
GetTracer().TraceObjectNotPrintable();
}
-void XclImpDrawObjBase::ImplReadObj3( XclImpStream& rStrm )
+void XclImpDrawObjBase::DoPostProcessSdrObj( XclImpDffConverter&, SdrObject& ) const
{
- sal_uInt16 nObjFlags, nMacroSize;
- XclObjAnchor aAnchor( GetCurrScTab() );
+}
+void XclImpDrawObjBase::ImplReadObj3( XclImpStream& rStrm )
+{
// back to offset 4 (ignore object count field)
rStrm.Seek( 4 );
- rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+
+ sal_uInt16 nObjFlags, nMacroSize;
+ rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize;
rStrm.Ignore( 2 );
+ mbHasAnchor = true;
mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
- SetAnchor( aAnchor );
DoReadObj3( rStrm, nMacroSize );
}
void XclImpDrawObjBase::ImplReadObj4( XclImpStream& rStrm )
{
- sal_uInt16 nObjFlags, nMacroSize;
- XclObjAnchor aAnchor( GetCurrScTab() );
-
// back to offset 4 (ignore object count field)
rStrm.Seek( 4 );
- rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+
+ sal_uInt16 nObjFlags, nMacroSize;
+ rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize;
rStrm.Ignore( 2 );
+ mbHasAnchor = true;
mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
mbPrintable = ::get_flag( nObjFlags, EXC_OBJ_PRINTABLE );
- SetAnchor( aAnchor );
DoReadObj4( rStrm, nMacroSize );
}
void XclImpDrawObjBase::ImplReadObj5( XclImpStream& rStrm )
{
- sal_uInt16 nObjFlags, nMacroSize, nNameLen;
- XclObjAnchor aAnchor( GetCurrScTab() );
-
// back to offset 4 (ignore object count field)
rStrm.Seek( 4 );
- rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags >> aAnchor >> nMacroSize;
+
+ sal_uInt16 nObjFlags, nMacroSize, nNameLen;
+ rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize;
rStrm.Ignore( 2 );
rStrm >> nNameLen;
rStrm.Ignore( 2 );
+ mbHasAnchor = true;
mbHidden = ::get_flag( nObjFlags, EXC_OBJ_HIDDEN );
mbVisible = ::get_flag( nObjFlags, EXC_OBJ_VISIBLE );
mbPrintable = ::get_flag( nObjFlags, EXC_OBJ_PRINTABLE );
- SetAnchor( aAnchor );
DoReadObj5( rStrm, nNameLen, nMacroSize );
}
@@ -845,7 +844,7 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm )
if( (rStrm.GetRecPos() == 4) && (nSubRecSize >= 6) )
{
sal_uInt16 nObjFlags;
- rStrm >> mnObjType >> maObjId.mnObjId >> nObjFlags;
+ rStrm >> mnObjType >> mnObjId >> nObjFlags;
mbPrintable = ::get_flag( nObjFlags, EXC_OBJCMO_PRINTABLE );
}
break;
@@ -928,7 +927,7 @@ XclImpGroupObj::XclImpGroupObj( const XclImpRoot& rRoot ) :
bool XclImpGroupObj::TryInsert( XclImpDrawObjRef xDrawObj )
{
- if( (xDrawObj->GetScTab() != GetScTab()) || (xDrawObj->GetObjId().mnObjId == mnFirstUngrouped) )
+ if( xDrawObj->GetObjId() == mnFirstUngrouped )
return false;
// insert into own list or into nested group
maChildren.InsertGrouped( xDrawObj );
@@ -965,13 +964,14 @@ sal_Size XclImpGroupObj::DoGetProgressSize() const
return XclImpDrawObjBase::DoGetProgressSize() + maChildren.GetProgressSize();
}
-SdrObject* XclImpGroupObj::DoCreateSdrObj( const Rectangle& /*rAnchorRect*/, ScfProgressBar& rProgress ) const
+SdrObject* XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& /*rAnchorRect*/ ) const
{
TSdrObjectPtr< SdrObjGroup > xSdrObj( new SdrObjGroup );
// child objects in BIFF2-BIFF5 have absolute size, not needed to pass own anchor rectangle
+ SdrObjList& rObjList = *xSdrObj->GetSubList(); // SdrObjGroup always returns existing sublist
for( XclImpDrawObjVector::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt )
- GetObjectManager().GetDffManager().ProcessObject( xSdrObj->GetSubList(), **aIt );
- rProgress.Progress();
+ rDffConv.ProcessObject( rObjList, **aIt );
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1007,7 +1007,7 @@ void XclImpLineObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpLineObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
::basegfx::B2DPolygon aB2DPolygon;
switch( mnStartPoint )
@@ -1100,7 +1100,7 @@ SdrObject* XclImpLineObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgr
xSdrObj->SetMergedItem( XLineEndCenterItem( FALSE ) );
}
}
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1144,11 +1144,11 @@ void XclImpRectObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpRectObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpRectObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
SdrObjectPtr xSdrObj( new SdrRectObj( rAnchorRect ) );
ConvertRectStyle( *xSdrObj );
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1159,11 +1159,11 @@ XclImpOvalObj::XclImpOvalObj( const XclImpRoot& rRoot ) :
{
}
-SdrObject* XclImpOvalObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpOvalObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
SdrObjectPtr xSdrObj( new SdrCircObj( OBJ_CIRC, rAnchorRect ) );
ConvertRectStyle( *xSdrObj );
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1198,7 +1198,7 @@ void XclImpArcObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uIn
ReadMacro5( rStrm, nMacroSize );
}
-SdrObject* XclImpArcObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
Rectangle aNewRect = rAnchorRect;
long nStartAngle = 0;
@@ -1235,7 +1235,7 @@ SdrObject* XclImpArcObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgre
SdrObjectPtr xSdrObj( new SdrCircObj( eObjKind, aNewRect, nStartAngle, nEndAngle ) );
ConvertFillStyle( *xSdrObj, maFillData );
ConvertLineStyle( *xSdrObj, maLineData );
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1297,7 +1297,7 @@ namespace {
} // namespace
-SdrObject* XclImpPolygonObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
SdrObjectPtr xSdrObj;
if( maCoords.size() >= 2 )
@@ -1314,7 +1314,7 @@ SdrObject* XclImpPolygonObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfPr
xSdrObj.reset( new SdrPathObj( eObjKind, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
ConvertRectStyle( *xSdrObj );
}
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
@@ -1375,7 +1375,7 @@ void XclImpTextObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
maTextData.ReadFormats( rStrm );
}
-SdrObject* XclImpTextObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
TSdrObjectPtr< SdrObjCustomShape > xSdrObj( new SdrObjCustomShape );
xSdrObj->NbcSetSnapRect( rAnchorRect );
@@ -1386,11 +1386,11 @@ SdrObject* XclImpTextObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgr
xSdrObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoSize ) );
xSdrObj->SetMergedItem( SdrTextAutoGrowHeightItem( bAutoSize ) );
xSdrObj->SetMergedItem( SdrTextWordWrapItem( TRUE ) );
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
-void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
// set text data
if( SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( &rSdrObj ) )
@@ -1469,7 +1469,7 @@ void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break;
case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break;
}
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = (MSO_Anchor)rDffConv.GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
switch( eTextAnchor )
{
case mso_anchorTopCentered :
@@ -1508,7 +1508,7 @@ void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_TOP; break;
case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break;
}
- MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
+ MSO_Anchor eTextAnchor = (MSO_Anchor)rDffConv.GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
switch ( eTextAnchor )
{
case mso_anchorTopCentered :
@@ -1539,7 +1539,7 @@ void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
}
}
// base class processing
- XclImpRectObj::DoProcessSdrObj( rSdrObj );
+ XclImpRectObj::DoPreProcessSdrObj( rDffConv, rSdrObj );
}
// ----------------------------------------------------------------------------
@@ -1633,11 +1633,11 @@ sal_Size XclImpChartObj::DoGetProgressSize() const
return mxChart.is() ? mxChart->GetProgressSize() : 1;
}
-SdrObject* XclImpChartObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
SdrObjectPtr xSdrObj;
SfxObjectShell* pDocShell = GetDocShell();
- if( SvtModuleOptions().IsChart() && pDocShell && mxChart.is() && !mxChart->IsPivotChart() )
+ if( rDffConv.SupportsOleObjects() && SvtModuleOptions().IsChart() && pDocShell && mxChart.is() && !mxChart->IsPivotChart() )
{
// create embedded chart object
OUString aEmbObjName;
@@ -1655,20 +1655,28 @@ SdrObject* XclImpChartObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProg
// create the container OLE object
xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect ) );
+ }
- // convert Excel chart to OOo Chart
- if( svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) )
- {
- Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY );
- mxChart->Convert( xModel, rProgress, aEmbObjName );
+ return xSdrObj.release();
+}
- Reference< XEmbedPersist > xPers( xEmbObj, UNO_QUERY );
- if( xPers.is() )
- xPers->storeOwn();
+void XclImpChartObj::DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
+{
+ const SdrOle2Obj* pSdrOleObj = dynamic_cast< const SdrOle2Obj* >( &rSdrObj );
+ if( mxChart.is() && pSdrOleObj )
+ {
+ Reference< XEmbeddedObject > xEmbObj = pSdrOleObj->GetObjRef();
+ if( xEmbObj.is() && ::svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) ) try
+ {
+ Reference< XEmbedPersist > xPersist( xEmbObj, UNO_QUERY_THROW );
+ Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY_THROW );
+ mxChart->Convert( xModel, rDffConv, xPersist->getEntryName(), rSdrObj.GetLogicRect() );
+ xPersist->storeOwn();
+ }
+ catch( Exception& )
+ {
}
}
-
- return xSdrObj.release();
}
void XclImpChartObj::FinalizeTabChart()
@@ -1683,12 +1691,12 @@ void XclImpChartObj::FinalizeTabChart()
// calculate size of the chart object
const XclPageData& rPageData = GetPageSettings().GetPageData();
- Size aPaperSize( rPageData.GetScPaperSize() );
+ Size aPaperSize = rPageData.GetScPaperSize();
long nWidth = XclTools::GetHmmFromTwips( aPaperSize.Width() );
long nHeight = XclTools::GetHmmFromTwips( aPaperSize.Height() );
- // subtract page margins, give 1cm extra space
+ // subtract page margins, give some more extra space
nWidth -= (XclTools::GetHmmFromInch( rPageData.mfLeftMargin + rPageData.mfRightMargin ) + 2000);
nHeight -= (XclTools::GetHmmFromInch( rPageData.mfTopMargin + rPageData.mfBottomMargin ) + 1000);
@@ -1700,8 +1708,8 @@ void XclImpChartObj::FinalizeTabChart()
}
// create the object anchor
- XclObjAnchor aAnchor( GetScTab() );
- aAnchor.SetRect( GetDoc(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
+ XclObjAnchor aAnchor;
+ aAnchor.SetRect( GetDoc(), GetCurrScTab(), Rectangle( 1000, 500, nWidth, nHeight ), MAP_100TH_MM );
SetAnchor( aAnchor );
}
@@ -1723,10 +1731,10 @@ void XclImpNoteObj::SetNoteData( const ScAddress& rScPos, sal_uInt16 nNoteFlags
mnNoteFlags = nNoteFlags;
}
-void XclImpNoteObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+void XclImpNoteObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
// create formatted text
- XclImpTextObj::DoProcessSdrObj( rSdrObj );
+ XclImpTextObj::DoPreProcessSdrObj( rDffConv, rSdrObj );
OutlinerParaObject* pOutlinerObj = rSdrObj.GetOutlinerParaObject();
if( maScPos.IsValid() && pOutlinerObj )
{
@@ -1970,16 +1978,16 @@ void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const
ConvertFont( rPropSet );
}
-SdrObject* XclImpTbxObjBase::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpTbxObjBase::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
- SdrObjectPtr xSdrObj( GetObjectManager().GetDffManager().CreateSdrObject( *this, rAnchorRect ) );
- rProgress.Progress();
+ SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRect ) );
+ rDffConv.Progress();
return xSdrObj.release();
}
-void XclImpTbxObjBase::DoProcessSdrObj( SdrObject& /*rSdrObj*/ ) const
+void XclImpTbxObjBase::DoPreProcessSdrObj( XclImpDffConverter& /*rDffConv*/, SdrObject& /*rSdrObj*/ ) const
{
- // do not call DoProcessSdrObj() from base class (to skip text processing)
+ // do not call DoPreProcessSdrObj() from base class (to skip text processing)
ProcessControl( *this );
}
@@ -2740,7 +2748,7 @@ void XclImpPictureObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
ReadPictFmla( rStrm, nLinkSize );
if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
- maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ maGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm );
}
void XclImpPictureObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
@@ -2755,7 +2763,7 @@ void XclImpPictureObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize )
ReadPictFmla( rStrm, nLinkSize );
if( (rStrm.GetNextRecId() == EXC_ID3_IMGDATA) && rStrm.StartNextRecord() )
- maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ maGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm );
}
void XclImpPictureObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize )
@@ -2777,7 +2785,7 @@ void XclImpPictureObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal
if( IsHidden() && (GetObjName() == CREATE_STRING( "__BkgndObj" )) )
GetPageSettings().ReadImgData( rStrm );
else
- maGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ maGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm );
}
}
@@ -2796,10 +2804,10 @@ void XclImpPictureObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRec
}
}
-SdrObject* XclImpPictureObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const
+SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const
{
// try to create an OLE object or form control
- SdrObjectPtr xSdrObj( GetObjectManager().GetDffManager().CreateSdrObject( *this, rAnchorRect ) );
+ SdrObjectPtr xSdrObj( rDffConv.CreateSdrObject( *this, rAnchorRect ) );
// no OLE - create a plain picture from IMGDATA record data
if( !xSdrObj && (maGraphic.GetType() != GRAPHIC_NONE) )
@@ -2808,21 +2816,21 @@ SdrObject* XclImpPictureObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfPr
ConvertRectStyle( *xSdrObj );
}
- rProgress.Progress();
+ rDffConv.Progress();
return xSdrObj.release();
}
-void XclImpPictureObj::DoProcessSdrObj( SdrObject& rSdrObj ) const
+void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
{
if( IsOcxControl() )
{
- // do not call XclImpRectObj::DoProcessSdrObj(), it would trace missing "printable" feature
+ // do not call XclImpRectObj::DoPreProcessSdrObj(), it would trace missing "printable" feature
ProcessControl( *this );
}
else if( mbEmbedded || mbLinked )
{
// trace missing "printable" feature
- XclImpRectObj::DoProcessSdrObj( rSdrObj );
+ XclImpRectObj::DoPreProcessSdrObj( rDffConv, rSdrObj );
SfxObjectShell* pDocShell = GetDocShell();
SdrOle2Obj* pOleSdrObj = dynamic_cast< SdrOle2Obj* >( &rSdrObj );
@@ -3062,18 +3070,18 @@ void XclImpSolverContainer::UpdateConnection( sal_uInt32 nDffShapeId, SdrObject*
// ----------------------------------------------------------------------------
-XclImpSimpleDffManager::XclImpSimpleDffManager( const XclImpRoot& rRoot, SvStream& rDffStrm ) :
+XclImpSimpleDffConverter::XclImpSimpleDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm ) :
SvxMSDffManager( rDffStrm, rRoot.GetBasePath(), 0, 0, rRoot.GetDoc().GetDrawLayer(), 1440, COL_DEFAULT, 24, 0, &rRoot.GetTracer().GetBaseTracer() ),
XclImpRoot( rRoot )
{
SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS | SVXMSDFF_SETTINGS_IMPORT_EXCEL );
}
-XclImpSimpleDffManager::~XclImpSimpleDffManager()
+XclImpSimpleDffConverter::~XclImpSimpleDffConverter()
{
}
-FASTBOOL XclImpSimpleDffManager::GetColorFromPalette( USHORT nIndex, Color& rColor ) const
+FASTBOOL XclImpSimpleDffConverter::GetColorFromPalette( USHORT nIndex, Color& rColor ) const
{
ColorData nColor = GetPalette().GetColorData( static_cast< sal_uInt16 >( nIndex ) );
@@ -3086,14 +3094,23 @@ FASTBOOL XclImpSimpleDffManager::GetColorFromPalette( USHORT nIndex, Color& rCol
// ----------------------------------------------------------------------------
-XclImpDffManager::XclImpDffManager(
- const XclImpRoot& rRoot, XclImpObjectManager& rObjManager, SvStream& rDffStrm ) :
- XclImpSimpleDffManager( rRoot, rDffStrm ),
- SvxMSConvertOCXControls( rRoot.GetDocShell(), 0 ),
- mrObjManager( rObjManager ),
- mnOleImpFlags( 0 ),
+XclImpDffConverter::XclImpDffConvData::XclImpDffConvData(
+ XclImpDrawing& rDrawing, SdrModel& rSdrModel, SdrPage& rSdrPage ) :
+ mrDrawing( rDrawing ),
+ mrSdrModel( rSdrModel ),
+ mrSdrPage( rSdrPage ),
mnLastCtrlIndex( -1 ),
- mnCurrFormScTab( -1 )
+ mbHasCtrlForm( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+XclImpDffConverter::XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm ) :
+ XclImpSimpleDffConverter( rRoot, rDffStrm ),
+ SvxMSConvertOCXControls( rRoot.GetDocShell(), 0 ),
+ maStdFormName( CREATE_OUSTRING( "Standard" ) ),
+ mnOleImpFlags( 0 )
{
if( SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get() )
{
@@ -3113,81 +3130,104 @@ XclImpDffManager::XclImpDffManager(
ScaleEmu( mnDefTextMargin );
}
-XclImpDffManager::~XclImpDffManager()
+XclImpDffConverter::~XclImpDffConverter()
{
}
-void XclImpDffManager::StartProgressBar( sal_Size nProgressSize )
+void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize )
{
mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) );
mxProgress->AddSegment( nProgressSize );
mxProgress->Activate();
}
-void XclImpDffManager::ProcessObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj )
+void XclImpDffConverter::Progress( sal_Size nDelta )
{
- Rectangle aAnchorRect = rDrawObj.GetAnchorRect();
- if( rDrawObj.IsProcessSdrObj() && rDrawObj.IsValidSize( aAnchorRect ) )
- {
- // CreateSdrObject() recursively creates embedded child objects
- SdrObjectPtr xSdrObj( rDrawObj.CreateSdrObject( aAnchorRect, *mxProgress, false ) );
- if( xSdrObj.is() )
- rDrawObj.ProcessSdrObject( *xSdrObj );
- // call InsertSdrObject() also, if SdrObject is missing
- InsertSdrObject( pObjList, rDrawObj, xSdrObj.release() );
- UpdateUsedArea( rDrawObj );
- }
+ DBG_ASSERT( mxProgress.is(), "XclImpDffConverter::Progress - invalid call, no progress bar" );
+ mxProgress->Progress( nDelta );
}
-void XclImpDffManager::ProcessDrawingGroup( SvStream& rDffStrm )
+void XclImpDffConverter::InitializeDrawing( XclImpDrawing& rDrawing, SdrModel& rSdrModel, SdrPage& rSdrPage )
{
- rDffStrm.Seek( STREAM_SEEK_TO_BEGIN );
- DffRecordHeader aHeader;
- rDffStrm >> aHeader;
- if( aHeader.nRecType == DFF_msofbtDggContainer )
- ProcessDggContainer( rDffStrm, aHeader );
- else
+ XclImpDffConvDataRef xConvData( new XclImpDffConvData( rDrawing, rSdrModel, rSdrPage ) );
+ maDataStack.push_back( xConvData );
+ SetModel( &xConvData->mrSdrModel, 1440 );
+}
+
+void XclImpDffConverter::ProcessObject( SdrObjList& rObjList, const XclImpDrawObjBase& rDrawObj )
+{
+ if( rDrawObj.IsProcessSdrObj() )
{
- DBG_ERRORFILE( "XclImpDffManager::ProcessDrawingGroup - unexpected record" );
+ if( const XclObjAnchor* pAnchor = rDrawObj.GetAnchor() )
+ {
+ Rectangle aAnchorRect = GetConvData().mrDrawing.CalcAnchorRect( *pAnchor, false );
+ if( rDrawObj.IsValidSize( aAnchorRect ) )
+ {
+ // CreateSdrObject() recursively creates embedded child objects
+ SdrObjectPtr xSdrObj( rDrawObj.CreateSdrObject( *this, aAnchorRect, false ) );
+ if( xSdrObj.is() )
+ rDrawObj.PreProcessSdrObject( *this, *xSdrObj );
+ // call InsertSdrObject() also, if SdrObject is missing
+ InsertSdrObject( rObjList, rDrawObj, xSdrObj.release() );
+ }
+ }
}
}
-void XclImpDffManager::ProcessDrawing( SvStream& rDffStrm, sal_Size nStrmPos )
+void XclImpDffConverter::ProcessDrawing( const XclImpDrawObjVector& rDrawObjs )
{
- rDffStrm.Seek( nStrmPos );
- DffRecordHeader aHeader;
- rDffStrm >> aHeader;
- if( aHeader.nRecType == DFF_msofbtDgContainer )
- ProcessDgContainer( rDffStrm, aHeader );
- else
+ SdrPage& rSdrPage = GetConvData().mrSdrPage;
+ for( XclImpDrawObjVector::const_iterator aIt = rDrawObjs.begin(), aEnd = rDrawObjs.end(); aIt != aEnd; ++aIt )
+ ProcessObject( rSdrPage, **aIt );
+}
+
+void XclImpDffConverter::ProcessDrawing( SvStream& rDffStrm )
+{
+ rDffStrm.Seek( STREAM_SEEK_TO_END );
+ if( rDffStrm.Tell() > 0 )
{
- DBG_ERRORFILE( "XclImpDffManager::ProcessDrawing - unexpected record" );
+ rDffStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ DffRecordHeader aHeader;
+ rDffStrm >> aHeader;
+ DBG_ASSERT( aHeader.nRecType == DFF_msofbtDgContainer, "XclImpDffConverter::ProcessDrawing - unexpected record" );
+ if( aHeader.nRecType == DFF_msofbtDgContainer )
+ ProcessDgContainer( rDffStrm, aHeader );
}
}
-SdrObject* XclImpDffManager::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect )
+void XclImpDffConverter::FinalizeDrawing()
+{
+ DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::FinalizeDrawing - no drawing manager on stack" );
+ maDataStack.pop_back();
+ // restore previous model at core DFF converter
+ if( !maDataStack.empty() )
+ SetModel( &maDataStack.back()->mrSdrModel, 1440 );
+}
+
+SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect )
{
SdrObjectPtr xSdrObj;
OUString aServiceName = rTbxObj.GetServiceName();
- if( aServiceName.getLength() > 0 ) try
+ if( SupportsOleObjects() && (aServiceName.getLength() > 0) ) try
{
// create the form control from scratch
Reference< XFormComponent > xFormComp( ScfApiHelper::CreateInstance( GetDocShell(), aServiceName ), UNO_QUERY_THROW );
- // set current controls form, needed in virtual function InsertControl()
- SetCurrentForm( rTbxObj.GetScTab() );
+ // set controls form, needed in virtual function InsertControl()
+ InitControlForm();
// try to insert the control into the form
::com::sun::star::awt::Size aDummySize;
Reference< XShape > xShape;
- if( mxCurrForm.is() && InsertControl( xFormComp, aDummySize, &xShape, TRUE ) )
+ XclImpDffConvData& rConvData = GetConvData();
+ if( rConvData.mxCtrlForm.is() && InsertControl( xFormComp, aDummySize, &xShape, TRUE ) )
{
xSdrObj.reset( rTbxObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
// try to attach a macro to the control
ScriptEventDescriptor aDescriptor;
- if( (mnLastCtrlIndex >= 0) && rTbxObj.FillMacroDescriptor( aDescriptor ) )
+ if( (rConvData.mnLastCtrlIndex >= 0) && rTbxObj.FillMacroDescriptor( aDescriptor ) )
{
- Reference< XEventAttacherManager > xEventMgr( mxCurrForm, UNO_QUERY_THROW );
- xEventMgr->registerScriptEvent( mnLastCtrlIndex, aDescriptor );
+ Reference< XEventAttacherManager > xEventMgr( rConvData.mxCtrlForm, UNO_QUERY_THROW );
+ xEventMgr->registerScriptEvent( rConvData.mnLastCtrlIndex, aDescriptor );
}
}
}
@@ -3198,52 +3238,55 @@ SdrObject* XclImpDffManager::CreateSdrObject( const XclImpTbxObjBase& rTbxObj, c
return xSdrObj.release();
}
-SdrObject* XclImpDffManager::CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect )
+SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect )
{
SdrObjectPtr xSdrObj;
- if( rPicObj.IsOcxControl() )
- {
- if( mxCtlsStrm.Is() ) try
- {
- /* set current controls form, needed in virtual function InsertControl()
- called from ReadOCXExcelKludgeStream() */
- SetCurrentForm( rPicObj.GetScTab() );
- // seek to stream position of the extra data for this control
- mxCtlsStrm->Seek( rPicObj.GetCtlsStreamPos() );
- // read from mxCtlsStrm into xShape, insert the control model into the form
- Reference< XShape > xShape;
- if( mxCurrForm.is() && ReadOCXExcelKludgeStream( mxCtlsStrm, &xShape, TRUE ) )
- xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
- }
- catch( Exception& )
- {
- }
- }
- else
+ if( SupportsOleObjects() )
{
- SfxObjectShell* pDocShell = GetDocShell();
- SotStorageRef xSrcStrg = GetRootStorage();
- String aStrgName = rPicObj.GetOleStorageName();
- if( pDocShell && xSrcStrg.Is() && (aStrgName.Len() > 0) )
+ if( rPicObj.IsOcxControl() )
{
- // first try to resolve graphic from DFF storage
- Graphic aGraphic;
- Rectangle aVisArea;
- if( !GetBLIP( GetPropertyValue( DFF_Prop_pib ), aGraphic, &aVisArea ) )
+ if( mxCtlsStrm.Is() ) try
{
- // if not found, use graphic from object (imported from IMGDATA record)
- aGraphic = rPicObj.GetGraphic();
- aVisArea = rPicObj.GetVisArea();
+ /* set controls form, needed in virtual function InsertControl()
+ called from ReadOCXExcelKludgeStream() */
+ InitControlForm();
+ // seek to stream position of the extra data for this control
+ mxCtlsStrm->Seek( rPicObj.GetCtlsStreamPos() );
+ // read from mxCtlsStrm into xShape, insert the control model into the form
+ Reference< XShape > xShape;
+ if( GetConvData().mxCtrlForm.is() && ReadOCXExcelKludgeStream( mxCtlsStrm, &xShape, TRUE ) )
+ xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) );
}
- if( aGraphic.GetType() != GRAPHIC_NONE )
+ catch( Exception& )
{
- ErrCode nError = ERRCODE_NONE;
- namespace cssea = ::com::sun::star::embed::Aspects;
- sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT;
- xSdrObj.reset( CreateSdrOLEFromStorage(
- aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic,
- rAnchorRect, aVisArea, 0, nError, mnOleImpFlags, nAspects ) );
+ }
+ }
+ else
+ {
+ SfxObjectShell* pDocShell = GetDocShell();
+ SotStorageRef xSrcStrg = GetRootStorage();
+ String aStrgName = rPicObj.GetOleStorageName();
+ if( pDocShell && xSrcStrg.Is() && (aStrgName.Len() > 0) )
+ {
+ // first try to resolve graphic from DFF storage
+ Graphic aGraphic;
+ Rectangle aVisArea;
+ if( !GetBLIP( GetPropertyValue( DFF_Prop_pib ), aGraphic, &aVisArea ) )
+ {
+ // if not found, use graphic from object (imported from IMGDATA record)
+ aGraphic = rPicObj.GetGraphic();
+ aVisArea = rPicObj.GetVisArea();
+ }
+ if( aGraphic.GetType() != GRAPHIC_NONE )
+ {
+ ErrCode nError = ERRCODE_NONE;
+ namespace cssea = ::com::sun::star::embed::Aspects;
+ sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT;
+ xSdrObj.reset( CreateSdrOLEFromStorage(
+ aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic,
+ rAnchorRect, aVisArea, 0, nError, mnOleImpFlags, nAspects ) );
+ }
}
}
}
@@ -3251,44 +3294,43 @@ SdrObject* XclImpDffManager::CreateSdrObject( const XclImpPictureObj& rPicObj, c
return xSdrObj.release();
}
-ScRange XclImpDffManager::GetUsedArea( SCTAB nScTab ) const
+bool XclImpDffConverter::SupportsOleObjects() const
{
- ScRange aScUsedArea( ScAddress::INITIALIZE_INVALID );
- ScRangeMap::const_iterator aIt = maUsedAreaMap.find( nScTab );
- if( aIt != maUsedAreaMap.end() )
- aScUsedArea = aIt->second;
- return aScUsedArea;
+ return GetConvData().mrDrawing.SupportsOleObjects();
}
// virtual functions ----------------------------------------------------------
-void XclImpDffManager::ProcessClientAnchor2( SvStream& rDffStrm,
+void XclImpDffConverter::ProcessClientAnchor2( SvStream& rDffStrm,
DffRecordHeader& rHeader, void* /*pClientData*/, DffObjData& rObjData )
{
// find the OBJ record data related to the processed shape
- if( XclImpDrawObjBase* pDrawObj = mrObjManager.FindDrawObj( rObjData.rSpHd ).get() )
+ XclImpDffConvData& rConvData = GetConvData();
+ if( XclImpDrawObjBase* pDrawObj = rConvData.mrDrawing.FindDrawObj( rObjData.rSpHd ).get() )
{
- DBG_ASSERT( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffManager::ProcessClientAnchor2 - no client anchor record" );
- XclObjAnchor aAnchor( pDrawObj->GetScTab() );
+ DBG_ASSERT( rHeader.nRecType == DFF_msofbtClientAnchor, "XclImpDffConverter::ProcessClientAnchor2 - no client anchor record" );
+ XclObjAnchor aAnchor;
rHeader.SeekToContent( rDffStrm );
rDffStrm.SeekRel( 2 ); // flags
rDffStrm >> aAnchor; // anchor format equal to BIFF5 OBJ records
pDrawObj->SetAnchor( aAnchor );
- rObjData.aChildAnchor = pDrawObj->GetAnchorRect();
+ rObjData.aChildAnchor = rConvData.mrDrawing.CalcAnchorRect( aAnchor, true );
rObjData.bChildAnchor = sal_True;
}
}
-SdrObject* XclImpDffManager::ProcessObj( SvStream& rDffStrm,
- DffObjData& rDffObjData, void* pClientData, Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
+SdrObject* XclImpDffConverter::ProcessObj( SvStream& rDffStrm, DffObjData& rDffObjData,
+ void* pClientData, Rectangle& /*rTextRect*/, SdrObject* pOldSdrObj )
{
+ XclImpDffConvData& rConvData = GetConvData();
+
/* pOldSdrObj passes a generated SdrObject. This function owns this object
and can modify it. The function has either to return it back to caller
or to delete it by itself. */
SdrObjectPtr xSdrObj( pOldSdrObj );
// find the OBJ record data related to the processed shape
- XclImpDrawObjRef xDrawObj = mrObjManager.FindDrawObj( rDffObjData.rSpHd );
+ XclImpDrawObjRef xDrawObj = rConvData.mrDrawing.FindDrawObj( rDffObjData.rSpHd );
const Rectangle& rAnchorRect = rDffObjData.aChildAnchor;
// #102378# Do not process the global page group shape (flag SP_FPATRIARCH)
@@ -3326,7 +3368,7 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rDffStrm,
/* Connect textbox data (string, alignment, text orientation) to object.
#98132# don't ask for a text-ID, DFF export doesn't set one. */
if( XclImpTextObj* pTextObj = dynamic_cast< XclImpTextObj* >( xDrawObj.get() ) )
- if( const XclImpObjTextData* pTextData = mrObjManager.FindTextData( rDffObjData.rSpHd ) )
+ if( const XclImpObjTextData* pTextData = rConvData.mrDrawing.FindTextData( rDffObjData.rSpHd ) )
pTextObj->SetTextData( *pTextData );
// copy line and fill formatting of TBX form controls from DFF properties
@@ -3334,7 +3376,7 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rDffStrm,
pTbxObj->SetDffProperties( *this );
// try to create a custom SdrObject that overwrites the passed object
- SdrObjectPtr xNewSdrObj( xDrawObj->CreateSdrObject( rAnchorRect, *mxProgress, true ) );
+ SdrObjectPtr xNewSdrObj( xDrawObj->CreateSdrObject( *this, rAnchorRect, true ) );
if( xNewSdrObj.is() )
xSdrObj.reset( xNewSdrObj.release() );
@@ -3346,40 +3388,50 @@ SdrObject* XclImpDffManager::ProcessObj( SvStream& rDffStrm,
xSdrObj->SetMergedItem( XFillColorItem( EMPTY_STRING, GetPalette().GetColor( EXC_COLOR_WINDOWBACK ) ) );
// additional processing on the SdrObject
- xDrawObj->ProcessSdrObject( *xSdrObj );
-
- // add the area used by this object to the internal map of used areas
- UpdateUsedArea( *xDrawObj );
+ xDrawObj->PreProcessSdrObject( *this, *xSdrObj );
/* If the SdrObject will not be inserted into the draw page, delete it
- here. Happens e.g. for notes: The ProcessSdrObject() call above has
- inserted the note into the document, and the SdrObject is not
+ here. Happens e.g. for notes: The PreProcessSdrObject() call above
+ has inserted the note into the document, and the SdrObject is not
needed anymore. */
if( !xDrawObj->IsInsertSdrObj() )
xSdrObj.reset();
}
- /* Store the relation between shape ID and SdrObject for connectors. Must
- be done here (and not in InsertSdrObject() function), otherwise all
- SdrObjects embedded in groups would be lost. */
if( xSdrObj.is() )
- maSolverCont.InsertSdrObjectInfo( *xSdrObj, xDrawObj->GetDffShapeId(), xDrawObj->GetDffFlags() );
+ {
+ /* Store the relation between shape ID and SdrObject for connectors.
+ Must be done here (and not in InsertSdrObject() function),
+ otherwise all SdrObjects embedded in groups would be lost. */
+ rConvData.maSolverCont.InsertSdrObjectInfo( *xSdrObj, xDrawObj->GetDffShapeId(), xDrawObj->GetDffFlags() );
+
+ /* If the drawing object is embedded in a group object, call
+ PostProcessSdrObject() here. For top-level objects this will be
+ done automatically in InsertSdrObject() but grouped shapes are
+ inserted into their groups somewhere in the SvxMSDffManager base
+ class without chance of notification. Unfortunately, now this is
+ called before the object is really inserted into its group object,
+ but that should not have any effect for grouped objects. */
+ if( !bIsTopLevel )
+ xDrawObj->PostProcessSdrObject( *this, *xSdrObj );
+ }
return xSdrObj.release();
}
-ULONG XclImpDffManager::Calc_nBLIPPos( ULONG /*nOrgVal*/, ULONG nStreamPos ) const
+ULONG XclImpDffConverter::Calc_nBLIPPos( ULONG /*nOrgVal*/, ULONG nStreamPos ) const
{
return nStreamPos + 4;
}
-sal_Bool XclImpDffManager::InsertControl( const Reference< XFormComponent >& rxFormComp,
+sal_Bool XclImpDffConverter::InsertControl( const Reference< XFormComponent >& rxFormComp,
const ::com::sun::star::awt::Size& /*rSize*/, Reference< XShape >* pxShape,
BOOL /*bFloatingCtrl*/ )
{
if( GetDocShell() ) try
{
- Reference< XIndexContainer > xFormIC( mxCurrForm, UNO_QUERY_THROW );
+ XclImpDffConvData& rConvData = GetConvData();
+ Reference< XIndexContainer > xFormIC( rConvData.mxCtrlForm, UNO_QUERY_THROW );
Reference< XControlModel > xCtrlModel( rxFormComp, UNO_QUERY_THROW );
// create the control shape
@@ -3390,7 +3442,7 @@ sal_Bool XclImpDffManager::InsertControl( const Reference< XFormComponent >& rxF
sal_Int32 nNewIndex = xFormIC->getCount();
xFormIC->insertByIndex( nNewIndex, Any( rxFormComp ) );
// on success: store new index of the control for later use (macro events)
- mnLastCtrlIndex = nNewIndex;
+ rConvData.mnLastCtrlIndex = nNewIndex;
// set control model at control shape and pass back shape to caller
xCtrlShape->setControl( xCtrlModel );
@@ -3399,7 +3451,7 @@ sal_Bool XclImpDffManager::InsertControl( const Reference< XFormComponent >& rxF
}
catch( Exception& )
{
- DBG_ERRORFILE( "XclImpDffManager::InsertControl - cannot create form control" );
+ DBG_ERRORFILE( "XclImpDffConverter::InsertControl - cannot create form control" );
}
return sal_False;
@@ -3407,7 +3459,19 @@ sal_Bool XclImpDffManager::InsertControl( const Reference< XFormComponent >& rxF
// private --------------------------------------------------------------------
-String XclImpDffManager::ReadHlinkProperty( SvStream& rDffStrm ) const
+XclImpDffConverter::XclImpDffConvData& XclImpDffConverter::GetConvData()
+{
+ DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" );
+ return *maDataStack.back();
+}
+
+const XclImpDffConverter::XclImpDffConvData& XclImpDffConverter::GetConvData() const
+{
+ DBG_ASSERT( !maDataStack.empty(), "XclImpDffConverter::GetConvData - no drawing manager on stack" );
+ return *maDataStack.back();
+}
+
+String XclImpDffConverter::ReadHlinkProperty( SvStream& rDffStrm ) const
{
/* Reads hyperlink data from a complex DFF property. Contents of this
property are equal to the HLINK record, import of this record is
@@ -3438,13 +3502,7 @@ String XclImpDffManager::ReadHlinkProperty( SvStream& rDffStrm ) const
return aString;
}
-void XclImpDffManager::ProcessDggContainer( SvStream& rDffStrm, const DffRecordHeader& rDggHeader )
-{
- // seek to end of drawing group container
- rDggHeader.SeekToEndOfRecord( rDffStrm );
-}
-
-void XclImpDffManager::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader )
+void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader )
{
sal_Size nEndPos = rDgHeader.GetRecEndFilePos();
while( rDffStrm.Tell() < nEndPos )
@@ -3467,12 +3525,13 @@ void XclImpDffManager::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHe
rDgHeader.SeekToEndOfRecord( rDffStrm );
// #i12638# #i37900# connector rules
- maSolverCont.UpdateConnectorRules();
- SolveSolver( maSolverCont );
- maSolverCont.RemoveConnectorRules();
+ XclImpSolverContainer& rSolverCont = GetConvData().maSolverCont;
+ rSolverCont.UpdateConnectorRules();
+ SolveSolver( rSolverCont );
+ rSolverCont.RemoveConnectorRules();
}
-void XclImpDffManager::ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader )
+void XclImpDffConverter::ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader )
{
sal_Size nEndPos = rShGrHeader.GetRecEndFilePos();
while( rDffStrm.Tell() < nEndPos )
@@ -3493,17 +3552,17 @@ void XclImpDffManager::ProcessShGrContainer( SvStream& rDffStrm, const DffRecord
rShGrHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::ProcessSolverContainer( SvStream& rDffStrm, const DffRecordHeader& rSolverHeader )
+void XclImpDffConverter::ProcessSolverContainer( SvStream& rDffStrm, const DffRecordHeader& rSolverHeader )
{
// solver container wants to read the solver container header again
rSolverHeader.SeekToBegOfRecord( rDffStrm );
// read the entire solver container
- rDffStrm >> maSolverCont;
+ rDffStrm >> GetConvData().maSolverCont;
// seek to end of solver container
rSolverHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader )
+void XclImpDffConverter::ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader )
{
rShHeader.SeekToBegOfRecord( rDffStrm );
Rectangle aDummy;
@@ -3516,112 +3575,70 @@ void XclImpDffManager::ProcessShContainer( SvStream& rDffStrm, const DffRecordHe
the pointer to the related draw object data (OBJ record) into pDrawObj. */
SdrObjectPtr xSdrObj( ImportObj( rDffStrm, &pDrawObj, aDummy, aDummy, 0, 0 ) );
if( pDrawObj && xSdrObj.is() )
- InsertSdrObject( GetSdrPage( pDrawObj->GetScTab() ), *pDrawObj, xSdrObj.release() );
+ InsertSdrObject( GetConvData().mrSdrPage, *pDrawObj, xSdrObj.release() );
rShHeader.SeekToEndOfRecord( rDffStrm );
}
-void XclImpDffManager::InsertSdrObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj )
+void XclImpDffConverter::InsertSdrObject( SdrObjList& rObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj )
{
+ XclImpDffConvData& rConvData = GetConvData();
/* Take ownership of the passed object. If insertion fails (e.g. rDrawObj
- states to skip insertion, or missing draw page), the object is
- automatically deleted. */
+ states to skip insertion), the object is automatically deleted. */
SdrObjectPtr xSdrObj( pSdrObj );
- if( pObjList && xSdrObj.is() && rDrawObj.IsInsertSdrObj() )
- pObjList->NbcInsertObject( xSdrObj.release() );
- // SdrObject still here? Insertion failed, remove data from shape ID map.
+ if( xSdrObj.is() && rDrawObj.IsInsertSdrObj() )
+ {
+ rObjList.NbcInsertObject( xSdrObj.release() );
+ // callback to drawing manager for e.g. tracking of used sheet area
+ rConvData.mrDrawing.OnObjectInserted( rDrawObj );
+ // callback to drawing object for post processing (use pSdrObj, xSdrObj already released)
+ rDrawObj.PostProcessSdrObject( *this, *pSdrObj );
+ }
+ /* SdrObject still here? Insertion failed, remove data from shape ID map.
+ The SdrObject will be destructed then. */
if( xSdrObj.is() )
- maSolverCont.RemoveSdrObjectInfo( *xSdrObj );
+ rConvData.maSolverCont.RemoveSdrObjectInfo( *xSdrObj );
}
-void XclImpDffManager::SetCurrentForm( SCTAB nScTab )
+void XclImpDffConverter::InitControlForm()
{
- if( nScTab != mnCurrFormScTab )
- {
- mxCurrForm.clear();
- mnCurrFormScTab = nScTab;
+ XclImpDffConvData& rConvData = GetConvData();
+ if( rConvData.mbHasCtrlForm )
+ return;
- SdrPage* pSdrPage = GetSdrPage( nScTab );
- if( GetDocShell() && pSdrPage ) try
+ rConvData.mbHasCtrlForm = true;
+ if( SupportsOleObjects() ) try
+ {
+ Reference< XFormsSupplier > xFormsSupplier( rConvData.mrSdrPage.getUnoPage(), UNO_QUERY_THROW );
+ Reference< XNameContainer > xFormsNC( xFormsSupplier->getForms(), UNO_SET_THROW );
+ // find or create the Standard form used to insert the imported controls
+ if( xFormsNC->hasByName( maStdFormName ) )
{
- Reference< XFormsSupplier > xFormsSupplier( pSdrPage->getUnoPage(), UNO_QUERY_THROW );
- Reference< XNameContainer > xFormsNC = xFormsSupplier->getForms();
- if( xFormsNC.is() )
- {
- // find or create the Standard form used to insert the imported controls
- OUString aFormName = CREATE_OUSTRING( "Standard" );
- if( xFormsNC->hasByName( aFormName ) )
- {
- xFormsNC->getByName( aFormName ) >>= mxCurrForm;
- }
- else
- {
- mxCurrForm.set( ScfApiHelper::CreateInstance( GetDocShell(), CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), UNO_QUERY_THROW );
- xFormsNC->insertByName( aFormName, Any( mxCurrForm ) );
- }
- }
+ xFormsNC->getByName( maStdFormName ) >>= rConvData.mxCtrlForm;
}
- catch( Exception& )
+ else if( SfxObjectShell* pDocShell = GetDocShell() )
{
+ rConvData.mxCtrlForm.set( ScfApiHelper::CreateInstance( pDocShell, CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), UNO_QUERY_THROW );
+ xFormsNC->insertByName( maStdFormName, Any( rConvData.mxCtrlForm ) );
}
}
-}
-
-void XclImpDffManager::UpdateUsedArea( const XclImpDrawObjBase& rDrawObj )
-{
- ScRange aScObjArea = rDrawObj.GetUsedArea();
- if( aScObjArea.IsValid() )
+ catch( Exception& )
{
- ScRange* pScTabArea = 0;
- ScRangeMap::iterator aIt = maUsedAreaMap.find( rDrawObj.GetScTab() );
- if( aIt == maUsedAreaMap.end() )
- {
- pScTabArea = &maUsedAreaMap[ rDrawObj.GetScTab() ];
- pScTabArea->SetInvalid();
- }
- else
- pScTabArea = &aIt->second;
-
- if( pScTabArea )
- pScTabArea->ExtendTo( aScObjArea );
}
}
-// The object manager =========================================================
+// Drawing manager ============================================================
-XclImpObjectManager::XclImpObjectManager( const XclImpRoot& rRoot ) :
- XclImpRoot( rRoot )
+XclImpDrawing::XclImpDrawing( const XclImpRoot& rRoot, bool bOleObjects ) :
+ XclImpRoot( rRoot ),
+ mbOleObjs( bOleObjects )
{
- maDefObjNames[ EXC_OBJTYPE_GROUP ] = CREATE_STRING( "Group" );
- maDefObjNames[ EXC_OBJTYPE_LINE ] = CREATE_STRING( "Line" );
- maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = CREATE_STRING( "Rectangle" );
- maDefObjNames[ EXC_OBJTYPE_OVAL ] = CREATE_STRING( "Oval" );
- maDefObjNames[ EXC_OBJTYPE_ARC ] = CREATE_STRING( "Arc" );
- maDefObjNames[ EXC_OBJTYPE_CHART ] = CREATE_STRING( "Chart" );
- maDefObjNames[ EXC_OBJTYPE_TEXT ] = CREATE_STRING( "Text" );
- maDefObjNames[ EXC_OBJTYPE_BUTTON ] = CREATE_STRING( "Button" );
- maDefObjNames[ EXC_OBJTYPE_PICTURE ] = CREATE_STRING( "Picture" );
- maDefObjNames[ EXC_OBJTYPE_POLYGON ] = CREATE_STRING( "Freeform" );
- maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = CREATE_STRING( "Check Box" );
- maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = CREATE_STRING( "Option Button" );
- maDefObjNames[ EXC_OBJTYPE_EDIT ] = CREATE_STRING( "Edit Box" );
- maDefObjNames[ EXC_OBJTYPE_LABEL ] = CREATE_STRING( "Label" );
- maDefObjNames[ EXC_OBJTYPE_DIALOG ] = CREATE_STRING( "Dialog Frame" );
- maDefObjNames[ EXC_OBJTYPE_SPIN ] = CREATE_STRING( "Spinner" );
- maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = CREATE_STRING( "Scroll Bar" );
- maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = CREATE_STRING( "List Box" );
- maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = CREATE_STRING( "Group Box" );
- maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = CREATE_STRING( "Drop Down" );
- maDefObjNames[ EXC_OBJTYPE_NOTE ] = CREATE_STRING( "Comment" );
- maDefObjNames[ EXC_OBJTYPE_DRAWING ] = CREATE_STRING( "AutoShape" );
}
-XclImpObjectManager::~XclImpObjectManager()
+XclImpDrawing::~XclImpDrawing()
{
}
-// *** Read Excel records *** -------------------------------------------------
-
-Graphic XclImpObjectManager::ReadImgData( XclImpStream& rStrm ) // static helper
+/*static*/ Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm )
{
Graphic aGraphic;
sal_uInt16 nFormat, nEnv;
@@ -3631,33 +3648,33 @@ Graphic XclImpObjectManager::ReadImgData( XclImpStream& rStrm ) // static helper
{
switch( nFormat )
{
- case EXC_IMGDATA_WMF: ReadWmf( aGraphic, rStrm ); break;
- case EXC_IMGDATA_BMP: ReadBmp( aGraphic, rStrm ); break;
- default: DBG_ERRORFILE( "XclImpObjectManager::ReadImgData - unknown image format" );
+ case EXC_IMGDATA_WMF: ReadWmf( aGraphic, rRoot, rStrm ); break;
+ case EXC_IMGDATA_BMP: ReadBmp( aGraphic, rRoot, rStrm ); break;
+ default: DBG_ERRORFILE( "XclImpDrawing::ReadImgData - unknown image format" );
}
}
return aGraphic;
}
-void XclImpObjectManager::ReadObj( XclImpStream& rStrm )
+void XclImpDrawing::ReadObj( XclImpStream& rStrm )
{
XclImpDrawObjRef xDrawObj;
/* #i61786# In BIFF8 streams, OBJ records may occur without MSODRAWING
records. In this case, the OBJ records are in BIFF5 format. Do a sanity
check here that there is no DFF data loaded before. */
- DBG_ASSERT( maDffStrm.Tell() == 0, "XclImpObjectManager::ReadObj - unexpected DFF stream data, OBJ will be ignored" );
+ DBG_ASSERT( maDffStrm.Tell() == 0, "XclImpDrawing::ReadObj - unexpected DFF stream data, OBJ will be ignored" );
if( maDffStrm.Tell() == 0 ) switch( GetBiff() )
{
case EXC_BIFF3:
- xDrawObj = XclImpDrawObjBase::ReadObj3( rStrm );
+ xDrawObj = XclImpDrawObjBase::ReadObj3( GetRoot(), rStrm );
break;
case EXC_BIFF4:
- xDrawObj = XclImpDrawObjBase::ReadObj4( rStrm );
+ xDrawObj = XclImpDrawObjBase::ReadObj4( GetRoot(), rStrm );
break;
case EXC_BIFF5:
case EXC_BIFF8:
- xDrawObj = XclImpDrawObjBase::ReadObj5( rStrm );
+ xDrawObj = XclImpDrawObjBase::ReadObj5( GetRoot(), rStrm );
break;
default:
DBG_ERROR_BIFF();
@@ -3672,30 +3689,11 @@ void XclImpObjectManager::ReadObj( XclImpStream& rStrm )
}
}
-void XclImpObjectManager::ReadMsoDrawingGroup( XclImpStream& rStrm )
-{
- DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 );
- // Excel continues this record with MSODRAWINGGROUP and CONTINUE records, hmm.
- rStrm.ResetRecord( true, EXC_ID_MSODRAWINGGROUP );
- ReadDffRecord( rStrm );
-}
-
-void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
+void XclImpDrawing::ReadMsoDrawing( XclImpStream& rStrm )
{
DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 );
// disable internal CONTINUE handling
rStrm.ResetRecord( false );
- /* #i60510# real life: MSODRAWINGSELECTION record may contain garbage -
- this makes it impossible to process the DFF stream in one run.
- Store stream start position for every sheet separately, will be used
- to seek the stream to these positions later, when processing the next
- sheet. */
- size_t nTabIdx = static_cast< size_t >( GetCurrScTab() );
- if( nTabIdx >= maTabStrmPos.size() )
- {
- maTabStrmPos.resize( nTabIdx, STREAM_SEEK_TO_END );
- maTabStrmPos.push_back( maDffStrm.Tell() );
- }
// read leading MSODRAWING record
ReadDffRecord( rStrm );
@@ -3725,36 +3723,7 @@ void XclImpObjectManager::ReadMsoDrawing( XclImpStream& rStrm )
rStrm.ResetRecord( true );
}
-void XclImpObjectManager::ReadNote( XclImpStream& rStrm )
-{
- switch( GetBiff() )
- {
- case EXC_BIFF2:
- case EXC_BIFF3:
- case EXC_BIFF4:
- case EXC_BIFF5:
- ReadNote3( rStrm );
- break;
- case EXC_BIFF8:
- ReadNote8( rStrm );
- break;
- default:
- DBG_ERROR_BIFF();
- }
-}
-
-void XclImpObjectManager::ReadTabChart( XclImpStream& rStrm )
-{
- DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF5 );
- ScfRef< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
- xChartObj->ReadChartSubStream( rStrm );
- // insert the chart as raw object without connected DFF data
- maRawObjs.push_back( xChartObj );
-}
-
-// *** Drawing objects *** ----------------------------------------------------
-
-XclImpDrawObjRef XclImpObjectManager::FindDrawObj( const DffRecordHeader& rHeader ) const
+XclImpDrawObjRef XclImpDrawing::FindDrawObj( const DffRecordHeader& rHeader ) const
{
/* maObjMap stores objects by position of the client data (OBJ record) in
the DFF stream, which is always behind shape start position of the
@@ -3769,16 +3738,16 @@ XclImpDrawObjRef XclImpObjectManager::FindDrawObj( const DffRecordHeader& rHeade
return xDrawObj;
}
-XclImpDrawObjRef XclImpObjectManager::FindDrawObj( const XclObjId& rObjId ) const
+XclImpDrawObjRef XclImpDrawing::FindDrawObj( sal_uInt16 nObjId ) const
{
XclImpDrawObjRef xDrawObj;
- XclImpObjMapById::const_iterator aIt = maObjMapId.find( rObjId );
+ XclImpObjMapById::const_iterator aIt = maObjMapId.find( nObjId );
if( aIt != maObjMapId.end() )
xDrawObj = aIt->second;
return xDrawObj;
}
-const XclImpObjTextData* XclImpObjectManager::FindTextData( const DffRecordHeader& rHeader ) const
+const XclImpObjTextData* XclImpDrawing::FindTextData( const DffRecordHeader& rHeader ) const
{
/* maTextMap stores textbox data by position of the client data (TXO
record) in the DFF stream, which is always behind shape start position
@@ -3792,75 +3761,46 @@ const XclImpObjTextData* XclImpObjectManager::FindTextData( const DffRecordHeade
return 0;
}
-void XclImpObjectManager::SetSkipObj( SCTAB nScTab, sal_uInt16 nObjId )
+void XclImpDrawing::SetSkipObj( sal_uInt16 nObjId )
{
- maSkipObjs.push_back( XclObjId( nScTab, nObjId ) );
+ maSkipObjs.push_back( nObjId );
}
-// *** Drawing object conversion *** ------------------------------------------
-
-XclImpDffManager& XclImpObjectManager::GetDffManager()
+sal_Size XclImpDrawing::GetProgressSize() const
{
- if( !mxDffManager )
- mxDffManager.reset( new XclImpDffManager( GetRoot(), *this, maDffStrm ) );
- return *mxDffManager;
+ sal_Size nProgressSize = maRawObjs.GetProgressSize();
+ for( XclImpObjMap::const_iterator aIt = maObjMap.begin(), aEnd = maObjMap.end(); aIt != aEnd; ++aIt )
+ nProgressSize += aIt->second->GetProgressSize();
+ return nProgressSize;
}
-void XclImpObjectManager::ConvertObjects()
+void XclImpDrawing::ImplConvertObjects( XclImpDffConverter& rDffConv, SdrModel& rSdrModel, SdrPage& rSdrPage )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sc", "dr104026", "XclImpObjectManager::ConvertObjects" );
-
- // do nothing if the document does not contain a drawing layer
- if( GetDoc().GetDrawLayer() )
- {
- // process list of identifiers of objects to be skipped
- for( XclObjIdVec::const_iterator aVIt = maSkipObjs.begin(), aVEnd = maSkipObjs.end(); aVIt != aVEnd; ++aVIt )
- if( XclImpDrawObjBase* pDrawObj = FindDrawObj( *aVIt ).get() )
- pDrawObj->SetProcessSdrObj( false );
-
- // get progress bar size for all valid objects
- sal_Size nProgressSize = GetProgressSize();
- if( nProgressSize > 0 )
- {
- XclImpDffManager& rDffManager = GetDffManager();
- rDffManager.StartProgressBar( nProgressSize );
- // process drawing objects without DFF data
- for( XclImpDrawObjVector::const_iterator aVIt = maRawObjs.begin(), aVEnd = maRawObjs.end(); aVIt != aVEnd; ++aVIt )
- rDffManager.ProcessObject( GetSdrPage( (*aVIt)->GetScTab() ), **aVIt );
- // process the global DFF container, contains pictures
- if( !maTabStrmPos.empty() && (maTabStrmPos.front() > 0) )
- rDffManager.ProcessDrawingGroup( maDffStrm );
- // process the sheet records, this inserts the objects into the drawing layer
- for( StreamPosVec::const_iterator aPIt = maTabStrmPos.begin(), aPEnd = maTabStrmPos.end(); aPIt != aPEnd; ++aPIt )
- if( *aPIt != STREAM_SEEK_TO_END )
- rDffManager.ProcessDrawing( maDffStrm, *aPIt );
- }
- }
- ScChartListenerCollection* pChartListeners = GetDoc().GetChartListenerCollection();
- if (pChartListeners && pChartListeners->GetCount())
- pChartListeners->SetDirty();
+ // register this drawing manager at the passed (global) DFF manager
+ rDffConv.InitializeDrawing( *this, rSdrModel, rSdrPage );
+ // process list of objects to be skipped
+ for( ScfUInt16Vec::const_iterator aIt = maSkipObjs.begin(), aEnd = maSkipObjs.end(); aIt != aEnd; ++aIt )
+ if( XclImpDrawObjBase* pDrawObj = FindDrawObj( *aIt ).get() )
+ pDrawObj->SetProcessSdrObj( false );
+ // process drawing objects without DFF data
+ rDffConv.ProcessDrawing( maRawObjs );
+ // process all objects in the DFF stream
+ rDffConv.ProcessDrawing( maDffStrm );
+ // unregister this drawing manager at the passed (global) DFF manager
+ rDffConv.FinalizeDrawing();
}
-String XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const
-{
- String aDefName;
- DefObjNameMap::const_iterator aIt = maDefObjNames.find( rDrawObj.GetObjType() );
- if( aIt != maDefObjNames.end() )
- aDefName.Append( aIt->second );
- return aDefName.Append( sal_Unicode( ' ' ) ).Append( String::CreateFromInt32( rDrawObj.GetObjId().mnObjId ) );
-}
+// protected ------------------------------------------------------------------
-ScRange XclImpObjectManager::GetUsedArea( SCTAB nScTab ) const
+void XclImpDrawing::AppendRawObject( const XclImpDrawObjRef& rxDrawObj )
{
- ScRange aScUsedArea( ScAddress::INITIALIZE_INVALID );
- if( mxDffManager.is() )
- aScUsedArea = mxDffManager->GetUsedArea( nScTab );
- return aScUsedArea;
+ DBG_ASSERT( rxDrawObj.is(), "XclImpDrawing::AppendRawObject - unexpected empty reference" );
+ maRawObjs.push_back( rxDrawObj );
}
// private --------------------------------------------------------------------
-void XclImpObjectManager::ReadWmf( Graphic& rGraphic, XclImpStream& rStrm ) // static helper
+void XclImpDrawing::ReadWmf( Graphic& rGraphic, const XclImpRoot&, XclImpStream& rStrm ) // static helper
{
// extract graphic data from IMGDATA and following CONTINUE records
rStrm.Ignore( 8 );
@@ -3873,7 +3813,7 @@ void XclImpObjectManager::ReadWmf( Graphic& rGraphic, XclImpStream& rStrm ) // s
rGraphic = aGDIMetaFile;
}
-void XclImpObjectManager::ReadBmp( Graphic& rGraphic, XclImpStream& rStrm ) // static helper
+void XclImpDrawing::ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpStream& rStrm ) // static helper
{
// extract graphic data from IMGDATA and following CONTINUE records
SvMemoryStream aMemStrm;
@@ -3883,7 +3823,7 @@ void XclImpObjectManager::ReadBmp( Graphic& rGraphic, XclImpStream& rStrm ) // s
pixel depth = 32 bit. After that, 3 unused bytes are added before the
actual pixel data. This does even confuse Excel 5 and later, which
cannot read the image data correctly. */
- if( rStrm.GetRoot().GetBiff() <= EXC_BIFF4 )
+ if( rRoot.GetBiff() <= EXC_BIFF4 )
{
rStrm.PushPosition();
sal_uInt32 nHdrSize;
@@ -3910,21 +3850,21 @@ void XclImpObjectManager::ReadBmp( Graphic& rGraphic, XclImpStream& rStrm ) // s
rGraphic = aBitmap;
}
-void XclImpObjectManager::ReadDffRecord( XclImpStream& rStrm )
+void XclImpDrawing::ReadDffRecord( XclImpStream& rStrm )
{
maDffStrm.Seek( STREAM_SEEK_TO_END );
rStrm.CopyRecordToStream( maDffStrm );
}
-void XclImpObjectManager::ReadObj8( XclImpStream& rStrm )
+void XclImpDrawing::ReadObj8( XclImpStream& rStrm )
{
- XclImpDrawObjRef xDrawObj = XclImpDrawObjBase::ReadObj8( rStrm );
+ XclImpDrawObjRef xDrawObj = XclImpDrawObjBase::ReadObj8( GetRoot(), rStrm );
// store the new object in the internal containers
maObjMap[ maDffStrm.Tell() ] = xDrawObj;
maObjMapId[ xDrawObj->GetObjId() ] = xDrawObj;
}
-void XclImpObjectManager::ReadTxo( XclImpStream& rStrm )
+void XclImpDrawing::ReadTxo( XclImpStream& rStrm )
{
XclImpObjTextRef xTextData( new XclImpObjTextData );
maTextMap[ maDffStrm.Tell() ] = xTextData;
@@ -3938,7 +3878,7 @@ void XclImpObjectManager::ReadTxo( XclImpStream& rStrm )
if( xTextData->maData.mnTextLen > 0 )
{
bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
- DBG_ASSERT( bValid, "XclImpObjectManager::ReadTxo - missing CONTINUE record" );
+ DBG_ASSERT( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" );
if( bValid )
xTextData->mxString.reset( new XclImpString( rStrm.ReadUniString( xTextData->maData.mnTextLen ) ) );
}
@@ -3947,21 +3887,78 @@ void XclImpObjectManager::ReadTxo( XclImpStream& rStrm )
if( xTextData->maData.mnFormatSize > 0 )
{
bValid = (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord();
- DBG_ASSERT( bValid, "XclImpObjectManager::ReadTxo - missing CONTINUE record" );
+ DBG_ASSERT( bValid, "XclImpDrawing::ReadTxo - missing CONTINUE record" );
if( bValid )
xTextData->ReadFormats( rStrm );
}
}
-void XclImpObjectManager::ReadNote3( XclImpStream& rStrm )
+// ----------------------------------------------------------------------------
+
+XclImpSheetDrawing::XclImpSheetDrawing( const XclImpRoot& rRoot, SCTAB nScTab ) :
+ XclImpDrawing( rRoot, true ),
+ maScUsedArea( ScAddress::INITIALIZE_INVALID )
+{
+ maScUsedArea.aStart.SetTab( nScTab );
+ maScUsedArea.aEnd.SetTab( nScTab );
+}
+
+void XclImpSheetDrawing::ReadNote( XclImpStream& rStrm )
+{
+ switch( GetBiff() )
+ {
+ case EXC_BIFF2:
+ case EXC_BIFF3:
+ case EXC_BIFF4:
+ case EXC_BIFF5:
+ ReadNote3( rStrm );
+ break;
+ case EXC_BIFF8:
+ ReadNote8( rStrm );
+ break;
+ default:
+ DBG_ERROR_BIFF();
+ }
+}
+
+void XclImpSheetDrawing::ReadTabChart( XclImpStream& rStrm )
+{
+ DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF5 );
+ ScfRef< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
+ xChartObj->ReadChartSubStream( rStrm );
+ // insert the chart as raw object without connected DFF data
+ AppendRawObject( xChartObj );
+}
+
+void XclImpSheetDrawing::ConvertObjects( XclImpDffConverter& rDffConv )
+{
+ if( SdrModel* pSdrModel = GetDoc().GetDrawLayer() )
+ if( SdrPage* pSdrPage = GetSdrPage( maScUsedArea.aStart.Tab() ) )
+ ImplConvertObjects( rDffConv, *pSdrModel, *pSdrPage );
+}
+
+Rectangle XclImpSheetDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor, bool /*bDffAnchor*/ ) const
+{
+ return rAnchor.GetRect( GetDoc(), maScUsedArea.aStart.Tab(), MAP_100TH_MM );
+}
+
+void XclImpSheetDrawing::OnObjectInserted( const XclImpDrawObjBase& rDrawObj )
+{
+ ScRange aScObjArea = rDrawObj.GetUsedArea( maScUsedArea.aStart.Tab() );
+ if( aScObjArea.IsValid() )
+ maScUsedArea.ExtendTo( aScObjArea );
+}
+
+// private --------------------------------------------------------------------
+
+void XclImpSheetDrawing::ReadNote3( XclImpStream& rStrm )
{
XclAddress aXclPos;
sal_uInt16 nTotalLen;
rStrm >> aXclPos >> nTotalLen;
- SCTAB nScTab = GetCurrScTab();
ScAddress aScNotePos( ScAddress::UNINITIALIZED );
- if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, nScTab, true ) )
+ if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, maScUsedArea.aStart.Tab(), true ) )
{
sal_uInt16 nPartLen = ::std::min( nTotalLen, static_cast< sal_uInt16 >( rStrm.GetRecLeft() ) );
String aNoteText = rStrm.ReadRawByteString( nPartLen );
@@ -3988,33 +3985,117 @@ void XclImpObjectManager::ReadNote3( XclImpStream& rStrm )
}
}
-void XclImpObjectManager::ReadNote8( XclImpStream& rStrm )
+void XclImpSheetDrawing::ReadNote8( XclImpStream& rStrm )
{
XclAddress aXclPos;
sal_uInt16 nFlags, nObjId;
rStrm >> aXclPos >> nFlags >> nObjId;
- SCTAB nScTab = GetCurrScTab();
ScAddress aScNotePos( ScAddress::UNINITIALIZED );
- if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, nScTab, true ) )
+ if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, maScUsedArea.aStart.Tab(), true ) )
if( nObjId != EXC_OBJ_INVALID_ID )
- if( XclImpNoteObj* pNoteObj = dynamic_cast< XclImpNoteObj* >( FindDrawObj( XclObjId( nScTab, nObjId ) ).get() ) )
+ if( XclImpNoteObj* pNoteObj = dynamic_cast< XclImpNoteObj* >( FindDrawObj( nObjId ).get() ) )
pNoteObj->SetNoteData( aScNotePos, nFlags );
}
-sal_Size XclImpObjectManager::GetProgressSize() const
+// The object manager =========================================================
+
+XclImpObjectManager::XclImpObjectManager( const XclImpRoot& rRoot ) :
+ XclImpRoot( rRoot )
{
- sal_Size nProgressSize = maRawObjs.GetProgressSize();
- for( XclImpObjMap::const_iterator aMIt = maObjMap.begin(), aMEnd = maObjMap.end(); aMIt != aMEnd; ++aMIt )
- nProgressSize += aMIt->second->GetProgressSize();
- return nProgressSize;
+ maDefObjNames[ EXC_OBJTYPE_GROUP ] = CREATE_STRING( "Group" );
+ maDefObjNames[ EXC_OBJTYPE_LINE ] = CREATE_STRING( "Line" );
+ maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = CREATE_STRING( "Rectangle" );
+ maDefObjNames[ EXC_OBJTYPE_OVAL ] = CREATE_STRING( "Oval" );
+ maDefObjNames[ EXC_OBJTYPE_ARC ] = CREATE_STRING( "Arc" );
+ maDefObjNames[ EXC_OBJTYPE_CHART ] = CREATE_STRING( "Chart" );
+ maDefObjNames[ EXC_OBJTYPE_TEXT ] = CREATE_STRING( "Text" );
+ maDefObjNames[ EXC_OBJTYPE_BUTTON ] = CREATE_STRING( "Button" );
+ maDefObjNames[ EXC_OBJTYPE_PICTURE ] = CREATE_STRING( "Picture" );
+ maDefObjNames[ EXC_OBJTYPE_POLYGON ] = CREATE_STRING( "Freeform" );
+ maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = CREATE_STRING( "Check Box" );
+ maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = CREATE_STRING( "Option Button" );
+ maDefObjNames[ EXC_OBJTYPE_EDIT ] = CREATE_STRING( "Edit Box" );
+ maDefObjNames[ EXC_OBJTYPE_LABEL ] = CREATE_STRING( "Label" );
+ maDefObjNames[ EXC_OBJTYPE_DIALOG ] = CREATE_STRING( "Dialog Frame" );
+ maDefObjNames[ EXC_OBJTYPE_SPIN ] = CREATE_STRING( "Spinner" );
+ maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = CREATE_STRING( "Scroll Bar" );
+ maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = CREATE_STRING( "List Box" );
+ maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = CREATE_STRING( "Group Box" );
+ maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = CREATE_STRING( "Drop Down" );
+ maDefObjNames[ EXC_OBJTYPE_NOTE ] = CREATE_STRING( "Comment" );
+ maDefObjNames[ EXC_OBJTYPE_DRAWING ] = CREATE_STRING( "AutoShape" );
+}
+
+XclImpObjectManager::~XclImpObjectManager()
+{
+}
+
+void XclImpObjectManager::ReadMsoDrawingGroup( XclImpStream& rStrm )
+{
+ DBG_ASSERT_BIFF( GetBiff() == EXC_BIFF8 );
+ // Excel continues this record with MSODRAWINGGROUP and CONTINUE records, hmm.
+ rStrm.ResetRecord( true, EXC_ID_MSODRAWINGGROUP );
+ maDggStrm.Seek( STREAM_SEEK_TO_END );
+ rStrm.CopyRecordToStream( maDggStrm );
+}
+
+XclImpSheetDrawing& XclImpObjectManager::GetSheetDrawing( SCTAB nScTab )
+{
+ XclImpSheetDrawingRef& rxDrawing = maSheetDrawings[ nScTab ];
+ if( !rxDrawing )
+ rxDrawing.reset( new XclImpSheetDrawing( GetRoot(), nScTab ) );
+ return *rxDrawing;
+}
+
+void XclImpObjectManager::ConvertObjects()
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sc", "dr104026", "XclImpObjectManager::ConvertObjects" );
+
+ // do nothing if the document does not contain a drawing layer
+ if( !GetDoc().GetDrawLayer() )
+ return;
+
+ // get total progress bar size for all sheet drawing managers
+ sal_Size nProgressSize = 0;
+ for( XclImpSheetDrawingMap::iterator aIt = maSheetDrawings.begin(), aEnd = maSheetDrawings.end(); aIt != aEnd; ++aIt )
+ nProgressSize += aIt->second->GetProgressSize();
+ // nothing to do if progress bar is zero (no objects present)
+ if( nProgressSize == 0 )
+ return;
+
+ XclImpDffConverter aDffConv( GetRoot(), maDggStrm );
+ aDffConv.StartProgressBar( nProgressSize );
+ for( XclImpSheetDrawingMap::iterator aIt = maSheetDrawings.begin(), aEnd = maSheetDrawings.end(); aIt != aEnd; ++aIt )
+ aIt->second->ConvertObjects( aDffConv );
+
+ ScChartListenerCollection* pChartListeners = GetDoc().GetChartListenerCollection();
+ if( pChartListeners && (pChartListeners->GetCount() > 0) )
+ pChartListeners->SetDirty();
+}
+
+String XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const
+{
+ String aDefName;
+ DefObjNameMap::const_iterator aIt = maDefObjNames.find( rDrawObj.GetObjType() );
+ if( aIt != maDefObjNames.end() )
+ aDefName.Append( aIt->second );
+ return aDefName.Append( sal_Unicode( ' ' ) ).Append( String::CreateFromInt32( rDrawObj.GetObjId() ) );
+}
+
+ScRange XclImpObjectManager::GetUsedArea( SCTAB nScTab ) const
+{
+ XclImpSheetDrawingMap::const_iterator aIt = maSheetDrawings.find( nScTab );
+ if( aIt != maSheetDrawings.end() )
+ return aIt->second->GetUsedArea();
+ return ScRange( ScAddress::INITIALIZE_INVALID );
}
// DFF property set helper ====================================================
XclImpDffPropSet::XclImpDffPropSet( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot ),
- maDffManager( rRoot, maDummyStrm )
+ maDffConv( rRoot, maDummyStrm )
{
}
@@ -4030,18 +4111,18 @@ void XclImpDffPropSet::Read( XclImpStream& rStrm )
mxMemStrm.reset( new SvMemoryStream );
rStrm.CopyToStream( *mxMemStrm, 8 + nPropSetSize );
mxMemStrm->Seek( STREAM_SEEK_TO_BEGIN );
- maDffManager.ReadPropSet( *mxMemStrm, 0 );
+ maDffConv.ReadPropSet( *mxMemStrm, 0 );
}
sal_uInt32 XclImpDffPropSet::GetPropertyValue( sal_uInt16 nPropId, sal_uInt32 nDefault ) const
{
- return maDffManager.GetPropertyValue( nPropId, nDefault );
+ return maDffConv.GetPropertyValue( nPropId, nDefault );
}
void XclImpDffPropSet::FillToItemSet( SfxItemSet& rItemSet ) const
{
if( mxMemStrm.get() )
- maDffManager.ApplyAttributes( *mxMemStrm, rItemSet );
+ maDffConv.ApplyAttributes( *mxMemStrm, rItemSet );
}
XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet )
diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx
index 75ec91626cf6..c689d0eb7feb 100644
--- a/sc/source/filter/excel/xipage.cxx
+++ b/sc/source/filter/excel/xipage.cxx
@@ -168,7 +168,7 @@ void XclImpPageSettings::ReadPrintGridLines( XclImpStream& rStrm )
void XclImpPageSettings::ReadImgData( XclImpStream& rStrm )
{
- Graphic aGraphic = XclImpObjectManager::ReadImgData( rStrm );
+ Graphic aGraphic = XclImpDrawing::ReadImgData( GetRoot(), rStrm );
if( aGraphic.GetType() != GRAPHIC_NONE )
maData.mxBrushItem.reset( new SvxBrushItem( aGraphic, GPOS_TILED, ATTR_BACKGROUND ) );
}
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index ac184224c611..29e27a698a42 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1311,7 +1311,7 @@ void XclImpPivotTable::ReadSxpi( XclImpStream& rStrm )
maPageFields.push_back( aPageInfo.mnField );
pField->SetPageFieldInfo( aPageInfo );
}
- GetObjectManager().SetSkipObj( GetCurrScTab(), aPageInfo.mnObjId );
+ GetCurrSheetDrawing().SetSkipObj( aPageInfo.mnObjId );
}
}
diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx
index 7b03d56408c9..3384cf248c87 100644
--- a/sc/source/filter/excel/xiroot.cxx
+++ b/sc/source/filter/excel/xiroot.cxx
@@ -206,6 +206,12 @@ XclImpObjectManager& XclImpRoot::GetObjectManager() const
return *mrImpData.mxObjMgr;
}
+XclImpSheetDrawing& XclImpRoot::GetCurrSheetDrawing() const
+{
+ DBG_ASSERT( !IsInGlobals(), "XclImpRoot::GetCurrSheetDrawing - must not be called from workbook globals" );
+ return mrImpData.mxObjMgr->GetSheetDrawing( GetCurrScTab() );
+}
+
XclImpCondFormatManager& XclImpRoot::GetCondFormatManager() const
{
DBG_ASSERT( mrImpData.mxCondFmtMgr.is(), "XclImpRoot::GetCondFormatManager - invalid call, wrong BIFF" );
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 2391eb7ef92e..41e682f85808 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -308,7 +308,7 @@ XclChTypeGroup::XclChTypeGroup() :
// ----------------------------------------------------------------------------
XclChProperties::XclChProperties() :
- mnFlags( EXC_CHPROPS_MANSERIES ),
+ mnFlags( 0 ),
mnEmptyMode( EXC_CHPROPS_EMPTY_SKIP )
{
}
@@ -988,8 +988,8 @@ void XclChPropSetHelper::ReadLegendProperties( XclChLegend& rLegend, const ScfPr
cssc::RelativePosition aRelPos;
if( aRelPosAny >>= aRelPos )
{
- rLegend.maRect.mnX = limit_cast< sal_Int32 >( aRelPos.Primary * 4000.0, 0, 4000 );
- rLegend.maRect.mnY = limit_cast< sal_Int32 >( aRelPos.Secondary * 4000.0, 0, 4000 );
+ rLegend.maRect.mnX = limit_cast< sal_Int32 >( aRelPos.Primary * EXC_CHART_UNIT, 0, EXC_CHART_UNIT );
+ rLegend.maRect.mnY = limit_cast< sal_Int32 >( aRelPos.Secondary * EXC_CHART_UNIT, 0, EXC_CHART_UNIT );
}
else
rLegend.mnDockMode = EXC_CHLEGEND_LEFT;
@@ -1240,8 +1240,8 @@ void XclChPropSetHelper::WriteLegendProperties(
eApiExpand = cssc::LegendExpansion_BALANCED;
// set position
cssc::RelativePosition aRelPos;
- aRelPos.Primary = rLegend.maRect.mnX / 4000.0;
- aRelPos.Secondary = rLegend.maRect.mnY / 4000.0;
+ aRelPos.Primary = static_cast< double >( rLegend.maRect.mnX ) / EXC_CHART_UNIT;
+ aRelPos.Secondary = static_cast< double >( rLegend.maRect.mnY ) / EXC_CHART_UNIT;
aRelPos.Anchor = cssd::Alignment_TOP_LEFT;
aRelPosAny <<= aRelPos;
}
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index 5d74346608fd..538fd7fd7242 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -159,12 +159,16 @@ void lclMirrorRectangle( Rectangle& rRect )
rRect.Right() = -nLeft;
}
+sal_uInt16 lclGetEmbeddedScale( long nPageSize, sal_Int32 nPageScale, long nPos, double fPosScale )
+{
+ return static_cast< sal_uInt16 >( nPos * fPosScale / nPageSize * nPageScale + 0.5 );
+}
+
} // namespace
// ----------------------------------------------------------------------------
-XclObjAnchor::XclObjAnchor( SCTAB nScTab ) :
- mnScTab( nScTab ),
+XclObjAnchor::XclObjAnchor() :
mnLX( 0 ),
mnTY( 0 ),
mnRX( 0 ),
@@ -172,35 +176,61 @@ XclObjAnchor::XclObjAnchor( SCTAB nScTab ) :
{
}
-Rectangle XclObjAnchor::GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const
+Rectangle XclObjAnchor::GetRect( ScDocument& rDoc, SCTAB nScTab, MapUnit eMapUnit ) const
{
double fScale = lclGetTwipsScale( eMapUnit );
Rectangle aRect(
- lclGetXFromCol( rDoc, mnScTab, maFirst.mnCol, mnLX, fScale ),
- lclGetYFromRow( rDoc, mnScTab, maFirst.mnRow, mnTY, fScale ),
- lclGetXFromCol( rDoc, mnScTab, maLast.mnCol, mnRX + 1, fScale ),
- lclGetYFromRow( rDoc, mnScTab, maLast.mnRow, mnBY, fScale ) );
+ lclGetXFromCol( rDoc, nScTab, maFirst.mnCol, mnLX, fScale ),
+ lclGetYFromRow( rDoc, nScTab, maFirst.mnRow, mnTY, fScale ),
+ lclGetXFromCol( rDoc, nScTab, maLast.mnCol, mnRX + 1, fScale ),
+ lclGetYFromRow( rDoc, nScTab, maLast.mnRow, mnBY, fScale ) );
// #106948# adjust coordinates in mirrored sheets
- if( rDoc.IsLayoutRTL( mnScTab ) )
+ if( rDoc.IsLayoutRTL( nScTab ) )
lclMirrorRectangle( aRect );
return aRect;
}
-void XclObjAnchor::SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit eMapUnit )
+void XclObjAnchor::SetRect( ScDocument& rDoc, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit )
{
Rectangle aRect( rRect );
// #106948# adjust coordinates in mirrored sheets
- if( rDoc.IsLayoutRTL( mnScTab ) )
+ if( rDoc.IsLayoutRTL( nScTab ) )
lclMirrorRectangle( aRect );
double fScale = lclGetTwipsScale( eMapUnit );
long nDummy = 0;
- lclGetColFromX( rDoc, mnScTab, maFirst.mnCol, mnLX, 0, nDummy, aRect.Left(), fScale );
- lclGetColFromX( rDoc, mnScTab, maLast.mnCol, mnRX, maFirst.mnCol, nDummy, aRect.Right(), fScale );
+ lclGetColFromX( rDoc, nScTab, maFirst.mnCol, mnLX, 0, nDummy, aRect.Left(), fScale );
+ lclGetColFromX( rDoc, nScTab, maLast.mnCol, mnRX, maFirst.mnCol, nDummy, aRect.Right(), fScale );
nDummy = 0;
- lclGetRowFromY( rDoc, mnScTab, maFirst.mnRow, mnTY, 0, nDummy, aRect.Top(), fScale );
- lclGetRowFromY( rDoc, mnScTab, maLast.mnRow, mnBY, maFirst.mnRow, nDummy, aRect.Bottom(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maFirst.mnRow, mnTY, 0, nDummy, aRect.Top(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maLast.mnRow, mnBY, maFirst.mnRow, nDummy, aRect.Bottom(), fScale );
+}
+
+void XclObjAnchor::SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
+ const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor )
+{
+ double fScale = 1.0;
+ switch( eMapUnit )
+ {
+ case MAP_TWIP: fScale = HMM_PER_TWIPS; break; // Calc twips -> 1/100mm
+ case MAP_100TH_MM: fScale = 1.0; break; // Calc 1/100mm -> 1/100mm
+ default: DBG_ERRORFILE( "XclObjAnchor::SetRect - map unit not implemented" );
+ }
+
+ /* In objects with DFF client anchor, the position of the shape is stored
+ in the cell address components of the client anchor. In old BIFF3-BIFF5
+ objects, the position is stored in the offset components of the anchor. */
+ (bDffAnchor ? maFirst.mnCol : mnLX) = lclGetEmbeddedScale( rPageSize.Width(), nScaleX, rRect.Left(), fScale );
+ (bDffAnchor ? maFirst.mnRow : mnTY) = lclGetEmbeddedScale( rPageSize.Height(), nScaleY, rRect.Top(), fScale );
+ (bDffAnchor ? maLast.mnCol : mnRX) = lclGetEmbeddedScale( rPageSize.Width(), nScaleX, rRect.Right(), fScale );
+ (bDffAnchor ? maLast.mnRow : mnBY) = lclGetEmbeddedScale( rPageSize.Height(), nScaleY, rRect.Bottom(), fScale );
+
+ // for safety, clear the other members
+ if( bDffAnchor )
+ mnLX = mnTY = mnRX = mnBY = 0;
+ else
+ Set( 0, 0, 0, 0 );
}
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/inc/root.hxx b/sc/source/filter/inc/root.hxx
index fcac4da4be62..facc8b1b2fa0 100644
--- a/sc/source/filter/inc/root.hxx
+++ b/sc/source/filter/inc/root.hxx
@@ -52,9 +52,6 @@ class _ScRangeListTabs;
class XclExpChTrTabId;
class XclExpUserBViewList;
-class XclObjList;
-class XclEscher;
-
class XclImpRoot;
class XclExpRoot;
@@ -78,10 +75,6 @@ struct RootData // -> Inkarnation jeweils im ImportExcel-Objekt!
XclExpChTrTabId* pTabId; // pointer to rec list, do not destroy
XclExpUserBViewList* pUserBViewList; // pointer to rec list, do not destroy
- // Biff8
- XclObjList* pObjRecs;
- XclEscher* pEscher;
-
XclImpRoot* pIR;
XclExpRoot* pER;
diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx
index 2aa7c824af99..fde03337cc0f 100644
--- a/sc/source/filter/inc/xcl97esc.hxx
+++ b/sc/source/filter/inc/xcl97esc.hxx
@@ -28,9 +28,10 @@
#ifndef SC_XCL97ESC_HXX
#define SC_XCL97ESC_HXX
-#include <filter/msfilter/escherex.hxx>
+#include <memory>
#include <tools/table.hxx>
#include <tools/stack.hxx>
+#include <filter/msfilter/escherex.hxx>
#include "xlescher.hxx"
#include "xeroot.hxx"
@@ -39,10 +40,28 @@
namespace utl { class TempFile; }
-// --- class XclEscherEx ---------------------------------------------
+// ============================================================================
class SvStream;
+
+class XclEscherExGlobal : public EscherExGlobal, protected XclExpRoot
+{
+public:
+ explicit XclEscherExGlobal( const XclExpRoot& rRoot );
+
+private:
+ /** Overloaded to create a new temporary file and return its stream. */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ ::std::auto_ptr< ::utl::TempFile > mxPicTempFile;
+ ::std::auto_ptr< SvStream > mxPicStrm;
+};
+
+// ============================================================================
+
class XclObj;
+class XclExpDffAnchorBase;
class XclEscherHostAppData;
class XclEscherClientData;
class XclEscherClientTextbox;
@@ -54,56 +73,56 @@ class XclExpTbxControlObj;
class XclEscherEx : public EscherEx, protected XclExpRoot
{
-private:
- List aOffsetMap;
- Stack aStack;
- utl::TempFile* pPicTempFile;
- SvStream* pPicStrm;
- XclObj* pCurrXclObj;
- XclEscherHostAppData* pCurrAppData;
- XclEscherClientData* pTheClientData; // always the same
- XclEscherClientTextbox* pAdditionalText;
- USHORT nAdditionalText;
-
- void DeleteCurrAppData();
-
public:
- XclEscherEx( const XclExpRoot& rRoot, SvStream& rStrm, UINT32 nDrawings );
- virtual ~XclEscherEx();
-
- /// maintains OffsetMap
- virtual void InsertAtCurrentPos( UINT32 nBytes, BOOL bCont = FALSE );
-
- virtual SvStream* QueryPicStream();
- virtual EscherExHostAppData* StartShape( const com::sun::star::uno::Reference<
- com::sun::star::drawing::XShape>& rShape );
+ explicit XclEscherEx(
+ const XclExpRoot& rRoot,
+ XclExpObjectManager& rObjMgr,
+ SvStream& rStrm,
+ const XclEscherEx* pParent = 0 );
+ virtual ~XclEscherEx();
+
+ /** Called by MSODRAWING record constructors to initialize the DFF stream
+ fragment they will own. returns the DFF fragment identifier. */
+ sal_uInt32 InitNextDffFragment();
+ /** Called after some data has been written to the DFF stream, to update
+ the end position of the DFF fragment owned by an MSODRAWING record. */
+ void UpdateDffFragmentEnd();
+
+ /** Returns the position of the specified DFF stream fragment. */
+ sal_uInt32 GetDffFragmentPos( sal_uInt32 nFragmentKey );
+ /** Returns the size of the specified DFF stream fragment. */
+ sal_uInt32 GetDffFragmentSize( sal_uInt32 nFragmentKey );
+ /** Returns true, if there is more data left in the DFF stream than owned
+ by the last MSODRAWING record. */
+ bool HasPendingDffData();
+
+ /** Creates a new DFF client anchor object and calculates the anchor
+ position of the passed object. Caller takes ownership! */
+ XclExpDffAnchorBase* CreateDffAnchor( const SdrObject& rSdrObj ) const;
+
+ virtual EscherExHostAppData* StartShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape,
+ const Rectangle* pChildAnchor );
virtual void EndShape( UINT16 nShapeType, UINT32 nShapeID );
virtual EscherExHostAppData* EnterAdditionalTextGroup();
- /// appends stream offset to list and returns position in list
- ULONG AddCurrentOffsetToMap();
- /// replaces position in list with current stream offset
- void ReplaceCurrentOffsetInMap( ULONG nPos );
- /// returns stream offset for position in list
- inline ULONG GetOffsetFromMap( ULONG nPos ) const;
- /// last position in list (count-1)
- inline ULONG GetLastOffsetMapPos() const;
-
/// Flush and merge PicStream into EscherStream
void EndDocument();
#if EXC_EXP_OCX_CTRL
/** Creates an OCX form control OBJ record from the passed form control.
@descr Writes the form control data to the 'Ctls' stream. */
- XclExpOcxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xShape );
+ XclExpOcxControlObj* CreateCtrlObj(
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
+ const Rectangle* pChildAnchor );
private:
SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream.
#else
/** Creates a TBX form control OBJ record from the passed form control. */
- XclExpTbxControlObj* CreateCtrlObj( ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xShape );
+ XclExpTbxControlObj* CreateCtrlObj(
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
+ const Rectangle* pChildAnchor );
private:
/** Tries to get the name of a Basic macro from a control. */
@@ -112,43 +131,21 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::awt::XControlModel > xCtrlModel );
#endif
-};
-
-
-inline ULONG XclEscherEx::GetOffsetFromMap( ULONG nPos ) const
-{
- return (ULONG) aOffsetMap.GetObject( nPos );
-}
-
-
-inline ULONG XclEscherEx::GetLastOffsetMapPos() const
-{
- return aOffsetMap.Count() - 1;
-}
-
-// --- class XclEscher -----------------------------------------------
+ void DeleteCurrAppData();
-struct RootData;
-
-class XclEscher : protected XclExpRoot
-{
private:
- utl::TempFile* pTempFile;
- SvStream* pStrm;
- XclEscherEx* pEx;
-
-public:
- XclEscher( const XclExpRoot& rRoot, UINT32 nDrawings );
- ~XclEscher();
-
- inline XclEscherEx* GetEx() const { return pEx; }
- inline SvStream& GetStrm() const { return *pStrm; }
-
- void AddSdrPage();
+ XclExpObjectManager& mrObjMgr;
+ Stack aStack;
+ XclObj* pCurrXclObj;
+ XclEscherHostAppData* pCurrAppData;
+ XclEscherClientData* pTheClientData; // always the same
+ XclEscherClientTextbox* pAdditionalText;
+ USHORT nAdditionalText;
+ sal_uInt32 mnNextKey;
+ bool mbIsRootDff;
};
-
// --- class XclEscherHostAppData ------------------------------------
class XclEscherHostAppData : public EscherExHostAppData
@@ -164,55 +161,6 @@ public:
};
-// DFF client anchor ==========================================================
-
-class Rectangle;
-class SdrObject;
-class ScAddress;
-
-/** Represents the position (anchor) of an object in a Calc document. */
-class XclExpDffAnchor : public EscherExClientAnchor_Base, protected XclExpRoot
-{
-public:
- /** Constructs a dummy client anchor. */
- explicit XclExpDffAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags = 0 );
- /** Constructs a client anchor directly from an SdrObject. */
- explicit XclExpDffAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj );
-
- /** Sets the flags according to the passed SdrObject. */
- void SetFlags( const SdrObject& rSdrObj );
-
- /** Called from SVX Escher exporter.
- @param rRect The object anchor rectangle to be exported (in twips). */
- virtual void WriteData( EscherEx& rEx, const Rectangle& rRect );
-
- /** Writes the anchor structure with the current anchor position. */
- void WriteData( EscherEx& rEx ) const;
-
-protected: // for access in derived classes
- XclObjAnchor maAnchor; /// The client anchor data.
- sal_uInt16 mnFlags; /// Flags for DFF stream export.
-};
-
-// ----------------------------------------------------------------------------
-
-/** Represents the position (anchor) of a note object. */
-class XclExpDffNoteAnchor : public XclExpDffAnchor
-{
-public:
- explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
-};
-
-
-// ----------------------------------------------------------------------------
-
-/** Represents the position (anchor) of a cell dropdown object. */
-class XclExpDffDropDownAnchor : public XclExpDffAnchor
-{
-public:
- explicit XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos );
-};
-
// ============================================================================
@@ -221,8 +169,8 @@ public:
class XclEscherClientData : public EscherExClientRecord_Base
{
public:
- XclEscherClientData() {}
- virtual void WriteData( EscherEx& rEx ) const;
+ XclEscherClientData() {}
+ virtual void WriteData( EscherEx& rEx ) const;
};
@@ -233,20 +181,19 @@ class SdrTextObj;
class XclEscherClientTextbox : public EscherExClientRecord_Base, protected XclExpRoot
{
private:
- const SdrTextObj& rTextObj;
- XclObj* pXclObj;
+ const SdrTextObj& rTextObj;
+ XclObj* pXclObj;
public:
- XclEscherClientTextbox(
- const XclExpRoot& rRoot,
- const SdrTextObj& rObj,
- XclObj* pObj
- );
+ XclEscherClientTextbox(
+ const XclExpRoot& rRoot,
+ const SdrTextObj& rObj,
+ XclObj* pObj );
//! ONLY for the AdditionalText mimic
- inline void SetXclObj( XclObj* p ) { pXclObj = p; }
+ inline void SetXclObj( XclObj* p ) { pXclObj = p; }
- virtual void WriteData( EscherEx& rEx ) const;
+ virtual void WriteData( EscherEx& rEx ) const;
};
diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index 2c6ae2f9ab0c..7a2a33795520 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -32,88 +32,35 @@
#include "xcl97esc.hxx"
#include "xlstyle.hxx"
-#include <vector>
-
-// --- class XclMsodrawing_Base --------------------------------------
-
-class XclMsodrawing_Base
-{
-protected:
- XclEscher* pEscher;
- sal_Size nStartPos; // position in OffsetMap
- sal_Size nStopPos; // position in OffsetMap
-
-public:
- XclMsodrawing_Base( XclEscher& rEscher, sal_Size nInitialSize = 0 );
- virtual ~XclMsodrawing_Base();
-
- inline XclEscher* GetEscher() const { return pEscher; }
- inline XclEscherEx* GetEscherEx() const { return pEscher->GetEx(); }
- void UpdateStopPos();
- sal_Size GetDataLen() const;
-};
-
-
-// --- class XclMsodrawinggroup --------------------------------------
-
-class XclMsodrawinggroup : public XclMsodrawing_Base, public XclExpRecord
-{
-private:
-
- virtual void WriteBody( XclExpStream& rStrm );
-
-public:
- XclMsodrawinggroup( RootData& rRoot,
- UINT16 nEscherType = 0 );
- virtual ~XclMsodrawinggroup();
-};
-
-
-// --- class XclMsodrawing -------------------------------------------
-
-class XclMsodrawing : public XclMsodrawing_Base, public XclExpRecord
-{
-private:
-
- virtual void WriteBody( XclExpStream& rStrm );
-
-public:
- XclMsodrawing(
- const XclExpRoot& rRoot,
- UINT16 nEscherType = 0,
- sal_Size nInitialSize = 0 );
- virtual ~XclMsodrawing();
-};
-
-
-// --- class XclObjList ----------------------------------------------
+// ============================================================================
class XclObj;
-class XclMsodrawing;
+class XclExpMsoDrawing;
-class XclObjList : public List, public ExcEmptyRec, protected XclExpRoot
+class XclExpObjList : public List, public ExcEmptyRec, protected XclExpRoot
{
-private:
- XclMsodrawing* pMsodrawingPerSheet;
- XclMsodrawing* pSolverContainer;
-
public:
- XclObjList( const XclExpRoot& rRoot );
- virtual ~XclObjList();
+ explicit XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx );
+ virtual ~XclExpObjList();
- XclObj* First() { return (XclObj*) List::First(); }
- XclObj* Next() { return (XclObj*) List::Next(); }
+ XclObj* First() { return (XclObj*) List::First(); }
+ XclObj* Next() { return (XclObj*) List::Next(); }
- /// return: 1-based ObjId
- ///! count>=0xFFFF: Obj will be deleted, return 0
- UINT16 Add( XclObj* );
+ /// return: 1-based ObjId
+ ///! count>=0xFFFF: Obj will be deleted, return 0
+ UINT16 Add( XclObj* );
- inline XclMsodrawing* GetMsodrawingPerSheet() { return pMsodrawingPerSheet; }
+ inline XclExpMsoDrawing* GetMsodrawingPerSheet() { return pMsodrawingPerSheet; }
/// close groups and DgContainer opened in ctor
- void EndSheet();
+ void EndSheet();
- virtual void Save( XclExpStream& rStrm );
+ virtual void Save( XclExpStream& rStrm );
+
+private:
+ XclEscherEx& mrEscherEx;
+ XclExpMsoDrawing* pMsodrawingPerSheet;
+ XclExpMsoDrawing* pSolverContainer;
};
@@ -125,8 +72,9 @@ class SdrTextObj;
class XclObj : public XclExpRecord
{
protected:
- XclMsodrawing* pMsodrawing;
- XclMsodrawing* pClientTextbox;
+ XclEscherEx& mrEscherEx;
+ XclExpMsoDrawing* pMsodrawing;
+ XclExpMsoDrawing* pClientTextbox;
XclTxo* pTxo;
sal_uInt16 mnObjType;
UINT16 nObjId;
@@ -137,7 +85,9 @@ protected:
/** @param bOwnEscher If set to true, this object will create its escher data.
See SetOwnEscher() for details. */
- explicit XclObj( const XclExpRoot& rRoot, sal_uInt16 nObjType, bool bOwnEscher = false );
+ explicit XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher = false );
+
+ void ImplWriteAnchor( const XclExpRoot& rRoot, const SdrObject* pSdrObj, const Rectangle* pChildAnchor );
// overwritten for writing MSODRAWING record
virtual void WriteBody( XclExpStream& rStrm );
@@ -179,27 +129,15 @@ public:
//! actually writes ESCHER_ClientTextbox
void SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj );
- inline void UpdateStopPos();
-
virtual void Save( XclExpStream& rStrm );
};
-
-inline void XclObj::UpdateStopPos()
-{
- if ( pClientTextbox )
- pClientTextbox->UpdateStopPos();
- else
- pMsodrawing->UpdateStopPos();
-}
-
-
// --- class XclObjComment -------------------------------------------
class XclObjComment : public XclObj
{
public:
- XclObjComment( const XclExpRoot& rRoot,
+ XclObjComment( XclExpObjectManager& rObjMgr,
const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
virtual ~XclObjComment();
@@ -224,7 +162,7 @@ private:
protected:
public:
- XclObjDropDown( const XclExpRoot& rRoot, const ScAddress& rPos, BOOL bFilt );
+ XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& rPos, BOOL bFilt );
virtual ~XclObjDropDown();
};
@@ -271,7 +209,7 @@ private:
virtual void WriteSubRecs( XclExpStream& rStrm );
public:
- XclObjOle( const XclExpRoot& rRoot, const SdrObject& rObj );
+ XclObjOle( XclExpObjectManager& rObjMgr, const SdrObject& rObj );
virtual ~XclObjOle();
virtual void Save( XclExpStream& rStrm );
@@ -286,7 +224,7 @@ private:
virtual void WriteSubRecs( XclExpStream& rStrm );
public:
- XclObjAny( const XclExpRoot& rRoot );
+ XclObjAny( XclExpObjectManager& rObjMgr );
virtual ~XclObjAny();
virtual void Save( XclExpStream& rStrm );
diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx
index eb6026a82e9a..2cf976b11efe 100644
--- a/sc/source/filter/inc/xechart.hxx
+++ b/sc/source/filter/inc/xechart.hxx
@@ -28,6 +28,7 @@
#ifndef SC_XECHART_HXX
#define SC_XECHART_HXX
+#include <tools/gen.hxx>
#include "xerecord.hxx"
#include "xlchart.hxx"
#include "xlformula.hxx"
@@ -1194,6 +1195,27 @@ private:
// ----------------------------------------------------------------------------
+/** Represents the group of DFF and OBJ records containing all drawing shapes
+ embedded in the chart object.
+ */
+class XclExpChartDrawing : public XclExpRecordBase, protected XclExpRoot
+{
+public:
+ explicit XclExpChartDrawing(
+ const XclExpRoot& rRoot,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ const Size& rChartSize );
+ virtual ~XclExpChartDrawing();
+
+ virtual void Save( XclExpStream& rStrm );
+
+private:
+ ScfRef< XclExpObjectManager > mxObjMgr;
+ ScfRef< XclExpRecordBase > mxObjRecs;
+};
+
+// ----------------------------------------------------------------------------
+
/** Represents the entire chart substream (all records in BOF/EOF block). */
class XclExpChart : public XclExpSubStream, protected XclExpRoot
{
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 6448ccb4853e..d227db184f1a 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -29,6 +29,7 @@
#define SC_XEESCHER_HXX
#include <vcl/graph.hxx>
+#include <filter/msfilter/escherex.hxx>
#include "xcl97rec.hxx"
#include "xlescher.hxx"
@@ -36,6 +37,127 @@ namespace com { namespace sun { namespace star {
namespace script { struct ScriptEventDescriptor; }
} } }
+// DFF client anchor ==========================================================
+
+/** Base class for DFF client anchor atoms used in spreadsheets. */
+class XclExpDffAnchorBase : public EscherExClientAnchor_Base, protected XclExpRoot
+{
+public:
+ /** Constructs a dummy client anchor. */
+ explicit XclExpDffAnchorBase( const XclExpRoot& rRoot, sal_uInt16 nFlags = 0 );
+
+ /** Sets the flags according to the passed SdrObject. */
+ void SetFlags( const SdrObject& rSdrObj );
+ /** Sets the anchor position and flags according to the passed SdrObject. */
+ void SetSdrObject( const SdrObject& rSdrObj );
+
+ /** Writes the DFF client anchor structure with the current anchor position. */
+ void WriteDffData( EscherEx& rEscherEx ) const;
+
+ /** Called from SVX DFF converter.
+ @param rRect The object anchor rectangle to be exported (in twips). */
+ virtual void WriteData( EscherEx& rEscherEx, const Rectangle& rRect );
+
+private:
+ virtual void ImplSetFlags( const SdrObject& rSdrObj );
+ virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+
+protected: // for access in derived classes
+ XclObjAnchor maAnchor; /// The client anchor data.
+ sal_uInt16 mnFlags; /// Flags for DFF stream export.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Represents the position (anchor) of an object in a Calc sheet. */
+class XclExpDffSheetAnchor : public XclExpDffAnchorBase
+{
+public:
+ explicit XclExpDffSheetAnchor( const XclExpRoot& rRoot );
+
+private:
+ virtual void ImplSetFlags( const SdrObject& rSdrObj );
+ virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+
+private:
+ SCTAB mnScTab; /// Calc sheet index.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Represents the position (anchor) of a shape in an embedded draw page. */
+class XclExpDffEmbeddedAnchor : public XclExpDffAnchorBase
+{
+public:
+ explicit XclExpDffEmbeddedAnchor( const XclExpRoot& rRoot,
+ const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY );
+
+private:
+ virtual void ImplSetFlags( const SdrObject& rSdrObj );
+ virtual void ImplCalcAnchorRect( const Rectangle& rRect, MapUnit eMapUnit );
+
+private:
+ Size maPageSize;
+ sal_Int32 mnScaleX;
+ sal_Int32 mnScaleY;
+};
+
+// ----------------------------------------------------------------------------
+
+/** Represents the position (anchor) of a note object. */
+class XclExpDffNoteAnchor : public XclExpDffAnchorBase
+{
+public:
+ explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect );
+};
+
+// ----------------------------------------------------------------------------
+
+/** Represents the position (anchor) of a cell dropdown object. */
+class XclExpDffDropDownAnchor : public XclExpDffAnchorBase
+{
+public:
+ explicit XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos );
+};
+
+// MSODRAWING* records ========================================================
+
+/** Base class for records holding DFF stream fragments. */
+class XclExpMsoDrawingBase : public XclExpRecord
+{
+public:
+ explicit XclExpMsoDrawingBase( XclEscherEx& rEscherEx, sal_uInt16 nRecId );
+
+private:
+ virtual void WriteBody( XclExpStream& rStrm );
+
+protected:
+ XclEscherEx& mrEscherEx; /// Reference to the DFF converter containing the DFF stream.
+ sal_uInt32 mnFragmentKey; /// The key of the DFF stream fragment to be written by this record.
+};
+
+// ----------------------------------------------------------------------------
+
+/** The MSODRAWINGGROUP record contains the DGGCONTAINER with global DFF data
+ such as the picture container.
+ */
+class XclExpMsoDrawingGroup : public XclExpMsoDrawingBase
+{
+public:
+ explicit XclExpMsoDrawingGroup( XclEscherEx& rEscherEx );
+};
+
+// ----------------------------------------------------------------------------
+
+/** One or more MSODRAWING records contain the DFF stream data for a drawing
+ shape.
+ */
+class XclExpMsoDrawing : public XclExpMsoDrawingBase
+{
+public:
+ explicit XclExpMsoDrawing( XclEscherEx& rEscherEx );
+};
+
// ============================================================================
/** Provides export of bitmap data to an IMGDATA record. */
@@ -94,8 +216,9 @@ class XclExpOcxControlObj : public XclObj, public XclExpControlHelper
{
public:
explicit XclExpOcxControlObj(
- const XclExpRoot& rRoot,
+ XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
+ const Rectangle* pChildAnchor,
const String& rClassName,
sal_uInt32 nStrmStart, sal_uInt32 nStrmSize );
@@ -115,8 +238,9 @@ class XclExpTbxControlObj : public XclObj, public XclExpControlHelper
{
public:
explicit XclExpTbxControlObj(
- const XclExpRoot& rRoot,
- ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ XclExpObjectManager& rObjMgr,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
+ const Rectangle* pChildAnchor );
/** Sets the name of a macro attached to this control.
@return true = The passed event descriptor was valid, macro name has been found. */
@@ -161,10 +285,10 @@ class XclExpChart;
class XclExpChartObj : public XclObj, protected XclExpRoot
{
public:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > XShapeRef;
-
-public:
- explicit XclExpChartObj( const XclExpRoot& rRoot, XShapeRef xShape );
+ explicit XclExpChartObj(
+ XclExpObjectManager& rObjMgr,
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
+ const Rectangle* pChildAnchor );
virtual ~XclExpChartObj();
/** Writes the OBJ record and the entire chart substream. */
@@ -237,6 +361,74 @@ private:
XclExpNoteList& mrNotes;
};
+// object manager =============================================================
+
+class XclExpObjectManager : public XclExpRoot
+{
+public:
+ explicit XclExpObjectManager( const XclExpRoot& rRoot );
+ virtual ~XclExpObjectManager();
+
+ /** Creates a new DFF client anchor object. Caller takes ownership! May be
+ overwritten in derived classes. */
+ virtual XclExpDffAnchorBase* CreateDffAnchor() const;
+
+ /** Creates and returns the MSODRAWINGGROUP record containing global DFF
+ data in the DGGCONTAINER. */
+ ScfRef< XclExpRecordBase > CreateDrawingGroup();
+
+ /** Initializes the object manager for a new sheet. */
+ void StartSheet();
+
+ /** Processes a drawing page and returns the record block containing all
+ related records (MSODRAWING, OBJ, TXO, charts, etc.). */
+ ScfRef< XclExpRecordBase > ProcessDrawing( SdrPage* pSdrPage );
+ /** Processes a collection of UNO shapes and returns the record block
+ containing all related records (MSODRAWING, OBJ, TXO, charts, etc.). */
+ ScfRef< XclExpRecordBase > ProcessDrawing( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+ /** Finalizes the object manager after conversion of all sheets. */
+ void EndDocument();
+
+ inline XclEscherEx& GetEscherEx() { return *mxEscherEx; }
+ XclExpMsoDrawing* GetMsodrawingPerSheet();
+ bool HasObj() const;
+ sal_uInt16 AddObj( XclObj* pObjRec );
+ XclObj* RemoveLastObj();
+
+protected:
+ explicit XclExpObjectManager( const XclExpObjectManager& rParent );
+
+private:
+ void InitStream( bool bTempFile );
+
+private:
+ ScfRef< ::utl::TempFile > mxTempFile;
+ ScfRef< SvStream > mxDffStrm;
+ ScfRef< XclEscherEx > mxEscherEx;
+ ScfRef< XclExpObjList > mxObjList;
+};
+
+// ----------------------------------------------------------------------------
+
+class XclExpEmbeddedObjectManager : public XclExpObjectManager
+{
+public:
+ explicit XclExpEmbeddedObjectManager(
+ const XclExpObjectManager& rParent,
+ const Size& rPageSize,
+ sal_Int32 nScaleX, sal_Int32 nScaleY );
+
+ /** Creates a new DFF client anchor object for embedded objects according
+ to the scaling data passed to the constructor. Caller takes ownership! */
+ virtual XclExpDffAnchorBase* CreateDffAnchor() const;
+
+private:
+ Size maPageSize;
+ sal_Int32 mnScaleX;
+ sal_Int32 mnScaleY;
+};
+
// ============================================================================
#endif
diff --git a/sc/source/filter/inc/xerecord.hxx b/sc/source/filter/inc/xerecord.hxx
index fa3810c0e92b..a191cd9b1c20 100644
--- a/sc/source/filter/inc/xerecord.hxx
+++ b/sc/source/filter/inc/xerecord.hxx
@@ -48,9 +48,6 @@ public:
/** Overwrite this method to do any operation while saving the record. */
virtual void Save( XclExpStream& rStrm );
virtual void SaveXml( XclExpXmlStream& rStrm );
-
-//UNUSED2008-05 /** Calls Save(XclExpStream&) nCount times. */
-//UNUSED2008-05 void SaveRepeated( XclExpStream& rStrm, size_t nCount );
};
// ----------------------------------------------------------------------------
diff --git a/sc/source/filter/inc/xeroot.hxx b/sc/source/filter/inc/xeroot.hxx
index ce32a46cbc66..f9d3a6ab2f95 100644
--- a/sc/source/filter/inc/xeroot.hxx
+++ b/sc/source/filter/inc/xeroot.hxx
@@ -52,6 +52,7 @@ class XclExpNumFmtBuffer;
class XclExpXFBuffer;
class XclExpLinkManager;
class XclExpNameManager;
+class XclExpObjectManager;
class XclExpFilterManager;
class XclExpPivotTableManager;
@@ -70,6 +71,7 @@ struct XclExpRootData : public XclRootData
typedef ScfRef< XclExpXFBuffer > XclExpXFBfrRef;
typedef ScfRef< XclExpNameManager > XclExpNameMgrRef;
typedef ScfRef< XclExpLinkManager > XclExpLinkMgrRef;
+ typedef ScfRef< XclExpObjectManager > XclExpObjectMgrRef;
typedef ScfRef< XclExpFilterManager > XclExpFilterMgrRef;
typedef ScfRef< XclExpPivotTableManager > XclExpPTableMgrRef;
@@ -86,6 +88,7 @@ struct XclExpRootData : public XclRootData
XclExpNameMgrRef mxNameMgr; /// Internal defined names.
XclExpLinkMgrRef mxGlobLinkMgr; /// Global link manager for defined names.
XclExpLinkMgrRef mxLocLinkMgr; /// Local link manager for a sheet.
+ XclExpObjectMgrRef mxObjMgr; /// All drawing objects.
XclExpFilterMgrRef mxFilterMgr; /// Manager for filtered areas in all sheets.
XclExpPTableMgrRef mxPTableMgr; /// All pivot tables and pivot caches.
@@ -134,6 +137,8 @@ public:
XclExpLinkManager& GetLocalLinkManager() const;
/** Returns the buffer that contains internal defined names. */
XclExpNameManager& GetNameManager() const;
+ /** Returns the drawing object manager. */
+ XclExpObjectManager& GetObjectManager() const;
/** Returns the filter manager. */
XclExpFilterManager& GetFilterManager() const;
/** Returns the pivot table manager. */
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 25e52f3f0168..5d03c99b124a 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -39,8 +39,8 @@
#include "token.hxx"
#include "xlchart.hxx"
#include "xlstyle.hxx"
+#include "xiescher.hxx"
#include "xistring.hxx"
-#include "xiroot.hxx"
namespace com { namespace sun { namespace star {
namespace frame
@@ -111,7 +111,7 @@ public:
/** Starts the API chart document conversion. Must be called once before all API conversion. */
void InitConversion( XChartDocRef xChartDoc ) const;
/** Finishes the API chart document conversion. Must be called once after all API conversion. */
- void FinishConversion( ScfProgressBar& rProgress ) const;
+ void FinishConversion( XclImpDffConverter& rDffConv ) const;
/** Returns the data provider for the chart document. */
XDataProviderRef GetDataProvider() const;
@@ -1355,7 +1355,9 @@ public:
inline sal_Size GetProgressSize() const { return 2 * EXC_CHART_PROGRESS_SIZE; }
/** Converts and writes all properties to the passed chart. */
- void Convert( XChartDocRef xChartDoc, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const;
+ void Convert( XChartDocRef xChartDoc,
+ XclImpDffConverter& rDffConv,
+ const ::rtl::OUString& rObjName ) const;
private:
/** Reads a CHSERIES group (data series source and formatting). */
@@ -1400,6 +1402,31 @@ typedef ScfRef< XclImpChChart > XclImpChChartRef;
// ----------------------------------------------------------------------------
+/** Drawing container of a chart. */
+class XclImpChartDrawing : public XclImpDrawing
+{
+public:
+ explicit XclImpChartDrawing( const XclImpRoot& rRoot, bool bOwnTab );
+
+ /** Converts all objects and inserts them into the chart drawing page. */
+ void ConvertObjects(
+ XclImpDffConverter& rDffConv,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel,
+ const Rectangle& rChartRect );
+
+ /** Calculate the resulting rectangle of the passed anchor. */
+ virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
+ /** Called whenever an object has been inserted into the draw page. */
+ virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj );
+
+private:
+ Rectangle maChartRect; /// Position and size of the chart shape in 1/100 mm.
+ SCTAB mnScTab; /// Index of the sheet that contains the chart.
+ bool mbOwnTab; /// True = own sheet, false = embedded object.
+};
+
+// ----------------------------------------------------------------------------
+
/** Represents the entire chart substream (all records in BOF/EOF block). */
class XclImpChart : protected XclImpRoot
{
@@ -1410,6 +1437,7 @@ public:
/** Constructs a new chart object.
@param bOwnTab True = chart is on an own sheet; false = chart is an embedded object. */
explicit XclImpChart( const XclImpRoot& rRoot, bool bOwnTab );
+ virtual ~XclImpChart();
/** Reads the complete chart substream (BOF/EOF block).
@descr The passed stream must be located in the BOF record of the chart substream. */
@@ -1423,14 +1451,22 @@ public:
inline bool IsPivotChart() const { return mbIsPivotChart; }
/** Creates the chart object in the passed component. */
- void Convert( XModelRef xModel, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const;
+ void Convert( XModelRef xModel,
+ XclImpDffConverter& rDffConv,
+ const ::rtl::OUString& rObjName,
+ const Rectangle& rChartRect ) const;
private:
+ /** Returns (initially creates) the drawing container for embedded shapes. **/
+ XclImpChartDrawing& GetChartDrawing();
/** Reads the CHCHART group (entire chart data). */
void ReadChChart( XclImpStream& rStrm );
private:
+ typedef ScfRef< XclImpChartDrawing > XclImpChartDrawingRef;
+
XclImpChChartRef mxChartData; /// The chart data (CHCHART group).
+ XclImpChartDrawingRef mxChartDrawing; /// Drawing container for embedded shapes.
bool mbOwnTab; /// true = own sheet; false = embedded object.
bool mbIsPivotChart; /// true = chart is based on a pivot table.
};
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 258720e89584..0167d160f297 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -42,9 +42,12 @@ namespace com { namespace sun { namespace star {
namespace form { class XForm; }
} } }
+class SdrObjList;
class ScfProgressBar;
class ScfPropertySet;
class XclImpChart;
+class XclImpDffConverter;
+class XclImpDrawing;
// Drawing objects ============================================================
@@ -59,23 +62,23 @@ public:
virtual ~XclImpDrawObjBase();
/** Reads the BIFF3 OBJ record, returns a new drawing object. */
- static XclImpDrawObjRef ReadObj3( XclImpStream& rStrm );
+ static XclImpDrawObjRef ReadObj3( const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads the BIFF4 OBJ record, returns a new drawing object. */
- static XclImpDrawObjRef ReadObj4( XclImpStream& rStrm );
+ static XclImpDrawObjRef ReadObj4( const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads the BIFF5 OBJ record, returns a new drawing object. */
- static XclImpDrawObjRef ReadObj5( XclImpStream& rStrm );
+ static XclImpDrawObjRef ReadObj5( const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads the BIFF8 OBJ record, returns a new drawing object. */
- static XclImpDrawObjRef ReadObj8( XclImpStream& rStrm );
+ static XclImpDrawObjRef ReadObj8( const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Sets whether this is an area object (then its width and height must be greater than 0). */
inline void SetAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
/** If set to true, a new SdrObject will be created while in DFF import. */
inline void SetSimpleMacro( bool bMacro ) { mbSimpleMacro = bMacro; }
- /** Sets shape data from DFF stream. */
- void SetDffData( const DffObjData& rDffObjData, const String& rObjName, const String& rHyperlink, bool bVisible, bool bAutoMargin );
/** Sets the object anchor explicitly. */
void SetAnchor( const XclObjAnchor& rAnchor );
+ /** Sets shape data from DFF stream. */
+ void SetDffData( const DffObjData& rDffObjData, const String& rObjName, const String& rHyperlink, bool bVisible, bool bAutoMargin );
/** If set to false, the SdrObject will not be created, processed, or inserted into the draw page. */
inline void SetProcessSdrObj( bool bProcess ) { mbProcessSdr = bProcess; }
@@ -84,10 +87,8 @@ public:
/** If set to true, a new SdrObject will be created while in DFF import. */
inline void SetCustomDffObj( bool bCustom ) { mbCustomDff = bCustom; }
- /** Returns the Calc sheet index of this object. */
- inline SCTAB GetScTab() const { return maObjId.mnScTab; }
/** Returns the sheet index and Excel object identifier from OBJ record. */
- inline const XclObjId& GetObjId() const { return maObjId; }
+ inline sal_uInt16 GetObjId() const { return mnObjId; }
/** Returns the Excel object type from OBJ record. */
inline sal_uInt16 GetObjType() const { return mnObjType; }
/** Returns the name of this object, may generate a default name. */
@@ -107,14 +108,14 @@ public:
/** Returns true, if the object is printable. */
inline bool IsPrintable() const { return mbPrintable; }
+ /** Returns the object anchor if existing, null otherwise. */
+ const XclObjAnchor* GetAnchor() const;
/** Returns true, if the passed size is valid for this object. */
bool IsValidSize( const Rectangle& rAnchorRect ) const;
- /** Returns the area in the sheet used by this object. */
- ScRange GetUsedArea() const;
- /** Returns the area on the drawing layer for this object. */
- Rectangle GetAnchorRect() const;
+ /** Returns the range in the sheet covered by this object. */
+ ScRange GetUsedArea( SCTAB nScTab ) const;
- /** Returns true, if the object is valid and will be processed.. */
+ /** Returns true, if the object is valid and will be processed. */
inline bool IsProcessSdrObj() const { return mbProcessSdr && !mbHidden; }
/** Returns true, if the SdrObject will be created or processed, but not be inserted into the draw page. */
inline bool IsInsertSdrObj() const { return mbInsertSdr; }
@@ -122,9 +123,13 @@ public:
/** Returns the needed size on the progress bar (calls virtual DoGetProgressSize() function). */
sal_Size GetProgressSize() const;
/** Creates and returns an SdrObject from the contained data. Caller takes ownership! */
- SdrObject* CreateSdrObject( const Rectangle& rAnchorRect, ScfProgressBar& rProgress, bool bDffImport ) const;
- /** Additional processing for the passed SdrObject (calls virtual DoProcessSdrObj() function). */
- void ProcessSdrObject( SdrObject& rSdrObj ) const;
+ SdrObject* CreateSdrObject( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect, bool bIsDff ) const;
+ /** Additional processing for the passed SdrObject before insertion into
+ the drawing page (calls virtual DoPreProcessSdrObj() function). */
+ void PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
+ /** Additional processing for the passed SdrObject after insertion into the
+ drawing page (calls virtual DoPostProcessSdrObj() function). */
+ void PostProcessSdrObject( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
protected:
/** Reads the object name in a BIFF5 OBJ record. */
@@ -162,9 +167,11 @@ protected:
/** Derived classes may return a progress bar size different from 1. */
virtual sal_Size DoGetProgressSize() const;
/** Derived classes create and return a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
- /** Derived classes may perform additional processing for the passed SdrObject. */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ /** Derived classes may perform additional processing for the passed SdrObject before insertion. */
+ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
+ /** Derived classes may perform additional processing for the passed SdrObject after insertion. */
+ virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
private:
/** Reads the contents of a BIFF3 OBJ record. */
@@ -177,16 +184,15 @@ private:
void ImplReadObj8( XclImpStream& rStrm );
private:
- typedef ScfRef< XclObjAnchor > XclObjAnchorRef;
-
- XclObjAnchorRef mxAnchor; /// The position of the object in the containing sheet.
- XclObjId maObjId; /// Sheet index and object identifier.
+ XclObjAnchor maAnchor; /// The position of the object in its parent.
+ sal_uInt16 mnObjId; /// The object identifier (unique per drawing).
sal_uInt16 mnObjType; /// The Excel object type from OBJ record.
sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream.
sal_uInt32 mnDffFlags; /// Shape flags from DFF stream.
String maObjName; /// Name of the object.
String maMacroName; /// Name of an attached macro.
String maHyperlink; /// On-click hyperlink URL.
+ bool mbHasAnchor; /// true = maAnchor is initialized.
bool mbHidden; /// true = Object is hidden.
bool mbVisible; /// true = Object is visible.
bool mbPrintable; /// true = Object is printable.
@@ -242,7 +248,7 @@ protected:
/** Returns a progress bar size that takes all group children into account. */
virtual sal_Size DoGetProgressSize() const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
protected:
XclImpDrawObjVector maChildren; /// Grouped objects.
@@ -265,7 +271,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
protected:
XclObjLineData maLineData; /// BIFF5 line formatting.
@@ -295,7 +301,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
protected:
XclObjFillData maFillData; /// BIFF5 fill formatting.
@@ -313,7 +319,7 @@ public:
protected:
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
};
// ----------------------------------------------------------------------------
@@ -332,7 +338,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
protected:
XclObjFillData maFillData; /// BIFF5 fill formatting.
@@ -357,7 +363,7 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
protected:
typedef ::std::vector< Point > PointVector;
@@ -398,9 +404,9 @@ protected:
/** Reads the contents of the a BIFF5 OBJ record from the passed stream. */
virtual void DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
/** Inserts the contained text data at the passed object. */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
protected:
XclImpObjTextData maTextData; /// Textbox data from BIFF5 OBJ or BIFF8 TXO record.
@@ -430,7 +436,9 @@ protected:
/** Returns the needed size on the progress bar. */
virtual sal_Size DoGetProgressSize() const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
+ /** Converts the chart document. */
+ virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
private:
/** Calculates the object anchor of a sheet chart (chart fills one page). */
@@ -456,7 +464,7 @@ public:
protected:
/** Inserts the note into the document, sets visibility. */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
private:
ScAddress maScPos; /// Cell position of the note object.
@@ -533,9 +541,9 @@ protected:
void ConvertLabel( ScfPropertySet& rPropSet ) const;
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
/** Additional processing on the SdrObject, calls new virtual function DoProcessControl(). */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
/** Derived classes return the service name of the control component to be created. */
virtual ::rtl::OUString DoGetServiceName() const = 0;
@@ -882,9 +890,9 @@ protected:
/** Reads the contents of the specified subrecord of a BIFF8 OBJ record from stream. */
virtual void DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize );
/** Creates and returns a new SdrObject from the contained data. Caller takes ownership! */
- virtual SdrObject* DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProgressBar& rProgress ) const;
+ virtual SdrObject* DoCreateSdrObj( XclImpDffConverter& rDffConv, const Rectangle& rAnchorRect ) const;
/** Overloaded to do additional processing on the SdrObject. */
- virtual void DoProcessSdrObj( SdrObject& rSdrObj ) const;
+ virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const;
private:
/** Reads and sets the picture flags from a BIFF3-BIFF5 OBJ picture record. */
@@ -955,13 +963,13 @@ private:
// ----------------------------------------------------------------------------
/** Simple implementation of the SVX DFF manager. Implements resolving palette
- colors. Used by XclImpDffPropSet (as is), extended by XclImpDffManager.
+ colors. Used by XclImpDffPropSet (as is), extended by XclImpDffConverter.
*/
-class XclImpSimpleDffManager : public SvxMSDffManager, protected XclImpRoot
+class XclImpSimpleDffConverter : public SvxMSDffManager, protected XclImpRoot
{
public:
- explicit XclImpSimpleDffManager( const XclImpRoot& rRoot, SvStream& rDffStrm );
- virtual ~XclImpSimpleDffManager();
+ explicit XclImpSimpleDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm );
+ virtual ~XclImpSimpleDffConverter();
protected:
/** Returns a color from the Excel color palette. */
@@ -970,42 +978,46 @@ protected:
// ----------------------------------------------------------------------------
-class XclImpObjectManager;
-class SdrObjList;
+/** This is the central instance for converting binary DFF data into shape
+ objects. Used for all sheet shapes and shapes embedded in chart objects.
-/** Derived from SvxMSDffManager and SvxMSConvertOCXControls, contains core
- implementation of DFF stream import and OCX form control import.
+ The class derives from SvxMSDffManager and SvxMSConvertOCXControls and
+ contains core implementation of DFF stream import and OCX form control
+ import.
*/
-class XclImpDffManager : public XclImpSimpleDffManager, protected SvxMSConvertOCXControls
+class XclImpDffConverter : public XclImpSimpleDffConverter, private SvxMSConvertOCXControls
{
public:
- explicit XclImpDffManager(
- const XclImpRoot& rRoot,
- XclImpObjectManager& rObjManager,
- SvStream& rDffStrm );
- virtual ~XclImpDffManager();
+ explicit XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm );
+ virtual ~XclImpDffConverter();
/** Initializes the internal progress bar with the passed size and starts it. */
void StartProgressBar( sal_Size nProgressSize );
+ /** Increase the progress bar by the passed value. */
+ void Progress( sal_Size nDelta = 1 );
+ /** Initially called before the objects of the passed drawing manager are converted. */
+ void InitializeDrawing( XclImpDrawing& rDrawing, SdrModel& rSdrModel, SdrPage& rSdrPage );
/** Processes BIFF5 drawing objects without DFF data, inserts into the passed object list. */
- void ProcessObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj );
- /** Processes the leading drawing group container in the DFF stream. */
- void ProcessDrawingGroup( SvStream& rDffStrm );
- /** Processes a drawing container for a sheet in the DFF stream, converts all objects. */
- void ProcessDrawing( SvStream& rDffStrm, sal_Size nStrmPos );
+ void ProcessObject( SdrObjList& rObjList, const XclImpDrawObjBase& rDrawObj );
+ /** Processes all objects in the passed list. */
+ void ProcessDrawing( const XclImpDrawObjVector& rDrawObjs );
+ /** Processes a drawing container in the passed DFF stream, converts all objects. */
+ void ProcessDrawing( SvStream& rDffStrm );
+ /** Finally called after the objects of the passed drawing manager have been converted. */
+ void FinalizeDrawing();
/** Creates the SdrObject for the passed Excel TBX form control object. */
SdrObject* CreateSdrObject( const XclImpTbxObjBase& rTbxObj, const Rectangle& rAnchorRect );
/** Creates the SdrObject for the passed Excel OLE object or OCX form control object. */
SdrObject* CreateSdrObject( const XclImpPictureObj& rPicObj, const Rectangle& rAnchorRect );
+ /** Returns true, if the conversion of OLE objects is supported. */
+ bool SupportsOleObjects() const;
/** Returns the default text margin in drawing layer units. */
inline sal_Int32 GetDefaultTextMargin() const { return mnDefTextMargin; }
- /** Returns the used area in the sheet with the passed index. */
- ScRange GetUsedArea( SCTAB nScTab ) const;
-protected:
+private:
// virtual functions of SvxMSDffManager
/** Reads the client anchor from the DFF stream and sets it at the correct object. */
@@ -1036,11 +1048,30 @@ protected:
BOOL bFloatingCtrl );
private:
+ /** Data per registered drawing manager, will be stacked for recursive calls. */
+ struct XclImpDffConvData
+ {
+ XclImpDrawing& mrDrawing; /// Current drawing container with all drawing objects.
+ SdrModel& mrSdrModel; /// The SdrModel of the drawing manager.
+ SdrPage& mrSdrPage; /// The SdrPage of the drawing manager.
+ XclImpSolverContainer maSolverCont; /// The solver container for connector rules.
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
+ mxCtrlForm; /// Controls form of current drawing page.
+ sal_Int32 mnLastCtrlIndex; /// Last insertion index of a form control (for macro events).
+ bool mbHasCtrlForm; /// True = mxCtrlForm is initialized (but maybe still null).
+
+ explicit XclImpDffConvData( XclImpDrawing& rDrawing,
+ SdrModel& rSdrModel, SdrPage& rSdrPage );
+ };
+
+ /** Returns the current drawing manager data struct from top of the stack. */
+ XclImpDffConvData& GetConvData();
+ /** Returns the current drawing manager data struct from top of the stack. */
+ const XclImpDffConvData& GetConvData() const;
+
/** Reads contents of a hyperlink property and returns the extracted URL. */
String ReadHlinkProperty( SvStream& rDffStrm ) const;
- /** Processes a drawing group container (global drawing data). */
- void ProcessDggContainer( SvStream& rDffStrm, const DffRecordHeader& rDggHeader );
/** Processes a drawing container (all drawing data of a sheet). */
void ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader );
/** Processes the global shape group container (all shapes of a sheet). */
@@ -1051,87 +1082,71 @@ private:
void ProcessShContainer( SvStream& rDffStrm, const DffRecordHeader& rShHeader );
/** Inserts the passed SdrObject into the document. This function takes ownership of pSdrObj! */
- void InsertSdrObject( SdrObjList* pObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj );
- /** Stores the standard controls form for the passed sheet in mxCurrForm member. */
- void SetCurrentForm( SCTAB nScTab );
-
- /** Updates the used area of a sheet with the position and size of the passed object. */
- void UpdateUsedArea( const XclImpDrawObjBase& rDrawObj );
+ void InsertSdrObject( SdrObjList& rObjList, const XclImpDrawObjBase& rDrawObj, SdrObject* pSdrObj );
+ /** Initializes the mxCtrlForm referring to the standard controls form. */
+ void InitControlForm();
private:
- typedef ::std::map< SCTAB, ScRange > ScRangeMap;
- typedef ScfRef< ScfProgressBar > ScfProgressBarRef;
+ typedef ScfRef< ScfProgressBar > ScfProgressBarRef;
+ typedef ScfRef< XclImpDffConvData > XclImpDffConvDataRef;
+ typedef ::std::vector< XclImpDffConvDataRef > XclImpDffConvDataStack;
- XclImpObjectManager& mrObjManager; /// The Excel object manager.
- XclImpSolverContainer maSolverCont; /// The solver container for connector rules.
+ const ::rtl::OUString maStdFormName; /// Standard name of control forms.
SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream for OCX form controls.
- ScRangeMap maUsedAreaMap; /// Used ranges for all sheets.
ScfProgressBarRef mxProgress; /// The progress bar used in ProcessObj().
- ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >
- mxCurrForm; /// Controls form of current sheet (needed in virtual functions).
+ XclImpDffConvDataStack maDataStack; /// Stack for registered drawing managers.
sal_uInt32 mnOleImpFlags; /// Application OLE import settings.
sal_Int32 mnDefTextMargin; /// Default margin in text boxes.
- sal_Int32 mnLastCtrlIndex; /// Last insertion index of a form control (for macro events).
- SCTAB mnCurrFormScTab; /// Sheet index of form stored in mxCurrForm.
};
-// The object manager =========================================================
+// Drawing manager ============================================================
-/** Stores all drawing and OLE objects and additional data related to these objects. */
-class XclImpObjectManager : protected XclImpRoot
+/** Base class for a container for all objects on a drawing (spreadsheet or
+ embedded chart object). */
+class XclImpDrawing : protected XclImpRoot
{
public:
- explicit XclImpObjectManager( const XclImpRoot& rRoot );
- virtual ~XclImpObjectManager();
-
- // *** Read Excel records *** ---------------------------------------------
+ explicit XclImpDrawing( const XclImpRoot& rRoot, bool bOleObjects );
+ virtual ~XclImpDrawing();
/** Reads and returns a bitmap from the IMGDATA record. */
- static Graphic ReadImgData( XclImpStream& rStrm );
+ static Graphic ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads a plain OBJ record (without leading DFF data). */
void ReadObj( XclImpStream& rStrm );
- /** Reads the MSODRAWINGGROUP record. */
- void ReadMsoDrawingGroup( XclImpStream& rStrm );
/** Reads the MSODRAWING or MSODRAWINGSELECTION record. */
void ReadMsoDrawing( XclImpStream& rStrm );
- /** Reads the NOTE record. */
- void ReadNote( XclImpStream& rStrm );
-
- /** Inserts a new chart object and reads the chart substream (BOF/EOF block).
- @descr Used to import chart sheets, which do not have a corresponding OBJ record. */
- void ReadTabChart( XclImpStream& rStrm );
-
- // *** Drawing objects *** ------------------------------------------------
+ /** Returns true, if the conversion of OLE objects is supported. */
+ inline bool SupportsOleObjects() const { return mbOleObjs; }
/** Finds the OBJ record data related to the DFF shape at the passed position. */
XclImpDrawObjRef FindDrawObj( const DffRecordHeader& rHeader ) const;
/** Finds the OBJ record data specified by the passed object identifier. */
- XclImpDrawObjRef FindDrawObj( const XclObjId& rObjId ) const;
+ XclImpDrawObjRef FindDrawObj( sal_uInt16 nObjId ) const;
/** Finds the textbox data related to the DFF shape at the passed position. */
const XclImpObjTextData* FindTextData( const DffRecordHeader& rHeader ) const;
/** Sets the object with the passed identification to be skipped on import. */
- void SetSkipObj( SCTAB nScTab, sal_uInt16 nObjId );
-
- // *** Drawing object conversion *** --------------------------------------
+ void SetSkipObj( sal_uInt16 nObjId );
+ /** Returns the size of the progress bar shown while processing all objects. */
+ sal_Size GetProgressSize() const;
- /** Returns the DFF manager (DFF stream converter). Don't call before the DFF stream is read. */
- XclImpDffManager& GetDffManager();
- /** Inserts all objects into the Calc document. */
- void ConvertObjects();
+ /** Derived classes calculate the resulting rectangle of the passed anchor. */
+ virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const = 0;
+ /** Called whenever an object has been inserted into the draw page. */
+ virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj ) = 0;
- /** Returns the default name for the passed object. */
- String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const;
- /** Returns the used area in the sheet with the passed index. */
- ScRange GetUsedArea( SCTAB nScTab ) const;
+protected:
+ /** Appends a new drawing object to the list of raw objects (without DFF data). */
+ void AppendRawObject( const XclImpDrawObjRef& rxDrawObj );
+ /** Converts all objects and inserts them into the current drawing page. */
+ void ImplConvertObjects( XclImpDffConverter& rDffConv, SdrModel& rSdrModel, SdrPage& rSdrPage );
- // ------------------------------------------------------------------------
private:
/** Reads and returns a bitmap from WMF/PICT format. */
- static void ReadWmf( Graphic& rGraphic, XclImpStream& rStrm );
+ static void ReadWmf( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads and returns a bitmap from BMP format. */
- static void ReadBmp( Graphic& rGraphic, XclImpStream& rStrm );
+ static void ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpStream& rStrm );
/** Reads contents of an DFF record and append data to internal DFF stream. */
void ReadDffRecord( XclImpStream& rStrm );
@@ -1140,36 +1155,86 @@ private:
/** Reads the TXO record and following CONTINUE records containing string and formatting. */
void ReadTxo( XclImpStream& rStrm );
+private:
+ typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap;
+ typedef ::std::map< sal_uInt16, XclImpDrawObjRef > XclImpObjMapById;
+ typedef ScfRef< XclImpObjTextData > XclImpObjTextRef;
+ typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap;
+
+ XclImpDrawObjVector maRawObjs; /// BIFF5 objects without DFF data.
+ SvMemoryStream maDffStrm; /// Copy of the DFF page stream in memory.
+ XclImpObjMap maObjMap; /// Maps BIFF8 drawing objects to DFF stream position.
+ XclImpObjMapById maObjMapId; /// Maps BIFF8 drawing objects to object ID.
+ XclImpObjTextMap maTextMap; /// Maps BIFF8 TXO textbox data to DFF stream position.
+ ScfUInt16Vec maSkipObjs; /// IDs of all objects to be skipped.
+ bool mbOleObjs; /// True = draw model supports OLE objects.
+};
+
+// ----------------------------------------------------------------------------
+
+/** Drawing manager of a single sheet. */
+class XclImpSheetDrawing : public XclImpDrawing
+{
+public:
+ explicit XclImpSheetDrawing( const XclImpRoot& rRoot, SCTAB nScTab );
+
+ /** Reads the NOTE record. */
+ void ReadNote( XclImpStream& rStrm );
+ /** Inserts a new chart object and reads the chart substream (BOF/EOF block).
+ @descr Used to import chart sheets, which do not have a corresponding OBJ record. */
+ void ReadTabChart( XclImpStream& rStrm );
+
+ /** Returns the total cell range covered by any shapes in the sheet. */
+ inline const ScRange& GetUsedArea() const { return maScUsedArea; }
+ /** Converts all objects and inserts them into the sheet drawing page. */
+ void ConvertObjects( XclImpDffConverter& rDffConv );
+
+ /** Calculate the resulting rectangle of the passed anchor. */
+ virtual Rectangle CalcAnchorRect( const XclObjAnchor& rAnchor, bool bDffAnchor ) const;
+ /** On call, updates the used area of the sheet. */
+ virtual void OnObjectInserted( const XclImpDrawObjBase& rDrawObj );
+
+private:
/** Reads a BIFF3-BIFF5 NOTE record. */
void ReadNote3( XclImpStream& rStrm );
/** Reads a BIFF8 NOTE record. */
void ReadNote8( XclImpStream& rStrm );
- /** Returns the size of the progress bar shown while processing all objects. */
- sal_Size GetProgressSize() const;
+private:
+ ScRange maScUsedArea; /// Sheet index and used area in this sheet.
+};
+
+// The object manager =========================================================
+
+/** Stores all drawing and OLE objects and additional data related to these objects. */
+class XclImpObjectManager : protected XclImpRoot
+{
+public:
+ explicit XclImpObjectManager( const XclImpRoot& rRoot );
+ virtual ~XclImpObjectManager();
+
+ /** Reads the MSODRAWINGGROUP record. */
+ void ReadMsoDrawingGroup( XclImpStream& rStrm );
+
+ /** Returns (initially creates) the drawing manager of the specified sheet. */
+ XclImpSheetDrawing& GetSheetDrawing( SCTAB nScTab );
+ /** Inserts all objects into the Calc document. */
+ void ConvertObjects();
+
+ /** Returns the default name for the passed object. */
+ String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const;
+ /** Returns the used area in the sheet with the passed index. */
+ ScRange GetUsedArea( SCTAB nScTab ) const;
// ------------------------------------------------------------------------
private:
- typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap;
- typedef ::std::map< XclObjId, XclImpDrawObjRef > XclImpObjMapById;
- typedef ScfRef< XclImpObjTextData > XclImpObjTextRef;
- typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap;
- typedef ::std::vector< XclObjId > XclObjIdVec;
-
typedef ::std::map< sal_uInt16, String > DefObjNameMap;
- typedef ::std::vector< sal_Size > StreamPosVec;
- typedef ScfRef< XclImpDffManager > XclImpDffMgrRef;
-
- XclImpDrawObjVector maRawObjs; /// BIFF5 objects without DFF data.
- XclImpObjMap maObjMap; /// Maps BIFF8 drawing objects to DFF stream position.
- XclImpObjMapById maObjMapId; /// Maps BIFF8 drawing objects to sheet index and object ID.
- XclImpObjTextMap maTextMap; /// Maps BIFF8 TXO textbox data to DFF stream position.
- XclObjIdVec maSkipObjs; /// All objects to be skipped.
+ typedef ScfRef< XclImpSheetDrawing > XclImpSheetDrawingRef;
+ typedef ::std::map< SCTAB, XclImpSheetDrawingRef > XclImpSheetDrawingMap;
DefObjNameMap maDefObjNames; /// Default base names for all object types.
- SvMemoryStream maDffStrm; /// Copy of DFF stream in memory.
- StreamPosVec maTabStrmPos; /// Start positions of DFF stream fragments for all sheets.
- XclImpDffMgrRef mxDffManager; /// The DFF stream converter.
+ SvMemoryStream maDggStrm; /// Copy of global DFF data (DGG container) in memory.
+ XclImpSheetDrawingMap maSheetDrawings; /// Drawing managers of all sheets.
};
// DFF property set helper ====================================================
@@ -1197,8 +1262,8 @@ public:
private:
typedef ::std::auto_ptr< SvMemoryStream > SvMemoryStreamPtr;
- SvMemoryStream maDummyStrm; /// Dummy stream for DFF manager.
- XclImpSimpleDffManager maDffManager;/// DFF manager used to resolve palette colors.
+ SvMemoryStream maDummyStrm; /// Dummy DGG stream for DFF manager.
+ XclImpSimpleDffConverter maDffConv; /// DFF converter used to resolve palette colors.
SvMemoryStreamPtr mxMemStrm; /// Helper stream.
};
diff --git a/sc/source/filter/inc/xiroot.hxx b/sc/source/filter/inc/xiroot.hxx
index 3881adaaf911..0e06b31b650d 100644
--- a/sc/source/filter/inc/xiroot.hxx
+++ b/sc/source/filter/inc/xiroot.hxx
@@ -51,6 +51,7 @@ class XclImpTabInfo;
class XclImpNameManager;
class XclImpLinkManager;
class XclImpObjectManager;
+class XclImpSheetDrawing;
class XclImpCondFormatManager;
class XclImpAutoFilterBuffer;
class XclImpWebQueryBuffer;
@@ -176,6 +177,8 @@ public:
/** Returns the drawing object manager. */
XclImpObjectManager& GetObjectManager() const;
+ /** Returns the drawing container of the current sheet. */
+ XclImpSheetDrawing& GetCurrSheetDrawing() const;
/** Returns the conditional formattings manager. */
XclImpCondFormatManager& GetCondFormatManager() const;
/** Returns the filter manager. */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 7e5f90fda4a7..f6711211bc13 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -71,6 +71,7 @@ namespace com { namespace sun { namespace star {
#define SERVICE_CHART2_TITLE CREATE_OUSTRING( "com.sun.star.chart2.Title" )
// property names
+#define EXC_CHPROP_ADDITIONALSHAPES CREATE_OUSTRING( "AdditionalShapes" )
#define EXC_CHPROP_ARRANGEORDER CREATE_OUSTRING( "ArrangeOrder" )
#define EXC_CHPROP_ATTAXISINDEX CREATE_OUSTRING( "AttachedAxisIndex" )
#define EXC_CHPROP_ATTRIBDATAPOINTS CREATE_OUSTRING( "AttributedDataPoints" )
@@ -168,6 +169,8 @@ const sal_Int32 EXC_CHART_AXESSET_NONE = -1; /// For internal use
const sal_Int32 EXC_CHART_AXESSET_PRIMARY = 0; /// API primary axes set index.
const sal_Int32 EXC_CHART_AXESSET_SECONDARY = 1; /// API secondary axes set index.
+const sal_Int32 EXC_CHART_UNIT = 4000; /// Chart objects are positioned in 1/4000 of chart area.
+
// (0x0850) CHFRINFO ----------------------------------------------------------
const sal_uInt16 EXC_ID_CHFRINFO = 0x0850;
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index f60d6d3a5ee5..33b75af8cd2c 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -312,18 +312,21 @@ bool operator<( const XclObjId& rL, const XclObjId& rR );
/** Represents the position (anchor) of an object in a Calc document. */
struct XclObjAnchor : public XclRange
{
- SCTAB mnScTab; /// Calc sheet index.
sal_uInt16 mnLX; /// X offset in left column (1/1024 of column width).
sal_uInt16 mnTY; /// Y offset in top row (1/256 of row height).
sal_uInt16 mnRX; /// X offset in right column (1/1024 of column width).
sal_uInt16 mnBY; /// Y offset in bottom row (1/256 of row height).
- explicit XclObjAnchor( SCTAB nScTab );
+ explicit XclObjAnchor();
/** Calculates a rectangle from the contained coordinates. */
- Rectangle GetRect( ScDocument& rDoc, MapUnit eMapUnit ) const;
- /** Initializes the anchor coordinates from a rectangle. */
- void SetRect( ScDocument& rDoc, const Rectangle& rRect, MapUnit eMapUnit );
+ Rectangle GetRect( ScDocument& rDoc, SCTAB nScTab, MapUnit eMapUnit ) const;
+ /** Initializes the anchor coordinates for a sheet. */
+ void SetRect( ScDocument& rDoc, SCTAB nScTab, const Rectangle& rRect, MapUnit eMapUnit );
+
+ /** Initializes the anchor coordinates for an embedded draw page. */
+ void SetRect( const Size& rPageSize, sal_Int32 nScaleX, sal_Int32 nScaleY,
+ const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor );
};
template< typename StreamType >
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 2c5a30f085d3..a7c6dee67dc5 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -59,9 +59,11 @@
#include "xechart.hxx"
#include "xcl97esc.hxx"
+using ::rtl::OUString;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::container::XIndexAccess;
@@ -72,24 +74,40 @@ using ::com::sun::star::form::XFormsSupplier;
using ::com::sun::star::script::ScriptEventDescriptor;
using ::com::sun::star::script::XEventAttacherManager;
-// --- class XclEscherEx ---------------------------------------------
+// ============================================================================
-XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, SvStream& rStrm, UINT32 nDrawings )
- :
- EscherEx( rStrm, nDrawings ),
- XclExpRoot( rRoot ),
- pPicTempFile( NULL ),
- pPicStrm( NULL ),
- pCurrXclObj( NULL ),
- pCurrAppData( NULL ),
- pTheClientData( new XclEscherClientData ),
- pAdditionalText( NULL ),
- nAdditionalText( 0 )
+XclEscherExGlobal::XclEscherExGlobal( const XclExpRoot& rRoot ) :
+ XclExpRoot( rRoot )
+{
+}
+
+SvStream* XclEscherExGlobal::ImplQueryPictureStream()
+{
+ mxPicTempFile.reset( new ::utl::TempFile );
+ if( mxPicTempFile->IsValid() )
+ {
+ mxPicTempFile->EnableKillingFile();
+ mxPicStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxPicTempFile->GetURL(), STREAM_STD_READWRITE ) );
+ mxPicStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ }
+ return mxPicStrm.get();
+}
+
+// ============================================================================
+
+XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, XclExpObjectManager& rObjMgr, SvStream& rStrm, const XclEscherEx* pParent ) :
+ EscherEx( pParent ? pParent->mxGlobal : EscherExGlobalRef( new XclEscherExGlobal( rRoot ) ), rStrm ),
+ XclExpRoot( rRoot ),
+ mrObjMgr( rObjMgr ),
+ pCurrXclObj( NULL ),
+ pCurrAppData( NULL ),
+ pTheClientData( new XclEscherClientData ),
+ pAdditionalText( NULL ),
+ nAdditionalText( 0 ),
+ mnNextKey( 0 ),
+ mbIsRootDff( pParent == 0 )
{
- aOffsetMap.Insert( (void*) 0, LIST_APPEND ); // start of stream
- // Xcl forgets OLE objects completely if the Escher object is not EMF and
- // the corresponding OLE application is opened and nothing is changed.
- SetOleEmf( TRUE );
+ InsertPersistOffset( mnNextKey, 0 );
}
@@ -98,86 +116,83 @@ XclEscherEx::~XclEscherEx()
DBG_ASSERT( !aStack.Count(), "~XclEscherEx: stack not empty" );
DeleteCurrAppData();
delete pTheClientData;
- if ( pPicStrm )
- {
- delete pPicStrm;
- }
- if ( pPicTempFile )
- delete pPicTempFile;
}
-SvStream* XclEscherEx::QueryPicStream()
+sal_uInt32 XclEscherEx::InitNextDffFragment()
{
- if ( !pPicStrm )
- {
- if ( !pPicTempFile )
- {
- pPicTempFile = new utl::TempFile;
- if ( pPicTempFile->IsValid() )
- pPicTempFile->EnableKillingFile();
- else
- {
- delete pPicTempFile;
- pPicTempFile = NULL;
- }
- }
- if ( pPicTempFile )
- {
- pPicStrm = utl::UcbStreamHelper::CreateStream( pPicTempFile->GetURL(), STREAM_STD_READWRITE );
- pPicStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- }
- }
- return pPicStrm;
+ /* Current value of mnNextKey will be used by caller to refer to the
+ starting point of the DFF fragment. The key exists already in the
+ PersistTable (has been inserted by c'tor of previous call of
+ InitNextDffFragment(), has been updated by UpdateDffFragmentEnd(). */
+ sal_uInt32 nPersistKey = mnNextKey;
+
+ /* Prepare the next key that is used by caller as end point of the DFF
+ fragment. Will be updated by caller when writing to the DFF stream,
+ using the UpdateDffFragmentEnd() function. This is needed to find DFF
+ data written by the SVX base class implementation without interaction,
+ e.g. the solver container that will be written after the last shape. */
+ ++mnNextKey;
+ InsertPersistOffset( mnNextKey, mpOutStrm->Tell() );
+
+ return nPersistKey;
}
-
-void XclEscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bCont )
+void XclEscherEx::UpdateDffFragmentEnd()
{
- ULONG nPos = GetStreamPos();
- ULONG nCnt = aOffsetMap.Count();
- ULONG j, nOff;
- for ( j=0, nOff = (ULONG) aOffsetMap.First(); j<nCnt;
- j++, nOff = (ULONG) aOffsetMap.Next() )
- {
- if ( nOff >= nPos )
- aOffsetMap.Replace( (void*) (nOff + nBytes) );
- }
- EscherEx::InsertAtCurrentPos( nBytes, bCont );
+ // update existing fragment key with new stream position
+ ReplacePersistOffset( mnNextKey, mpOutStrm->Tell() );
}
-
-ULONG XclEscherEx::AddCurrentOffsetToMap()
+sal_uInt32 XclEscherEx::GetDffFragmentPos( sal_uInt32 nFragmentKey )
{
- aOffsetMap.Insert( (void*) GetStreamPos(), LIST_APPEND );
- return aOffsetMap.Count() - 1;
+ /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
+ is non-const due to tools/List usage. */
+ return GetPersistOffset( nFragmentKey );
}
+sal_uInt32 XclEscherEx::GetDffFragmentSize( sal_uInt32 nFragmentKey )
+{
+ /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
+ is non-const due to tools/List usage. */
+ return GetDffFragmentPos( nFragmentKey + 1 ) - GetDffFragmentPos( nFragmentKey );
+}
-void XclEscherEx::ReplaceCurrentOffsetInMap( ULONG nPos )
+bool XclEscherEx::HasPendingDffData()
{
- aOffsetMap.Replace( (void*) GetStreamPos(), nPos );
+ /* TODO: this function is non-const because PersistTable::PtGetOffsetByID()
+ is non-const due to tools/List usage. */
+ return GetDffFragmentPos( mnNextKey ) < GetStreamPos();
}
-sal_Bool ImplXclEscherExIsFontwork( const SdrObject* pObj )
+XclExpDffAnchorBase* XclEscherEx::CreateDffAnchor( const SdrObject& rSdrObj ) const
{
- const rtl::OUString sTextPath( RTL_CONSTASCII_USTRINGPARAM ( "TextPath" ) );
+ // the object manager creates the correct anchor type according to context
+ XclExpDffAnchorBase* pAnchor = mrObjMgr.CreateDffAnchor();
+ // pass the drawing object, that will calculate the anchor position
+ pAnchor->SetSdrObject( rSdrObj );
+ return pAnchor;
+}
- sal_Bool bIsFontwork = sal_False;
- if ( pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE )
+namespace {
+
+bool lcl_IsFontwork( const SdrObject* pObj )
+{
+ bool bIsFontwork = false;
+ if( pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE )
{
+ const OUString aTextPath = CREATE_OUSTRING( "TextPath" );
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)
pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
-
- com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
- if ( pAny )
+ if( Any* pAny = rGeometryItem.GetPropertyValueByName( aTextPath, aTextPath ) )
*pAny >>= bIsFontwork;
}
return bIsFontwork;
}
-EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Reference<
- com::sun::star::drawing::XShape >& rShape )
+} // namespace
+
+EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape, const Rectangle* pChildAnchor )
{
if ( nAdditionalText )
nAdditionalText++;
@@ -185,17 +200,17 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
if ( bInGroup )
{ // stacked recursive group object
if ( !pCurrAppData->IsStackedGroup() )
- { //! UpdateStopPos only once
+ { //! UpdateDffFragmentEnd only once
pCurrAppData->SetStackedGroup( TRUE );
- pCurrXclObj->UpdateStopPos();
+ UpdateDffFragmentEnd();
}
}
aStack.Push( pCurrXclObj );
aStack.Push( pCurrAppData );
pCurrAppData = new XclEscherHostAppData;
- SdrObject* pObj = GetSdrObjectFromXShape( rShape );
+ SdrObject* pObj = GetSdrObjectFromXShape( rxShape );
if ( !pObj )
- pCurrXclObj = new XclObjAny( GetRoot() ); // just what is it?!?
+ pCurrXclObj = new XclObjAny( mrObjMgr ); // just what is it?!?
else
{
pCurrXclObj = NULL;
@@ -203,38 +218,50 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
if( nObjType == OBJ_OLE2 )
{
- //! not-const because GetObjRef may load the OLE object
- Reference < XClassifiedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), UNO_QUERY );
- if ( xObj.is() )
+ // no OLE objects in embedded drawings (chart shapes)
+ if( mbIsRootDff )
{
- SvGlobalName aObjClsId( xObj->getClassID() );
- if ( SotExchange::IsChart( aObjClsId ) )
- { // yes, it's a chart diagram
- GetOldRoot().pObjRecs->Add( new XclExpChartObj( GetRoot(), rShape ) );
- pCurrXclObj = NULL; // no metafile or whatsoever
+ //! not-const because GetObjRef may load the OLE object
+ Reference < XClassifiedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), UNO_QUERY );
+ if ( xObj.is() )
+ {
+ SvGlobalName aObjClsId( xObj->getClassID() );
+ if ( SotExchange::IsChart( aObjClsId ) )
+ { // yes, it's a chart diagram
+ mrObjMgr.AddObj( new XclExpChartObj( mrObjMgr, rxShape, pChildAnchor ) );
+ pCurrXclObj = NULL; // no metafile or whatsoever
+ }
+ else // metafile and OLE object
+ pCurrXclObj = new XclObjOle( mrObjMgr, *pObj );
}
- else // metafile and OLE object
- pCurrXclObj = new XclObjOle( GetRoot(), *pObj );
+ else // just a metafile
+ pCurrXclObj = new XclObjAny( mrObjMgr );
}
- else // just a metafile
- pCurrXclObj = new XclObjAny( GetRoot() );
+ else
+ pCurrXclObj = new XclObjAny( mrObjMgr );
}
else if( nObjType == OBJ_UNO )
{
- pCurrXclObj = CreateCtrlObj( rShape );
+#if EXC_EXP_OCX_CTRL
+ // no ActiveX controls in embedded drawings (chart shapes)
+ if( mbIsRootDff )
+ pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
+#else
+ pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
+#endif
if( !pCurrXclObj )
- pCurrXclObj = new XclObjAny( GetRoot() ); // just a metafile
+ pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
}
else if( !ScDrawLayer::IsNoteCaption( pObj ) )
{
// #107540# ignore permanent note shapes
// #i12190# do not ignore callouts (do not filter by object type ID)
- pCurrXclObj = new XclObjAny( GetRoot() ); // just a metafile
+ pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
}
}
if ( pCurrXclObj )
{
- if ( !GetOldRoot().pObjRecs->Add( pCurrXclObj ) )
+ if ( !mrObjMgr.AddObj( pCurrXclObj ) )
{ // maximum count reached, object got deleted
pCurrXclObj = NULL;
}
@@ -247,14 +274,15 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
{
if ( !bInGroup )
{
- /* Create a dummy anchor carrying the flags. Real coordinates are
- calculated later in WriteData(EscherEx&,const Rectangle&). */
- XclExpDffAnchor* pAnchor = new XclExpDffAnchor( GetRoot() );
+ /* Create a dummy anchor carrying the flags. Real
+ coordinates are calculated later in virtual call of
+ WriteData(EscherEx&,const Rectangle&). */
+ XclExpDffAnchorBase* pAnchor = mrObjMgr.CreateDffAnchor();
pAnchor->SetFlags( *pObj );
pCurrAppData->SetClientAnchor( pAnchor );
}
const SdrTextObj* pTextObj = PTR_CAST( SdrTextObj, pObj );
- if ( pTextObj && !ImplXclEscherExIsFontwork( pTextObj ) && ( pObj->GetObjIdentifier() != OBJ_CAPTION ) )
+ if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != OBJ_CAPTION) )
{
const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
if( pParaObj )
@@ -265,7 +293,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const com::sun::star::uno::Referen
else
{
if ( !bInGroup )
- pCurrAppData->SetClientAnchor( new XclExpDffAnchor( GetRoot() ) );
+ pCurrAppData->SetClientAnchor( mrObjMgr.CreateDffAnchor() );
}
}
else if ( nAdditionalText == 3 )
@@ -295,13 +323,10 @@ void XclEscherEx::EndShape( UINT16 nShapeType, UINT32 nShapeID )
// escher data of last shape not written? -> delete it from object list
if( nShapeID == 0 )
{
- XclObj* pLastObj = static_cast< XclObj* >( GetOldRoot().pObjRecs->Last() );
+ XclObj* pLastObj = mrObjMgr.RemoveLastObj();
DBG_ASSERT( pLastObj == pCurrXclObj, "XclEscherEx::EndShape - wrong object" );
- if ( pLastObj == pCurrXclObj )
- {
- GetOldRoot().pObjRecs->Remove();
- DELETEZ( pCurrXclObj );
- }
+ DELETEZ( pLastObj );
+ pCurrXclObj = 0;
}
if( pCurrXclObj )
@@ -312,7 +337,7 @@ void XclEscherEx::EndShape( UINT16 nShapeType, UINT32 nShapeID )
else
{
pCurrXclObj->SetEscherShapeType( nShapeType );
- pCurrXclObj->UpdateStopPos();
+ UpdateDffFragmentEnd();
}
}
}
@@ -335,26 +360,18 @@ EscherExHostAppData* XclEscherEx::EnterAdditionalTextGroup()
}
-void XclEscherEx::DeleteCurrAppData()
-{
- if ( pCurrAppData )
- {
- delete pCurrAppData->GetClientAnchor();
-// delete pCurrAppData->GetClientData();
- delete pCurrAppData->GetClientTextbox();
- delete pCurrAppData;
- }
-}
-
-
void XclEscherEx::EndDocument()
{
- Flush( pPicStrm );
+ if( mbIsRootDff )
+ Flush( static_cast< XclEscherExGlobal& >( *mxGlobal ).GetPictureStream() );
+
+ // seek back DFF stream to prepare saving the MSODRAWING[GROUP] records
+ mpOutStrm->Seek( 0 );
}
#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
+XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
@@ -375,7 +392,7 @@ XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart );
// adjust the class name to "Forms.***.1"
aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" );
- xOcxCtrl.reset( new XclExpOcxControlObj( GetRoot(), xShape, aClassName, nStrmStart, nStrmSize ) );
+ xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pChildAnchor, aClassName, nStrmStart, nStrmSize ) );
}
}
}
@@ -384,9 +401,9 @@ XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
#else
-XclExpTbxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape )
+XclExpTbxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const Rectangle* pChildAnchor )
{
- ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( GetRoot(), xShape ) );
+ ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
xTbxCtrl.reset();
@@ -454,98 +471,17 @@ void XclEscherEx::ConvertTbxMacro( XclExpTbxControlObj& rTbxCtrlObj, Reference<
#endif
-// --- class XclEscher -----------------------------------------------
-
-XclEscher::XclEscher( const XclExpRoot& rRoot, UINT32 nDrawings ) :
- XclExpRoot( rRoot )
-{
- pTempFile = new utl::TempFile;
- pTempFile->EnableKillingFile();
- pStrm = utl::UcbStreamHelper::CreateStream( pTempFile->GetURL(), STREAM_STD_READWRITE );
- pStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- pEx = new XclEscherEx( rRoot, *pStrm, nDrawings );
-}
-
-
-XclEscher::~XclEscher()
-{
- delete pEx;
- delete pStrm;
- delete pTempFile;
-}
-
-
-void XclEscher::AddSdrPage()
-{
- if( SdrPage* pPage = GetSdrPage( GetCurrScTab() ) )
- pEx->AddSdrPage( *pPage );
- // #106213# the first dummy object may still be open
- DBG_ASSERT( pEx->GetGroupLevel() <= 1, "XclEscher::AddSdrPage - still groups open?" );
- while( pEx->GetGroupLevel() )
- pEx->LeaveGroup();
-}
-
-
-// Escher client anchor =======================================================
-
-XclExpDffAnchor::XclExpDffAnchor( const XclExpRoot& rRoot, sal_uInt16 nFlags ) :
- XclExpRoot( rRoot ),
- maAnchor( rRoot.GetCurrScTab() ),
- mnFlags( nFlags )
-{
-}
-
-XclExpDffAnchor::XclExpDffAnchor( const XclExpRoot& rRoot, const SdrObject& rSdrObj ) :
- XclExpRoot( rRoot ),
- maAnchor( rRoot.GetCurrScTab() )
-{
- SetFlags( rSdrObj );
- maAnchor.SetRect( GetDoc(), rSdrObj.GetCurrentBoundRect(), MAP_100TH_MM );
-}
-
-void XclExpDffAnchor::SetFlags( const SdrObject& rSdrObj )
-{
- // Special case "page anchor" (X==0,Y==1) -> lock pos and size.
- const Point& rPos = rSdrObj.GetAnchorPos();
- mnFlags = ((rPos.X() == 0) && (rPos.Y() == 1)) ? EXC_ESC_ANCHOR_LOCKED : 0;
-}
-
-void XclExpDffAnchor::WriteData( EscherEx& rEx, const Rectangle& rRect )
-{
- // the rectangle is already in twips
- maAnchor.SetRect( GetDoc(), rRect, MAP_TWIP );
- WriteData( rEx );
-}
-
-
-void XclExpDffAnchor::WriteData( EscherEx& rEx ) const
-{
- rEx.AddAtom( 18, ESCHER_ClientAnchor );
- rEx.GetStream() << mnFlags << maAnchor;
-}
-
-
-// ----------------------------------------------------------------------------
-
-XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const Rectangle& rRect ) :
- XclExpDffAnchor( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
-{
- maAnchor.SetRect( GetDoc(), rRect, MAP_100TH_MM );
-}
-
-
-// ----------------------------------------------------------------------------
-
-XclExpDffDropDownAnchor::XclExpDffDropDownAnchor( const XclExpRoot& rRoot, const ScAddress& rScPos ) :
- XclExpDffAnchor( rRoot, EXC_ESC_ANCHOR_POSLOCKED )
+void XclEscherEx::DeleteCurrAppData()
{
- GetAddressConverter().ConvertAddress( maAnchor.maFirst, rScPos, true );
- maAnchor.maLast.mnCol = maAnchor.maFirst.mnCol + 1;
- maAnchor.maLast.mnRow = maAnchor.maFirst.mnRow + 1;
- maAnchor.mnLX = maAnchor.mnTY = maAnchor.mnRX = maAnchor.mnBY = 0;
+ if ( pCurrAppData )
+ {
+ delete pCurrAppData->GetClientAnchor();
+// delete pCurrAppData->GetClientData();
+ delete pCurrAppData->GetClientTextbox();
+ delete pCurrAppData;
+ }
}
-
// ============================================================================
// --- class XclEscherClientData -------------------------------------
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index e4c4443ea56e..67a295ccec8b 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -49,6 +49,7 @@
#include "xcl97esc.hxx"
#include "editutil.hxx"
#include "xecontent.hxx"
+#include "xeescher.hxx"
#include "xestyle.hxx"
#include "xelink.hxx"
@@ -86,158 +87,22 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::drawing::XShape;
+// ============================================================================
-//___________________________________________________________________
-
-// --- class XclMsodrawing_Base --------------------------------------
-
-XclMsodrawing_Base::XclMsodrawing_Base( XclEscher& rEscher, sal_Size nInitialSize )
- :
- pEscher( &rEscher ),
- nStartPos( rEscher.GetEx()->GetLastOffsetMapPos() )
-{
- // for safety's sake add this now
- nStopPos = GetEscherEx()->AddCurrentOffsetToMap();
- (void)nInitialSize; // avoid compiler warning
- DBG_ASSERT( GetDataLen() == nInitialSize, "XclMsodrawing_Base ctor: do I really own that data?" );
-}
-
-
-XclMsodrawing_Base::~XclMsodrawing_Base()
-{
-}
-
-
-void XclMsodrawing_Base::UpdateStopPos()
-{
- if ( nStopPos > 0 )
- GetEscherEx()->ReplaceCurrentOffsetInMap( nStopPos );
- else
- nStopPos = GetEscherEx()->AddCurrentOffsetToMap();
-}
-
-
-sal_Size XclMsodrawing_Base::GetDataLen() const
-{
- if ( nStartPos < nStopPos )
- {
- XclEscherEx* pEx = GetEscherEx();
- return pEx->GetOffsetFromMap( nStopPos ) - pEx->GetOffsetFromMap( nStartPos );
- }
- DBG_ERRORFILE( "XclMsodrawing_Base::GetDataLen: position mismatch" );
- return 0;
-}
-
-
-
-// --- class XclMsodrawinggroup --------------------------------------
-
-XclMsodrawinggroup::XclMsodrawinggroup( RootData& rRoot, UINT16 nEscherType ) :
- XclMsodrawing_Base( *rRoot.pEscher ),
- XclExpRecord(0x00EB, 2) // bogus record size since we don't know the actual size yet.
-{
- if ( nEscherType )
- {
- XclEscherEx* pEx = GetEscherEx();
- SvStream& rOut = pEx->GetStream();
- switch ( nEscherType )
- {
- case ESCHER_DggContainer :
- { // per-document data
- pEx->OpenContainer( nEscherType );
-//2do: stuff it with our own document defaults?
-#if 0
- pEx->BeginCount();
- pEx->AddOpt( ... );
- pEx->EndCount( ESCHER_OPT, 3 );
-#else
- BYTE pDummyOPT[] = {
- 0xBF, 0x00, 0x08, 0x00, 0x08, 0x00, 0x81, 0x01,
- 0x09, 0x00, 0x00, 0x08, 0xC0, 0x01, 0x40, 0x00,
- 0x00, 0x08
- };
- pEx->AddAtom( sizeof(pDummyOPT), ESCHER_OPT, 3, 3 );
- rOut.Write( pDummyOPT, sizeof(pDummyOPT) );
-#endif
- BYTE pDummySplitMenuColors[] = {
- 0x0D, 0x00, 0x00, 0x08, 0x0C, 0x00, 0x00, 0x08,
- 0x17, 0x00, 0x00, 0x08, 0xF7, 0x00, 0x00, 0x10
- };
- pEx->AddAtom( sizeof(pDummySplitMenuColors), ESCHER_SplitMenuColors, 0, 4 );
- rOut.Write( pDummySplitMenuColors, sizeof(pDummySplitMenuColors) );
- pEx->CloseContainer(); // ESCHER_DggContainer
- }
- break;
- }
- UpdateStopPos();
- }
-}
-
-
-XclMsodrawinggroup::~XclMsodrawinggroup()
-{
-}
-
-
-void XclMsodrawinggroup::WriteBody( XclExpStream& rStrm )
-{
- DBG_ASSERT( GetEscherEx()->GetStreamPos() == GetEscherEx()->GetOffsetFromMap( nStartPos ),
- "XclMsodrawinggroup::SaveCont: Escher stream position mismatch" );
- rStrm.CopyFromStream( pEscher->GetStrm(), GetDataLen() );
-}
-
-
-// --- class XclMsodrawing --------------------------------------
-
-XclMsodrawing::XclMsodrawing( const XclExpRoot& rRoot, UINT16 nEscherType, sal_Size nInitialSize ) :
- XclMsodrawing_Base( *rRoot.GetOldRoot().pEscher, nInitialSize ),
- XclExpRecord( 0x00EC, nInitialSize )
-{
- if ( nEscherType )
- {
- XclEscherEx* pEx = GetEscherEx();
- switch ( nEscherType )
- {
- case ESCHER_DgContainer :
- { // per-sheet data
- pEx->OpenContainer( nEscherType );
- // open group shape container
- Rectangle aRect( 0, 0, 0, 0 );
- pEx->EnterGroup( &aRect );
- }
- break;
- }
- UpdateStopPos();
- }
-}
-
-
-XclMsodrawing::~XclMsodrawing()
-{
-}
-
-
-void XclMsodrawing::WriteBody( XclExpStream& rStrm )
-{
- DBG_ASSERT( GetEscherEx()->GetStreamPos() == GetEscherEx()->GetOffsetFromMap( nStartPos ),
- "XclMsodrawing::SaveCont: Escher stream position mismatch" );
- rStrm.CopyFromStream( pEscher->GetStrm(), GetDataLen() );
-}
-
-
-
-
-// --- class XclObjList ----------------------------------------------
-
-XclObjList::XclObjList( const XclExpRoot& rRoot ) :
+XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx ) :
XclExpRoot( rRoot ),
- pMsodrawingPerSheet( new XclMsodrawing( rRoot, ESCHER_DgContainer ) ),
- pSolverContainer( NULL )
+ mrEscherEx( rEscherEx ),
+ pSolverContainer( 0 )
{
+ pMsodrawingPerSheet = new XclExpMsoDrawing( rEscherEx );
+ // open the DGCONTAINER and the patriarch group shape
+ mrEscherEx.OpenContainer( ESCHER_DgContainer );
+ Rectangle aRect( 0, 0, 0, 0 );
+ mrEscherEx.EnterGroup( &aRect );
+ mrEscherEx.UpdateDffFragmentEnd();
}
-
-XclObjList::~XclObjList()
+XclExpObjList::~XclExpObjList()
{
for ( XclObj* p = First(); p; p = Next() )
delete p;
@@ -245,10 +110,9 @@ XclObjList::~XclObjList()
delete pSolverContainer;
}
-
-UINT16 XclObjList::Add( XclObj* pObj )
+UINT16 XclExpObjList::Add( XclObj* pObj )
{
- DBG_ASSERT( Count() < 0xFFFF, "XclObjList::Add: too much for Xcl" );
+ DBG_ASSERT( Count() < 0xFFFF, "XclExpObjList::Add: too much for Xcl" );
if ( Count() < 0xFFFF )
{
Insert( pObj, LIST_APPEND );
@@ -263,22 +127,17 @@ UINT16 XclObjList::Add( XclObj* pObj )
}
}
-
-void XclObjList::EndSheet()
+void XclExpObjList::EndSheet()
{
- XclEscherEx* pEx = pMsodrawingPerSheet->GetEscherEx();
-
// Is there still something in the stream? -> The solver container
- sal_Size nSolverSize = pEx->GetStreamPos() - pEx->GetOffsetFromMap( pEx->GetLastOffsetMapPos() );
- if( nSolverSize > 0 )
- pSolverContainer = new XclMsodrawing( GetRoot(), ESCHER_SolverContainer, nSolverSize );
+ if( mrEscherEx.HasPendingDffData() )
+ pSolverContainer = new XclExpMsoDrawing( mrEscherEx );
- //! close ESCHER_DgContainer created by XclObjList ctor MSODRAWING
- pEx->CloseContainer();
+ // close the DGCONTAINER created by XclExpObjList ctor MSODRAWING
+ mrEscherEx.CloseContainer();
}
-
-void XclObjList::Save( XclExpStream& rStrm )
+void XclExpObjList::Save( XclExpStream& rStrm )
{
//! Escher must be written, even if there are no objects
pMsodrawingPerSheet->Save( rStrm );
@@ -290,28 +149,26 @@ void XclObjList::Save( XclExpStream& rStrm )
pSolverContainer->Save( rStrm );
}
-
-
// --- class XclObj --------------------------------------------------
-XclObj::XclObj( const XclExpRoot& rRoot, sal_uInt16 nObjType, bool bOwnEscher ) :
+XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) :
XclExpRecord( EXC_ID_OBJ, 26 ),
+ mrEscherEx( rObjMgr.GetEscherEx() ),
pClientTextbox( NULL ),
pTxo( NULL ),
mnObjType( nObjType ),
nObjId(0),
nGrbit( 0x6011 ), // AutoLine, AutoFill, Printable, Locked
- bFirstOnSheet( rRoot.GetOldRoot().pObjRecs->Count() == 0 ),
+ bFirstOnSheet( !rObjMgr.HasObj() ),
mbOwnEscher( bOwnEscher )
{
//! first object continues the first MSODRAWING record
if ( bFirstOnSheet )
- pMsodrawing = rRoot.GetOldRoot().pObjRecs->GetMsodrawingPerSheet();
+ pMsodrawing = rObjMgr.GetMsodrawingPerSheet();
else
- pMsodrawing = new XclMsodrawing( rRoot );
+ pMsodrawing = new XclExpMsoDrawing( mrEscherEx );
}
-
XclObj::~XclObj()
{
if ( !bFirstOnSheet )
@@ -320,6 +177,18 @@ XclObj::~XclObj()
delete pTxo;
}
+void XclObj::ImplWriteAnchor( const XclExpRoot& /*rRoot*/, const SdrObject* pSdrObj, const Rectangle* pChildAnchor )
+{
+ if( pChildAnchor )
+ {
+ mrEscherEx.AddChildAnchor( *pChildAnchor );
+ }
+ else if( pSdrObj )
+ {
+ ::std::auto_ptr< XclExpDffAnchorBase > xDffAnchor( mrEscherEx.CreateDffAnchor( *pSdrObj ) );
+ xDffAnchor->WriteDffData( mrEscherEx );
+ }
+}
void XclObj::SetEscherShapeType( UINT16 nType )
{
@@ -350,21 +219,19 @@ void XclObj::SetEscherShapeType( UINT16 nType )
}
}
-
void XclObj::SetText( const XclExpRoot& rRoot, const SdrTextObj& rObj )
{
DBG_ASSERT( !pClientTextbox, "XclObj::SetText: already set" );
if ( !pClientTextbox )
{
- pMsodrawing->UpdateStopPos();
- pClientTextbox = new XclMsodrawing( rRoot );
- pClientTextbox->GetEscherEx()->AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
- pClientTextbox->UpdateStopPos();
+ mrEscherEx.UpdateDffFragmentEnd();
+ pClientTextbox = new XclExpMsoDrawing( mrEscherEx );
+ mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
+ mrEscherEx.UpdateDffFragmentEnd();
pTxo = new XclTxo( rRoot, rObj );
}
}
-
void XclObj::WriteBody( XclExpStream& rStrm )
{
DBG_ASSERT( mnObjType != EXC_OBJTYPE_UNKNOWN, "XclObj::WriteBody - unknown type" );
@@ -392,7 +259,6 @@ void XclObj::WriteBody( XclExpStream& rStrm )
rStrm.CopyFromStream( aMemStrm );
}
-
void XclObj::Save( XclExpStream& rStrm )
{
// MSODRAWING record (msofbtSpContainer)
@@ -406,7 +272,6 @@ void XclObj::Save( XclExpStream& rStrm )
SaveTextRecs( rStrm );
}
-
void XclObj::WriteSubRecs( XclExpStream& /*rStrm*/ )
{
}
@@ -421,17 +286,14 @@ void XclObj::SaveTextRecs( XclExpStream& rStrm )
pTxo->Save( rStrm );
}
-
// --- class XclObjComment -------------------------------------------
-
-XclObjComment::XclObjComment( const XclExpRoot& rRoot, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible )
- :
- XclObj( rRoot, EXC_OBJTYPE_NOTE, true )
+XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true )
{
- ProcessEscherObj(rRoot, rRect, pCaption, bVisible);
+ ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible);
// TXO
- pTxo = new XclTxo( rRoot, rEditObj, pCaption );
+ pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption );
}
void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible )
@@ -482,66 +344,62 @@ void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle&
}
nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked
- XclEscherEx* pEx = pMsodrawing->GetEscherEx();
- pEx->OpenContainer( ESCHER_SpContainer );
- pEx->AddShape( ESCHER_ShpInst_TextBox, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.OpenContainer( ESCHER_SpContainer );
+ mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
sal_uInt32 nFlags = 0x000A0000;
::set_flag( nFlags, sal_uInt32(2), !bVisible );
aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
- aPropOpt.Commit( pEx->GetStream() );
+ aPropOpt.Commit( mrEscherEx.GetStream() );
- XclExpDffNoteAnchor( rRoot, rRect ).WriteData( *pEx);
+ XclExpDffNoteAnchor( rRoot, rRect ).WriteDffData( mrEscherEx );
+
+ mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
+ mrEscherEx.UpdateDffFragmentEnd();
- pEx->AddAtom( 0, ESCHER_ClientData ); // OBJ record
- pMsodrawing->UpdateStopPos();
//! Be sure to construct the MSODRAWING ClientTextbox record _after_ the
//! base OBJ's MSODRAWING record Escher data is completed.
- pClientTextbox = new XclMsodrawing( rRoot );
- pClientTextbox->GetEscherEx()->AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
- pClientTextbox->UpdateStopPos();
- pEx->CloseContainer(); // ESCHER_SpContainer
+ pClientTextbox = new XclExpMsoDrawing( mrEscherEx );
+ mrEscherEx.AddAtom( 0, ESCHER_ClientTextbox ); // TXO record
+ mrEscherEx.UpdateDffFragmentEnd();
+ mrEscherEx.CloseContainer(); // ESCHER_SpContainer
}
-
XclObjComment::~XclObjComment()
{
}
-
void XclObjComment::Save( XclExpStream& rStrm )
{
// content of this record
XclObj::Save( rStrm );
}
-
// --- class XclObjDropDown ------------------------------------------
-XclObjDropDown::XclObjDropDown( const XclExpRoot& rRoot, const ScAddress& rPos, BOOL bFilt ) :
- XclObj( rRoot, EXC_OBJTYPE_DROPDOWN, true ),
- bIsFiltered( bFilt )
+XclObjDropDown::XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& rPos, BOOL bFilt ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_DROPDOWN, true ),
+ bIsFiltered( bFilt )
{
SetLocked( TRUE );
SetPrintable( FALSE );
SetAutoFill( TRUE );
SetAutoLine( FALSE );
nGrbit |= 0x0100; // undocumented
- XclEscherEx* pEx = pMsodrawing->GetEscherEx();
- pEx->OpenContainer( ESCHER_SpContainer );
- pEx->AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
+ mrEscherEx.OpenContainer( ESCHER_SpContainer );
+ mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT );
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01040104 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00010000 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080000 ); // bool field
aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x000A0000 ); // bool field
- aPropOpt.Commit( pEx->GetStream() );
+ aPropOpt.Commit( mrEscherEx.GetStream() );
- XclExpDffDropDownAnchor( rRoot, rPos ).WriteData( *pEx );
+ XclExpDffDropDownAnchor( rObjMgr.GetRoot(), rPos ).WriteDffData( mrEscherEx );
- pEx->AddAtom( 0, ESCHER_ClientData ); // OBJ record
- pMsodrawing->UpdateStopPos();
- pEx->CloseContainer(); // ESCHER_SpContainer
+ mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
+ mrEscherEx.UpdateDffFragmentEnd();
+ mrEscherEx.CloseContainer(); // ESCHER_SpContainer
// old size + ftSbs + ftLbsData
AddRecSize( 24 + 20 );
@@ -568,7 +426,6 @@ void XclObjDropDown::WriteSubRecs( XclExpStream& rStrm )
rStrm.EndRecord();
}
-
// --- class XclTxo --------------------------------------------------
sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet )
@@ -725,22 +582,19 @@ sal_Size XclTxo::GetLen() const
return 18;
}
-
// --- class XclObjOle -------------------------------------------
-XclObjOle::XclObjOle( const XclExpRoot& rRoot, const SdrObject& rObj ) :
- XclObj( rRoot, EXC_OBJTYPE_PICTURE ),
+XclObjOle::XclObjOle( XclExpObjectManager& rObjMgr, const SdrObject& rObj ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_PICTURE ),
rOleObj( rObj ),
- pRootStorage( rRoot.GetRootStorage() )
+ pRootStorage( rObjMgr.GetRoot().GetRootStorage() )
{
}
-
XclObjOle::~XclObjOle()
{
}
-
void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
{
// write only as embedded, not linked
@@ -810,18 +664,16 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
}
}
-
void XclObjOle::Save( XclExpStream& rStrm )
{
// content of this record
XclObj::Save( rStrm );
}
-
// --- class XclObjAny -------------------------------------------
-XclObjAny::XclObjAny( const XclExpRoot& rRoot ) :
- XclObj( rRoot, EXC_OBJTYPE_UNKNOWN )
+XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr ) :
+ XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN )
{
}
@@ -846,7 +698,6 @@ void XclObjAny::Save( XclExpStream& rStrm )
XclObj::Save( rStrm );
}
-
// --- class ExcBof8_Base --------------------------------------------
ExcBof8_Base::ExcBof8_Base()
diff --git a/scp2/macros/macro.pl b/scp2/macros/macro.pl
index 4f44da084a69..d9d1420bdc73 100644
--- a/scp2/macros/macro.pl
+++ b/scp2/macros/macro.pl
@@ -60,6 +60,7 @@ write_DIR_ISOLANGUAGE_ALL_LANG();
write_DIR_ISOLANGUAGE_ALL_LANG_LPROJ();
write_DIR_IDENT_ALL_LANG();
write_EXTRA_ALL_LANG();
+write_EXTRA_ALL_LANG_BUT_EN_US();
write_EXTRA_ALL_GOOD_HELP_LOCALIZATIONS_LANG();
write_EXTRA_IDENT_ALL_LANG();
write_RESFILE_ALL_LANG();
@@ -134,14 +135,29 @@ sub write_DIR_IDENT_ALL_LANG
sub write_EXTRA_ALL_LANG
{
- print OUTFILE "#define EXTRA_ALL_LANG(name) ";
+ print OUTFILE "#define EXTRA_ALL_LANG(name,ext) ";
foreach $lang (@completelangiso) {
- print OUTFILE "\\\n\tName ($lang) = EXTRAFILENAME(name,_$lang)";
+ print OUTFILE "\\\n\tName ($lang) = CONFIGLANGFILENAME(name,_$lang,ext)";
print OUTFILE "; " if ( $lang ne $completelangiso[$#completelangiso]);
}
print OUTFILE "\n\n";
}
+sub write_EXTRA_ALL_LANG_BUT_EN_US
+{
+ print OUTFILE "#define EXTRA_ALL_LANG_BUT_EN_US(name,ext) ";
+ my $first = 1;
+ foreach $lang (@completelangiso) {
+ if ($lang ne "en-US") {
+ print OUTFILE "; " unless $first;
+ $first = 0;
+ print OUTFILE
+ "\\\n\tName ($lang) = CONFIGLANGFILENAME(name,_$lang,ext)";
+ }
+ }
+ print OUTFILE "\n\n";
+}
+
sub write_EXTRA_ALL_GOOD_HELP_LOCALIZATIONS_LANG
{
my $first = 1;
diff --git a/scp2/source/base/file_base.scp b/scp2/source/base/file_base.scp
index 9edecfdd536a..3d209912479c 100644
--- a/scp2/source/base/file_base.scp
+++ b/scp2/source/base/file_base.scp
@@ -79,38 +79,9 @@ File gid_File_Help_Sdatabase_Zip
Patchfiles = ();
End
-File gid_File_Registry_Spool_Oo_Setup_Base_Xcu
+File gid_File_Share_Registry_Base_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-base.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "base.xcd";
End
-
-File gid_File_Registry_Spool_Oo_Common_Base_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-base.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Database_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_database_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Database_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_database_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Database_Others_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Misc;
- Name = "/registry/spool/fcfg_database_others.xcu";
-End
-
diff --git a/scp2/source/base/module_base.scp b/scp2/source/base/module_base.scp
index b620b49beab1..dc4d76fcf5d1 100644
--- a/scp2/source/base/module_base.scp
+++ b/scp2/source/base/module_base.scp
@@ -43,10 +43,7 @@ Module gid_Module_Prg_Base_Bin
Default = YES;
Styles = (HIDDEN_ROOT);
Files = (
- gid_File_Registry_Spool_Oo_Setup_Base_Xcu,gid_File_Registry_Spool_Oo_Common_Base_Xcu
- ,gid_File_Registry_Spool_Oo_TypeDetection_Database_Types_Xcu
- ,gid_File_Registry_Spool_Oo_TypeDetection_Database_Filters_Xcu
- ,gid_File_Registry_Spool_Oo_TypeDetection_Database_Others_Xcu
+ gid_File_Share_Registry_Base_Xcd
,gid_File_Lib_Abp
,gid_File_Lib_Dbp
,gid_File_Lib_Dbu
diff --git a/scp2/source/binfilter/file_binfilter.scp b/scp2/source/binfilter/file_binfilter.scp
index d4f89e589d8f..be66b907a25d 100644
--- a/scp2/source/binfilter/file_binfilter.scp
+++ b/scp2/source/binfilter/file_binfilter.scp
@@ -28,127 +28,13 @@
#include "macros.inc"
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Chart_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_chart_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Chart_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_chart_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Calc_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_calc_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Calc_Bf_Filters_Xcu
+File gid_File_Share_Registry_Binfilter_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_calc_bf_filters.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "binfilter.xcd";
End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Draw_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_draw_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Draw_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_draw_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Global_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_global_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Global_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_global_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Impress_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_impress_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Impress_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_impress_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Math_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_math_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Math_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_math_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Web_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_web_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Web_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_web_bf_filters.xcu";
-End
-
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Writer_Bf_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_writer_bf_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Writer_Bf_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_writer_bf_filters.xcu";
-End
-
-
File gid_Starregistry_Legacy_Binfilters_Rdb
TXT_FILE_BODY;
Name = "legacy_binfilters.rdb";
diff --git a/scp2/source/binfilter/module_binfilter.scp b/scp2/source/binfilter/module_binfilter.scp
index 8200b4575495..d7cba78f6101 100644
--- a/scp2/source/binfilter/module_binfilter.scp
+++ b/scp2/source/binfilter/module_binfilter.scp
@@ -34,22 +34,7 @@ Module gid_Module_Optional_Binfilter
InstallOrder = "1100";
ParentID = gid_Module_Optional;
Default = YES;
- Files = (gid_File_Registry_Spool_Oo_TypeDetection_Chart_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Chart_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Calc_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Calc_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Draw_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Draw_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Global_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Global_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Impress_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Impress_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Math_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Math_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Web_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Web_Bf_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Writer_Bf_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Writer_Bf_Filters_Xcu,
+ Files = (gid_File_Share_Registry_Binfilter_Xcd,
gid_Starregistry_Legacy_Binfilters_Rdb,
gid_File_Lib_Bf_Go,
gid_File_Lib_Bf_Sch,
diff --git a/scp2/source/calc/file_calc.scp b/scp2/source/calc/file_calc.scp
index 173a3a358863..7b392f173378 100644
--- a/scp2/source/calc/file_calc.scp
+++ b/scp2/source/calc/file_calc.scp
@@ -38,12 +38,13 @@ End
STD_UNO_LIB_FILE( gid_File_Lib_Analysis, analysis)
-File gid_File_Oo_Office_Dataaccess_Calc_Xcu
+File gid_File_Share_Registry_Calc_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/calc.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "calc.xcd";
End
+
STD_UNO_LIB_FILE( gid_File_Lib_Calc, calc)
STD_UNO_LIB_FILE( gid_File_Lib_Date, date)
@@ -64,13 +65,6 @@ STD_RES_FILE( gid_File_Res_Date, date)
STD_RES_FILE( gid_File_Res_Sc, sc )
-File gid_File_Registry_Spool_Oo_Office_Embedding_Calc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-calc.xcu";
-End
-
File gid_File_Help_Scalc_Zip
Dir = gid_Dir_Help_Isolanguage;
ARCHIVE_TXT_FILE_BODY;
@@ -87,69 +81,6 @@ File gid_File_Share_Config_Sofficecfg_Calc_Menubar_Xml
Name = "/uiconfig/scalc/menubar/menubar.xml";
End
*/
-File gid_File_Oo_Office_Ui_Calccommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/CalcCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Calccommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/CalcCommands.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Calc_UISort_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort;
- Name = "/registry/spool/org/openoffice/TypeDetection/UISort-calc.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Calc_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_calc_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Calc_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_calc_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Common_Calc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-calc.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Setup_Calc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-calc.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Calcwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/CalcWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Calcwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/CalcWindowState.xcu";
-End
-
File gid_File_Exe_Scalc
BIN_FILE_BODY;
Dir = gid_Brand_Dir_Program;
diff --git a/scp2/source/calc/module_calc.scp b/scp2/source/calc/module_calc.scp
index bbb61d1fc241..84ab326814ee 100644
--- a/scp2/source/calc/module_calc.scp
+++ b/scp2/source/calc/module_calc.scp
@@ -42,11 +42,9 @@ Module gid_Module_Prg_Calc_Bin
Minimal = YES;
Default = YES;
Styles = (HIDDEN_ROOT);
- Files = (gid_File_Oo_Office_Dataaccess_Calc_Xcu,gid_File_Lib_Calc,gid_File_Lib_Sc,gid_File_Lib_Scui,gid_File_Lib_Scfilt,gid_File_Lib_Scd,gid_File_Extra_Urldesktop_Calc,gid_File_Extra_Urlnew_Calc,gid_File_Extra_Urlstart_Calc,gid_File_Extra_Urltasks_Calc,gid_File_Oo_Office_Filter_Calc_Pkg,gid_File_Share_Config_Sofficecfg_Calc_Menubar_Xml,
+ Files = (gid_File_Share_Registry_Calc_Xcd,gid_File_Lib_Calc,gid_File_Lib_Sc,gid_File_Lib_Scui,gid_File_Lib_Scfilt,gid_File_Lib_Scd,gid_File_Extra_Urldesktop_Calc,gid_File_Extra_Urlnew_Calc,gid_File_Extra_Urlstart_Calc,gid_File_Extra_Urltasks_Calc,gid_File_Oo_Office_Filter_Calc_Pkg,gid_File_Share_Config_Sofficecfg_Calc_Menubar_Xml,
gid_File_Lib_Solver,gid_File_Lib_Lpsolve,
- gid_File_Oo_Office_Ui_Calccommands_Xcs,gid_File_Oo_Office_Ui_Calccommands_Xcu,gid_File_Oo_Office_Ui_Calcwindowstate_Xcs,
- gid_File_Registry_Spool_Oo_Common_Calc_Xcu,gid_File_Registry_Spool_Oo_Setup_Calc_Xcu, gid_File_Registry_Spool_Oo_Office_Embedding_Calc_Xcu,
- gid_File_Oo_Office_Ui_Calcwindowstate_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_Calc_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_Calc_Filters_Xcu, gid_File_Tmp_Userinstall_Calc_Inf);
+ gid_File_Tmp_Userinstall_Calc_Inf);
End
// Module gid_Module_Prg_Calc_Help
diff --git a/scp2/source/canvas/canvascommons.scp b/scp2/source/canvas/canvascommons.scp
index be8214b5593f..f095eff9f23e 100644
--- a/scp2/source/canvas/canvascommons.scp
+++ b/scp2/source/canvas/canvascommons.scp
@@ -27,19 +27,6 @@
#include "macros.inc"
-File gid_File_Oo_Office_Canvas_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Canvas.xcs";
-End
-File gid_File_Oo_Office_Canvas_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Canvas.xcu";
-End
-
STD_LIB_FILE(gid_File_Lib_CppCanvas, cppcanvas)
STD_LIB_FILE(gid_File_Lib_CanvasTools, canvastools)
diff --git a/scp2/source/crashrep/file_crashrep_dynamic.scp b/scp2/source/crashrep/file_crashrep.scp
index f92f93f0b1d8..f92f93f0b1d8 100644
--- a/scp2/source/crashrep/file_crashrep_dynamic.scp
+++ b/scp2/source/crashrep/file_crashrep.scp
diff --git a/scp2/source/crashrep/file_crashrep_static.scp b/scp2/source/crashrep/file_crashrep_static.scp
deleted file mode 100644
index ba5c65087d79..000000000000
--- a/scp2/source/crashrep/file_crashrep_static.scp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "macros.inc"
-
-// crashreporter files
-// crash_report_with_gtk.bin is statically built
-// it exists only for Unix
-
-#ifndef MACOSX
-
-File gid_File_Bin_Crashreport_With_Gtk
- BIN_FILE_BODY;
- Name = "crash_report_with_gtk.bin";
- Dir = gid_Dir_Program;
- Styles = (PACKED);
-End
-
-#endif
-
-#ifndef MACOSX
-
-File gid_File_Aliases_Pangox
- TXT_FILE_BODY;
- Name = "pangox.aliases";
- Dir = gid_Dir_Program;
- Styles = (PACKED);
-End
-
-#endif
diff --git a/scp2/source/crashrep/makefile.mk b/scp2/source/crashrep/makefile.mk
index 17c7584b9bb2..5e8101488270 100644
--- a/scp2/source/crashrep/makefile.mk
+++ b/scp2/source/crashrep/makefile.mk
@@ -42,7 +42,7 @@ TARGETTYPE=CUI
SCP_PRODUCT_TYPE=osl
PARFILES = \
- file_crashrep_dynamic.par
+ file_crashrep.par
.ENDIF # "$(ENABLE_CRASHDUMP)" != ""
diff --git a/scp2/source/draw/file_draw.scp b/scp2/source/draw/file_draw.scp
index 2278301e6a70..357e01f3cc00 100644
--- a/scp2/source/draw/file_draw.scp
+++ b/scp2/source/draw/file_draw.scp
@@ -27,11 +27,11 @@
#include "macros.inc"
-File gid_File_Registry_Spool_Oo_Office_Embedding_Draw_Xcu
+File gid_File_Share_Registry_Draw_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-draw.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "draw.xcd";
End
File gid_File_Help_Sdraw_Zip
@@ -62,53 +62,3 @@ File gid_File_Share_Config_Sofficecfg_Draw_Menubar_Xml
Name = "/uiconfig/sdraw/menubar/menubar.xml";
End
*/
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Draw_UISort_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort;
- Name = "/registry/spool/org/openoffice/TypeDetection/UISort-draw.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Draw_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_draw_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Draw_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_draw_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Common_Draw_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-draw.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Setup_Draw_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-draw.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Drawwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DrawWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Drawwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu";
-End
-
diff --git a/scp2/source/draw/module_draw.scp b/scp2/source/draw/module_draw.scp
index 824b694e74b0..3226e08ea559 100644
--- a/scp2/source/draw/module_draw.scp
+++ b/scp2/source/draw/module_draw.scp
@@ -43,10 +43,8 @@ Module gid_Module_Prg_Draw_Bin
Default = YES;
Styles = (HIDDEN_ROOT);
Files = (gid_File_Extra_Urldesktop_Draw,gid_File_Extra_Urlnew_Draw,gid_File_Extra_Urlstart_Draw,gid_File_Extra_Urltasks_Draw,gid_File_Share_Config_Sofficecfg_Draw_Menubar_Xml,
- gid_File_Registry_Spool_Oo_Common_Draw_Xcu,gid_File_Registry_Spool_Oo_Setup_Draw_Xcu,
- gid_File_Oo_Office_Ui_Drawwindowstate_Xcs,gid_File_Oo_Office_Ui_Drawwindowstate_Xcu,
- gid_File_Registry_Spool_Oo_Office_Embedding_Draw_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Draw_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_Draw_Filters_Xcu, gid_File_Tmp_Userinstall_Draw_Inf);
+ gid_File_Share_Registry_Draw_Xcd,
+ gid_File_Tmp_Userinstall_Draw_Inf);
End
// Module gid_Module_Prg_Draw_Help
diff --git a/scp2/source/gnome/file_gnome.scp b/scp2/source/gnome/file_gnome.scp
index fefe57df96e2..9d10261843d2 100644
--- a/scp2/source/gnome/file_gnome.scp
+++ b/scp2/source/gnome/file_gnome.scp
@@ -48,6 +48,15 @@ File gid_File_Lib_Gnomevfs
End
#endif
+#if (defined ENABLE_GNOMEVFS && defined ENABLE_LOCKDOWN) || defined ENABLE_GIO
+File gid_File_Share_Registry_Gnome_Xcd
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = gid_Dir_Share_Registry;
+ Name = "gnome.xcd";
+End
+#endif
+
#ifdef ENABLE_GCONF
File gid_File_Lib_Gconfbe
TXT_FILE_BODY;
diff --git a/scp2/source/gnome/makefile.mk b/scp2/source/gnome/makefile.mk
index a7f9b2a7cdf6..185915353a5a 100644
--- a/scp2/source/gnome/makefile.mk
+++ b/scp2/source/gnome/makefile.mk
@@ -45,6 +45,10 @@ SCP_PRODUCT_TYPE=osl
SCPDEFS+=-DENABLE_GCONF
.ENDIF
+.IF "$(ENABLE_LOCKDOWN)" == "YES"
+SCPDEFS+=-DENABLE_LOCKDOWN
+.ENDIF
+
.IF "$(ENABLE_GNOMEVFS)" != ""
SCPDEFS+=-DENABLE_GNOMEVFS
.ENDIF
diff --git a/scp2/source/gnome/module_gnome.scp b/scp2/source/gnome/module_gnome.scp
index 8f87492cbb47..f9df5c8969a1 100644
--- a/scp2/source/gnome/module_gnome.scp
+++ b/scp2/source/gnome/module_gnome.scp
@@ -27,15 +27,6 @@
#include "macros.inc"
-#ifdef ENABLE_GIO
-File gid_File_Registry_Spool_Oo_Ucb_Configuration_GIOContentProvider_Xcu
- TXT_FILE_BODY;
- Dir = gid_Dir_Share_Registry_Modules_Oo_Ucb_Configuration;
- Name = "/registry/spool/org/openoffice/ucb/Configuration-gio.xcu";
- Styles = (PACKED,SCPZIP_REPLACE);
-End
-#endif
-
Module gid_Module_Optional_Gnome
ParentID = gid_Module_Optional;
Default = YES;
@@ -54,11 +45,14 @@ Module gid_Module_Optional_Gnome
gid_File_Lib_Gnomevfs, gid_File_Bin_Gnome_Set_Default_Application,
#endif
#ifdef ENABLE_GIO
- gid_File_Lib_GIO, gid_File_Registry_Spool_Oo_Ucb_Configuration_GIOContentProvider_Xcu
+ gid_File_Lib_GIO,
#endif
#ifdef ENABLE_GCONF
gid_File_Lib_Gconfbe
#endif
+#if (defined ENABLE_GNOMEVFS && defined ENABLE_LOCKDOWN) || defined ENABLE_GIO
+ gid_File_Share_Registry_Gnome_Xcd
+#endif
);
End
diff --git a/scp2/source/graphicfilter/file_graphicfilter.scp b/scp2/source/graphicfilter/file_graphicfilter.scp
index b8d90c9a6ada..2cd0f53f9e56 100644
--- a/scp2/source/graphicfilter/file_graphicfilter.scp
+++ b/scp2/source/graphicfilter/file_graphicfilter.scp
@@ -27,32 +27,11 @@
#include "macros.inc"
-File gid_File_Registry_Spool_Oo_TypeDetection_ImpressGraphics_Types_Xcu
+File gid_File_Share_Registry_Graphicfilter_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_impressgraphics_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_ImpressGraphics_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_impressgraphics_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_DrawGraphics_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_drawgraphics_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_DrawGraphics_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_drawgraphics_filters.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "graphicfilter.xcd";
End
STD_UNO_LIB_FILE( gid_File_Lib_Flash, flash )
diff --git a/scp2/source/graphicfilter/module_graphicfilter.scp b/scp2/source/graphicfilter/module_graphicfilter.scp
index eb4f92a55485..d5d99969fd64 100644
--- a/scp2/source/graphicfilter/module_graphicfilter.scp
+++ b/scp2/source/graphicfilter/module_graphicfilter.scp
@@ -34,6 +34,5 @@ Module gid_Module_Optional_Grfflt
ParentID = gid_Module_Optional;
Default = YES;
Files = (gid_File_Lib_Svg, gid_File_Lib_Flash,
- gid_File_Registry_Spool_Oo_TypeDetection_ImpressGraphics_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_ImpressGraphics_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_DrawGraphics_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_DrawGraphics_Filters_Xcu);
+ gid_File_Share_Registry_Graphicfilter_Xcd);
End
diff --git a/scp2/source/impress/file_impress.scp b/scp2/source/impress/file_impress.scp
index e93cc421ba06..00dde2ca9162 100644
--- a/scp2/source/impress/file_impress.scp
+++ b/scp2/source/impress/file_impress.scp
@@ -37,11 +37,11 @@ File gid_File_Lib_Animcore
PACKED_UNO_LIB_FILE_BODY;
End
-File gid_File_Registry_Spool_Oo_Office_Embedding_Impress_Xcu
+File gid_File_Share_Registry_Impress_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-impress.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "impress.xcd";
End
File gid_File_Help_Simpress_Zip
@@ -74,55 +74,6 @@ File gid_File_Share_Config_Sofficecfg_Impress_Menubar_Xml
End
*/
-File gid_File_Registry_Spool_Oo_TypeDetection_Impress_UISort_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort;
- Name = "/registry/spool/org/openoffice/TypeDetection/UISort-impress.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Impress_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_impress_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Impress_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_impress_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Common_Impress_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-impress.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Setup_Impress_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-impress.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Impresswindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/ImpressWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Impresswindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu";
-End
-
// configuration files for custom animation effects
File gid_File_Share_Config_Sofficecfg_Impress_Effects_Xml
@@ -138,17 +89,3 @@ File gid_File_Share_Config_Sofficecfg_Impress_Transitions_Xml
Dir = gid_Dir_Share_Config_Sofficecfg_Simpress;
Name = "transitions.xml";
End
-
-File gid_File_Oo_Office_Ui_Effects_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/Effects.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Effects_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/Effects.xcu";
-End
diff --git a/scp2/source/impress/module_impress.scp b/scp2/source/impress/module_impress.scp
index 84fcb713a4e8..7f8bcb7c44f7 100644
--- a/scp2/source/impress/module_impress.scp
+++ b/scp2/source/impress/module_impress.scp
@@ -43,11 +43,9 @@ Module gid_Module_Prg_Impress_Bin
Default = YES;
Styles = (HIDDEN_ROOT);
Files = (gid_File_Extra_Urldesktop_Impress,gid_File_Extra_Urlnew_Impress,gid_File_Extra_Urlstart_Impress,gid_File_Extra_Urltasks_Impress,gid_File_Lib_Placeware,
- gid_File_Registry_Spool_Oo_Common_Impress_Xcu,gid_File_Registry_Spool_Oo_Setup_Impress_Xcu,
- gid_File_Oo_Office_Ui_Impresswindowstate_Xcs,gid_File_Oo_Office_Ui_Impresswindowstate_Xcu,
+ gid_File_Share_Registry_Impress_Xcd,
gid_File_Lib_Animcore,gid_File_Share_Config_Sofficecfg_Impress_Effects_Xml, gid_File_Share_Config_Sofficecfg_Impress_Transitions_Xml,
- gid_File_Oo_Office_Ui_Effects_Xcs, gid_File_Oo_Office_Ui_Effects_Xcu, gid_File_Registry_Spool_Oo_Office_Embedding_Impress_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Impress_Filters_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_Impress_Types_Xcu, gid_File_Tmp_Userinstall_Impress_Inf);
+ gid_File_Tmp_Userinstall_Impress_Inf);
End
// Module gid_Module_Prg_Impress_Help
diff --git a/scp2/source/impress/module_ogltrans.scp b/scp2/source/impress/module_ogltrans.scp
index b0f872a644c4..06fbb4bfcc1a 100644
--- a/scp2/source/impress/module_ogltrans.scp
+++ b/scp2/source/impress/module_ogltrans.scp
@@ -31,7 +31,7 @@ Module gid_Module_Optional_OGLTrans
PackageInfo = "packinfo_office.txt";
MOD_NAME_DESC(MODULE_OPTIONAL_OGLTRANS);
ParentID = gid_Module_Optional;
- Files = ( gid_File_Lib_OpenGLTransitions, gid_File_Share_Config_Sofficecfg_Impress_Transitions_OGL_Xml, gid_File_Registry_Spool_Oo_Office_Impress_OGLTrans_Xcu );
+ Files = ( gid_File_Lib_OpenGLTransitions, gid_File_Share_Config_Sofficecfg_Impress_Transitions_OGL_Xml, gid_File_Share_Registry_Ogltrans_Xcd );
Minimal = NO;
Default = NO;
End
@@ -55,9 +55,9 @@ File gid_File_Share_Config_Sofficecfg_Impress_Transitions_OGL_Xml
Name = "transitions-ogl.xml";
End
-File gid_File_Registry_Spool_Oo_Office_Impress_OGLTrans_Xcu
+File gid_File_Share_Registry_Ogltrans_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Impress;
- Name = "registry/spool/org/openoffice/Office/Impress-ogltrans.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "ogltrans.xcd";
End
diff --git a/scp2/source/javafilter/file_javafilter.scp b/scp2/source/javafilter/file_javafilter.scp
index 89135ebe37f4..d7a902dbf00f 100644
--- a/scp2/source/javafilter/file_javafilter.scp
+++ b/scp2/source/javafilter/file_javafilter.scp
@@ -49,46 +49,25 @@ End
#endif
-File gid_File_Registry_Spool_Oo_TypeDetection_Palm_Types_Xcu
+File gid_File_Share_Registry_Palm_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_palm_types.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "palm.xcd";
End
-File gid_File_Registry_Spool_Oo_TypeDetection_Palm_Filters_Xcu
+File gid_File_Share_Registry_Pocketexcel_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_palm_filters.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "pocketexcel.xcd";
End
-File gid_File_Registry_Spool_Oo_TypeDetection_PocketWord_Types_Xcu
+File gid_File_Share_Registry_Pocketword_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_pocketword_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_PocketWord_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_pocketword_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_PocketExcel_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_pocketexcel_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_PocketExcel_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_pocketexcel_filters.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "pocketword.xcd";
End
#ifdef SOLAR_JAVA
diff --git a/scp2/source/javafilter/module_javafilter.scp b/scp2/source/javafilter/module_javafilter.scp
index f9b0f5c42a99..dd69d014caf7 100644
--- a/scp2/source/javafilter/module_javafilter.scp
+++ b/scp2/source/javafilter/module_javafilter.scp
@@ -60,7 +60,7 @@ End
Module gid_Module_Optional_Javafilter_Palm_Aportisdoc
MOD_NAME_DESC(MODULE_OPTIONAL_JAVAFILTER_PALM_APORTISDOC);
ParentID = gid_Module_Optional_Javafilter_Palm;
- Files = ( gid_File_Jar_Aportisdoc, gid_File_Registry_Spool_Oo_TypeDetection_Palm_Filters_Xcu, gid_File_Registry_Spool_Oo_TypeDetection_Palm_Types_Xcu );
+ Files = ( gid_File_Jar_Aportisdoc, gid_File_Share_Registry_Palm_Xcd );
Sortkey = "100";
Minimal = NO;
Default = NO;
@@ -96,7 +96,7 @@ Module gid_Module_Optional_Javafilter_Pocketpc_Pocket_Word
MOD_NAME_DESC(MODULE_OPTIONAL_JAVAFILTER_POCKETPC_POCKET_WORD);
ParentID = gid_Module_Optional_Javafilter_Pocketpc;
Sortkey = "100";
- Files = ( gid_File_Lib_Xmergesync,gid_File_Jar_Pocketword,gid_File_Registry_Spool_Oo_TypeDetection_PocketWord_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_PocketWord_Filters_Xcu, gid_File_Tmp_Userinstall_Pocketpcword_Inf );
+ Files = ( gid_File_Lib_Xmergesync,gid_File_Jar_Pocketword, gid_File_Share_Registry_Pocketword_Xcd, gid_File_Tmp_Userinstall_Pocketpcword_Inf );
Minimal = NO;
Default = NO;
Styles (en-US) = ();
@@ -111,7 +111,7 @@ Module gid_Module_Optional_Javafilter_Pocketpc_Pocket_Excel
MOD_NAME_DESC(MODULE_OPTIONAL_JAVAFILTER_POCKETPC_POCKET_EXCEL);
ParentID = gid_Module_Optional_Javafilter_Pocketpc;
Sortkey = "200";
- Files = ( gid_File_Lib_Xmergesync,gid_File_Jar_Pexcel,gid_File_Registry_Spool_Oo_TypeDetection_PocketExcel_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_PocketExcel_Filters_Xcu, gid_File_Tmp_Userinstall_Pocketpcexcel_Inf );
+ Files = ( gid_File_Lib_Xmergesync,gid_File_Jar_Pexcel, gid_File_Share_Registry_Pocketexcel_Xcd, gid_File_Tmp_Userinstall_Pocketpcexcel_Inf );
Minimal = NO;
Default = NO;
Styles (en-US) = ();
diff --git a/scp2/source/math/file_math.scp b/scp2/source/math/file_math.scp
index e42c801849c3..4da9f1a23bbc 100644
--- a/scp2/source/math/file_math.scp
+++ b/scp2/source/math/file_math.scp
@@ -43,11 +43,11 @@ STD_UNO_LIB_FILE( gid_File_Lib_Smd , smd)
STD_RES_FILE( gid_File_Res_Sm, sm )
-File gid_File_Registry_Spool_Oo_Office_Embedding_Math_Xcu
+File gid_File_Share_Registry_Math_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-math.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "math.xcd";
End
File gid_File_Help_Smath_Zip
@@ -78,67 +78,3 @@ File gid_File_Share_Config_Sofficecfg_Math_Menubar_Xml
Name = "/uiconfig/smath/menubar/menubar.xml";
End
*/
-
-File gid_File_Oo_Office_Ui_Mathcommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/MathCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Mathcommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/MathCommands.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Math_UISort_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort;
- Name = "/registry/spool/org/openoffice/TypeDetection/UISort-math.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Math_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_math_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Math_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_math_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Common_Math_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-math.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Setup_Math_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-math.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Mathwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/MathWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Mathwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/MathWindowState.xcu";
-End
-
diff --git a/scp2/source/math/module_math.scp b/scp2/source/math/module_math.scp
index 4724c5791b4a..e9c084ba928d 100644
--- a/scp2/source/math/module_math.scp
+++ b/scp2/source/math/module_math.scp
@@ -43,10 +43,8 @@ Module gid_Module_Prg_Math_Bin
Default = YES;
Styles = (HIDDEN_ROOT);
Files = (gid_File_Html_W3c_Ipr,gid_File_Lib_Sm,gid_File_Lib_Smd,gid_File_Extra_Urlmore_Math,gid_File_Extra_Urlnew_Math,gid_File_Extra_Urltasks_Math,
- gid_File_Oo_Office_Ui_Mathcommands_Xcs,gid_File_Oo_Office_Ui_Mathcommands_Xcu,gid_File_Oo_Office_Ui_Mathwindowstate_Xcs
- gid_File_Registry_Spool_Oo_Common_Math_Xcu, gid_File_Registry_Spool_Oo_Setup_Math_Xcu,
- gid_File_Oo_Office_Ui_Mathwindowstate_Xcu, gid_File_Registry_Spool_Oo_Office_Embedding_Math_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Math_Types_Xcu,gid_File_Registry_Spool_Oo_TypeDetection_Math_Filters_Xcu, gid_File_Tmp_Userinstall_Math_Inf);
+ gid_File_Share_Registry_Math_Xcd,
+ gid_File_Tmp_Userinstall_Math_Inf);
End
// Module gid_Module_Prg_Math_Help
diff --git a/scp2/source/onlineupdate/file_onlineupdate.scp b/scp2/source/onlineupdate/file_onlineupdate.scp
index 44cc9615a6e8..e33eb6fa35c7 100644
--- a/scp2/source/onlineupdate/file_onlineupdate.scp
+++ b/scp2/source/onlineupdate/file_onlineupdate.scp
@@ -29,18 +29,11 @@
SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Updchk , updchk.uno )
-File gid_File_Registry_Spool_Oo_Office_Addons_Onlineupdate_Xcu
+File gid_File_Share_Registry_Onlineupdate_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Addons;
- Name = "/registry/spool/org/openoffice/Office/Addons/Addons-onlineupdate.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Office_Jobs_Onlineupdate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Jobs;
- Name = "/registry/spool/org/openoffice/Office/Jobs/Jobs-onlineupdate.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "onlineupdate.xcd";
End
#if defined LINUX || defined SOLARIS
diff --git a/scp2/source/onlineupdate/module_onlineupdate.scp b/scp2/source/onlineupdate/module_onlineupdate.scp
index af3d8eabfd6e..6685450774f2 100644
--- a/scp2/source/onlineupdate/module_onlineupdate.scp
+++ b/scp2/source/onlineupdate/module_onlineupdate.scp
@@ -34,6 +34,5 @@ Module gid_Module_Optional_Onlineupdate
ParentID = gid_Module_Optional;
Default = YES;
Styles = (DONTSHOWINUSERINSTALL);
- Files = (gid_File_Lib_Updchk, gid_File_Registry_Spool_Oo_Office_Addons_Onlineupdate_Xcu, gid_File_Registry_Spool_Oo_Office_Jobs_Onlineupdate_Xcu, gid_File_Bin_UnpackUpdate);
- Dirs = (gid_Dir_Share_Registry_Modules_Oo_Office_Addons, gid_Dir_Share_Registry_Modules_Oo_Office_Jobs);
+ Files = (gid_File_Lib_Updchk, gid_File_Share_Registry_Onlineupdate_Xcd, gid_File_Bin_UnpackUpdate);
End
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index ecf1b2adb051..c96313ddb834 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -47,20 +47,6 @@ Module gid_Module_Root_Brand
gid_Brand_Dir_Share_Uno_Packages,
gid_Brand_Dir_Share_Uno_Packages_Cache,
gid_Brand_Dir_Share_Registry,
- gid_Brand_Dir_Share_Registry_Data,
- gid_Brand_Dir_Share_Registry_Data_Org,
- gid_Brand_Dir_Share_Registry_Data_Org_Openoffice,
- gid_Brand_Dir_Share_Registry_Data_Org_Openoffice_Office,
- gid_Brand_Dir_Share_Registry_Modules,
- gid_Brand_Dir_Share_Registry_Modules_Org,
- gid_Brand_Dir_Share_Registry_Modules_Oo,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Inet,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Office,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Common,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Jobs,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Ui,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Writer,
- gid_Brand_Dir_Share_Registry_Modules_Oo_Setup,
gid_Brand_Dir_Share_Xdg);
Files = (gid_Brand_File_BasisLink,
gid_Brand_File_Bin_Crashreport,
@@ -97,12 +83,8 @@ Module gid_Module_Root_Brand
gid_Brand_File_Msvcm80crt_Manifest,
gid_Brand_File_Lib_Npsoplugin,
gid_Brand_File_Lib_Subscrib_C05,
- gid_Brand_File_Oo_Office_Compatibility_Xcu,
- gid_Brand_File_Registry_Spool_Oo_Setup_Brand_Xcu,
- gid_Brand_File_Registry_Spool_Oo_Office_Common_Brand_Xcu,
- gid_Brand_File_Registry_Spool_Oo_Office_Ui_Brand_Xcu,
+ gid_Brand_File_Share_Registry_Brand_Xcd,
gid_Brand_File_Script_Unopkg,
- gid_Brand_File_Share_Registry_Modules_Oo_Office_Jobs_Registration,
gid_Brand_File_Share_Xdg_Base,
gid_Brand_File_Share_Xdg_Calc,
gid_Brand_File_Share_Xdg_Draw,
@@ -145,9 +127,8 @@ Module gid_Module_Langpack_Brand_Template
gid_Brand_File_License_License_Html,
gid_Brand_File_Readme_Readme,
gid_Brand_File_Readme_Readme_Html,
- gid_Brand_File_Registry_Spool_Oo_Office_Common_Cjk_Xcu,
- gid_Brand_File_Registry_Spool_Oo_Office_Common_Korea_Xcu,
- gid_Brand_File_Registry_Spool_Oo_Office_Writer_Cjk_Xcu,
+ gid_Brand_File_Share_Registry_Cjk_Xcd,
+ gid_Brand_File_Share_Registry_Korea_Xcd,
gid_Brand_File_Txt_License,
gid_Brand_File_Txt_License_Html,
gid_Brand_File_Txt_Readme,
@@ -250,71 +231,6 @@ Directory gid_Brand_Dir_Share_Registry
DosName = "registry";
End
-Directory gid_Brand_Dir_Share_Registry_Data
- ParentID = gid_Brand_Dir_Share_Registry;
- HostName = "data";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Data_Org
- ParentID = gid_Brand_Dir_Share_Registry_Data;
- HostName = "org";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Data_Org_Openoffice
- ParentID = gid_Brand_Dir_Share_Registry_Data_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Data_Org_Openoffice_Office
- ParentID = gid_Brand_Dir_Share_Registry_Data_Org_Openoffice;
- HostName = "Office";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules
- ParentID = gid_Brand_Dir_Share_Registry;
- HostName = "modules";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Org
- ParentID = gid_Brand_Dir_Share_Registry_Modules;
- HostName = "org";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Inet
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo;
- HostName = "Inet";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Office
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo;
- HostName = "Office";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Common
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Common";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Ui
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "UI";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Writer
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Writer";
-End
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Setup
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo;
- HostName = "Setup";
-End
-
#if defined UNX && ! defined MACOSX
Directory gid_Brand_Dir_Share_Xdg
ParentID = gid_Brand_Dir_Share;
@@ -551,59 +467,28 @@ File gid_Brand_File_Images_Brand_Zip
Styles = (PACKED);
End
-File gid_Brand_File_Oo_Office_Compatibility_Xcu
+File gid_Brand_File_Share_Registry_Brand_Xcd
TXT_FILE_BODY;
Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Brand_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Compatibility.xcu";
+ Dir = gid_Brand_Dir_Share_Registry;
+ Name = "brand.xcd";
End
-File gid_Brand_File_Registry_Spool_Oo_Office_Common_Brand_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-brand.xcu";
-End
-
-File gid_Brand_File_Registry_Spool_Oo_Office_Common_Cjk_Xcu
+File gid_Brand_File_Share_Registry_Cjk_Xcd
TXT_FILE_BODY;
Styles = (PACKED,MAKE_LANG_SPECIFIC);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name (ja) = "/registry/spool/org/openoffice/Office/Common-cjk.xcu";
- Name (ko) = "/registry/spool/org/openoffice/Office/Common-cjk.xcu";
- Name (zh-CN) = "/registry/spool/org/openoffice/Office/Common-cjk.xcu";
- Name (zh-TW) = "/registry/spool/org/openoffice/Office/Common-cjk.xcu";
+ Dir = gid_Brand_Dir_Share_Registry;
+ Name (ja) = "cjk.xcd";
+ Name (ko) = "cjk.xcd";
+ Name (zh-CN) = "cjk.xcd";
+ Name (zh-TW) = "cjk.xcd";
End
-File gid_Brand_File_Registry_Spool_Oo_Office_Common_Korea_Xcu
+File gid_Brand_File_Share_Registry_Korea_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name (ko) = "/registry/spool/org/openoffice/Office/Common-korea.xcu";
-End
-
-File gid_Brand_File_Registry_Spool_Oo_Office_Ui_Brand_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Ui;
- Name = "/registry/spool/org/openoffice/Office/UI-brand.xcu";
-End
-
-File gid_Brand_File_Registry_Spool_Oo_Office_Writer_Cjk_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED,MAKE_LANG_SPECIFIC);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Writer;
- Name (ja) = "/registry/spool/org/openoffice/Office/Writer-cjk.xcu";
- Name (ko) = "/registry/spool/org/openoffice/Office/Writer-cjk.xcu";
- Name (zh-CN) = "/registry/spool/org/openoffice/Office/Writer-cjk.xcu";
- Name (zh-TW) = "/registry/spool/org/openoffice/Office/Writer-cjk.xcu";
-End
-
-File gid_Brand_File_Registry_Spool_Oo_Setup_Brand_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-brand.xcu";
+ Dir = gid_Brand_Dir_Share_Registry;
+ Name (ko) = "korea.xcd";
End
#if defined UNX && ! defined MACOSX
@@ -878,7 +763,6 @@ ProfileItem gid_Brand_Profileitem_Bootstrap_Userinstall
#else
Value = "$SYSUSERCONFIG/.%LCONEWORDPRODUCTNAME/%USERDIRPRODUCTVERSION";
#endif
- StandaloneValue = "$ORIGIN/..";
End
ProfileItem gid_Brand_Profileitem_Soffice_UreBootstrap
@@ -1328,22 +1212,6 @@ ProfileItem gid_Brand_Profileitem_Setup_Install
End
#endif
-#ifdef ENABLE_SVCTAGS
-
-Directory gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Jobs
- ParentID = gid_Brand_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Jobs";
-End
-
-File gid_Brand_File_Share_Registry_Modules_Oo_Office_Jobs_Registration
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Brand_Dir_Share_Registry_Modules_Oo_Office_Jobs;
- Name = "/registry/spool/org/openoffice/Office/Jobs/Jobs-registration.xcu";
-End
-
-#endif
-
//TODO: This actually belongs into a module of its own:
#if !defined SYSTEM_PYTHON
File gid_Brand_File_Bin_Python
diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp
index b153f3bbf353..cc805f9e8288 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -174,56 +174,6 @@ Directory gid_Dir_User
DosName = "presets";
End
-Directory gid_Dir_User_Registry
- ParentID = gid_Dir_User;
- DosName = "registry";
-End
-
-Directory gid_Dir_User_Registry_Data
- ParentID = gid_Dir_User_Registry;
- DosName = "data";
-End
-
-Directory gid_Dir_User_Registry_Data_Org
- ParentID = gid_Dir_User_Registry_Data;
- DosName = "org";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice
- ParentID = gid_Dir_User_Registry_Data_Org;
- DosName = "openoffice";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice_Office
- ParentID = gid_Dir_User_Registry_Data_Org_Openoffice;
- DosName = "Office";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice_Office_Ui
- ParentID = gid_Dir_User_Registry_Data_Org_Openoffice_Office;
- DosName = "UI";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice_Office_Dataaccess
- ParentID = gid_Dir_User_Registry_Data_Org_Openoffice_Office;
- HostName = "DataAccess";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice_Office_OOoImprovement
- ParentID = gid_Dir_User_Registry_Data_Org_Openoffice_Office;
- DosName = "OOoImprovement";
-End
-
-Directory gid_Dir_User_Registry_Data_Org_Openoffice_Ucb
- ParentID = gid_Dir_User_Registry_Data_Org_Openoffice;
- DosName = "ucb";
-End
-
-Directory gid_Dir_User_Registry_Cache
- ParentID = gid_Dir_User_Registry;
- DosName = "cache";
-End
-
Directory gid_Dir_User_Xslt
ParentID = gid_Dir_User;
DosName = "xslt";
@@ -724,256 +674,11 @@ Directory gid_Dir_Share_Registry
DosName = "registry";
End
-Directory gid_Dir_Share_Registry_Schema
- ParentID = gid_Dir_Share_Registry;
- HostName = "schema";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org
- ParentID = gid_Dir_Share_Registry_Schema;
- HostName = "org";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice
- ParentID = gid_Dir_Share_Registry_Schema_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Office
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- HostName = "Office";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- HostName = "UI";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Dataaccess
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- HostName = "DataAccess";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_OOoImprovement
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- HostName = "OOoImprovement";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Ucb
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- HostName = "ucb";
-End
-
-Directory gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection
- ParentID = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- HostName = "TypeDetection";
-End
-
-Directory gid_Dir_Share_Registry_Ldap
- ParentID = gid_Dir_Share_Registry;
- HostName = "ldap";
-End
-
-Directory gid_Dir_Share_Registry_Data
- ParentID = gid_Dir_Share_Registry;
- HostName = "data";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org
- ParentID = gid_Dir_Share_Registry_Data;
- HostName = "org";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice
- ParentID = gid_Dir_Share_Registry_Data_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice_Office
- ParentID = gid_Dir_Share_Registry_Data_Org_Openoffice;
- HostName = "Office";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui
- ParentID = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- HostName = "UI";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Dataaccess
- ParentID = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- HostName = "DataAccess";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice_Ucb
- ParentID = gid_Dir_Share_Registry_Data_Org_Openoffice;
- HostName = "ucb";
-End
-
-Directory gid_Dir_Share_Registry_Data_Org_Openoffice_Typedetection
- ParentID = gid_Dir_Share_Registry_Data_Org_Openoffice;
- HostName = "TypeDetection";
-End
-
Directory gid_Dir_Share_Registry_Res
ParentID = gid_Dir_Share_Registry;
HostName = "res";
End
-Directory gid_Dir_Share_Registry_Res_Lang
- ParentID = gid_Dir_Share_Registry_Res;
- DIR_ISOLANGUAGE_ALL_LANG_2;
-End
-
-Directory gid_Dir_Share_Registry_Res_Lang_Org
- ParentID = gid_Dir_Share_Registry_Res_Lang;
- HostName = "org";
-End
-
-Directory gid_Dir_Share_Registry_Res_Lang_Org_Openoffice
- ParentID = gid_Dir_Share_Registry_Res_Lang_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Dir_Share_Registry_Res_Lang_Org_Openoffice_Office
- ParentID = gid_Dir_Share_Registry_Res_Lang_Org_Openoffice;
- HostName = "Office";
-End
-
-Directory gid_Dir_Share_Registry_Res_Lang_Org_Openoffice_Ucb
- ParentID = gid_Dir_Share_Registry_Res_Lang_Org_Openoffice;
- HostName = "ucb";
-End
-
-Directory gid_Dir_Share_Registry_Modules
- ParentID = gid_Dir_Share_Registry;
- HostName = "modules";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Org
- ParentID = gid_Dir_Share_Registry_Modules;
- HostName = "org";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo
- ParentID = gid_Dir_Share_Registry_Modules_Org;
- HostName = "openoffice";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office
- ParentID = gid_Dir_Share_Registry_Modules_Oo;
- HostName = "Office";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection
- ParentID = gid_Dir_Share_Registry_Modules_Oo;
- HostName = "TypeDetection";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort
- ParentID = gid_Dir_Share_Registry_Modules_Oo_TypeDetection;
- HostName = "UISort";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Ucb
- ParentID = gid_Dir_Share_Registry_Modules_Oo;
- HostName = "ucb";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Ucb_Configuration
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Ucb;
- HostName = "Configuration";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Setup
- ParentID = gid_Dir_Share_Registry_Modules_Oo;
- HostName = "Setup";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Accelerators
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Accelerators";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Paths
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Paths";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Common
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Common";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Writer
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Writer";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Impress
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Impress";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Linguistic";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Logging
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Logging";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Embedding
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Embedding";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Scripting
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Scripting";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Addons
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Addons";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_Jobs
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "Jobs";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter
- ParentID = gid_Dir_Share_Registry_Modules_Oo_TypeDetection;
- HostName = "Filter";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection_GraphicFilter
- ParentID = gid_Dir_Share_Registry_Modules_Oo_TypeDetection;
- HostName = "GraphicFilter";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types
- ParentID = gid_Dir_Share_Registry_Modules_Oo_TypeDetection;
- HostName = "Types";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Misc
- ParentID = gid_Dir_Share_Registry_Modules_Oo_TypeDetection;
- HostName = "Misc";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office;
- HostName = "DataAccess";
-End
-
-Directory gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers
- ParentID = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess;
- HostName = "Drivers";
-End
-
Directory gid_Dir_Autotext
ParentID = gid_Dir_Share;
DosName = "autotext";
diff --git a/scp2/source/ooo/file_extra_ooo.scp b/scp2/source/ooo/file_extra_ooo.scp
index 2a5905b27d00..dbea12eee10c 100644
--- a/scp2/source/ooo/file_extra_ooo.scp
+++ b/scp2/source/ooo/file_extra_ooo.scp
@@ -38,7 +38,7 @@ File gid_File_Extra_Autotextshare_Lang
Dir = gid_Dir_Autotext_Language;
USER_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(autotextshare);
+ EXTRA_ALL_LANG(autotextshare,zip);
End
File gid_File_Extra_Autotextuser
@@ -305,7 +305,7 @@ File gid_File_Extra_Palettes_Lang
Dir = gid_Dir_User_Config;
USER_FILE_BODY;
Styles = (ARCHIVE, WORKSTATION, DONT_OVERWRITE);
- EXTRA_ALL_LANG(palettes);
+ EXTRA_ALL_LANG(palettes,zip);
End
File gid_File_Extra_Poll_Asp
@@ -354,14 +354,14 @@ File gid_File_Extra_Tpllayoutimpr_Lang
Dir = gid_Dir_Template_Layout;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tpllayoutimpr);
+ EXTRA_ALL_LANG(tpllayoutimpr,zip);
End
File gid_File_Extra_Tplpresntimpr_Lang
Dir = gid_Dir_Template_Presnt;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplpresntimpr);
+ EXTRA_ALL_LANG(tplpresntimpr,zip);
End
File gid_File_Extra_Tplwizbitmap
@@ -375,7 +375,7 @@ File gid_File_Extra_Tplwizdesktop_Lang
Dir = gid_Dir_Template_Internal;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplwizdesktop);
+ EXTRA_ALL_LANG(tplwizdesktop,zip);
End
File gid_File_Extra_Tplwizletter
@@ -387,35 +387,35 @@ End
File gid_File_Extra_Tplwizletter_Lang
Dir = gid_Dir_Template_Wizard_Letter;
ARCHIVE_TXT_FILE_BODY;
- EXTRA_ALL_LANG(tplwizletter);
+ EXTRA_ALL_LANG(tplwizletter,zip);
End
File gid_File_Extra_Tplwizfax_Lang
Dir = gid_Dir_Template_Wizard_Fax;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplwizfax);
+ EXTRA_ALL_LANG(tplwizfax,zip);
End
File gid_File_Extra_Tplwizagenda_Lang
Dir = gid_Dir_Template_Wizard_Agenda;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplwizagenda);
+ EXTRA_ALL_LANG(tplwizagenda,zip);
End
File gid_File_Extra_Tplwizreport_Lang
Dir = gid_Dir_Template_Wizard_Report;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplwizreport);
+ EXTRA_ALL_LANG(tplwizreport,zip);
End
File gid_File_Extra_Tplwizstyles_Lang
Dir = gid_Dir_Template_Wizard_Styles;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(tplwizstyles);
+ EXTRA_ALL_LANG(tplwizstyles,zip);
End
File gid_File_Extra_Webcast_Asp
@@ -441,5 +441,5 @@ File gid_File_Extra_Wordbook_Lang
Dir = gid_Dir_Wordbook_Language;
TXT_FILE_BODY;
Styles = (ARCHIVE, DONT_OVERWRITE);
- EXTRA_ALL_LANG(wordbook);
+ EXTRA_ALL_LANG(wordbook,zip);
End
diff --git a/scp2/source/ooo/file_improvement.scp b/scp2/source/ooo/file_improvement.scp
index 8dbd452f361d..224d26de6a0d 100644
--- a/scp2/source/ooo/file_improvement.scp
+++ b/scp2/source/ooo/file_improvement.scp
@@ -28,20 +28,11 @@
#include "macros.inc"
#if defined(BUILD_SPECIAL)
-File gid_File_Share_Registry_Modules_Oo_Office_Logging_Improvement
+File gid_File_Share_Registry_Oooimprovement_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Logging;
- Name = "/registry/spool/org/openoffice/Office/Logging/Logging-oooimprovement.xcu";
-End
-#endif
-
-#if defined(BUILD_SPECIAL)
-File gid_File_Share_Registry_Modules_Oo_Office_Jobs_Improvement
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Jobs;
- Name = "/registry/spool/org/openoffice/Office/Jobs/Jobs-oooimprovement.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "oooimprovement.xcd";
End
#endif
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 9b0da10d5238..4a39b5da4978 100755
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -36,22 +36,10 @@ End
#endif
#if ((defined(WNT)) || (defined(LINUX)) || ((defined(SOLARIS)) && (defined(SPARC)))|| defined(NETBSD) )
STD_UNO_LIB_FILE( gid_File_Lib_Adabas, adabas)
-File gid_File_Oo_Office_Dataaccess_Adabas_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/adabas.xcu";
-End
#endif
#if defined(WNT)
STD_UNO_LIB_FILE( gid_File_Lib_Ado, ado)
-File gid_File_Oo_Office_Dataaccess_Ado_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/ado.xcu";
-End
#endif
STD_UNO_LIB_FILE( gid_File_Lib_Basctl, basctl)
@@ -96,41 +84,7 @@ File gid_File_Lib_Cached1
#endif
End
-File gid_File_Lib_Configmgr2
- TXT_FILE_BODY;
- Styles = (PACKED,UNO_COMPONENT);
- RegistryID = gid_Starregistry_Services_Rdb;
- Dir = SCP2_OOO_BIN_DIR;
- #ifdef UNX
- Name = STRING(CONCAT2(configmgr2.uno,UNXSUFFIX));
- #else
- Name = "configmgr2.uno.dll";
- #endif
-End
-
-File gid_File_Lib_Sysmgr1
- TXT_FILE_BODY;
- Styles = (PACKED,UNO_COMPONENT);
- RegistryID = gid_Starregistry_Services_Rdb;
- Dir = SCP2_OOO_BIN_DIR;
- #ifdef UNX
- Name = STRING(CONCAT2(sysmgr1.uno,UNXSUFFIX));
- #else
- Name = "sysmgr1.uno.dll";
- #endif
-End
-
-File gid_File_Lib_Behelper
- TXT_FILE_BODY;
- Styles = (PACKED,UNO_COMPONENT);
- RegistryID = gid_Starregistry_Services_Rdb;
- Dir = SCP2_OOO_BIN_DIR;
- #ifdef UNX
- Name = STRING(CONCAT2(behelper.uno,UNXSUFFIX));
- #else
- Name = "behelper.uno.dll";
- #endif
-End
+SPECIAL_UNO_LIB_FILE(gid_File_Lib_Configmgr, configmgr)
#ifdef WITH_LDAP
File gid_File_Lib_Ldapbe2
@@ -290,12 +244,6 @@ STD_UNO_LIB_FILE( gid_File_Lib_Dbmm, dbmm)
STD_UNO_LIB_FILE( gid_File_Lib_Dbacfg, dbacfg)
STD_UNO_LIB_FILE( gid_File_Lib_Dbase2, dbase )
-File gid_File_Oo_Office_Dataaccess_Dbase_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/dbase.xcu";
-End
STD_LIB_FILE( gid_File_Lib_Dbfile , file)
STD_LIB_FILE( gid_File_Lib_Odbcbase,odbcbase)
@@ -498,12 +446,6 @@ End
#ifdef UNX
#ifdef ENABLE_KAB
-File gid_File_Oo_Office_Dataaccess_Kab_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/kab.xcu";
-End
File gid_File_Lib_Kab_1
TXT_FILE_BODY;
Styles = (PACKED,UNO_COMPONENT);
@@ -522,12 +464,6 @@ End
#endif
#ifdef MACOSX
-File gid_File_Oo_Office_Dataaccess_Macab_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/macab.xcu";
-End
File gid_File_Lib_Macab_1
TXT_FILE_BODY;
Styles = (PACKED,UNO_COMPONENT);
@@ -546,12 +482,6 @@ End
#endif // #ifdef ENABLE_KAB
#ifdef ENABLE_EVOAB2
-File gid_File_Oo_Office_Dataaccess_Evoab2_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/evoab2.xcu";
-End
STD_UNO_LIB_FILE( gid_File_Lib_Evoab , evoab)
@@ -581,12 +511,6 @@ File gid_File_Lib_Filterconfig1
Name = SPECIAL_NAME(filterconfig1);
End
-File gid_File_Oo_Office_Dataaccess_Flat_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/flat.xcu";
-End
STD_UNO_LIB_FILE( gid_File_Lib_Flat, flat)
#ifdef WNT
@@ -859,22 +783,10 @@ End
#ifdef SOLAR_JAVA
STD_UNO_LIB_FILE( gid_File_Lib_Jdbc, jdbc)
-File gid_File_Oo_Office_Dataaccess_Jdbc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/jdbc.xcu";
-End
#endif
#ifdef SOLAR_JAVA
-File gid_File_Oo_Office_Dataaccess_Hsqldb_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/hsqldb.xcu";
-End
File gid_File_Lib_Hsqldb_2
TXT_FILE_BODY;
Styles = (PACKED,UNO_COMPONENT);
@@ -1004,17 +916,6 @@ End
#if !defined(SYSTEM_MOZILLA) && !defined(WITHOUT_MOZILLA) && !defined(MACOSX)
// #i91209#
-File gid_File_Oo_Office_Dataaccess_Mozab_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
-#ifdef WNT
- Name = "/registry/spool/DataAccess/mozab.xcu";
-#else
- Name = "/registry/spool/DataAccess/mozab2.xcu";
-#endif
-End
-
STD_UNO_LIB_FILE(gid_File_Lib_Mozab,mozab)
STD_LIB_FILE(gid_File_Lib_Mozabdrv,mozabdrv)
@@ -1148,25 +1049,7 @@ End
#endif
STD_UNO_LIB_FILE(gid_File_Lib_Mysql,mysql)
-File gid_File_Oo_Office_Dataaccess_Mysql_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/mysql.xcu";
-End
STD_UNO_LIB_FILE(gid_File_Lib_Odbc,odbc)
-File gid_File_Oo_Office_Dataaccess_Odbc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_DataAccess_Drivers;
- Name = "/registry/spool/DataAccess/odbc.xcu";
-End
-
-File gid_File_Registry_Drivers_Zip
- Dir = gid_Dir_Share_Registry_Res_Lang;
- ARCHIVE_TXT_FILE_BODY;
- EXTRA_ALL_LANG(fcfg_drivers);
-End
// STD_LIB_FILE( gid_File_Lib_Ofa , ofa)
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index d2277ad48b9f..d21afbc07c5a 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -1144,969 +1144,25 @@ End
#endif
-File gid_File_Oo_Inet_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/Inet.xcs";
-End
-
-File gid_File_Oo_Inet_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/Inet.xcu";
-End
-
-File gid_File_Oo_Office_Addons_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Addons.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Basicidecommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/BasicIDECommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Basicidecommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/BasicIDECommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Windowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Basicidewindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/BasicIDEWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Basicidewindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Bibliographycommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/BibliographyCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Bibliographycommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/BibliographyCommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Bibliographywindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/BibliographyWindowState.xcs";
-End
-
-/*
-File gid_File_Oo_Office_Ui_Bibliographywindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/BibliographyWindowState.xcu";
-End
-*/
-File gid_File_Oo_Office_Calc_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Calc.xcs";
-End
-
-File gid_File_Oo_Office_Calc_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Calc.xcu";
-End
-
-File gid_File_Oo_Office_CalcAddIns_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/CalcAddIns.xcs";
-End
-
-File gid_File_Oo_Office_Chart_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Chart.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Chartcommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/ChartCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Chartcommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/ChartCommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Chartwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/ChartWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Chartwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Commands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Commands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Commands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/Commands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Category_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/Category.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Drawimpresscommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DrawImpressCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Drawimpresscommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Genericcategories_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/GenericCategories.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Genericcategories_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/GenericCategories.xcu";
-End
-
-File gid_File_Oo_Office_Common_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Common.xcs";
-End
-
-File gid_File_Oo_Office_Histories_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Histories.xcs";
-End
-
-File gid_File_Oo_Office_Ui_WindowContentFactories_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WindowContentFactories.xcs";
-End
-
-File gid_File_Oo_Office_Extendedcolorscheme_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/ExtendedColorScheme.xcs";
-End
-
-File gid_File_Oo_Office_Paths_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Paths.xcs";
-End
-
-File gid_File_Oo_Office_Logging_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Logging.xcs";
-End
-
-File gid_File_Oo_Office_OOoImprovement_Settings_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_OOoImprovement;
- Name = "/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs";
-End
-
-File gid_File_Oo_Office_OptionsDialog_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/OptionsDialog.xcs";
-End
-
-File gid_File_Oo_Office_Recovery_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Recovery.xcs";
-End
-
-File gid_File_Oo_Office_Histories_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Histories.xcu";
-End
-
-File gid_File_Oo_Office_Common_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED,SCPZIP_REPLACE);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Common.xcu";
-End
-
-File gid_File_Oo_Office_Accelerators_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Accelerators.xcs";
-End
-
-File gid_File_Oo_Office_Accelerators_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Accelerators.xcu";
-End
-
-File gid_File_Oo_Office_Paths_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Paths.xcu";
-End
-
-File gid_File_Oo_Office_Logging_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Logging.xcu";
-End
-
-File gid_File_Oo_Office_Views_Xcu
+File gid_File_Share_Registry_Main_Xcd
TXT_FILE_BODY;
Styles = (PACKED, SCPZIP_REPLACE);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Views.xcu";
-End
-
-File gid_File_Oo_Office_Compatibility_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Compatibility.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Controller_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/Controller.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Controller_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/Controller.xcu";
-End
-
-File gid_File_Oo_Office_Dataaccess_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/DataAccess.xcs";
-End
-
-File gid_File_Oo_Office_Dataaccess_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/DataAccess.xcu";
-End
-
-File gid_File_Oo_Office_Dataaccess_Drivers_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Dataaccess;
- Name = "/registry/schema/org/openoffice/Office/DataAccess/Drivers.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbucommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbuCommands.xcs";
+ Dir = gid_Dir_Share_Registry;
+ Name = "main.xcd";
End
-File gid_File_Oo_Office_Ui_Dbucommands_Xcu
+File gid_File_Oo_Ldap_Xcd_Sample
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbuCommands.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "oo-ldap.xcd.sample";
End
-File gid_File_Oo_Office_Ui_Basewindowstate_Xcs
+File gid_File_Oo_Ad_Ldap_Xcd_Sample
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/BaseWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Basewindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/BaseWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Dbtablewindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbTableWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbtablewindowstate_xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbTableWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Dbbrowserwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbBrowserWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbbrowserwindowstate_xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbBrowserWindowState.xcu";
-End
-
-
-File gid_File_Oo_Office_Ui_Dbtabledatawindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbTableDataWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbtabledatawindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbTableDataWindowState.xcu";
-End
-
-
-File gid_File_Oo_Office_Ui_Dbquerywindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbQueryWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbquerywindowstate_xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbQueryWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Dbrelationwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/DbRelationWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Dbrelationwindowstate_xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/DbRelationWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Draw_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Draw.xcs";
-End
-
-File gid_File_Oo_Office_Events_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Events.xcs";
-End
-
-File gid_File_Oo_Office_ExtensionManager_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/ExtensionManager.xcs";
-End
-
-File gid_File_Oo_Office_ExtensionManager_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/ExtensionManager.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Factories_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/Factories.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Factories_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/Factories.xcu";
-End
-
-File gid_File_Oo_Office_Embedding_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Embedding.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Office_Embedding_Chart_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-chart.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Genericcommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/GenericCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Genericcommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/GenericCommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_GlobalSettings_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/GlobalSettings.xcs";
-End
-
-File gid_File_Oo_Office_Impress_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Impress.xcs";
-End
-
-File gid_File_Oo_Office_Impress_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Impress.xcu";
-End
-
-File gid_File_Oo_Office_Java_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Java.xcs";
-End
-
-File gid_File_Oo_Office_Jobs_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Jobs.xcs";
-End
-
-File gid_File_Oo_Office_Jobs_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Jobs.xcu";
-End
-
-File gid_File_Oo_Office_Labels_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Labels.xcs";
-End
-
-File gid_File_Oo_Office_Labels_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Labels.xcu";
-End
-
-File gid_File_Oo_Office_Linguistic_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Linguistic.xcs";
-End
-
-File gid_File_Oo_Office_Math_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Math.xcs";
-End
-
-File gid_File_Oo_Office_Math_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Math.xcu";
-End
-
-File gid_File_Oo_Office_TabBrowse_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/TabBrowse.xcs";
-End
-
-File gid_File_Oo_Office_Protocolhandler_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/ProtocolHandler.xcs";
-End
-
-File gid_File_Oo_Office_Protocolhandler_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/ProtocolHandler.xcu";
-End
-
-File gid_File_Oo_Office_Scripting_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Scripting.xcs";
-End
-
-File gid_File_Oo_Office_Scripting_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Scripting.xcu";
-End
-
-File gid_File_Oo_Office_Security_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Security.xcs";
-End
-
-File gid_File_Oo_Office_Security_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Security.xcu";
-End
-
-File gid_File_Oo_Office_Sfx_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/SFX.xcs";
-End
-
-File gid_File_Oo_Office_Sfx_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/SFX.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Startmodulecommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/StartModuleCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Startmodulecommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/StartModuleCommands.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Startmodulewindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/StartModuleWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Startmodulewindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/StartModuleWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Substitution_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Substitution.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/UI.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/UI.xcu";
-End
-
-File gid_File_Oo_Office_Views_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Views.xcs";
-End
-
-File gid_File_Oo_Office_Writer_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Writer.xcs";
-End
-
-File gid_File_Oo_Office_Writer_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/Writer.xcu";
-End
-
-File gid_File_Oo_Office_WebWizard_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/WebWizard.xcs";
-End
-
-File gid_File_Oo_Office_WebWizard_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/WebWizard.xcu";
-End
-
-File gid_File_Oo_Office_FormWizard_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/FormWizard.xcs";
-End
-
-File gid_File_Oo_Office_FormWizard_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/FormWizard.xcu";
-End
-
-
-File gid_File_Oo_Office_TableWizard_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/TableWizard.xcs";
-End
-
-File gid_File_Oo_Office_TableWizard_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office;
- Name = "/registry/data/org/openoffice/Office/TableWizard.xcu";
-End
-
-
-File gid_File_Oo_Office_Writerweb_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/WriterWeb.xcs";
-End
-
-File gid_File_Oo_Office_TypeDetection_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/TypeDetection.xcs";
-End
-
-File gid_File_Oo_Office_Embedding_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office;
- Name = "/registry/schema/org/openoffice/Office/Embedding.xcs";
-End
-
-File gid_File_Oo_Setup_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/Setup.xcs";
-End
-
-File gid_File_Oo_Setup_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/Setup.xcu";
-End
-
-File gid_File_Oo_Setup_Start_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-start.xcu";
-End
-
-File gid_File_Oo_Firststartwizard_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/FirstStartWizard.xcs";
-End
-
-File gid_File_Oo_Firststartwizard_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/FirstStartWizard.xcu";
-End
-
-File gid_File_Oo_System_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/System.xcs";
-End
-
-File gid_File_Oo_Typedetection_Filter_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection;
- Name = "/registry/schema/org/openoffice/TypeDetection/Filter.xcs";
-End
-
-File gid_File_Oo_Typedetection_Graphicfilter_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection;
- Name = "/registry/schema/org/openoffice/TypeDetection/GraphicFilter.xcs";
-End
-
-File gid_File_Oo_Typedetection_Misc_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection;
- Name = "/registry/schema/org/openoffice/TypeDetection/Misc.xcs";
-End
-
-File gid_File_Oo_Typedetection_Types_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection;
- Name = "/registry/schema/org/openoffice/TypeDetection/Types.xcs";
-End
-
-File gid_File_Oo_Typedetection_UISort_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Typedetection;
- Name = "/registry/schema/org/openoffice/TypeDetection/UISort.xcs";
-End
-
-File gid_File_Oo_TypeDetection_UISort_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Typedetection;
- Name = "/registry/data/org/openoffice/TypeDetection/UISort.xcu";
-End
-
-File gid_File_Oo_Ucb_Configuration_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Ucb;
- Name = "/registry/schema/org/openoffice/ucb/Configuration.xcs";
-End
-
-File gid_File_Oo_Ucb_InteractionHandler_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Ucb;
- Name = "/registry/schema/org/openoffice/ucb/InteractionHandler.xcs";
-End
-
-File gid_File_Oo_Ucb_Configuration_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Ucb;
- Name = "/registry/data/org/openoffice/ucb/Configuration.xcu";
-End
-
-File gid_File_Oo_Ucb_Hierarchy_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Ucb;
- Name = "/registry/schema/org/openoffice/ucb/Hierarchy.xcs";
-End
-
-File gid_File_Oo_Ucb_Store_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Ucb;
- Name = "/registry/schema/org/openoffice/ucb/Store.xcs";
-End
-
-File gid_File_Oo_Userprofile_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/UserProfile.xcs";
-End
-
-File gid_File_Oo_Userprofile_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/UserProfile.xcu";
-End
-
-File gid_File_Oo_Vcl_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/VCL.xcs";
-End
-
-File gid_File_Oo_Vcl_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/VCL.xcu";
-End
-
-File gid_File_Oo_Ldap_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice;
- Name = "/registry/schema/org/openoffice/LDAP.xcs";
-End
-
-
-File gid_File_Oo_Ldap_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice;
- Name = "/registry/data/org/openoffice/LDAP.xcu.sample";
-End
-
-File gid_File_Oo_Ldap_Attr_Map
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Ldap;
- Name = "/registry/schema/oo-ldap-attr.map";
-End
-
-File gid_File_Oo_AD_Ldap_Attr_Map
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Ldap;
- Name = "/registry/schema/oo-ad-ldap-attr.map";
+ Dir = gid_Dir_Share_Registry;
+ Name = "oo-ad-ldap.xcd.sample";
End
File gid_File_Rdb_Offapi
@@ -2135,141 +1191,43 @@ End
#endif
File gid_File_Registry_Lang
- Dir = gid_Dir_Share_Registry_Res_Lang;
- ARCHIVE_TXT_FILE_BODY;
- EXTRA_ALL_LANG(registry);
-End
-
-File gid_File_Registry_Filter_Zip
- Dir = gid_Dir_Share_Registry_Res_Lang;
- ARCHIVE_TXT_FILE_BODY;
- EXTRA_ALL_LANG(fcfg_langpack);
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Base_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_base_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Base_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_base_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Base_Others_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Misc;
- Name = "/registry/spool/fcfg_base_others.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Chart_Types_Xcu
+ Dir = gid_Dir_Share_Registry_Res;
TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_chart_types.xcu";
+ EXTRA_ALL_LANG_BUT_EN_US(registry,xcd);
End
-File gid_File_Registry_Spool_Oo_TypeDetection_Chart_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_chart_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Chart_Others_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Misc;
- Name = "/registry/spool/fcfg_chart_others.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_InternalGraphics_Types_Xcu
+File gid_File_Registry_Filter_Zip
+ Dir = gid_Dir_Share_Registry_Res;
TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_internalgraphics_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_InternalGraphics_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_GraphicFilter;
- Name = "/registry/spool/fcfg_internalgraphics_filters.xcu";
+ EXTRA_ALL_LANG(fcfg_langpack,xcd);
End
File gid_File_Registry_Spool_Langpack_Lang
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- FILE_ALL_LANG_LETTER(/registry/spool/Langpack-,xcu);
+ Dir = gid_Dir_Share_Registry;
+ FILE_ALL_LANG_LETTER(Langpack-,xcd);
End
-File gid_File_Registry_Spool_Oo_Accelerators_System_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Accelerators;
-#ifdef QUARTZ
- Name = "/registry/spool/org/openoffice/Office/Accelerators-macosx.xcu";
-#else
- Name = "/registry/spool/org/openoffice/Office/Accelerators-unxwnt.xcu";
-#endif
-End
-
-File gid_File_Oo_Office_Paths_System_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Paths;
-#ifdef MACOSX
- Name = "/registry/spool/org/openoffice/Office/Paths-macosx.xcu";
-#else
- Name = "/registry/spool/org/openoffice/Office/Paths-unxwnt.xcu";
-#endif
-End
-
-File gid_File_Registry_Spool_Oo_Common_System_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
-#ifdef WNT
- Name = "/registry/spool/org/openoffice/Office/Common-wnt.xcu";
-#elif defined QUARTZ
- Name = "/registry/spool/org/openoffice/Office/Common-macosx.xcu";
-#else
- Name = "/registry/spool/org/openoffice/Office/Common-unx.xcu";
-#endif
-End
-
-File gid_File_Registry_Spool_Oo_Common_Ctl_Xcu
+File gid_File_Share_Registry_Ctl_Xcd
TXT_FILE_BODY;
Styles = (PACKED,MAKE_LANG_SPECIFIC);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name (th) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (hi-IN) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (pa-IN) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (ta-IN) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (gu-IN) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (ar) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (he) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (lo) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (dz) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (km) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (gu-IN) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (or) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (ne) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (fa) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
- Name (my) = "/registry/spool/org/openoffice/Office/Common-ctl.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Office_Writer_PyMailMerge_Xcu
- TXT_FILE_BODY;
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Writer;
- Name = "/registry/spool/org/openoffice/Office/Writer-javamail.xcu";
- Styles = (PACKED);
+ Dir = gid_Dir_Share_Registry;
+ Name (th) = "ctl.xcd";
+ Name (hi-IN) = "ctl.xcd";
+ Name (pa-IN) = "ctl.xcd";
+ Name (ta-IN) = "ctl.xcd";
+ Name (gu-IN) = "ctl.xcd";
+ Name (ar) = "ctl.xcd";
+ Name (he) = "ctl.xcd";
+ Name (lo) = "ctl.xcd";
+ Name (dz) = "ctl.xcd";
+ Name (km) = "ctl.xcd";
+ Name (gu-IN) = "ctl.xcd";
+ Name (or) = "ctl.xcd";
+ Name (ne) = "ctl.xcd";
+ Name (fa) = "ctl.xcd";
+ Name (my) = "ctl.xcd";
End
File gid_File_Scripts_Beanshell
@@ -2719,28 +1677,6 @@ File gid_Starregistry_Services_Rdb
JavaServicesURLPrefix = "vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/";
End
-#if defined(UNX) && !defined(QUARTZ)
-
-File gid_File_Registry_Spool_Oo_Office_Common_UseOOoFileDialogs_Xcu
- TXT_FILE_BODY;
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-UseOOoFileDialogs.xcu";
- Styles = (PACKED,SCPZIP_REPLACE);
-End
-
-#endif
-
-#ifdef WNT
-
-File gid_File_Registry_Spool_Oo_Office_Linguistic_Forcedefaultlanguage_Xcu
- TXT_FILE_BODY;
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic;
- Name = "/registry/spool/org/openoffice/Office/Linguistic-ForceDefaultLanguage.xcu";
- Styles = (PACKED,SCPZIP_REPLACE,SET_OFFICE_LANGUAGE);
-End
-
-#endif
-
#ifdef LINUX
File gid_File_Dat_Root3
TXT_FILE_BODY;
@@ -2817,7 +1753,7 @@ File gid_File_InfoPlist_Lang
Dir = gid_Dir_Bundle_Contents_Resources_Lang;
ARCHIVE_TXT_FILE_BODY;
Styles = (ARCHIVE);
- EXTRA_ALL_LANG(InfoPlist);
+ EXTRA_ALL_LANG(InfoPlist,zip);
End
#endif
@@ -2924,25 +1860,11 @@ File gid_File_ImagesClassic8_Zip
Styles = (PACKED);
End
-File gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Spellchecker_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic;
- Name = "/registry/data/org/openoffice/Office/Linguistic-lingucomponent-spellchecker.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Hyphenator_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic;
- Name = "/registry/data/org/openoffice/Office/Linguistic-lingucomponent-hyphenator.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Thesaurus_Xcu
+File gid_File_Share_Registry_Lingucomponent_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Linguistic;
- Name = "/registry/data/org/openoffice/Office/Linguistic-lingucomponent-thesaurus.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "lingucomponent.xcd";
End
// Dictionary extensions
diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk
index 5258c40c8c02..0777febdc869 100644
--- a/scp2/source/ooo/makefile.mk
+++ b/scp2/source/ooo/makefile.mk
@@ -41,10 +41,6 @@ TARGETTYPE=CUI
SCPDEFS+=-D_MSC
.ENDIF
-.IF "$(ENABLE_CRASHDUMP)"!=""
-SCPDEFS+=-DENABLE_CRASHDUMP
-.ENDIF
-
.IF "$(BUILD_SPECIAL)"!=""
SCPDEFS+=-DBUILD_SPECIAL
.ENDIF
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index 1e27f8ffa9bd..1393eb36f6e5 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -170,13 +170,11 @@ Module gid_Module_Root_Files_4
gid_File_Lib_Dba,
gid_File_Lib_Dbacfg,
gid_File_Lib_Dbase2,
- gid_File_Oo_Office_Dataaccess_Dbase_Xcu,
gid_File_Lib_Dbaxml,
gid_File_Lib_Dbt,
gid_File_Lib_Dbfile,
gid_File_Lib_Drawinglayer,
gid_File_Lib_Editeng,
- gid_File_Oo_Office_Dataaccess_Flat_Xcu,
gid_File_Lib_Flat,
gid_File_Lib_For,
gid_File_Lib_Forui,
@@ -270,16 +268,13 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Index_Data,
gid_File_Lib_Textconv_Dict,
gid_File_Lib_Basprov,
- gid_File_Lib_Behelper,
- gid_File_Lib_Configmgr2,
+ gid_File_Lib_Configmgr,
gid_File_Lib_Crypto,
gid_File_Lib_Dlgprov,
gid_File_Lib_Stringresource,
gid_File_Lib_Ldapbe2,
gid_File_Lib_Comphelper2,
- gid_File_Lib_Sysmgr1,
gid_File_Lib_Adabas,
- gid_File_Oo_Office_Dataaccess_Adabas_Xcu,
gid_File_Lib_Cached1,
gid_File_Lib_Curl,
gid_File_Lib_Db,
@@ -287,11 +282,8 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Embobj,
gid_File_Lib_Emboleobj,
gid_File_Lib_Evoab_2,
- gid_File_Oo_Office_Dataaccess_Evoab_Xcu,
gid_File_Lib_Kab_1,
- gid_File_Oo_Office_Dataaccess_Kab_Xcu,
gid_File_Lib_Kab_Drv_1,
- gid_File_Oo_Office_Dataaccess_Macab_Xcu,
gid_File_Lib_Macab_1,
gid_File_Lib_Macab_Drv_1,
gid_File_Lib_Evtatt,
@@ -313,19 +305,14 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Localedata_Es,
gid_File_Lib_Localedata_Euro,
gid_File_Lib_Localedata_Others,
- gid_File_Oo_Office_Dataaccess_Hsqldb_Xcu,
gid_File_Lib_Hsqldb_2,
gid_File_Lib_Jdbc,
- gid_File_Oo_Office_Dataaccess_Jdbc_Xcu,
gid_File_Lib_Mcnttype,
- gid_File_Oo_Office_Dataaccess_Mozab_Xcu,
gid_File_Lib_Mozab_2,
gid_File_Lib_Mozabdrv,
gid_File_Lib_Mozbootstrap,
gid_File_Lib_Mysql,
- gid_File_Oo_Office_Dataaccess_Mysql_Xcu,
gid_File_Lib_Odbc,
- gid_File_Oo_Office_Dataaccess_Odbc_Xcu,
gid_File_Lib_Officebean,
gid_File_Lib_Openssl,
gid_File_Lib_Package2,
@@ -386,7 +373,6 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Stdc_5,
gid_File_Lib_Accessbridge,
gid_File_Lib_Ado,
- gid_File_Oo_Office_Dataaccess_Ado_Xcu,
gid_File_Lib_Dl,
gid_File_Lib_Dnd,
gid_File_Lib_Dtrans,
@@ -634,150 +620,9 @@ Module gid_Module_Root_Files_6
gid_File_Mod_Style,
gid_File_Mod_Table,
gid_File_Mod_Text,
- gid_File_Oo_Ldap_Attr_Map,
- gid_File_Oo_AD_Ldap_Attr_Map,
- gid_File_Oo_Inet_Xcs,
- gid_File_Oo_Inet_Xcu,
- gid_File_Oo_Office_Addons_Xcs,
- gid_File_Oo_Office_OOoImprovement_Settings_Xcs,
- gid_File_Oo_Office_Ui_Basicidecommands_Xcs,
- gid_File_Oo_Office_Ui_Basicidecommands_Xcu,
- gid_File_Oo_Office_Ui_Windowstate_Xcs,
- gid_File_Oo_Office_Ui_Basicidewindowstate_Xcs,
- gid_File_Oo_Office_Ui_Basicidewindowstate_Xcu,
- gid_File_Oo_Office_Ui_Bibliographycommands_Xcs,
- gid_File_Oo_Office_Ui_Bibliographycommands_Xcu,
- gid_File_Oo_Office_Ui_Bibliographywindowstate_Xcs,
- gid_File_Oo_Office_Calc_Xcs,
- gid_File_Oo_Office_Calc_Xcu,
- gid_File_Oo_Office_CalcAddIns_Xcs,
- gid_File_Oo_Office_Chart_Xcs,
- gid_File_Oo_Office_Ui_Chartcommands_Xcs,
- gid_File_Oo_Office_Ui_Chartcommands_Xcu,
- gid_File_Oo_Office_Ui_Chartwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Chartwindowstate_Xcu,
- gid_File_Oo_Office_Commands_Xcs,
- gid_File_Oo_Office_Ui_Commands_Xcs,
- gid_File_Oo_Office_Ui_Category_Xcs,
- gid_File_Oo_Office_Ui_Drawimpresscommands_Xcs,
- gid_File_Oo_Office_Ui_Drawimpresscommands_Xcu,
- gid_File_Oo_Office_Ui_Genericcategories_Xcs,
- gid_File_Oo_Office_Ui_Genericcategories_Xcu,
- gid_File_Oo_Office_Common_Xcs,
- gid_File_Oo_Office_Common_Xcu,
- gid_File_Oo_Office_Extendedcolorscheme_Xcs,
- gid_File_Oo_Office_OptionsDialog_Xcs,
- gid_File_Oo_Office_Recovery_Xcs,
- gid_File_Oo_Office_Compatibility_Xcs,
- gid_File_Oo_Office_Ui_Controller_Xcs,
- gid_File_Oo_Office_Ui_Controller_Xcu,
- gid_File_Oo_Office_Dataaccess_Xcs,
- gid_File_Oo_Office_Dataaccess_Xcu,
- gid_File_Oo_Office_Dataaccess_Drivers_Xcs,
- gid_File_Oo_Office_Ui_Dbucommands_Xcs,
- gid_File_Oo_Office_Ui_Dbucommands_Xcu,
- gid_File_Oo_Office_Ui_Basewindowstate_Xcs,
- gid_File_Oo_Office_Ui_Basewindowstate_Xcu,
- gid_File_Oo_Office_Ui_Dbtablewindowstate_Xcs,
- gid_File_Oo_Office_Ui_Dbtablewindowstate_xcu,
- gid_File_Oo_Office_Ui_Dbbrowserwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Dbbrowserwindowstate_xcu,
- gid_File_Oo_Office_Ui_Dbquerywindowstate_Xcs,
- gid_File_Oo_Office_Ui_Dbquerywindowstate_xcu,
- gid_File_Oo_Office_Ui_Dbrelationwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Dbrelationwindowstate_xcu,
- gid_File_Oo_Office_Draw_Xcs,
- gid_File_Oo_Office_Events_Xcs,
- gid_File_Oo_Office_ExtensionManager_Xcs,
- gid_File_Oo_Office_ExtensionManager_Xcu,
- gid_File_Oo_Office_Ui_Factories_Xcs,
- gid_File_Oo_Office_Ui_Factories_Xcu,
- gid_File_Oo_Office_Embedding_Xcu,
- gid_File_Oo_Office_Ui_Genericcommands_Xcs,
- gid_File_Oo_Office_Ui_Genericcommands_Xcu,
- gid_File_Oo_Office_Ui_GlobalSettings_Xcs,
- gid_File_Oo_Office_Impress_Xcs,
- gid_File_Oo_Office_Impress_Xcu,
- gid_File_Oo_Office_Java_Xcs,
- gid_File_Oo_Office_Jobs_Xcs,
- gid_File_Oo_Office_Jobs_Xcu,
- gid_File_Oo_Office_Labels_Xcs,
- gid_File_Oo_Office_Labels_Xcu,
- gid_File_Oo_Office_Linguistic_Xcs,
- gid_File_Oo_Office_Math_Xcs,
- gid_File_Oo_Office_Math_Xcu,
- gid_File_Oo_Office_Protocolhandler_Xcs,
- gid_File_Oo_Office_Protocolhandler_Xcu,
- gid_File_Oo_Office_Scripting_Xcs,
- gid_File_Oo_Office_Scripting_Xcu,
- gid_File_Oo_Office_Security_Xcs,
- gid_File_Oo_Office_Security_Xcu,
- gid_File_Oo_Office_Sfx_Xcs,
- gid_File_Oo_Office_Sfx_Xcu,
- gid_File_Oo_Office_Ui_Startmodulecommands_Xcs,
- gid_File_Oo_Office_Ui_Startmodulecommands_Xcu,
- gid_File_Oo_Office_Ui_Startmodulewindowstate_Xcs,
- gid_File_Oo_Office_Ui_Startmodulewindowstate_Xcu,
- gid_File_Oo_Office_Substitution_Xcs,
- gid_File_Oo_Office_Ui_Xcs,
- gid_File_Oo_Office_Ui_Xcu,
- gid_File_Oo_Office_Views_Xcs,
- gid_File_Oo_Office_Writer_Xcs,
- gid_File_Oo_Office_Writer_Xcu,
- gid_File_Oo_Office_WebWizard_Xcs,
- gid_File_Oo_Office_WebWizard_Xcu,
- gid_File_Oo_Office_FormWizard_Xcs,
- gid_File_Oo_Office_FormWizard_Xcu,
- gid_File_Oo_Office_TableWizard_Xcs,
- gid_File_Oo_Office_TableWizard_Xcu,
- gid_File_Oo_Office_Writerweb_Xcs,
- gid_File_Oo_Office_TypeDetection_Xcs,
- gid_File_Oo_Office_Embedding_Xcs,
- gid_File_Oo_Setup_Xcs,
- gid_File_Oo_Setup_Xcu,
- gid_File_Oo_Setup_Start_Xcu,
- gid_File_Oo_Firststartwizard_Xcs,
- gid_File_Oo_Firststartwizard_Xcu,
- gid_File_Oo_System_Xcs,
- gid_File_Oo_Typedetection_Filter_Xcs,
- gid_File_Oo_Typedetection_Graphicfilter_Xcs,
- gid_File_Oo_Typedetection_Misc_Xcs,
- gid_File_Oo_Typedetection_Types_Xcs,
- gid_File_Oo_Ucb_Configuration_Xcs,
- gid_File_Oo_Ucb_Configuration_Xcu,
- gid_File_Oo_Ucb_InteractionHandler_Xcs,
- gid_File_Oo_Ucb_Hierarchy_Xcs,
- gid_File_Oo_Ucb_Store_Xcs,
- gid_File_Oo_Userprofile_Xcs,
- gid_File_Oo_Userprofile_Xcu,
- gid_File_Oo_Vcl_Xcs,
- gid_File_Oo_Vcl_Xcu,
- gid_File_Oo_Ldap_Xcs,
- gid_File_Oo_Ldap_Xcu,
- gid_File_Oo_Typedetection_UISort_Xcs,
- gid_File_Oo_Office_Ui_Mathwindowstate_Xcs,
- gid_File_Oo_Office_Views_Xcu,
- gid_File_Oo_TypeDetection_UISort_Xcu,
- gid_File_Registry_Spool_Oo_Office_Embedding_Chart_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Base_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Base_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Base_Others_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Chart_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Chart_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Chart_Others_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_InternalGraphics_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_InternalGraphics_Filters_Xcu,
- gid_File_Registry_Spool_Oo_Common_System_Xcu,
- gid_File_Registry_Spool_Oo_Office_Common_UseOOoFileDialogs_Xcu,
- gid_File_Registry_Spool_Oo_Dataaccess_Adabasdriver_Xcu,
- gid_File_Registry_Spool_Oo_Writer_javamail_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_UISort_Writer_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Calc_UISort_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Draw_UISort_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Impress_UISort_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Math_UISort_Xcu,
- gid_File_Registry_Spool_Oo_Office_Linguistic_Forcedefaultlanguage_Xcu,
- gid_File_Registry_Spool_Oo_Office_Writer_PyMailMerge_Xcu,
+ gid_File_Oo_Ldap_Xcd_Sample,
+ gid_File_Oo_Ad_Ldap_Xcd_Sample,
+ gid_File_Share_Registry_Main_Xcd,
gid_File_Pymailmerge,
gid_File_Xsl_Common_Measure_Conversion,
gid_File_Xsl_Common_Math_Functions,
@@ -928,11 +773,9 @@ Module gid_Module_Oo_Linguistic
Styles = (HIDDEN_ROOT);
Files = (gid_File_Lib_Spell,
gid_File_Lib_Hunspell,
- gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Spellchecker_Xcu,
gid_File_Lib_Hyph,
- gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Hyphenator_Xcu,
gid_File_Lib_Lnth,
- gid_File_Registry_Spool_Oo_Office_Linguistic_Lingucomponent_Thesaurus_Xcu);
+ gid_File_Share_Registry_Lingucomponent_Xcd);
End
#ifdef LINUX
diff --git a/scp2/source/ooo/module_improvement.scp b/scp2/source/ooo/module_improvement.scp
index 07c0aab47bf1..1380202f34e7 100644
--- a/scp2/source/ooo/module_improvement.scp
+++ b/scp2/source/ooo/module_improvement.scp
@@ -37,6 +37,6 @@ Module gid_Module_Oooimprovement
ParentID = gid_Module_Root;
Default = YES;
Styles = (HIDDEN_ROOT);
- Files = (gid_File_Share_Registry_Modules_Oo_Office_Jobs_Improvement, gid_File_Share_Registry_Modules_Oo_Office_Logging_Improvement, gid_File_Lib_Oooimprovement);
+ Files = (gid_File_Share_Registry_Oooimprovement_Xcd, gid_File_Lib_Oooimprovement);
End
#endif
diff --git a/scp2/source/ooo/module_lang_template.scp b/scp2/source/ooo/module_lang_template.scp
index 2abbf1816edf..7ecd4747cdea 100755
--- a/scp2/source/ooo/module_lang_template.scp
+++ b/scp2/source/ooo/module_lang_template.scp
@@ -44,10 +44,9 @@ Module gid_Module_Langpack_Basis_Template
gid_File_Extra_Wordbook,
gid_File_Extra_Wordbook_Lang,
gid_File_Registry_Filter_Zip,
- gid_File_Registry_Drivers_Zip,
gid_File_Registry_Lang,
gid_File_Registry_Spool_Langpack_Lang,
- gid_File_Registry_Spool_Oo_Common_Ctl_Xcu,
+ gid_File_Share_Registry_Ctl_Xcd,
gid_File_InfoPlist_Lang);
Dirs = (gid_Dir_Samples_Language);
End
diff --git a/scp2/source/ooo/profile_ooo.scp b/scp2/source/ooo/profile_ooo.scp
index 502427e416c7..a2491045caf9 100644
--- a/scp2/source/ooo/profile_ooo.scp
+++ b/scp2/source/ooo/profile_ooo.scp
@@ -27,17 +27,6 @@
#include "macros.inc"
-Profile gid_Profile_Configmgr_Ini
- ModuleID = gid_Module_Root;
- #ifdef UNX
- Name = "configmgrrc";
- #else
- Name = "configmgr.ini";
- #endif
- Dir = gid_Dir_Program;
- Styles = (NETWORK);
-End
-
Profile gid_Profile_Uno_Ini
ModuleID = gid_Module_Root;
#ifdef UNX
diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp
index 191a96a27634..bb3a9ecd4126 100644
--- a/scp2/source/ooo/profileitem_ooo.scp
+++ b/scp2/source/ooo/profileitem_ooo.scp
@@ -27,262 +27,6 @@
#include "macros.inc"
-// for the configmgr
-
-ProfileItem gid_Profileitem_Configmgr_Cfg_Servertype
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 1;
- Key = "CFG_ServerType";
- Value = "uno";
-End
-
-
-ProfileItem gid_Profileitem_Configmgr_Bootstrap_Ini
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 2;
- Key = "BootstrapFile";
- Value = "$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap);
-End
-
-ProfileItem gid_Profileitem_Configmgr_Version_Ini
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 2;
- Key = "VersionFile";
- Value = "$BRAND_BASE_DIR/program/" PROFILENAME(version);
-End
-
-
-ProfileItem gid_Profileitem_Configmgr_Uno_Ini
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 3;
- Key = "UnoFile";
- #ifdef UNX
- Value = "$ORIGIN/unorc";
- #else
- Value = "$ORIGIN/uno.ini";
- #endif
-End
-
-
-ProfileItem gid_Profileitem_Configmgr_Baseinstallation
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 4;
- Key = "BaseInstallation";
- Value = "${OOO_BASE_DIR}";
-End
-
-
-ProfileItem gid_Profileitem_Configmgr_Userinstallation
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 5;
- Key = "UserInstallation";
- Value = "${$BootstrapFile:UserInstallation}";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Schemaversion
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 6;
- Key = "CFG_SchemaVersion";
- Value = "${$VersionFile:buildid}";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Schemadataurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 7;
- Key = "CFG_SchemaDataUrl";
- Value = "$BaseInstallation/share/registry/schema ?$CFG_BrandLayerUrl/schema ?$CFG_UnoSharedPackages/schema ?$CFG_UnoUserPackages/schema";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Defaultdataurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 8;
- Key = "CFG_DefaultLayerUrls";
- Value = "$BaseInstallation/share/registry $CFG_UnoSharedPackages $CFG_UnoUserPackages";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Cachedisposal
- ProfileID =gid_Profile_Configmgr_Ini ;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 9;
- Key = "CFG_CacheDisposeDelay";
- Value = "900";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Cacheinterval
- ProfileID = gid_Profile_Configmgr_Ini ;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 10;
- Key = "CFG_CacheDisposeInterval";
- Value = "60";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Cachewrite
- ProfileID = gid_Profile_Configmgr_Ini ;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 11;
- Key = "CFG_CacheWriteInterval";
- Value = "2";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Userdataurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 12;
- Key = "CFG_UserLayerUrl";
- Value = "$UserInstallation/user/registry";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Cacheurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 13;
- Key = "CFG_CacheUrl";
- Value = "$UserInstallation/user/registry/cache";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Defaultlayerurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 14;
- Key = "CFG_DefaultLayerUrl";
- Value = "$BaseInstallation/share/registry";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Modulelayerurl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 15;
- Key = "CFG_ModuleLayerUrl";
- Value = "$CFG_DefaultLayerUrl/modules";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Unosharedpackages
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 16;
- Key = "CFG_UnoSharedPackages";
- Value = "${$UnoFile:UNO_SHARED_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registry";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Unouserpackages
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 17;
- Key = "CFG_UnoUserPackages";
- Value = "${$UnoFile:UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registry";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Unocfg_BrandLayerUrl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 18;
- Key = "CFG_BrandLayerUrl";
- Value = "${BRAND_BASE_DIR}/share/registry";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Unocfg_BrandLayerModulesUrl
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 19;
- Key = "CFG_BrandLayerModulesUrl";
- Value = "$CFG_BrandLayerUrl/modules";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Unocfg_Backendservice
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 20;
- Key = "CFG_BackendService";
- Value = "com.sun.star.comp.configuration.backend.MultiStratumBackend";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Schemasupplier
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 21;
- Key = "CFG_SchemaSupplier";
- Value = "com.sun.star.comp.configuration.backend.LocalSchemaSupplier";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Datasvc
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 22;
- Key = "CFG_LocalDataSvc";
- Value = "com.sun.star.comp.configuration.backend.LocalStratum";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Moduledatasvc
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 23;
- Key = "CFG_LocalModuleDataSvc";
- Value = "com.sun.star.comp.configuration.backend.LocalMultiStratum";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Localcfg_Resdatasvc
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 24;
- Key = "CFG_LocalResDataSvc";
- Value = "com.sun.star.comp.configuration.backend.LocalResourceStratum";
-End
-
-
-ProfileItem gid_Profileitem_Configmgr_Strata
- ProfileID = gid_Profile_Configmgr_Ini;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 25;
- Key = "CFG_Strata";
- Value = "${CFG_LocalDataSvc}:$CFG_DefaultLayerUrl;${CFG_LocalModuleDataSvc}:$CFG_ModuleLayerUrl;${CFG_LocalResDataSvc}:$CFG_DefaultLayerUrl;?${CFG_LocalDataSvc}:$CFG_BrandLayerUrl;?${CFG_LocalModuleDataSvc}:$CFG_BrandLayerModulesUrl;${CFG_LocalDataSvc}:$CFG_UnoSharedPackages;?com.sun.star.comp.configuration.backend.SystemIntegration:;${CFG_LocalDataSvc}:$CFG_UnoUserPackages;${CFG_LocalDataSvc}:$CFG_UserLayerUrl;";
-End
-
-ProfileItem gid_Profileitem_Configmgr_Ldapmappingurl
- ProfileID = gid_Profile_Configmgr_Ini ;
- ModuleID = gid_Module_Root;
- Section = "Bootstrap";
- Order = 26;
- Key = "CFG_LdapMappingUrl";
- Value = "$BaseInstallation/share/registry/ldap";
-End
-
-//end configmgr
-
ProfileItem gid_Profileitem_Setup_Uno_Java_Comppath
ProfileID = gid_Profile_Setup_Ini;
ModuleID = gid_Module_Root;
diff --git a/scp2/source/python/file_python.scp b/scp2/source/python/file_python.scp
index e506801c7f74..1303bf59460f 100644
--- a/scp2/source/python/file_python.scp
+++ b/scp2/source/python/file_python.scp
@@ -118,11 +118,11 @@ End
// Scripting Framework Python configuration settings
-File gid_File_Registry_Spool_Oo_Scripting_Python_Xcu
+File gid_File_Share_Registry_Pyuno_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Scripting;
- Name = "/registry/spool/org/openoffice/Office/Scripting-python.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "pyuno.xcd";
End
#ifndef SYSTEM_PYTHON
diff --git a/scp2/source/python/module_python.scp b/scp2/source/python/module_python.scp
index 6e1ae9c40d34..3abeec2e3142 100644
--- a/scp2/source/python/module_python.scp
+++ b/scp2/source/python/module_python.scp
@@ -32,7 +32,7 @@ Module gid_Module_Optional_Pyuno
MOD_NAME_DESC ( MODULE_OPTIONAL_PYTHON );
ParentID = gid_Module_Optional;
Sortkey = "750";
- Files = (gid_File_Pyuno,gid_File_Lib_Pyuno,gid_File_Lib_Pythonloader,gid_File_Py_Unohelper,gid_File_Py_Officehelper,gid_File_Py_Uno,gid_File_Py_Pythonloader,gid_File_Py_Python_Core,gid_File_Py_Python_Bin,gid_File_Lib_Python_So, gid_File_Lib_Python_So_Brand, gid_File_Py_Scriptprovider,gid_File_Py_Pythonscript,gid_File_Scripts_Python,gid_File_Registry_Spool_Oo_Scripting_Python_Xcu);
+ Files = (gid_File_Pyuno,gid_File_Lib_Pyuno,gid_File_Lib_Pythonloader,gid_File_Py_Unohelper,gid_File_Py_Officehelper,gid_File_Py_Uno,gid_File_Py_Pythonloader,gid_File_Py_Python_Core,gid_File_Py_Python_Bin,gid_File_Lib_Python_So, gid_File_Lib_Python_So_Brand, gid_File_Py_Scriptprovider,gid_File_Py_Pythonscript,gid_File_Scripts_Python,gid_File_Share_Registry_Pyuno_Xcd);
Minimal = NO;
Default = YES;
Styles = ( );
diff --git a/scp2/source/writer/file_writer.scp b/scp2/source/writer/file_writer.scp
index c06fc9465d01..3d7c22b9e7a9 100644
--- a/scp2/source/writer/file_writer.scp
+++ b/scp2/source/writer/file_writer.scp
@@ -63,13 +63,6 @@ File gid_File_Exe_Sweb
End
#endif
-File gid_File_Registry_Spool_Oo_Office_Embedding_Writer_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Embedding;
- Name = "/registry/spool/org/openoffice/Office/Embedding-writer.xcu";
-End
-
File gid_File_Help_Swriter_Zip
Dir = gid_Dir_Help_Isolanguage;
ARCHIVE_TXT_FILE_BODY;
@@ -99,164 +92,10 @@ File gid_File_Share_Config_Sofficecfg_Writerglobal_Menubar_Xml
Name = "/uiconfig/sglobal/menubar/menubar.xml";
End
*/
-File gid_File_Oo_Office_Ui_Writercommands_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterCommands.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writercommands_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterCommands.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Writer_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_writer_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Writer_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_writer_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Web_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_web_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Web_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_web_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Global_Types_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_global_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_Global_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_global_filters.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_UISort_Writer_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_UISort;
- Name = "/registry/spool/org/openoffice/TypeDetection/UISort-writer.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Common_Writer_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Office_Common;
- Name = "/registry/spool/org/openoffice/Office/Common-writer.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_Setup_Writer_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_Setup;
- Name = "/registry/spool/org/openoffice/Setup-writer.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Writerwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Xformswindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/XFormsWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writerformwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterFormWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writerreportwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterReportWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writerglobalwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterGlobalWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writerwebwindowstate_Xcs
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Schema_Org_Openoffice_Office_Ui;
- Name = "/registry/schema/org/openoffice/Office/UI/WriterWebWindowState.xcs";
-End
-
-File gid_File_Oo_Office_Ui_Writerwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu";
-End
-File gid_File_Oo_Office_Ui_Xformswindowstate_Xcu
+File gid_File_Share_Registry_Writer_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "writer.xcd";
End
-
-File gid_File_Oo_Office_Ui_Writerformwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Writerreportwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Writerglobalwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu";
-End
-
-File gid_File_Oo_Office_Ui_Writerwebwindowstate_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Data_Org_Openoffice_Office_Ui;
- Name = "/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu";
-End
-
diff --git a/scp2/source/writer/module_writer.scp b/scp2/source/writer/module_writer.scp
index 0e93dfeab35a..16928c8b25b9 100644
--- a/scp2/source/writer/module_writer.scp
+++ b/scp2/source/writer/module_writer.scp
@@ -57,21 +57,7 @@ Module gid_Module_Prg_Wrt_Bin
gid_File_Jar_Email,
gid_File_Jar_Mail,
gid_File_Jar_Activation,
- gid_File_Oo_Office_Ui_Writercommands_Xcs,
- gid_File_Oo_Office_Ui_Writercommands_Xcu,
- gid_File_Registry_Spool_Oo_Common_Writer_Xcu,
- gid_File_Registry_Spool_Oo_Setup_Writer_Xcu,
- gid_File_Registry_Spool_Oo_Common_Dicooo_Xcu,
- gid_File_Oo_Office_Ui_Writerwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Writerglobalwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Writerwebwindowstate_Xcs,
- gid_File_Oo_Office_Ui_Writerwindowstate_Xcu,
- gid_File_Oo_Office_Ui_Writerglobalwindowstate_Xcu,
- gid_File_Oo_Office_Ui_Writerwebwindowstate_Xcu,
- gid_File_Registry_Spool_Oo_Office_Embedding_Writer_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Writer_Types_Xcu, gid_File_Registry_Spool_Oo_TypeDetection_Writer_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Web_Types_Xcu, gid_File_Registry_Spool_Oo_TypeDetection_Web_Filters_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_Global_Types_Xcu, gid_File_Registry_Spool_Oo_TypeDetection_Global_Filters_Xcu,
+ gid_File_Share_Registry_Writer_Xcd,
gid_File_Tmp_Userinstall_Wrt_Inf);
End
diff --git a/scp2/source/xsltfilter/file_xsltfilter.scp b/scp2/source/xsltfilter/file_xsltfilter.scp
index 735e55be8dd7..848b1c707ff7 100644
--- a/scp2/source/xsltfilter/file_xsltfilter.scp
+++ b/scp2/source/xsltfilter/file_xsltfilter.scp
@@ -27,18 +27,11 @@
#include "macros.inc"
-File gid_File_Registry_Spool_Oo_TypeDetection_XSLT_Types_Xcu
+File gid_File_Share_Registry_Xsltfilter_Xcd
TXT_FILE_BODY;
Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Types;
- Name = "/registry/spool/fcfg_xslt_types.xcu";
-End
-
-File gid_File_Registry_Spool_Oo_TypeDetection_XSLT_Filters_Xcu
- TXT_FILE_BODY;
- Styles = (PACKED);
- Dir = gid_Dir_Share_Registry_Modules_Oo_TypeDetection_Filter;
- Name = "/registry/spool/fcfg_xslt_filters.xcu";
+ Dir = gid_Dir_Share_Registry;
+ Name = "xsltfilter.xcd";
End
File gid_File_Stw_Docbooktemplate
diff --git a/scp2/source/xsltfilter/module_xsltfilter.scp b/scp2/source/xsltfilter/module_xsltfilter.scp
index 0cc033ea6dde..7854ce70474f 100644
--- a/scp2/source/xsltfilter/module_xsltfilter.scp
+++ b/scp2/source/xsltfilter/module_xsltfilter.scp
@@ -43,8 +43,7 @@ Module gid_Module_Optional_Xsltfiltersamples
gid_File_Xsl_Export_Xhtml_Master_Usability_Links,
gid_File_Xsl_Export_Xhtml_Ooo2xhtml,
gid_File_Xsl_Export_Xhtml_Table,
- gid_File_Registry_Spool_Oo_TypeDetection_XSLT_Types_Xcu,
- gid_File_Registry_Spool_Oo_TypeDetection_XSLT_Filters_Xcu );
+ gid_File_Share_Registry_Xsltfilter_Xcd );
Minimal = NO;
Default = NO;
Styles = ( );
diff --git a/scp2/util/makefile.mk b/scp2/util/makefile.mk
index f62d0c0f2a91..1fed891823b6 100644
--- a/scp2/util/makefile.mk
+++ b/scp2/util/makefile.mk
@@ -172,7 +172,7 @@ SCP1FILES += \
.IF "$(ENABLE_CRASHDUMP)" != ""
SCP1FILES += \
- file_crashrep_dynamic.par
+ file_crashrep.par
.ENDIF
SCP1FILES += \
@@ -325,7 +325,7 @@ SCP2FILES += \
.IF "$(ENABLE_CRASHDUMP)" != ""
SCP2FILES += \
- file_crashrep_dynamic.par
+ file_crashrep.par
.ENDIF
SCP2FILES += \
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index d0603ea4d5d4..2a40c8707866 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -205,7 +205,7 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
if ( !mpPicStrm )
mpPicStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) );
- mpPptEscherEx = new PptEscherEx( *mpStrm, mnDrawings );
+ mpPptEscherEx = new PptEscherEx( *mpStrm );
if ( !ImplGetStyleSheets() )
return;
@@ -1694,7 +1694,7 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+ EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );
if ( ImplGetPropertyValue( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index cda15e75831d..f07245d1ff31 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -754,7 +754,7 @@ sal_Bool PPTWriter::ImplCloseDocument()
nBytesToInsert += ImplDocumentListContainer( NULL );
// nBytes im Stream einfuegen, und abhaengige Container anpassen
- mpPptEscherEx->InsertAtCurrentPos( nBytesToInsert, TRUE );
+ mpPptEscherEx->InsertAtCurrentPos( nBytesToInsert, false );
// CREATE HYPERLINK CONTAINER
if ( nExEmbedSize )
@@ -1506,7 +1506,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+ EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.CreateGradientProperties( mXPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@@ -1529,7 +1529,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+ EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.CreateGradientProperties( mXBackgroundPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@@ -4135,7 +4135,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
if ( bRet && bMasterPage )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
- sal_uInt32 nPresShapeID = mpPptEscherEx->GetShapeID();
+ sal_uInt32 nPresShapeID = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nPresShapeID );// Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -4191,7 +4191,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
void PPTWriter::ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& rSolver )
{
- sal_uInt32 nId = mpPptEscherEx->GetShapeID();
+ sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( nType, nFlags, nId );
rSolver.AddShape( mXShape, nId );
}
@@ -4279,7 +4279,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
const ::com::sun::star::awt::Size aSize100thmm( mXShape->getSize() );
const ::com::sun::star::awt::Point aPoint100thmm( mXShape->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect100thmm );
+ EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
if ( bGroup )
{
@@ -4837,7 +4837,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
sal_uInt16 nChar;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
- mnShapeMasterTitle = mpPptEscherEx->GetShapeID();
+ mnShapeMasterTitle = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterTitle );// Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropertyOptions;
aPropertyOptions.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -4931,7 +4931,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
if ( mnTextSize )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
- mnShapeMasterBody = mpPptEscherEx->GetShapeID();
+ mnShapeMasterBody = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterBody ); // Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropOpt2;
aPropOpt2.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -5540,7 +5540,7 @@ void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 n
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
EscherPropertyContainer aPropOptSp;
- sal_uInt32 nId = mpPptEscherEx->GetShapeID();
+ sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Line, 0xa02, nId );
aPropOptSp.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0xa0008 );
@@ -5586,7 +5586,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
<< (INT32)maRect.Right()
<< (INT32)maRect.Bottom();
- sal_uInt32 nShapeId = mpPptEscherEx->GetShapeID();
+ sal_uInt32 nShapeId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | Patriarch
aSolverContainer.AddShape( rXShape, nShapeId );
EscherPropertyContainer aPropOpt2;
diff --git a/sd/source/filter/eppt/escherex.cxx b/sd/source/filter/eppt/escherex.cxx
index 1f91b4947026..fbb94de67ae7 100644
--- a/sd/source/filter/eppt/escherex.cxx
+++ b/sd/source/filter/eppt/escherex.cxx
@@ -37,14 +37,10 @@
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
-PptEscherEx::PptEscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
- EscherEx ( rOutStrm, nDrawings )
+PptEscherEx::PptEscherEx( SvStream& rOutStrm ) :
+ EscherEx( EscherExGlobalRef( new EscherExGlobal ), rOutStrm )
{
- mnFIDCLs = nDrawings;
mnCurrentDg = 0;
- mnCurrentShapeID = 0;
- mnTotalShapesDgg = 0;
- mnCurrentShapeMaximumID = 0;
}
// ---------------------------------------------------------------------------------------------
@@ -69,8 +65,8 @@ sal_uInt32 PptEscherEx::ImplDggContainerSize()
{
UINT32 nSize;
- nSize = ImplDggAtomSize();
- nSize += GetBlibStoreContainerSize();
+ nSize = mxGlobal->GetDggAtomSize();
+ nSize += mxGlobal->GetBlibStoreContainerSize();
nSize += ImplOptAtomSize();
nSize += ImplSplitMenuColorsAtomSize();
@@ -85,8 +81,9 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
rSt << (sal_uInt32)( 0xf | ( ESCHER_DggContainer << 16 ) )
<< (sal_uInt32)( nSize - 8 );
- ImplWriteDggAtom( rSt );
- WriteBlibStoreContainer( rSt );
+ mxGlobal->SetDggContainer();
+ mxGlobal->WriteDggAtom( rSt );
+ mxGlobal->WriteBlibStoreContainer( rSt );
ImplWriteOptAtom( rSt );
ImplWriteSplitMenuColorsAtom( rSt );
}
@@ -94,29 +91,6 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
// ---------------------------------------------------------------------------------------------
-sal_uInt32 PptEscherEx::ImplDggAtomSize()
-{
- return maFIDCLs.Tell() + 24;
-}
-
-void PptEscherEx::ImplWriteDggAtom( SvStream& rSt )
-{
- sal_uInt32 nSize = ImplDggAtomSize();
- if ( nSize )
- {
- rSt << (sal_uInt32)( ESCHER_Dgg << 16 )
- << (sal_uInt32)( nSize - 8 )
- << mnCurrentShapeID
- << (sal_uInt32)( mnFIDCLs + 1 )
- << mnTotalShapesDgg
- << mnDrawings;
-
- rSt.Write( maFIDCLs.GetData(), nSize - 24 );
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
#define ESCHER_OPT_COUNT 6
sal_uInt32 PptEscherEx::ImplOptAtomSize()
@@ -191,11 +165,7 @@ void PptEscherEx::OpenContainer( UINT16 n_EscherContainer, int nRecInstance )
if ( !mbEscherDg )
{
mbEscherDg = TRUE;
- mnCurrentDg++;
- mnTotalShapesDg = 0;
- mnTotalShapeIdUsedDg = 0;
- mnCurrentShapeID = ( mnCurrentShapeMaximumID &~0x3ff ) + 0x400; // eine neue Seite bekommt immer eine neue ShapeId die ein vielfaches von 1024 ist,
- // damit ist erste aktuelle Shape ID 0x400
+ mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
*mpOutStrm << (UINT32)0 // The number of shapes in this drawing
@@ -246,39 +216,7 @@ void PptEscherEx::CloseContainer()
{
mbEscherDg = FALSE;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
- {
- // shapeanzahl des drawings setzen
- mnTotalShapesDgg += mnTotalShapesDg;
- *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
-
- if ( !mnTotalShapesDg )
- {
- maFIDCLs << (UINT32)0
- << (UINT32)0;
- }
- else
- {
- if ( mnTotalShapeIdUsedDg )
- {
- UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
- if ( nFIDCL )
- mnFIDCLs += nFIDCL;
- for ( i = 0; i <= nFIDCL; i++ )
- {
- maFIDCLs << mnCurrentDg; // drawing number
- if ( i < nFIDCL )
- maFIDCLs << 0x400;
- else
- {
- UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
- if ( !nShapesLeft )
- nShapesLeft = 0x400; // shape count in this IDCL
- maFIDCLs << (UINT32)nShapesLeft;
- }
- }
- }
- }
- }
+ *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
}
break;
@@ -326,7 +264,7 @@ sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClie
<< (INT32)aRect.Right()
<< (INT32)aRect.Bottom();
- nShapeId = GetShapeID();
+ nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
else
diff --git a/sd/source/filter/eppt/escherex.hxx b/sd/source/filter/eppt/escherex.hxx
index 5b8370857430..739ef6300d1c 100644
--- a/sd/source/filter/eppt/escherex.hxx
+++ b/sd/source/filter/eppt/escherex.hxx
@@ -48,14 +48,9 @@ enum PPT_TextHeader
class PptEscherEx : public EscherEx
{
- SvMemoryStream maFIDCLs;
-
sal_uInt32 ImplDggContainerSize();
void ImplWriteDggContainer( SvStream& rSt );
- sal_uInt32 ImplDggAtomSize();
- void ImplWriteDggAtom( SvStream& rSt );
-
sal_uInt32 ImplOptAtomSize();
void ImplWriteOptAtom( SvStream& rSt );
@@ -64,7 +59,7 @@ class PptEscherEx : public EscherEx
public:
- PptEscherEx( SvStream& rOut, UINT32 nDrawings );
+ PptEscherEx( SvStream& rOut );
~PptEscherEx();
void OpenContainer( UINT16 n_EscherContainer, int nRecInstance = 0 );
diff --git a/setup_native/scripts/javaloader.sh b/setup_native/scripts/javaloader.sh
index 22b1eb927625..e23505f586b0 100644
--- a/setup_native/scripts/javaloader.sh
+++ b/setup_native/scripts/javaloader.sh
@@ -242,7 +242,7 @@ install_linux_rpm()
# start to install jre
echo "Extracting ..."
olddir=`pwd`
- cd $tempdir
+ cd "$tempdir"
rpm2cpio $tempjrefile | cpio -i --make-directories
rm -f $tempjrefile # we do not need it anymore, so conserve discspace
@@ -330,7 +330,7 @@ install_linux_rpm()
fi
echo "Done."
- cd $olddir
+ cd "$olddir"
}
find_rpm2cpio()
diff --git a/setup_native/source/mac/macinstall.ulf b/setup_native/source/mac/macinstall.ulf
index 4651d93e03ab..2d92e8c260fb 100644
--- a/setup_native/source/mac/macinstall.ulf
+++ b/setup_native/source/mac/macinstall.ulf
@@ -62,7 +62,7 @@ en-US = "Installation failed."
en-US = "Installation of [PRODUCTNAME] language pack completed."
[InstallCompleteText2]
-en-US = "Call 'Tools-Options-Language Settings' to change the user interface language."
+en-US = "Call '[PRODUCTNAME]-Preferences-Language Settings-Languages' to change the user interface language."
[InstallCompleteTextPatch]
en-US = "Installation of [FULLPRODUCTNAME] completed"
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 03a31ac63db9..53cf115382e5 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -548,8 +548,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_CRASH :
{
- GetpApp()->Exception( EXC_SYSTEM );
- abort();
+ // Provoke a crash:
+ char * crash = 0;
+ *crash = 0;
+ break;
}
case SID_SHOW_IME_STATUS_WINDOW:
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 26fb46ec8b17..9ef635ae4786 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -122,7 +122,8 @@ rtl::OUString HelpLocaleString()
Any aLocale =
::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
::utl::ConfigManager::LOCALE );
- bool bOk = (aLocale >>= aLocaleStr);
+ aLocale >>= aLocaleStr;
+ bool bOk = aLocaleStr.getLength() != 0;
if ( bOk )
{
rtl::OUString aBaseInstallPath;
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index b128e305d655..091651fedbc2 100644
--- a/sfx2/source/bastyp/helper.cxx
+++ b/sfx2/source/bastyp/helper.cxx
@@ -549,9 +549,17 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL )
}
}
}
- catch( uno::Exception& )
- {
- DBG_ERRORFILE( "GetResultSet: Any other exception" );
+ catch( uno::Exception& e )
+ {
+ (void) e;
+ DBG_ERRORFILE(
+ rtl::OUStringToOString(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "GetResultSet: Any other exception: ")) +
+ e.Message),
+ RTL_TEXTENCODING_UTF8).
+ getStr());
}
if ( pList )
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
new file mode 100644
index 000000000000..21371755b479
--- /dev/null
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -0,0 +1,290 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OUString SAL_CALL getDefaultImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.DesktopBackend"));
+}
+
+css::uno::Sequence< rtl::OUString > SAL_CALL getDefaultSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.DesktopBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+class Default:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
+{
+public:
+ Default() {}
+
+private:
+ virtual ~Default() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getDefaultImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getDefaultSupportedServiceNames(); }
+
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+};
+
+void Default::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
+
+css::uno::Any Default::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::uno::XInterface > createBackend(
+ css::uno::Reference< css::uno::XComponentContext > const & context,
+ rtl::OUString const & name)
+{
+ try {
+ return css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(name, context);
+ } catch (css::uno::RuntimeException &) {
+ // Assuming these exceptions are real errors:
+ throw;
+ } catch (css::uno::Exception & e) {
+ // Assuming these exceptions indicate that the service is not installed:
+ OSL_TRACE(
+ "createInstance(%s) failed with %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return css::uno::Reference< css::uno::XInterface >();
+ }
+}
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ rtl::OUString desktop;
+ css::uno::Reference< css::uno::XCurrentContext > current(
+ css::uno::getCurrentContext());
+ if (current.is()) {
+ current->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ }
+ // Fall back to the default if the specific backend is not available:
+ css::uno::Reference< css::uno::XInterface > backend;
+ if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.GconfBackend")));
+ } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDEBackend")));
+ } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDE4Backend")));
+ }
+ return backend.is()
+ ? backend : static_cast< cppu::OWeakObject * >(new Default);
+}
+
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getDefaultImplementationName,
+ &getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/desktopbe/desktopbe.xml b/shell/source/backends/desktopbe/desktopbe.xml
deleted file mode 100644
index 0230028157dd..000000000000
--- a/shell/source/backends/desktopbe/desktopbe.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>desktopbe</module-name>
- <component-description>
- <author> Jan Holesovsky </author>
- <name>com.sun.star.comp.configuration.backend.DesktopBackend</name>
- <description> The shared gconf/KDE backend; will load GconfBackend or
- KDEBackend depending on the desktop environment.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.DesktopBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/desktopbe/desktopbe1-ucd.txt b/shell/source/backends/desktopbe/desktopbe1-ucd.txt
index c1df46010377..fd874a82ead5 100644
--- a/shell/source/backends/desktopbe/desktopbe1-ucd.txt
+++ b/shell/source/backends/desktopbe/desktopbe1-ucd.txt
@@ -2,8 +2,5 @@
ImplementationName=com.sun.star.comp.configuration.backend.DesktopBackend
ComponentName=desktopbe1.uno.so
LoaderName=com.sun.star.loader.SharedLibrary
-[Data]
-SupportedComponents=org.openoffice.VCL;org.openoffice.Inet;org.openoffice.Office.Common;org.openoffice.Office.Paths;org.openoffice.UserProfile;org.openoffice.Office.Recovery;org.openoffice.Setup
[SupportedServices]
com.sun.star.configuration.backend.DesktopBackend
-com.sun.star.configuration.backend.PlatformBackend
diff --git a/shell/source/backends/desktopbe/desktopbecdef.cxx b/shell/source/backends/desktopbe/desktopbecdef.cxx
deleted file mode 100644
index ab292cf1e5bb..000000000000
--- a/shell/source/backends/desktopbe/desktopbecdef.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createDesktopBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString::createFromAscii( "system.desktop-environment" ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( aValue >>= aDesktopEnvironment )
- {
- rtl::OUString aDesktopService;
- if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
- aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.GconfBackend" );
- else if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
- aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.KDEBackend" );
- else
- return uno::Reference<uno::XInterface>();
-
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- return uno::Reference< backend::XSingleLayerStratum >::query(
- xServiceManager->createInstanceWithContext( aDesktopService, xContext) );
- }
- }
- }
- } catch (uno::RuntimeException e) {
- }
-
- return uno::Reference<uno::XInterface>();
-}
-
-static rtl::OUString SAL_CALL getBackendName(void) {
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.DesktopBackend") );
-}
-
-static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.DesktopBackend")) ;
- aServices[1] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
- return aServices ;
-}
-
-static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void)
-{
- const sal_Int32 nComponents = 7;
-
- uno::Sequence<rtl::OUString> aSupportedComponentsList(nComponents) ;
-
- aSupportedComponentsList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.VCL")) ;
- aSupportedComponentsList[1] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Inet")) ;
- aSupportedComponentsList[2] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")) ;
- aSupportedComponentsList[3] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Paths")) ;
-
- aSupportedComponentsList[4] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.UserProfile")) ;
- aSupportedComponentsList[5] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")) ;
- aSupportedComponentsList[6] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")) ;
-
- return aSupportedComponentsList ;
-}
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createDesktopBackend,
- getBackendName,
- getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment ** /* aEnvironment */)
-{
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /* pServiceManager */,
- void *pRegistryKey)
-{
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( getSupportedComponents() );
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/desktopbe/exports.map b/shell/source/backends/desktopbe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/desktopbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk
index dd0afd88fe13..29260821d551 100644
--- a/shell/source/backends/desktopbe/makefile.mk
+++ b/shell/source/backends/desktopbe/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,49 +23,31 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME=shell
-TARGET=desktopbe
-
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
+#***********************************************************************/
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+PRJ = ../../..
+PRJNAME = shell
+TARGET = desktopbe
-# --- Settings ---
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
-.INCLUDE : settings.mk
+.INCLUDE: settings.mk
-UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
-
-# no "lib" prefix
DLLPRE =
-# --- Files ---
-
-SLOFILES=\
- $(SLO)$/desktopbecdef.obj
-
-SHL1NOCHECK=TRUE
-SHL1TARGET=$(TARGET)1.uno
-SHL1OBJS=$(SLOFILES)
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SLOFILES = $(SLO)/desktopbackend.obj
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=exports.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB)
+SHL1TARGET = desktopbe1.uno
+SHL1USE_EXPORTS = name
+DEF1NAME = $(SHL1TARGET)
-# --- Targets ---
+UNIXTEXT = $(MISC)/desktopbe1-ucd.txt
-.INCLUDE : target.mk
+.INCLUDE: target.mk
diff --git a/shell/source/backends/gconfbe/exports.map b/shell/source/backends/gconfbe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/gconfbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/gconfbe/gconflayer.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx
index 67fbb3ea2750..99a5b362c161 100644
--- a/shell/source/backends/gconfbe/gconflayer.cxx
+++ b/shell/source/backends/gconfbe/gconfaccess.cxx
@@ -1,78 +1,102 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
-#include "gconflayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <osl/thread.h>
-#include <com/sun/star/uno/Sequence.hxx>
+#include "sal/config.h"
#include <string.h>
-using namespace rtl;
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/file.hxx"
+#include "osl/security.hxx"
+#include "osl/thread.h"
+#include "rtl/strbuf.hxx"
+#include "rtl/ustrbuf.hxx"
-//==============================================================================
+#include "gconfaccess.hxx"
-GconfLayer::GconfLayer( const uno::Reference<uno::XComponentContext>& xContext,
- const ConfigurationValue pConfigurationValuesList[],
- const sal_Int32 nConfigurationValues,
- const char * pPreloadValuesList[] )
- :m_pConfigurationValuesList( pConfigurationValuesList )
- ,m_nConfigurationValues( nConfigurationValues )
- ,m_pPreloadValuesList( pPreloadValuesList )
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber" ) );
+#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
+#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext( k_sLayerDescriberService, xContext ) );
- }
- else
+namespace gconfaccess {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+using namespace rtl;
+
+GConfClient* getGconfClient()
+{
+ static GConfClient* mClient= 0;
+ if (mClient == NULL)
{
- OSL_TRACE( "Could not retrieve ServiceManager" );
+ /* initialize glib object type library */
+ g_type_init();
+
+ GError* aError = NULL;
+ if (!gconf_init(0, NULL, &aError))
+ {
+ rtl::OUStringBuffer msg;
+ msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " );
+ msg.appendAscii(aError->message);
+
+ g_error_free(aError);
+ aError = NULL;
+ throw uno::RuntimeException(msg.makeStringAndClear(),NULL);
+ }
+
+ mClient = gconf_client_get_default();
+ if (!mClient)
+ {
+ throw uno::RuntimeException(rtl::OUString::createFromAscii
+ ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL);
+ }
+
+ static const char * const PreloadValuesList[] =
+ {
+ "/desktop/gnome/interface",
+ "/system/proxy",
+ "/system/http_proxy/host",
+ "/desktop/gnome/url-handlers/mailto",
+#ifdef ENABLE_LOCKDOWN
+ "/apps/openoffice",
+ "/desktop/gnome/lockdown",
+ "/apps/openoffice/lockdown",
+#endif // ENABLE_LOCKDOWN
+ NULL
+ };
+ int i = 0;
+ while( PreloadValuesList[i] != NULL )
+ gconf_client_preload( mClient, PreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
}
-}
-//------------------------------------------------------------------------------
+ return mClient;
+}
static OUString xdg_user_dir_lookup (const char *type)
{
@@ -373,13 +397,12 @@ uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValu
//------------------------------------------------------------------------------
-sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
+sal_Bool SAL_CALL isDependencySatisfied( GConfClient* aClient, const ConfigurationValue aValue )
{
switch( aValue.nDependsOn )
{
case SETTING_PROXY_MODE:
{
- GConfClient* aClient = GconfBackend::getGconfClient();
GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_PROXY_MODE_KEY, NULL );
if ( aGconfValue != NULL )
@@ -446,116 +469,381 @@ sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
return sal_False;
}
-//------------------------------------------------------------------------------
+}
-void SAL_CALL GconfLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler )
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException )
+ConfigurationValue const ConfigurationValues[] =
{
- if( ! m_xLayerContentDescriber.is() )
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
+ SETTING_ENABLE_ACCESSIBILITY,
+ "/desktop/gnome/interface/accessibility",
+ "EnableATToolSupport",
+ sal_True,
+ SETTINGS_LAST
+ },
- uno::Sequence<backend::PropertyInfo> aPropInfoList( m_nConfigurationValues );
- sal_Int32 nProperties = 0;
+ {
+ SETTING_PROXY_MODE,
+ GCONF_PROXY_MODE_KEY,
+ "ooInetProxyType",
+ sal_True,
+ SETTINGS_LAST
+ },
- GConfClient* aClient = GconfBackend::getGconfClient();
- GConfValue* aGconfValue;
- int i = 0;
+ {
+ SETTING_PROXY_HTTP_HOST,
+ "/system/http_proxy/host",
+ "ooInetHTTPProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- while( m_pPreloadValuesList[i] != NULL )
- gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
+ {
+ SETTING_PROXY_HTTP_PORT,
+ "/system/http_proxy/port",
+ "ooInetHTTPProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
+
+ {
+ SETTING_PROXY_HTTPS_HOST,
+ "/system/proxy/secure_host",
+ "ooInetHTTPSProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- for( i = 0; i < m_nConfigurationValues; i++ )
{
- if( ( m_pConfigurationValuesList[i].nDependsOn != SETTINGS_LAST ) && !isDependencySatisfied( m_pConfigurationValuesList[i] ) )
- continue;
+ SETTING_PROXY_HTTPS_PORT,
+ "/system/proxy/secure_port",
+ "ooInetHTTPSProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
+ {
+ SETTING_PROXY_FTP_HOST,
+ "/system/proxy/ftp_host",
+ "ooInetFTPProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- if( aGconfValue != NULL )
- {
- aPropInfoList[nProperties].Name = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfItem );
- aPropInfoList[nProperties].Type = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfValueType );
- aPropInfoList[nProperties].Protected = m_pConfigurationValuesList[i].bLocked;
+ {
+ SETTING_PROXY_FTP_PORT,
+ "/system/proxy/ftp_port",
+ "ooInetFTPProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- if( m_pConfigurationValuesList[i].bNeedsTranslation )
- aPropInfoList[nProperties].Value = translateToOOo( m_pConfigurationValuesList[i], aGconfValue );
- else
- aPropInfoList[nProperties].Value = makeAnyOfGconfValue( aGconfValue );
+ {
+ SETTING_NO_PROXY_FOR,
+ "/system/http_proxy/ignore_hosts",
+ "ooInetNoProxy",
+ sal_True,
+ SETTING_PROXY_MODE
+ },
- gconf_value_free( aGconfValue );
+ {
+ SETTING_MAILER_PROGRAM,
+ "/desktop/gnome/url-handlers/mailto/command",
+ "ExternalMailer",
+ sal_True,
+ SETTINGS_LAST
+ },
+ {
+ SETTING_SOURCEVIEWFONT_NAME,
+ "/desktop/gnome/interface/monospace_font_name",
+ "SourceViewFontName",
+ sal_True,
+ SETTINGS_LAST
+ },
+ {
+ SETTING_SOURCEVIEWFONT_HEIGHT,
+ "/desktop/gnome/interface/monospace_font_name",
+ "SourceViewFontHeight",
+ sal_True,
+ SETTINGS_LAST
+ },
- nProperties++;
- }
- }
+ {
+ SETTING_WORK_DIRECTORY,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "WorkPathVariable",
+ sal_True,
+ SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked
+ },
- if( nProperties > 0 )
+#ifdef ENABLE_LOCKDOWN
{
- aPropInfoList.realloc( nProperties );
- m_xLayerContentDescriber->describeLayer( xHandler, aPropInfoList );
- }
-}
+ SETTING_WRITER_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/writer_default_document_format",
+ "TextDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
-//------------------------------------------------------------------------------
+ {
+ SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/impress_default_document_format",
+ "PresentationDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
-rtl::OUString SAL_CALL GconfLayer::getTimestamp( void )
- throw (uno::RuntimeException)
-{
- // Return a hash of the values as timestamp to avoid regenerating
- // the binary cache on each office launch.
- rtl::OStringBuffer aTimeStamp;
+ {
+ SETTING_CALC_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/calc_default_document_format",
+ "SpreadsheetDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
- // Make sure the timestamp differs from beta
- sal_Int32 nHashCode = 0;
+ {
+ SETTING_AUTO_SAVE,
+ GCONF_AUTO_SAVE_KEY,
+ "AutoSaveEnabled",
+ sal_False,
+ SETTINGS_LAST
+ },
- GConfClient* aClient = GconfBackend::getGconfClient();
- GConfValue* aGconfValue;
- int i = 0;
+ {
+ SETTING_AUTO_SAVE_INTERVAL,
+ "/apps/openoffice/auto_save_interval",
+ "AutoSaveTimeIntervall",
+ sal_False,
+ SETTING_AUTO_SAVE
+ },
+
+ {
+ SETTING_USER_GIVENNAME,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "givenname",
+ sal_True,
+ SETTING_USER_GIVENNAME
+ },
- while( m_pPreloadValuesList[i] != NULL )
- gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
+ {
+ SETTING_USER_SURNAME,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "sn",
+ sal_True,
+ SETTING_USER_SURNAME
+ },
+
+ {
+ SETTING_DISABLE_PRINTING,
+ "/desktop/gnome/lockdown/disable_printing",
+ "DisablePrinting",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_SYSTEM_FILE_DIALOG,
+ "/apps/openoffice/use_system_file_dialog",
+ "UseSystemFileDialog",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_PRINTING_MODIFIES_DOCUMENT,
+ "/apps/openoffice/printing_modifies_doc",
+ "PrintingModifiesDocument",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_ICONS_IN_MENUS,
+ "/apps/openoffice/show_menu_icons",
+ "ShowIconsInMenues",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_INACTIVE_MENUITEMS,
+ "/apps/openoffice/show_menu_inactive_items",
+ "DontHideDisabledEntry",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_FONT_PREVIEW,
+ "/apps/openoffice/show_font_preview",
+ "ShowFontBoxWYSIWYG",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_FONT_HISTORY,
+ "/apps/openoffice/show_font_history",
+ "FontViewHistory",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_ENABLE_OPENGL,
+ "/apps/openoffice/use_opengl",
+ "OpenGL",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_OPTIMIZE_OPENGL,
+ "/apps/openoffice/optimize_opengl",
+ "OpenGL_Faster",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_SYSTEM_FONT,
+ "/apps/openoffice/use_system_font",
+ "AccessibilityIsSystemFont",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_FONT_ANTI_ALIASING,
+ "/apps/openoffice/use_font_anti_aliasing",
+ "FontAntiAliasingEnabled",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
+ "/apps/openoffice/font_anti_aliasing_min_pixel",
+ "FontAntiAliasingMinPixelHeight",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_CREATE_PDF,
+ "/apps/openoffice/lockdown/warn_info_create_pdf",
+ "WarnCreatePDF",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_PRINT_DOC,
+ "/apps/openoffice/lockdown/warn_info_printing",
+ "WarnPrintDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
- for( i = 0; i < m_nConfigurationValues; i++ )
{
- aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
+ SETTING_WARN_SAVEORSEND_DOC,
+ "/apps/openoffice/lockdown/warn_info_saving",
+ "WarnSaveOrSendDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_SIGN_DOC,
+ "/apps/openoffice/lockdown/warn_info_signing",
+ "WarnSignDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_REMOVE_PERSONAL_INFO,
+ "/apps/openoffice/lockdown/remove_personal_info_on_save",
+ "Scripting/RemovePersonalInfoOnSaving",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_RECOMMEND_PASSWORD,
+ "/apps/openoffice/lockdown/recommend_password_on_save",
+ "RecommendPasswordProtection",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_UNDO_STEPS,
+ "/apps/openoffice/undo_steps",
+ "UndoSteps",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SYMBOL_SET,
+ "/apps/openoffice/icon_size",
+ "SymbolSet",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_MACRO_SECURITY_LEVEL,
+ "/apps/openoffice/lockdown/macro_security_level",
+ "MacroSecurityLevel",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_CREATE_BACKUP,
+ "/apps/openoffice/create_backup",
+ "CreateBackup",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_ALIEN_FORMAT,
+ "/apps/openoffice/warn_alien_format",
+ "WarnAlienFormat",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+#endif // ENABLE_LOCKDOWN
+};
+
+std::size_t const nConfigurationValues =
+ sizeof ConfigurationValues / sizeof ConfigurationValues[0];
+
+css::beans::Optional< css::uno::Any > getValue(ConfigurationValue const & data)
+{
+ GConfClient* aClient = getGconfClient();
+ GConfValue* aGconfValue;
+ if( ( data.nDependsOn == SETTINGS_LAST ) || isDependencySatisfied( aClient, data ) )
+ {
+ aGconfValue = gconf_client_get( aClient, data.GconfItem, NULL );
if( aGconfValue != NULL )
{
- switch( aGconfValue->type )
- {
- case GCONF_VALUE_BOOL:
- nHashCode ^= (sal_Int32) !gconf_value_get_bool( aGconfValue );
- break;
-
- case GCONF_VALUE_INT:
- nHashCode ^= (sal_Int32) gconf_value_get_int( aGconfValue );
- break;
-
- case GCONF_VALUE_STRING:
- nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string( aGconfValue ) );
- break;
-
- case GCONF_VALUE_LIST:
- if( GCONF_VALUE_STRING == gconf_value_get_list_type( aGconfValue ) )
- {
- GSList *list = gconf_value_get_list( aGconfValue );
- for(; list; list = g_slist_next(list))
- nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string((GConfValue *) list->data) );
- break;
- }
-
- default:
- fprintf( stderr, "getTimestamp: Type not handled.\n" );
- break;
- }
- nHashCode = (nHashCode << 5) - nHashCode;
+ css::uno::Any value;
+ if( data.bNeedsTranslation )
+ value = translateToOOo( data, aGconfValue );
+ else
+ value = makeAnyOfGconfValue( aGconfValue );
+
gconf_value_free( aGconfValue );
+
+ return css::beans::Optional< css::uno::Any >(true, value);
}
}
+ return css::beans::Optional< css::uno::Any >();
+}
- return rtl::OUString::valueOf( nHashCode );
}
diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx b/shell/source/backends/gconfbe/gconfaccess.hxx
new file mode 100644
index 000000000000..7fdd82ff05e7
--- /dev/null
+++ b/shell/source/backends/gconfbe/gconfaccess.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "gconf/gconf-client.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+namespace gconfaccess {
+
+enum ConfigurationSetting
+{
+ SETTING_PROXY_MODE,
+ SETTING_PROXY_HTTP_HOST,
+ SETTING_PROXY_HTTP_PORT,
+ SETTING_PROXY_HTTPS_HOST,
+ SETTING_PROXY_HTTPS_PORT,
+ SETTING_PROXY_FTP_HOST,
+ SETTING_PROXY_FTP_PORT,
+ SETTING_NO_PROXY_FOR,
+ SETTING_ENABLE_ACCESSIBILITY,
+ SETTING_MAILER_PROGRAM,
+ SETTING_WORK_DIRECTORY,
+ SETTING_SOURCEVIEWFONT_NAME,
+ SETTING_SOURCEVIEWFONT_HEIGHT,
+ SETTING_USER_GIVENNAME,
+ SETTING_USER_SURNAME,
+
+#ifdef ENABLE_LOCKDOWN
+
+ SETTING_DISABLE_PRINTING,
+ SETTING_USE_SYSTEM_FILE_DIALOG,
+ SETTING_PRINTING_MODIFIES_DOCUMENT,
+ SETTING_SHOW_ICONS_IN_MENUS,
+ SETTING_SHOW_INACTIVE_MENUITEMS,
+ SETTING_SHOW_FONT_PREVIEW,
+ SETTING_SHOW_FONT_HISTORY,
+ SETTING_ENABLE_OPENGL,
+ SETTING_OPTIMIZE_OPENGL,
+ SETTING_SAVE_DOCUMENT_WINDOWS,
+ SETTING_SAVE_DOCUMENT_VIEW_INFO,
+ SETTING_USE_SYSTEM_FONT,
+ SETTING_USE_FONT_ANTI_ALIASING,
+ SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
+ SETTING_WARN_CREATE_PDF,
+ SETTING_WARN_PRINT_DOC,
+ SETTING_WARN_SAVEORSEND_DOC,
+ SETTING_WARN_SIGN_DOC,
+ SETTING_REMOVE_PERSONAL_INFO,
+ SETTING_RECOMMEND_PASSWORD,
+ SETTING_UNDO_STEPS,
+ SETTING_SYMBOL_SET,
+ SETTING_MACRO_SECURITY_LEVEL,
+ SETTING_CREATE_BACKUP,
+ SETTING_WARN_ALIEN_FORMAT,
+ SETTING_AUTO_SAVE,
+ SETTING_AUTO_SAVE_INTERVAL,
+ SETTING_WRITER_DEFAULT_DOC_FORMAT,
+ SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
+ SETTING_CALC_DEFAULT_DOC_FORMAT,
+
+#endif // ENABLE_LOCKDOWN
+
+ SETTINGS_LAST
+};
+
+struct ConfigurationValue
+{
+ const ConfigurationSetting nSettingId;
+ const gchar *GconfItem;
+ const char *OOoConfItem;
+ const sal_Bool bNeedsTranslation;
+ const ConfigurationSetting nDependsOn;
+};
+
+extern ConfigurationValue const ConfigurationValues[];
+
+extern std::size_t const nConfigurationValues;
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ ConfigurationValue const & data);
+
+}
+
+#endif
diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx
index 15d2ee654e8e..122d1cad02b3 100644
--- a/shell/source/backends/gconfbe/gconfbackend.cxx
+++ b/shell/source/backends/gconfbe/gconfbackend.cxx
@@ -1,1007 +1,239 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
-
-#include "gconfbackend.hxx"
-#include "gconflayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#include <osl/process.h>
-#include <osl/time.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/byteseq.h>
-
-#include <stdio.h>
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue SetupConfigurationValuesList[] =
-{
- {
- SETTING_WRITER_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/writer_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/impress_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.presentation.PresentationDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_CALC_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/calc_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.sheet.SpreadsheetDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue RecoveryConfigurationValuesList[] =
-{
- {
- SETTING_AUTO_SAVE,
- GCONF_AUTO_SAVE_KEY,
- "org.openoffice.Office.Recovery/AutoSave/Enabled",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_AUTO_SAVE_INTERVAL,
- "/apps/openoffice/auto_save_interval",
- "org.openoffice.Office.Recovery/AutoSave/TimeIntervall",
- "int",
- sal_False,
- sal_False,
- SETTING_AUTO_SAVE
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-/*
- * This should be in a different backend actually, but this has to wait ..
- */
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue UserProfileConfigurationValuesList[] =
-{
- {
- SETTING_USER_GIVENNAME,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.UserProfile/Data/givenname",
- "string",
- sal_False,
- sal_True,
- SETTING_USER_GIVENNAME
- },
-
- {
- SETTING_USER_SURNAME,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.UserProfile/Data/sn",
- "string",
- sal_False,
- sal_True,
- SETTING_USER_SURNAME
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue VCLConfigurationValuesList[] =
-{
- {
- SETTING_ENABLE_ACCESSIBILITY,
- "/desktop/gnome/interface/accessibility",
- "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#ifdef ENABLE_LOCKDOWN
-
- {
- SETTING_DISABLE_PRINTING,
- "/desktop/gnome/lockdown/disable_printing",
- "org.openoffice.VCL/Settings/DesktopManagement/DisablePrinting",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#endif // ENABLE_LOCKDOWN
-
-};
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue InetConfigurationValuesList[] =
-{
- {
- SETTING_PROXY_MODE,
- GCONF_PROXY_MODE_KEY,
- "org.openoffice.Inet/Settings/ooInetProxyType",
- "int",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_PROXY_HTTP_HOST,
- "/system/http_proxy/host",
- "org.openoffice.Inet/Settings/ooInetHTTPProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTP_PORT,
- "/system/http_proxy/port",
- "org.openoffice.Inet/Settings/ooInetHTTPProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTPS_HOST,
- "/system/proxy/secure_host",
- "org.openoffice.Inet/Settings/ooInetHTTPSProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTPS_PORT,
- "/system/proxy/secure_port",
- "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_FTP_HOST,
- "/system/proxy/ftp_host",
- "org.openoffice.Inet/Settings/ooInetFTPProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_FTP_PORT,
- "/system/proxy/ftp_port",
- "org.openoffice.Inet/Settings/ooInetFTPProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_NO_PROXY_FOR,
- "/system/http_proxy/ignore_hosts",
- "org.openoffice.Inet/Settings/ooInetNoProxy",
- "string",
- sal_False,
- sal_True,
- SETTING_PROXY_MODE
- },
-};
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue CommonConfigurationValuesList[] =
-{
- {
- SETTING_MAILER_PROGRAM,
- "/desktop/gnome/url-handlers/mailto/command",
- "org.openoffice.Office.Common/ExternalMailer/Program",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
- {
- SETTING_SOURCEVIEWFONT_NAME,
- "/desktop/gnome/interface/monospace_font_name",
- "org.openoffice.Office.Common/Font/SourceViewFont/FontName",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
- {
- SETTING_SOURCEVIEWFONT_HEIGHT,
- "/desktop/gnome/interface/monospace_font_name",
- "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#ifdef ENABLE_LOCKDOWN
-
- {
- SETTING_USE_SYSTEM_FILE_DIALOG,
- "/apps/openoffice/use_system_file_dialog",
- "org.openoffice.Office.Common/Misc/UseSystemFileDialog",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_DISABLE_UI_CUSTOMIZATION,
- "/apps/openoffice/lockdown/disable_ui_customization",
- "org.openoffice.Office.Common/Misc/DisableUICustomization",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_PRINTING_MODIFIES_DOCUMENT,
- "/apps/openoffice/printing_modifies_doc",
- "org.openoffice.Office.Common/Print/PrintingModifiesDocument",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_ICONS_IN_MENUS,
- "/apps/openoffice/show_menu_icons",
- "org.openoffice.Office.Common/View/Menu/ShowIconsInMenues",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_INACTIVE_MENUITEMS,
- "/apps/openoffice/show_menu_inactive_items",
- "org.openoffice.Office.Common/View/Menu/DontHideDisabledEntry",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_FONT_PREVIEW,
- "/apps/openoffice/show_font_preview",
- "org.openoffice.Office.Common/Font/View/ShowFontBoxWYSIWYG",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_FONT_HISTORY,
- "/apps/openoffice/show_font_history",
- "org.openoffice.Office.Common/Font/View/History",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_ENABLE_OPENGL,
- "/apps/openoffice/use_opengl",
- "org.openoffice.Office.Common/_3D_Engine/OpenGL",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_OPTIMIZE_OPENGL,
- "/apps/openoffice/optimize_opengl",
- "org.openoffice.Office.Common/_3D_Engine/OpenGL_Faster",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_USE_SYSTEM_FONT,
- "/apps/openoffice/use_system_font",
- "org.openoffice.Office.Common/Accessibility/IsSystemFont",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_USE_FONT_ANTI_ALIASING,
- "/apps/openoffice/use_font_anti_aliasing",
- "org.openoffice.Office.Common/View/FontAntiAliasing/Enabled",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
- "/apps/openoffice/font_anti_aliasing_min_pixel",
- "org.openoffice.Office.Common/View/FontAntiAliasing/MinPixelHeight",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_CREATE_PDF,
- "/apps/openoffice/lockdown/warn_info_create_pdf",
- "org.openoffice.Office.Common/Security/Scripting/WarnCreatePDF",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_PRINT_DOC,
- "/apps/openoffice/lockdown/warn_info_printing",
- "org.openoffice.Office.Common/Security/Scripting/WarnPrintDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_SAVEORSEND_DOC,
- "/apps/openoffice/lockdown/warn_info_saving",
- "org.openoffice.Office.Common/Security/Scripting/WarnSaveOrSendDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_SIGN_DOC,
- "/apps/openoffice/lockdown/warn_info_signing",
- "org.openoffice.Office.Common/Security/Scripting/WarnSignDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_REMOVE_PERSONAL_INFO,
- "/apps/openoffice/lockdown/remove_personal_info_on_save",
- "org.openoffice.Office.Common/Security/Scripting/RemovePersonalInfoOnSaving",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_RECOMMEND_PASSWORD,
- "/apps/openoffice/lockdown/recommend_password_on_save",
- "org.openoffice.Office.Common/Security/Scripting/RecommendPasswordProtection",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_UNDO_STEPS,
- "/apps/openoffice/undo_steps",
- "org.openoffice.Office.Common/Undo/Steps",
- "int",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SYMBOL_SET,
- "/apps/openoffice/icon_size",
- "org.openoffice.Office.Common/Misc/SymbolSet",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_MACRO_SECURITY_LEVEL,
- "/apps/openoffice/lockdown/macro_security_level",
- "org.openoffice.Office.Common/Security/Scripting/MacroSecurityLevel",
- "int",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_CREATE_BACKUP,
- "/apps/openoffice/create_backup",
- "org.openoffice.Office.Common/Save/Document/CreateBackup",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_ALIEN_FORMAT,
- "/apps/openoffice/warn_alien_format",
- "org.openoffice.Office.Common/Save/Document/WarnAlienFormat",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
-#endif // ENABLE_LOCKDOWN
-
-};
-
-static const ConfigurationValue PathsConfigurationValuesList[] =
-{
- {
- SETTING_WORK_DIRECTORY,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.Office.Paths/Variables/Work",
- "string",
- sal_False,
- sal_True,
- SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked
- },
-};
-
-#ifdef ENABLE_LOCKDOWN
-static const char * SetupPreloadValuesList[] =
-{
- "/apps/openoffice",
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-static const char * RecoveryPreloadValuesList[] =
-{
- "/apps/openoffice",
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-static const char * UserProfilePreloadValuesList[] =
-{
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-static const char * VCLPreloadValuesList[] =
-{
- "/desktop/gnome/interface",
-#ifdef ENABLE_LOCKDOWN
- "/desktop/gnome/lockdown",
-#endif // ENABLE_LOCKDOWN
- NULL
-};
-
-static const char * InetPreloadValuesList[] =
-{
- "/system/proxy",
- "/system/http_proxy/host",
- NULL
-};
-
-static const char * CommonPreloadValuesList[] =
-{
- "/desktop/gnome/url-handlers/mailto",
-#ifdef ENABLE_LOCKDOWN
- "/apps/openoffice/lockdown",
- "/apps/openoffice",
-#endif // ENABLE_LOCKDOWN
- NULL
-};
-
-static const char * PathsPreloadValuesList[] =
-{
- NULL
-};
-
-//==============================================================================
-
-/*
-void ONotificationThread::run()
-{
- mLoop= NULL;
- //Need to start a GMain loop for notifications to work
- mLoop=g_main_loop_new(g_main_context_default(),FALSE);
- g_main_loop_run(mLoop);
-} ;
-
-*/
-
-//------------------------------------------------------------------------------
-
-GconfBackend* GconfBackend::mInstance= 0;
-
-GconfBackend* GconfBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if(mInstance == 0)
- {
- mInstance = new GconfBackend (xContext);
- }
-
- return mInstance;
-}
-
-//------------------------------------------------------------------------------
-
-GconfBackend::GconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
-// , mNotificationThread(NULL)
-
-
-{
-}
-
-//------------------------------------------------------------------------------
-
-GconfBackend::~GconfBackend(void) {
-
-
-// delete (mNotificationThread);
- GconfBackend::mClient = NULL;
-
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
+
+#include "gconfaccess.hxx"
+#include "orbit.h"
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.GconfBackend"));
}
-//------------------------------------------------------------------------------
-
-GConfClient* GconfBackend::mClient= 0;
-
-
-GConfClient* GconfBackend::getGconfClient()
-{
-
- if (mClient == NULL)
- {
- /* initialize glib object type library */
- g_type_init();
-
- GError* aError = NULL;
- if (!gconf_init(0, NULL, &aError))
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " );
- msg.appendAscii(aError->message);
-
- g_error_free(aError);
- aError = NULL;
- throw uno::RuntimeException(msg.makeStringAndClear(),NULL);
- }
-
- mClient = gconf_client_get_default();
- if (!mClient)
- {
- throw uno::RuntimeException(rtl::OUString::createFromAscii
- ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL);
- }
- }
-
- return mClient;
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.GconfBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL GconfBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
-
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- CommonConfigurationValuesList,
- G_N_ELEMENTS( CommonConfigurationValuesList ),
- CommonPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- InetConfigurationValuesList,
- G_N_ELEMENTS( InetConfigurationValuesList ),
- InetPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- VCLConfigurationValuesList,
- G_N_ELEMENTS( VCLConfigurationValuesList ),
- VCLPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- PathsConfigurationValuesList,
- G_N_ELEMENTS( PathsConfigurationValuesList ),
- PathsPreloadValuesList );
- }
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
+{
+public:
+ Service();
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
+
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ bool enabled_;
+};
-#ifdef ENABLE_LOCKDOWN
- else if( aComponent.equalsAscii("org.openoffice.UserProfile" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- UserProfileConfigurationValuesList,
- G_N_ELEMENTS( UserProfileConfigurationValuesList ),
- UserProfilePreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Recovery" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- RecoveryConfigurationValuesList,
- G_N_ELEMENTS( RecoveryConfigurationValuesList ),
- RecoveryPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Setup" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- SetupConfigurationValuesList,
- G_N_ELEMENTS( SetupConfigurationValuesList ),
- SetupPreloadValuesList );
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME")) &&
+ ((orbit_major_version == 2 && orbit_minor_version >= 8) ||
+ orbit_major_version > 2);
+ // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin
}
-#endif // ENABLE_LOCKDOWN
-
- return xLayer;
}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-GconfBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("GconfBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-}
-
-//------------------------------------------------------------------------------
-
-// currently not used
-#if 0
-static void
-keyChangedCallback(GConfClient* aClient,
- guint aID,
- GConfEntry* aEntry,
- gpointer aBackend)
-{
-
- OSL_TRACE("In KeyChangedCallback Function");
- rtl::OUString aGconfKey= rtl::OUString::createFromAscii(aEntry->key);
- GconfBackend * aGconfBe = (GconfBackend*) aBackend;
-
- aGconfBe->notifyListeners(aGconfKey);
-
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
-
-void GconfBackend::notifyListeners(const rtl::OUString& /*aGconfKey*/)
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
-/*
- //look up associated component from Map using GconfKey
- KeyMappingTable::iterator aIter;
- rtl::OUString aComponent;
- for( aIter= mKeyMap.begin(); aIter != mKeyMap.end(); aIter++)
- {
- if (aIter->second.mGconfName == aGconfKey)
+ for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) {
+ if (PropertyName.equalsAscii(
+ gconfaccess::ConfigurationValues[i].OOoConfItem))
{
- aComponent = aIter->first;
- break;
+ return css::uno::makeAny(
+ enabled_
+ ? gconfaccess::getValue(gconfaccess::ConfigurationValues[i])
+ : css::beans::Optional< css::uno::Any >());
}
-
- }
-
-
- //Need to store updated layer TimeStamp as Gconf library
- //has no access to TimeStamp via its api
- TimeValue aTimeValue ={0,0} ;
- osl_getSystemTime(&aTimeValue);
-
- oslDateTime aLayerTS;
- rtl::OUString aTimeStamp;
-
- if (osl_getDateTimeFromTimeValue(&aTimeValue, &aLayerTS)) {
- sal_Char asciiStamp [20] ;
-
- sprintf(asciiStamp, "%04d%02d%02d%02d%02d%02dZ",
- aLayerTS.Year, aLayerTS.Month, aLayerTS.Day,
- aLayerTS.Hours, aLayerTS.Minutes, aLayerTS.Seconds) ;
- aTimeStamp = rtl::OUString::createFromAscii(asciiStamp) ;
- }
-
-
- TSMappingTable::iterator aTSIter;
- aTSIter = mTSMap.find(aComponent);
- if (aTSIter == mTSMap.end())
- {
- mTSMap.insert(TSMappingTable::value_type(aComponent,aTimeStamp));
- }
- else
- {
- aTSIter->second = aTimeStamp;
-
}
- typedef ListenerList::iterator LLIter;
- typedef std::pair<LLIter, LLIter> BFRange;
- BFRange aRange = mListenerList.equal_range(aComponent);
- while (aRange.first != aRange.second)
- {
- LLIter cur = aRange.first++;
- backend::ComponentChangeEvent aEvent;
- aEvent.Component = aComponent;
- aEvent.Source = *this;
- cur->second->componentDataChanged(aEvent);
-
- }
-*/
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
}
-#endif
-//------------------------------------------------------------------------------
-void SAL_CALL GconfBackend::addChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
{
-/*
- osl::MutexGuard aGuard(mMutex);
-
- GConfClient* aClient = getGconfClient();
-
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- if (aIter == mListenerList.end())
- {
- typedef KeyMappingTable::iterator KMTIter;
- typedef std::pair<KMTIter, KMTIter> BFRange;
-
- BFRange aRange = mKeyMap.equal_range(aComponent);
-
- while (aRange.first != aRange.second)
- {
- KMTIter cur = aRange.first++;
-
- sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/');
- rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex);
- rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US);
- GError* aError = NULL;
- gconf_client_add_dir(aClient,
- aDirectoryStr.getStr(),
- GCONF_CLIENT_PRELOAD_NONE,
- &aError);
-
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot register listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
-
- rtl::OString aKey = rtl::OUStringToOString(cur->second.mGconfName,
- RTL_TEXTENCODING_ASCII_US);
-
- GConfClientNotifyFunc aNotifyFunc = &keyChangedCallback;
- sal_uInt32 aID = gconf_client_notify_add(
- aClient,
- aKey.getStr(),
- aNotifyFunc,
- this,
- NULL,
- &aError);
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot register listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
-
-
-
- }
-
- }
-*/
-
-/*
- if (mNotificationThread == NULL)
- {
-
- mNotificationThread = new ONotificationThread();
-
- if ( mNotificationThread == NULL)
- {
- OSL_ENSURE(false,"Could not start Notification Thread ");
- }
- else
- {
- mNotificationThread->create();
- }
- }
-*/
- //Store listener in list
- mListenerList.insert(ListenerList::value_type(aComponent, xListener));
-
-
+ return static_cast< cppu::OWeakObject * >(new Service);
}
-//------------------------------------------------------------------------------
-void SAL_CALL GconfBackend::removeChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& /*xListener*/,
- const rtl::OUString& /*aComponent*/)
- throw (::com::sun::star::uno::RuntimeException)
-{
-/*
- osl::MutexGuard aGuard(mMutex);
- GConfClient* aClient = GconfBackend::getGconfClient();
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- if (aIter == mListenerList.end())
- {
-
- OSL_TRACE("GconfBackend:: Cannot deregister listener for Component %s - Listner not registered",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
-
- typedef KeyMappingTable::iterator KMTIter;
- typedef std::pair<KMTIter, KMTIter> BFRange;
-
- BFRange aRange = mKeyMap.equal_range(aComponent);
-
- while (aRange.first != aRange.second)
- {
- KMTIter cur = aRange.first++;
-
- sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/');
- rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex);
- rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US);
- GError* aError = NULL;
- gconf_client_remove_dir(aClient,
- aDirectoryStr.getStr(),
- &aError);
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot deRegister listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
- }
- }
-*/
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL GconfBackend::getBackendName(void) {
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.GconfBackend") );
-}
-
-//------------------------------------------------------------------------------
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
-rtl::OUString SAL_CALL GconfBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL GconfBackend::getBackendServiceNames(void)
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.GconfBackend")) ;
-
- return aServices ;
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL GconfBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
-
- return false;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL GconfBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
{
- return getBackendServiceNames() ;
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
}
-
-// ---------------------------------------------------------------------------------------
-
-
diff --git a/shell/source/backends/gconfbe/gconfbackend.hxx b/shell/source/backends/gconfbe/gconfbackend.hxx
deleted file mode 100644
index 849f7097d2c3..000000000000
--- a/shell/source/backends/gconfbe/gconfbackend.hxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef GCONFBACKEND_HXX_
-#define GCONFBACKEND_HXX_
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-//#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-//#endif // _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-//#ifndef _VOS_THREAD_HXX_
-//#include <vos/thread.hxx>
-//#endif
-
-#include <gconf/gconf-client.h>
-
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-/** Structure containing the mapping between OOffice and Gconf keys.
- AlOO specifies whether the key is protected, if key is protected it
- can not be over riden in subsequent higher layers
-*/
-struct keyMapping
-{
- keyMapping(){};
- rtl::OUString mOOName;
- rtl::OUString mOOType;
- rtl::OUString mGconfName;
- sal_Bool mbProtected;
-};
-
-typedef keyMapping KeyMappingInfo;
-typedef std::multimap<rtl::OUString, KeyMappingInfo> KeyMappingTable;
-
-/*Time Stamp mapping table used to store timestamps of updated components
- when a notification is recieved. It is needed as you cannot access gconf key
- timestamps via the Gconf api */
-
-typedef std::multimap<rtl::OUString, rtl::OUString> TSMappingTable;
-
-//------------------------------------------------------------------------------
-
-/*
-class ONotificationThread: public vos::OThread
-{
-
-
-public:
- ONotificationThread()
- {}
-
- ~ONotificationThread()
- {
- g_main_loop_quit(mLoop);
- }
-
-private:
- virtual void SAL_CALL onTerminated()
- {
- delete this;
- }
-
- virtual void SAL_CALL run();
- GMainLoop* mLoop;
-};
-
-*/
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper3<backend::XSingleLayerStratum,
- backend::XBackendChangesNotifier,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for gconf access.
- */
-class GconfBackend : public BackendBase {
- public :
-
- static GconfBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- /* returns a GconfClient */
- static GConfClient* getGconfClient();
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-// currently not used
-#if 0
- //Notify all listener of component change
- void notifyListeners(const rtl::OUString& aGconfKey);
-#endif
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- GconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~GconfBackend(void) ;
-
- private:
-
- typedef uno::Reference<backend::XBackendChangesListener> ListenerRef;
- typedef std::multimap<rtl::OUString,ListenerRef> ListenerList;
-
- /** Build Gconf/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- KeyMappingTable mKeyMap;
-
- /** List of component TimeStamps */
- TSMappingTable mTSMap;
-
- static GconfBackend* mInstance;
-
- /** List of listener */
- ListenerList mListenerList;
-
- /**Connection to Gconf */
- static GConfClient* mClient;
-
-// ONotificationThread* mNotificationThread;
-} ;
-
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
diff --git a/shell/source/backends/gconfbe/gconfbe.xml b/shell/source/backends/gconfbe/gconfbe.xml
deleted file mode 100644
index 55eea1c1f6c9..000000000000
--- a/shell/source/backends/gconfbe/gconfbe.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>gconfbe</module-name>
- <component-description>
- <author> Oliver Braun </author>
- <name>com.sun.star.comp.configuration.backend.GconfBackend</name>
- <description> The </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.GconfBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/gconfbe/gconfbecdef.cxx b/shell/source/backends/gconfbe/gconfbecdef.cxx
deleted file mode 100644
index 91714cd9cafc..000000000000
--- a/shell/source/backends/gconfbe/gconfbecdef.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "gconfbackend.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include "uno/current_context.hxx"
-#include <stdio.h>
-#include "orbit.h"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createGconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("GNOME")) )
- {
- // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin
- if ( (orbit_major_version >= 2) && (orbit_minor_version >= 8) )
- {
- return * GconfBackend::createInstance(xContext);
- }
- }
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createGconfBackend,
- GconfBackend::getBackendName,
- GconfBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **/*aEnvironment*/) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void */*pServiceManager*/,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + GconfBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = GconfBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/gconfbe/gconflayer.hxx b/shell/source/backends/gconfbe/gconflayer.hxx
deleted file mode 100644
index af9753b9179a..000000000000
--- a/shell/source/backends/gconfbe/gconflayer.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef GCONFLAYER_HXX_
-#define GCONFLAYER_HXX_
-
-#include "gconfbackend.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
-#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
-
-enum ConfigurationSetting
-{
- SETTING_PROXY_MODE,
- SETTING_PROXY_HTTP_HOST,
- SETTING_PROXY_HTTP_PORT,
- SETTING_PROXY_HTTPS_HOST,
- SETTING_PROXY_HTTPS_PORT,
- SETTING_PROXY_FTP_HOST,
- SETTING_PROXY_FTP_PORT,
- SETTING_NO_PROXY_FOR,
- SETTING_ENABLE_ACCESSIBILITY,
- SETTING_MAILER_PROGRAM,
- SETTING_WORK_DIRECTORY,
- SETTING_SOURCEVIEWFONT_NAME,
- SETTING_SOURCEVIEWFONT_HEIGHT,
- SETTING_USER_GIVENNAME,
- SETTING_USER_SURNAME,
-
-#ifdef ENABLE_LOCKDOWN
-
- SETTING_DISABLE_PRINTING,
- SETTING_USE_SYSTEM_FILE_DIALOG,
- SETTING_DISABLE_UI_CUSTOMIZATION,
- SETTING_PRINTING_MODIFIES_DOCUMENT,
- SETTING_SHOW_ICONS_IN_MENUS,
- SETTING_SHOW_INACTIVE_MENUITEMS,
- SETTING_SHOW_FONT_PREVIEW,
- SETTING_SHOW_FONT_HISTORY,
- SETTING_ENABLE_OPENGL,
- SETTING_OPTIMIZE_OPENGL,
- SETTING_SAVE_DOCUMENT_WINDOWS,
- SETTING_SAVE_DOCUMENT_VIEW_INFO,
- SETTING_USE_SYSTEM_FONT,
- SETTING_USE_FONT_ANTI_ALIASING,
- SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
- SETTING_WARN_CREATE_PDF,
- SETTING_WARN_PRINT_DOC,
- SETTING_WARN_SAVEORSEND_DOC,
- SETTING_WARN_SIGN_DOC,
- SETTING_REMOVE_PERSONAL_INFO,
- SETTING_RECOMMEND_PASSWORD,
- SETTING_UNDO_STEPS,
- SETTING_SYMBOL_SET,
- SETTING_MACRO_SECURITY_LEVEL,
- SETTING_CREATE_BACKUP,
- SETTING_WARN_ALIEN_FORMAT,
- SETTING_AUTO_SAVE,
- SETTING_AUTO_SAVE_INTERVAL,
- SETTING_WRITER_DEFAULT_DOC_FORMAT,
- SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
- SETTING_CALC_DEFAULT_DOC_FORMAT,
-
-#endif // ENABLE_LOCKDOWN
-
- SETTINGS_LAST
-};
-
-struct ConfigurationValue
-{
- const ConfigurationSetting nSettingId;
- const gchar *GconfItem;
- const char *OOoConfItem;
- const char *OOoConfValueType;
- const sal_Bool bLocked;
- const sal_Bool bNeedsTranslation;
- const ConfigurationSetting nDependsOn;
-};
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the Gconf values mapped into
- the org.openoffice.* configuration component.
- */
-class GconfLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- GconfLayer( const uno::Reference<uno::XComponentContext>& xContext,
- const ConfigurationValue pConfigurationValuesList[],
- const sal_Int32 nConfigurationValues,
- const char * pPreloadValuesList[] );
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException );
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~GconfLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
- const ConfigurationValue* m_pConfigurationValuesList;
- const sal_Int32 m_nConfigurationValues;
- const char** m_pPreloadValuesList;
- } ;
-
-#endif // GCONFLAYER
diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk
index 9a17d3aeaeb5..a8d9b23aa9df 100644
--- a/shell/source/backends/gconfbe/makefile.mk
+++ b/shell/source/backends/gconfbe/makefile.mk
@@ -31,8 +31,7 @@ TARGET=gconfbe
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -65,9 +64,8 @@ PKGCONFIG_LIBS!:=-Wl,--export-dynamic $(PKGCONFIG_LIBS)
SLOFILES=\
- $(SLO)$/gconfbecdef.obj \
- $(SLO)$/gconfbackend.obj \
- $(SLO)$/gconflayer.obj
+ $(SLO)$/gconfaccess.obj \
+ $(SLO)$/gconfbackend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -82,7 +80,6 @@ SHL1STDLIBS= \
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP=exports.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/kde4be/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx
new file mode 100644
index 000000000000..336d2d4a458e
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4access.cxx
@@ -0,0 +1,319 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "QFont"
+#include "QString"
+#include "kemailsettings.h"
+#include "kglobalsettings.h"
+#include "kprotocolmanager.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.hxx"
+
+#include "kde4access.hxx"
+
+#define SPACE ' '
+#define COMMA ','
+#define SEMI_COLON ';'
+
+namespace kde4access {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+
+}
+
+css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) {
+ if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) {
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sClientProgram ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")))
+ {
+ QFont aFixedFont;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ nFontHeight = aFixedFont.pointSize();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nFontHeight ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")))
+ {
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sFontName ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")))
+ {
+ /* does not make much sense without an accessibility bridge */
+ sal_Bool ATToolSupport = sal_False;
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sDocumentsURL ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) {
+ QString aNoProxyFor;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aNoProxyFor.isEmpty() )
+ {
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sNoProxyFor ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) {
+ int nProxyType;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ nProxyType = 1;
+ break;
+ default: // No proxy is used
+ nProxyType = 0;
+ }
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( (sal_Int32) nProxyType ) );
+ } else {
+ OSL_ASSERT(false); // this cannot happen
+ }
+ return css::beans::Optional< css::uno::Any >();
+}
+
+}
diff --git a/shell/source/backends/kde4be/kde4access.hxx b/shell/source/backends/kde4be/kde4access.hxx
new file mode 100644
index 000000000000..bfb7bc1ac945
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4access.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace kde4access {
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ rtl::OUString const & id);
+
+}
+
+#endif
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
index 28cfcd180d05..44ddb49bd025 100644
--- a/shell/source/backends/kde4be/kde4backend.cxx
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -1,155 +1,258 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
+#include "sal/config.h"
-#include "kde4backend.hxx"
-#include "kde4commonlayer.hxx"
-#include "kde4inetlayer.hxx"
-#include "kde4vcllayer.hxx"
-#include "kde4pathslayer.hxx"
+#include "kapplication.h"
-//------------------------------------------------------------------------------
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
-KDEBackend* KDEBackend::mInstance= 0;
+#include "kde4access.hxx"
-KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if (mInstance == 0)
- {
- mInstance = new KDEBackend (xContext);
- }
+namespace {
+
+namespace css = com::sun::star;
- return mInstance;
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.KDE4Backend"));
}
-//------------------------------------------------------------------------------
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDE4Backend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
-KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
{
-}
+public:
+ Service();
-//------------------------------------------------------------------------------
+private:
+ virtual ~Service() {}
-KDEBackend::~KDEBackend(void)
-{
-}
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
-//------------------------------------------------------------------------------
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
-uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new KDECommonLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new KDEInetLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new KDEVCLLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new KDEPathsLayer(m_xContext);
- }
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
- return xLayer;
-}
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-//------------------------------------------------------------------------------
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-}
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
-{
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
-}
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
-}
+ bool enabled_;
+};
-//------------------------------------------------------------------------------
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4")) &&
+ KApplication::kApplication() != 0;
+ }
+}
-uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
-
- return aServices ;
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(
+ enabled_
+ ? kde4access::getValue(PropertyName)
+ : css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
-sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+ return static_cast< cppu::OWeakObject * >(new Service);
+}
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
- return false;
}
-//------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
-uno::Sequence<rtl::OUString>
-SAL_CALL KDEBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- return getBackendServiceNames() ;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// ---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx
deleted file mode 100644
index ed0658c07c25..000000000000
--- a/shell/source/backends/kde4be/kde4backend.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#pragma once
-
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for KDE access.
- */
-class KDEBackend : public BackendBase {
- public :
-
- static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~KDEBackend(void) ;
-
- private:
-
- /** Build KDE/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- static KDEBackend* mInstance;
-};
diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml
deleted file mode 100644
index ea2d9be6dd6b..000000000000
--- a/shell/source/backends/kde4be/kde4be.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>kde4be</module-name>
- <component-description>
- <author> Éric Bischoff </author>
- <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
- <description> The KDE4 configuration backend </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx
deleted file mode 100644
index 189d7ff80d61..000000000000
--- a/shell/source/backends/kde4be/kde4becdef.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kde4backend.hxx"
-
-#include <kapplication.h>
-
-#include <cppuhelper/implementationentry.hxx>
-
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
- return * KDEBackend::createInstance(xContext);
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createKDEBackend,
- KDEBackend::getBackendName,
- KDEBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx
deleted file mode 100644
index c0d1cbf70b43..000000000000
--- a/shell/source/backends/kde4be/kde4commonlayer.cxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4commonlayer.hxx"
-
-#include <kemailsettings.h>
-#include <kglobalsettings.h>
-
-#include <QFont>
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
- sal_Int32 nProperties = 0;
-
- // Email client settings
- KEMailSettings aEmailSettings;
- QString aClientProgram;
- ::rtl::OUString sClientProgram;
-
- aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- if ( aClientProgram.isEmpty() )
- aClientProgram = "kmail";
- else
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
- sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
-
- // Source code font settings
- QFont aFixedFont;
- QString aFontName;
- :: rtl::OUString sFontName;
- short nFontHeight;
-
- aFixedFont = KGlobalSettings::fixedFont();
- aFontName = aFixedFont.family();
- sFontName = (const sal_Unicode *) aFontName.utf16();
- nFontHeight = aFixedFont.pointSize();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "short" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- KEMailSettings aEmailSettings;
- QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
-
- QString aFixedFont = KGlobalSettings::fixedFont().toString();
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx
deleted file mode 100644
index 9ce4cd4dc962..000000000000
--- a/shell/source/backends/kde4be/kde4commonlayer.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-#include "kde4backend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Common configuration component.
- */
-class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDECommonLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx
deleted file mode 100644
index 7382d7a089b0..000000000000
--- a/shell/source/backends/kde4be/kde4inetlayer.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include <kprotocolmanager.h>
-
-#include "kde4inetlayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define COMMA ','
-#define SEMI_COLON ';'
-
-//==============================================================================
-
-KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 0;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy: // Proxies are manually configured
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyFor( "HTTP" ),
- KProtocolManager::proxyFor( "FTP" ),
- KProtocolManager::proxyFor( "HTTPS" ));
- break;
- case KProtocolManager::PACProxy: // A proxy configuration URL has been given
- case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
- case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
-// In such cases, the proxy address is not stored in KDE, but determined dynamically.
-// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
-// The best we can do here is to ask the current value for a given address.
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
- KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
- KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
- break;
- default: // No proxy is used
- setProxy(aPropInfoList, nProperties, 0);
- }
-
- if ( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
- aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
- aFTPProxy = KProtocolManager::proxyFor( "FTP" );
- break;
- case KProtocolManager::PACProxy:
- case KProtocolManager::WPADProxy:
- case KProtocolManager::EnvVarProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
- aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
- aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
- break;
- default:
- aProxyType = '0';
- }
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
-
- return sTimeStamp;
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
-{
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
-
- if (nProxyType == 0) return;
-
- if ( !aNoProxy.isEmpty() )
- {
- QString aNoProxyFor(aNoProxy);
- ::rtl::OUString sNoProxyFor;
-
- aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
- sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
- }
-
- if ( !aHTTPProxy.isEmpty() )
- {
- KUrl aProxy(aHTTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aHTTPSProxy.isEmpty() )
- {
- KUrl aProxy(aHTTPSProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aFTPProxy.isEmpty() )
- {
- KUrl aProxy(aFTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-}
-
diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx
deleted file mode 100644
index 64d00fec45fc..000000000000
--- a/shell/source/backends/kde4be/kde4inetlayer.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-#pragma once
-
-#include <QString>
-
-#include "kde4backend.hxx"
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Inet configuration component.
- */
-class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEInetLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- void SAL_CALL setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxyfor = QString(),
- const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
-};
diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx
deleted file mode 100644
index cf6eb052d0bb..000000000000
--- a/shell/source/backends/kde4be/kde4pathslayer.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4pathslayer.hxx"
-
-#include <QString>
-#include <kglobalsettings.h>
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
- sal_Int32 nProperties = 0;
-
- QString aDocumentsDir( KGlobalSettings::documentPath() );
- rtl::OUString sDocumentsDir;
- rtl::OUString sDocumentsURL;
- if ( aDocumentsDir.endsWith(QChar('/')) )
- aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
- sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
- osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- QString aDocumentsDir;
- aDocumentsDir = KGlobalSettings::documentPath();
-
- sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx
deleted file mode 100644
index bc09b0f027db..000000000000
--- a/shell/source/backends/kde4be/kde4pathslayer.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#pragma once
-
-#include "kde4backend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Paths configuration component.
- */
-class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEPathsLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx
deleted file mode 100644
index a3a9f32dba74..000000000000
--- a/shell/source/backends/kde4be/kde4vcllayer.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4vcllayer.hxx"
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-//==============================================================================
-
-KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
-/*
- Commenting out, does not make much sense without an accessibility bridge
-===========================================================================
-#if defined(QT_ACCESSIBILITY_SUPPORT)
-// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
- int nVersionMajor = 0;
- const char *q = qVersion(); // "3.1.0" for example
- while ('0' <= *q && *q <= '9')
- nVersionMajor = nVersionMajor * 10 + *q++ - '0';
- sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
-#else
- sal_Bool ATToolSupport = sal_False;
-#endif
-===========================================================================
- End of commented out section
-*/ sal_Bool ATToolSupport = sal_False;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp(
- RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx
deleted file mode 100644
index 16036ee89122..000000000000
--- a/shell/source/backends/kde4be/kde4vcllayer.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-#pragma once
-
-#include "kde4backend.hxx"
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.VCL configuration component.
- */
-class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEVCLLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
index cc7a51ab0f3c..1f9093a95aee 100644
--- a/shell/source/backends/kde4be/makefile.mk
+++ b/shell/source/backends/kde4be/makefile.mk
@@ -31,11 +31,7 @@ TARGET=kde4be
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -60,12 +56,8 @@ CFLAGS+=$(KDE4_CFLAGS)
# --- Files ---
SLOFILES=\
- $(SLO)$/kde4backend.obj \
- $(SLO)$/kde4commonlayer.obj \
- $(SLO)$/kde4inetlayer.obj \
- $(SLO)$/kde4vcllayer.obj \
- $(SLO)$/kde4pathslayer.obj \
- $(SLO)$/kde4becdef.obj
+ $(SLO)$/kde4access.obj \
+ $(SLO)$/kde4backend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -78,8 +70,7 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(SALLIB) \
$(KDE4_LIBS) -lkio
-
-SHL1VERSIONMAP=exports.map
+
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/kdebe/exports.map b/shell/source/backends/kdebe/exports.map
deleted file mode 100644
index ba501f9ae076..000000000000
--- a/shell/source/backends/kdebe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx
new file mode 100644
index 000000000000..618d74b5eacf
--- /dev/null
+++ b/shell/source/backends/kdebe/kdeaccess.cxx
@@ -0,0 +1,315 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.hxx"
+
+#include "kde_headers.h"
+
+#include "kdeaccess.hxx"
+
+#define SPACE ' '
+#define COMMA ','
+#define SEMI_COLON ';'
+
+namespace kdeaccess {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+
+}
+
+css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) {
+ if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) {
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sClientProgram ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")))
+ {
+ QFont aFixedFont;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ nFontHeight = aFixedFont.pointSize();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nFontHeight ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")))
+ {
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sFontName ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")))
+ {
+ /* does not make much sense without an accessibility bridge */
+ sal_Bool ATToolSupport = sal_False;
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sDocumentsURL ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KURL aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KURL aProxy(aFTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPSProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) {
+ QString aNoProxyFor;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aNoProxyFor.isEmpty() )
+ {
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sNoProxyFor ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) {
+ int nProxyType;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ nProxyType = 1;
+ break;
+ default: // No proxy is used
+ nProxyType = 0;
+ }
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( (sal_Int32) nProxyType ) );
+ } else {
+ OSL_ASSERT(false); // this cannot happen
+ }
+ return css::beans::Optional< css::uno::Any >();
+}
+
+}
diff --git a/shell/source/backends/kdebe/kdeaccess.hxx b/shell/source/backends/kdebe/kdeaccess.hxx
new file mode 100644
index 000000000000..36a22e23db9a
--- /dev/null
+++ b/shell/source/backends/kdebe/kdeaccess.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace kdeaccess {
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ rtl::OUString const & id);
+
+}
+
+#endif
diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx
index edf88212a9af..53a00cf35987 100644
--- a/shell/source/backends/kdebe/kdebackend.cxx
+++ b/shell/source/backends/kdebe/kdebackend.cxx
@@ -1,155 +1,258 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
+#include "sal/config.h"
-#include "kdebackend.hxx"
-#include "kdecommonlayer.hxx"
-#include "kdeinetlayer.hxx"
-#include "kdevcllayer.hxx"
-#include "kdepathslayer.hxx"
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
-//------------------------------------------------------------------------------
+#include "kde_headers.h"
-KDEBackend* KDEBackend::mInstance= 0;
+#include "kdeaccess.hxx"
-KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if (mInstance == 0)
- {
- mInstance = new KDEBackend (xContext);
- }
+namespace {
+
+namespace css = com::sun::star;
- return mInstance;
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.KDEBackend"));
}
-//------------------------------------------------------------------------------
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDEBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
-KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
{
-}
+public:
+ Service();
-//------------------------------------------------------------------------------
+private:
+ virtual ~Service() {}
-KDEBackend::~KDEBackend(void)
-{
-}
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
-//------------------------------------------------------------------------------
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
-uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new KDECommonLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new KDEInetLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new KDEVCLLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new KDEPathsLayer(m_xContext);
- }
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
- return xLayer;
-}
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-//------------------------------------------------------------------------------
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-}
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
-{
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDEBackend") );
-}
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
-}
+ bool enabled_;
+};
-//------------------------------------------------------------------------------
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) &&
+ KApplication::kApplication() != 0;
+ }
+}
-uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDEBackend")) ;
-
- return aServices ;
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(
+ enabled_
+ ? kdeaccess::getValue(PropertyName)
+ : css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
-sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+ return static_cast< cppu::OWeakObject * >(new Service);
+}
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
- return false;
}
-//------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
-uno::Sequence<rtl::OUString>
-SAL_CALL KDEBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- return getBackendServiceNames() ;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// ---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/kdebe/kdebackend.hxx b/shell/source/backends/kdebe/kdebackend.hxx
deleted file mode 100644
index 23e8d148bb33..000000000000
--- a/shell/source/backends/kdebe/kdebackend.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef KDEBACKEND_HXX_
-#define KDEBACKEND_HXX_
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for KDE access.
- */
-class KDEBackend : public BackendBase {
- public :
-
- static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~KDEBackend(void) ;
-
- private:
-
- /** Build KDE/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- static KDEBackend* mInstance;
-};
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
diff --git a/shell/source/backends/kdebe/kdebe.xml b/shell/source/backends/kdebe/kdebe.xml
deleted file mode 100644
index edb1beb0698e..000000000000
--- a/shell/source/backends/kdebe/kdebe.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>kdebe</module-name>
- <component-description>
- <author> Éric Bischoff </author>
- <name>com.sun.star.comp.configuration.backend.KDEBackend</name>
- <description> The KDE configuration backend </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.KDEBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/kdebe/kdebecdef.cxx b/shell/source/backends/kdebe/kdebecdef.cxx
deleted file mode 100644
index 2201a7f27dda..000000000000
--- a/shell/source/backends/kdebe/kdebecdef.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdebackend.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include "kde_headers.h"
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
- return * KDEBackend::createInstance(xContext);
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createKDEBackend,
- KDEBackend::getBackendName,
- KDEBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kdebe/kdecommonlayer.cxx b/shell/source/backends/kdebe/kdecommonlayer.cxx
deleted file mode 100644
index 6e8d0d630e04..000000000000
--- a/shell/source/backends/kdebe/kdecommonlayer.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdecommonlayer.hxx"
-#include "kde_headers.h"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
- sal_Int32 nProperties = 0;
-
- // Email client settings
- KEMailSettings aEmailSettings;
- QString aClientProgram;
- ::rtl::OUString sClientProgram;
-
- aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- if ( aClientProgram.isEmpty() )
- aClientProgram = "kmail";
- else
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
- sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
-
- // Source code font settings
- QFont aFixedFont;
- QString aFontName;
- :: rtl::OUString sFontName;
- short nFontHeight;
-
- aFixedFont = KGlobalSettings::fixedFont();
- aFontName = aFixedFont.family();
- sFontName = (const sal_Unicode *) aFontName.ucs2();
- nFontHeight = aFixedFont.pointSize();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "short" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- KEMailSettings aEmailSettings;
- QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
-
- QString aFixedFont = KGlobalSettings::fixedFont().toString();
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aClientProgram.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFixedFont.ucs2();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdecommonlayer.hxx b/shell/source/backends/kdebe/kdecommonlayer.hxx
deleted file mode 100644
index e61661589145..000000000000
--- a/shell/source/backends/kdebe/kdecommonlayer.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef KDECOMMONLAYER_HXX_
-#define KDECOMMONLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Common configuration component.
- */
-class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDECommonLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDECOMMONLAYER
diff --git a/shell/source/backends/kdebe/kdeinetlayer.cxx b/shell/source/backends/kdebe/kdeinetlayer.cxx
deleted file mode 100644
index 231204191663..000000000000
--- a/shell/source/backends/kdebe/kdeinetlayer.cxx
+++ /dev/null
@@ -1,251 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdeinetlayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define COMMA ','
-#define SEMI_COLON ';'
-
-//==============================================================================
-
-KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 0;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy: // Proxies are manually configured
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyFor( "HTTP" ),
- KProtocolManager::proxyFor( "FTP" ),
- KProtocolManager::proxyFor( "HTTPS" ));
- break;
- case KProtocolManager::PACProxy: // A proxy configuration URL has been given
- case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
- case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
-// In such cases, the proxy address is not stored in KDE, but determined dynamically.
-// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
-// The best we can do here is to ask the current value for a given address.
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyForURL( "http://www.openoffice.org" ),
- KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ),
- KProtocolManager::proxyForURL( "https://www.openoffice.org" ));
- break;
- default: // No proxy is used
- setProxy(aPropInfoList, nProperties, 0);
- }
-
- if ( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
- aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
- aFTPProxy = KProtocolManager::proxyFor( "FTP" );
- break;
- case KProtocolManager::PACProxy:
- case KProtocolManager::WPADProxy:
- case KProtocolManager::EnvVarProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyForURL( "http://www.openoffice.org" );
- aHTTPSProxy = KProtocolManager::proxyForURL( "https://www.openoffice.org" );
- aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
- break;
- default:
- aProxyType = '0';
- }
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aProxyType.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aNoProxyFor.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPProxy.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPSProxy.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFTPProxy.ucs2();
-
- return sTimeStamp;
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
-{
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
-
- if (nProxyType == 0) return;
-
- if ( !aNoProxy.isEmpty() )
- {
- QString aNoProxyFor(aNoProxy);
- ::rtl::OUString sNoProxyFor;
-
- aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
- sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
- }
-
- if ( !aHTTPProxy.isEmpty() )
- {
- KURL aProxy(aHTTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aHTTPSProxy.isEmpty() )
- {
- KURL aProxy(aHTTPSProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aFTPProxy.isEmpty() )
- {
- KURL aProxy(aFTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-}
-
diff --git a/shell/source/backends/kdebe/kdeinetlayer.hxx b/shell/source/backends/kdebe/kdeinetlayer.hxx
deleted file mode 100755
index 1a7427b1cb2c..000000000000
--- a/shell/source/backends/kdebe/kdeinetlayer.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef KDEINETLAYER_HXX_
-#define KDEINETLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <kde_headers.h>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Inet configuration component.
- */
-class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEInetLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- void SAL_CALL setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxyfor = QString(),
- const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
- } ;
-
-#endif // KDEINETLAYER
diff --git a/shell/source/backends/kdebe/kdepathslayer.cxx b/shell/source/backends/kdebe/kdepathslayer.cxx
deleted file mode 100644
index 29d779cfdfc1..000000000000
--- a/shell/source/backends/kdebe/kdepathslayer.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdepathslayer.hxx"
-#include "kde_headers.h"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
- sal_Int32 nProperties = 0;
-
- QString aDocumentsDir( KGlobalSettings::documentPath() );
- rtl::OUString sDocumentsDir;
- rtl::OUString sDocumentsURL;
- if ( aDocumentsDir.endsWith(QChar('/')) )
- aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
- sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
- osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- QString aDocumentsDir;
- aDocumentsDir = KGlobalSettings::documentPath();
-
- sTimeStamp += (const sal_Unicode *) aDocumentsDir.ucs2();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdepathslayer.hxx b/shell/source/backends/kdebe/kdepathslayer.hxx
deleted file mode 100644
index 5ee289aeb68a..000000000000
--- a/shell/source/backends/kdebe/kdepathslayer.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef KDEPATHSLAYER_HXX_
-#define KDEPATHSLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Paths configuration component.
- */
-class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEPathsLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDEPATHSLAYER
diff --git a/shell/source/backends/kdebe/kdevcllayer.cxx b/shell/source/backends/kdebe/kdevcllayer.cxx
deleted file mode 100644
index 3fa08b46ff33..000000000000
--- a/shell/source/backends/kdebe/kdevcllayer.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdevcllayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-#include "kde_headers.h"
-
-//==============================================================================
-
-KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
-/*
- Commenting out, does not make much sense without an accessibility bridge
-===========================================================================
-#if defined(QT_ACCESSIBILITY_SUPPORT)
-// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
- int nVersionMajor = 0;
- const char *q = qVersion(); // "3.1.0" for example
- while ('0' <= *q && *q <= '9')
- nVersionMajor = nVersionMajor * 10 + *q++ - '0';
- sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
-#else
- sal_Bool ATToolSupport = sal_False;
-#endif
-===========================================================================
- End of commented out section
-*/ sal_Bool ATToolSupport = sal_False;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp(
- RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdevcllayer.hxx b/shell/source/backends/kdebe/kdevcllayer.hxx
deleted file mode 100644
index 4b3a50e5c4c8..000000000000
--- a/shell/source/backends/kdebe/kdevcllayer.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef KDEVCLLAYER_HXX_
-#define KDEVCLLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.VCL configuration component.
- */
-class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEVCLLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDEVCLLAYER
diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk
index 7bf8d53568b5..b63e2332624f 100644
--- a/shell/source/backends/kdebe/makefile.mk
+++ b/shell/source/backends/kdebe/makefile.mk
@@ -31,11 +31,7 @@ TARGET=kdebe
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -60,12 +56,8 @@ CFLAGS+=$(KDE_CFLAGS)
# --- Files ---
SLOFILES=\
- $(SLO)$/kdebackend.obj \
- $(SLO)$/kdecommonlayer.obj \
- $(SLO)$/kdeinetlayer.obj \
- $(SLO)$/kdevcllayer.obj \
- $(SLO)$/kdepathslayer.obj \
- $(SLO)$/kdebecdef.obj
+ $(SLO)$/kdeaccess.obj \
+ $(SLO)$/kdebackend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -77,9 +69,8 @@ SHL1LINKFLAGS+=$(KDE_LIBS) -lkio
SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=exports.map
+ $(SALLIB) \
+
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index c67d4f836d9e..1335d4a7fa50 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -29,9 +29,7 @@
#include "precompiled_shell.hxx"
#include "localebackend.hxx"
-#include "localelayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
+#include <com/sun/star/beans/Optional.hpp>
#include <osl/time.h>
#include <stdio.h>
@@ -226,11 +224,7 @@ rtl::OUString ImplGetLocale(LCID lcid)
// -------------------------------------------------------------------------------
-LocaleBackend::LocaleBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
-
+LocaleBackend::LocaleBackend()
{
}
@@ -242,11 +236,9 @@ LocaleBackend::~LocaleBackend(void)
//------------------------------------------------------------------------------
-LocaleBackend* LocaleBackend::createInstance(
- const uno::Reference<uno::XComponentContext>& xContext
-)
+LocaleBackend* LocaleBackend::createInstance()
{
- return new LocaleBackend(xContext);
+ return new LocaleBackend;
}
// ---------------------------------------------------------------------------------------
@@ -288,61 +280,45 @@ rtl::OUString LocaleBackend::getSystemLocale(void)
}
//------------------------------------------------------------------------------
-rtl::OUString LocaleBackend::createTimeStamp()
+void LocaleBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- // the time stamp is free text, so just returning the values here.
- return getLocale() + getUILocale() + getSystemLocale();
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL LocaleBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
+css::uno::Any LocaleBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
-
- uno::Sequence<rtl::OUString> aComps( getSupportedComponents() );
- if( aComponent.equals( aComps[0]) )
+ if (PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale"))) {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getLocale())));
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SystemLocale")))
{
- if( ! m_xSystemLayer.is() )
- {
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
-
- aPropInfoList[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System/L10N/UILocale") );
- aPropInfoList[0].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( getUILocale() );
-
- aPropInfoList[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/Locale") );
- aPropInfoList[1].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ));
- aPropInfoList[1].Protected = sal_False;
- aPropInfoList[1].Value = uno::makeAny( getLocale() );
-
- aPropInfoList[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/SystemLocale") );
- aPropInfoList[2].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ));
- aPropInfoList[2].Protected = sal_False;
- aPropInfoList[2].Value = uno::makeAny( getSystemLocale() );
-
- m_xSystemLayer = new LocaleLayer(aPropInfoList, createTimeStamp(), m_xContext);
- }
-
- return m_xSystemLayer;
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getSystemLocale())));
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("UILocale")))
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getUILocale())));
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
}
-
- return uno::Reference<backend::XLayer>();
-}
-
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-LocaleBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "LocaleBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
}
//------------------------------------------------------------------------------
@@ -363,10 +339,8 @@ rtl::OUString SAL_CALL LocaleBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LocaleBackend")) ;
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
return aServiceNameList ;
}
@@ -391,16 +365,3 @@ uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getSupportedServiceNames(vo
{
return getBackendServiceNames() ;
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(1);
- aSupportedComponentList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System" )
- );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/localebe/localebackend.hxx b/shell/source/backends/localebe/localebackend.hxx
index bfb89c6d06da..29950a3df913 100644
--- a/shell/source/backends/localebe/localebackend.hxx
+++ b/shell/source/backends/localebe/localebackend.hxx
@@ -28,10 +28,8 @@
#ifndef _FIXEDVALUEBACKEND_HXX_
#define _FIXEDVALUEBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
@@ -39,19 +37,14 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service.
- */
class LocaleBackend : public ::cppu::WeakImplHelper2 <
- backend::XSingleLayerStratum,
+ css::beans::XPropertySet,
lang::XServiceInfo > {
public :
- static LocaleBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static LocaleBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL
@@ -78,45 +71,70 @@ class LocaleBackend : public ::cppu::WeakImplHelper2 <
@return service names
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException) ;
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
protected:
/**
Service constructor from a service factory.
@param xContext component context
*/
- LocaleBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ LocaleBackend();
/** Destructor */
~LocaleBackend(void) ;
private:
-
- uno::Reference<uno::XComponentContext> m_xContext ;
- uno::Reference<backend::XLayer> m_xSystemLayer ;
-
- // Returns a time stamp in the appropriate format
- // for configuration layers.
- static rtl::OUString createTimeStamp(void);
-
// Returns the user locale
static rtl::OUString getLocale(void);
diff --git a/shell/source/backends/localebe/localebe.xml b/shell/source/backends/localebe/localebe.xml
index fb6823b43a05..3c22a4970881 100644
--- a/shell/source/backends/localebe/localebe.xml
+++ b/shell/source/backends/localebe/localebe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.LocaleBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx
index e5ff65318200..576501e4da9f 100644
--- a/shell/source/backends/localebe/localebecdef.cxx
+++ b/shell/source/backends/localebe/localebecdef.cxx
@@ -29,7 +29,6 @@
#include "precompiled_shell.hxx"
#include <localebackend.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#include <cppuhelper/implementationentry.hxx>
@@ -39,14 +38,13 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createLocaleBackend(
- const uno::Reference<uno::XComponentContext>& xContext){
+ const uno::Reference<uno::XComponentContext>&){
- return * LocaleBackend::createInstance(xContext);
+ return * LocaleBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +72,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + LocaleBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = LocaleBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( LocaleBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/localebe/localelayer.cxx b/shell/source/backends/localebe/localelayer.cxx
deleted file mode 100644
index a353478ac836..000000000000
--- a/shell/source/backends/localebe/localelayer.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "localelayer.hxx"
-
-//------------------------------------------------------------------------------
-
-LocaleLayer::LocaleLayer( const uno::Sequence<backend::PropertyInfo>& aPropInfoList,
- const rtl::OUString& aTimestamp,
- const uno::Reference<uno::XComponentContext>& xContext)
- : m_aTimestamp(aTimestamp), m_aPropInfoList(aPropInfoList)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocaleLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is())
- {
- m_xLayerContentDescriber->describeLayer(xHandler, m_aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocaleLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- return m_aTimestamp;
-}
-
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/localebe/localelayer.hxx b/shell/source/backends/localebe/localelayer.hxx
deleted file mode 100644
index 69b305079d33..000000000000
--- a/shell/source/backends/localebe/localelayer.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _LOCALELAYER_HXX_
-#define _LOCALELAYER_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class LocaleLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
- public :
- /**
- Constructor given the requested component name
-
- @param aPropInfoListyMap Gconf->OO key map
- @param aCompoentName Requested Component Name
- @param sTimestamp timestamp indicating last modifictaion
- */
- LocaleLayer(const uno::Sequence<backend::PropertyInfo>& aPropInfoList,
- const rtl::OUString& aTimestamp,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- ~LocaleLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- private :
-
- rtl::OUString m_aTimestamp ;
- rtl::OUString m_aComponent ;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- uno::Sequence<backend::PropertyInfo> m_aPropInfoList ;
-} ;
-
-#endif // _LOCALELAYER_HXX_
diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk
index 51a95344aa1f..8a05be4cb351 100644
--- a/shell/source/backends/localebe/makefile.mk
+++ b/shell/source/backends/localebe/makefile.mk
@@ -45,9 +45,8 @@ DLLPRE =
SLOFILES=\
$(SLO)$/localebecdef.obj \
- $(SLO)$/localebackend.obj \
- $(SLO)$/localelayer.obj
-
+ $(SLO)$/localebackend.obj
+
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx
index 499696cea54c..b07afb2e6701 100644
--- a/shell/source/backends/macbe/macbackend.cxx
+++ b/shell/source/backends/macbe/macbackend.cxx
@@ -28,18 +28,140 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+// For MAXHOSTNAMELEN constant
+#include <sys/param.h>
+
+#include <premac.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+#include <Foundation/NSPathUtilities.h>
+#include <postmac.h>
+
#include "macbackend.hxx"
-#include "macbelayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
-#define MACBE_INET_COMPONENT "org.openoffice.Inet"
-#define MACBE_PATHS_COMPONENT "org.openoffice.Office.Paths"
+#include "com/sun/star/beans/Optional.hpp"
+#include "rtl/ustrbuf.hxx"
+#include "osl/file.h"
+
+#define SPACE ' '
+#define SEMI_COLON ';'
+
+typedef struct
+{
+ rtl::OUString Server;
+ sal_Int32 Port;
+} ProxyEntry;
+
+typedef enum {
+ sHTTP,
+ sHTTPS,
+ sFTP
+} ServiceType;
+
+//------------------------------------------------------------------------
+// helper functions
+//------------------------------------------------------------------------
+
+namespace // private
+{
+
+/*
+ * Returns current proxy settings for selected service type (HTTP or
+ * FTP) as a C string (in the buffer specified by host and hostSize)
+ * and a port number.
+ */
+
+bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port)
+{
+ bool result;
+ CFDictionaryRef proxyDict;
+ CFNumberRef enableNum;
+ int enable;
+ CFStringRef hostStr;
+ CFNumberRef portNum;
+ int portInt;
+
+ proxyDict = SCDynamicStoreCopyProxies(NULL);
+
+ if (!proxyDict)
+ return false;
+
+ CFStringRef proxiesEnable;
+ CFStringRef proxiesProxy;
+ CFStringRef proxiesPort;
+
+ switch ( sType )
+ {
+ case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable;
+ proxiesProxy = kSCPropNetProxiesHTTPProxy;
+ proxiesPort = kSCPropNetProxiesHTTPPort;
+ break;
+ case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable;
+ proxiesProxy = kSCPropNetProxiesHTTPSProxy;
+ proxiesPort = kSCPropNetProxiesHTTPSPort;
+ break;
+ default: proxiesEnable = kSCPropNetProxiesFTPEnable;
+ proxiesProxy = kSCPropNetProxiesFTPProxy;
+ proxiesPort = kSCPropNetProxiesFTPPort;
+ break;
+ }
+ // Proxy enabled?
+ enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
+ proxiesEnable );
+
+ result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
+
+ if (result)
+ result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
+
+ // Proxy enabled -> get hostname
+ if (result)
+ {
+ hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict,
+ proxiesProxy );
+
+ result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
+ }
+
+ if (result)
+ result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII);
+
+ // Get proxy port
+ if (result)
+ {
+ portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
+ proxiesPort );
+
+ result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
+ }
+ else
+ {
+ CFRelease(proxyDict);
+ return false;
+ }
+
+ if (result)
+ result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt);
+
+ if (result)
+ *port = (UInt16) portInt;
+
+ if (proxyDict)
+ CFRelease(proxyDict);
+
+ if (!result)
+ {
+ *host = 0;
+ *port = 0;
+ }
+
+ return result;
+}
-MacOSXBackend::MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
+} // end private namespace
+
+//------------------------------------------------------------------------------
+
+MacOSXBackend::MacOSXBackend()
{
}
@@ -51,46 +173,282 @@ MacOSXBackend::~MacOSXBackend(void)
//------------------------------------------------------------------------------
-MacOSXBackend* MacOSXBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
+MacOSXBackend* MacOSXBackend::createInstance()
{
- return new MacOSXBackend(xContext);
+ return new MacOSXBackend;
}
// ---------------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL MacOSXBackend::getLayer(const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- if( aComponent.equalsAscii( MACBE_INET_COMPONENT ) )
- {
- if( ! m_xSystemLayer.is() )
- m_xSystemLayer = new MacOSXLayer( m_xContext );
+rtl::OUString CFStringToOUString(const CFStringRef sOrig) {
+ CFRetain(sOrig);
- return m_xSystemLayer;
- }
- else if( aComponent.equalsAscii( MACBE_PATHS_COMPONENT ) )
- {
- if( ! m_xPathLayer.is() )
- m_xPathLayer = new MacOSXPathLayer( m_xContext );
- return m_xPathLayer;
- }
+ CFIndex nStringLen = CFStringGetLength(sOrig)+1;
+
+ // Allocate a c string buffer
+ char sBuffer[nStringLen];
+
+ CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII);
+
+ CFRelease(sOrig);
- return uno::Reference<backend::XLayer>();
+ return rtl::OUString::createFromAscii((sal_Char*)sBuffer);
}
-//------------------------------------------------------------------------------
+rtl::OUString GetOUString( NSString* pStr )
+{
+ if( ! pStr )
+ return rtl::OUString();
+ int nLen = [pStr length];
+ if( nLen == 0 )
+ return rtl::OUString();
+
+ rtl::OUStringBuffer aBuf( nLen+1 );
+ aBuf.setLength( nLen );
+ [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
+ return aBuf.makeStringAndClear();
+}
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- MacOSXBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
+void MacOSXBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "MacOSXBackend: No Update Operation allowed, Read Only access") ),
- *this);
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
- return NULL;
+css::uno::Any MacOSXBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ rtl::OUString aDocDir;
+ NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true );
+ if( pPaths && [pPaths count] > 0 )
+ {
+ aDocDir = GetOUString( [pPaths objectAtIndex: 0] );
+
+ rtl::OUString aDocURL;
+ if( aDocDir.getLength() > 0 &&
+ osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny( aDocURL ) ) );
+ }
+ else
+ {
+ OSL_TRACE( "user documents list contains empty file path or conversion failed" );
+ }
+ }
+ else
+ {
+ OSL_TRACE( "Got nil or empty list of user document directories" );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ ProxyEntry aFtpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sFTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aFtpProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // ftp proxy name
+ if( aFtpProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aFtpProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ ProxyEntry aFtpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sFTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aFtpProxy.Port = port;
+ }
+
+ // ftp proxy port
+ if( aFtpProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aFtpProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ ProxyEntry aHttpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // http proxy name
+ if( aHttpProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ ProxyEntry aHttpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpProxy.Port = port;
+ }
+
+ // http proxy port
+ if( aHttpProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ ProxyEntry aHttpsProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTPS, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpsProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // https proxy name
+ if( aHttpsProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpsProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ ProxyEntry aHttpsProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTPS, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpsProxy.Port = port;
+ }
+
+ // https proxy port
+ if( aHttpsProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpsProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ // override default for ProxyType, which is "0" meaning "No proxies".
+ sal_Int32 nProperties = 1;
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nProperties ) ) );
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")))
+ {
+ rtl::OUString aProxyBypassList;
+
+ CFArrayRef rExceptionsList;
+ CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL);
+
+ if (!rProxyDict)
+ rExceptionsList = false;
+ else
+ rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
+
+ if (rExceptionsList)
+ {
+ for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
+ {
+ CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
+
+ if (idx>0)
+ aProxyBypassList += rtl::OUString::createFromAscii( ";" );
+
+ aProxyBypassList += CFStringToOUString(rException);
+ }
+ }
+
+ if (rProxyDict)
+ CFRelease(rProxyDict);
+
+ // fill proxy bypass list
+ if( aProxyBypassList.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true,
+ uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
}
//------------------------------------------------------------------------------
@@ -112,9 +470,8 @@ rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.MacOSXBackend"));
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend"));
return aServiceNameList;
}
@@ -140,15 +497,3 @@ uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedServiceNames(vo
{
return getBackendServiceNames();
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(2);
- aSupportedComponentList[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_INET_COMPONENT ) );
- aSupportedComponentList[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_PATHS_COMPONENT ) );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/macbe/macbackend.hxx b/shell/source/backends/macbe/macbackend.hxx
index 5c477d1a73e5..de4f9eee1ff6 100644
--- a/shell/source/backends/macbe/macbackend.hxx
+++ b/shell/source/backends/macbe/macbackend.hxx
@@ -28,10 +28,8 @@
#ifndef _MACBACKEND_HXX_
#define _MACBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
@@ -41,18 +39,13 @@
namespace css = com::sun::star;
namespace uno = css::uno;
namespace lang = css::lang;
-namespace backend = css::configuration::backend;
-
-/**
- Implements the SingleLayerStratum service.
- */
-class MacOSXBackend : public ::cppu::WeakImplHelper2 <backend::XSingleLayerStratum, lang::XServiceInfo >
+class MacOSXBackend : public ::cppu::WeakImplHelper2 <css::beans::XPropertySet, lang::XServiceInfo >
{
public:
- static MacOSXBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static MacOSXBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL getImplementationName()
@@ -78,19 +71,56 @@ public:
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void);
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void);
-
- // XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL getLayer(const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException);
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL getUpdatableLayer(const rtl::OUString& aLayerId)
- throw (backend::BackendAccessException, lang::NoSupportException, lang::IllegalArgumentException);
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
protected:
@@ -99,18 +129,10 @@ protected:
@param xContext component context
*/
- MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ MacOSXBackend();
/** Destructor */
~MacOSXBackend(void);
-
-private:
-
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<backend::XLayer> m_xSystemLayer;
- uno::Reference<backend::XLayer> m_xPathLayer;
-
};
#endif // _MACBACKEND_HXX_
diff --git a/shell/source/backends/macbe/macbe.xml b/shell/source/backends/macbe/macbe.xml
index 85854250cfe3..7cee5bb14de5 100644
--- a/shell/source/backends/macbe/macbe.xml
+++ b/shell/source/backends/macbe/macbe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.MacOSXBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx
index 82fae97dbdbe..18cf2806c16b 100644
--- a/shell/source/backends/macbe/macbecdef.cxx
+++ b/shell/source/backends/macbe/macbecdef.cxx
@@ -39,14 +39,13 @@
namespace css = com::sun::star;
namespace uno = css::uno;
namespace lang = css::lang;
-namespace backend = css::configuration::backend;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createMacOSXBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
+ const uno::Reference<uno::XComponentContext>&)
{
- return * MacOSXBackend::createInstance(xContext);
+ return * MacOSXBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +73,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + MacOSXBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = MacOSXBackend::getBackendServiceNames();
- for (sal_Int32 i = 0; i < sServiceNames.getLength(); ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( MacOSXBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/macbe/macbelayer.cxx b/shell/source/backends/macbe/macbelayer.cxx
deleted file mode 100644
index 113f7f964f54..000000000000
--- a/shell/source/backends/macbe/macbelayer.cxx
+++ /dev/null
@@ -1,440 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-// For MAXHOSTNAMELEN constant
-#include <sys/param.h>
-
-#include <premac.h>
-#include <SystemConfiguration/SystemConfiguration.h>
-#include <Foundation/NSPathUtilities.h>
-#include <postmac.h>
-
-#include "macbelayer.hxx"
-
-#include "rtl/ustrbuf.hxx"
-#include "osl/file.h"
-
-#define SPACE ' '
-#define SEMI_COLON ';'
-
-typedef struct
-{
- rtl::OUString Server;
- sal_Int32 Port;
-} ProxyEntry;
-
-typedef enum {
- sHTTP,
- sHTTPS,
- sFTP
-} ServiceType;
-
-//------------------------------------------------------------------------
-// helper functions
-//------------------------------------------------------------------------
-
-namespace // private
-{
-
-/*
- * Returns current proxy settings for selected service type (HTTP or
- * FTP) as a C string (in the buffer specified by host and hostSize)
- * and a port number.
- */
-
-bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port)
-{
- bool result;
- CFDictionaryRef proxyDict;
- CFNumberRef enableNum;
- int enable;
- CFStringRef hostStr;
- CFNumberRef portNum;
- int portInt;
-
- proxyDict = SCDynamicStoreCopyProxies(NULL);
-
- if (!proxyDict)
- return false;
-
- CFStringRef proxiesEnable;
- CFStringRef proxiesProxy;
- CFStringRef proxiesPort;
-
- switch ( sType )
- {
- case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable;
- proxiesProxy = kSCPropNetProxiesHTTPProxy;
- proxiesPort = kSCPropNetProxiesHTTPPort;
- break;
- case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable;
- proxiesProxy = kSCPropNetProxiesHTTPSProxy;
- proxiesPort = kSCPropNetProxiesHTTPSPort;
- break;
- default: proxiesEnable = kSCPropNetProxiesFTPEnable;
- proxiesProxy = kSCPropNetProxiesFTPProxy;
- proxiesPort = kSCPropNetProxiesFTPPort;
- break;
- }
- // Proxy enabled?
- enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
- proxiesEnable );
-
- result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
-
- if (result)
- result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
-
- // Proxy enabled -> get hostname
- if (result)
- {
- hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict,
- proxiesProxy );
-
- result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
- }
-
- if (result)
- result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII);
-
- // Get proxy port
- if (result)
- {
- portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
- proxiesPort );
-
- result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
- }
- else
- {
- CFRelease(proxyDict);
- return false;
- }
-
- if (result)
- result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt);
-
- if (result)
- *port = (UInt16) portInt;
-
- if (proxyDict)
- CFRelease(proxyDict);
-
- if (!result)
- {
- *host = 0;
- *port = 0;
- }
-
- return result;
-}
-
-} // end private namespace
-
-//------------------------------------------------------------------------------
-
-MacOSXLayer::MacOSXLayer( const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString CFStringToOUString(const CFStringRef sOrig) {
- CFRetain(sOrig);
-
- CFIndex nStringLen = CFStringGetLength(sOrig)+1;
-
- // Allocate a c string buffer
- char sBuffer[nStringLen];
-
- CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII);
-
- CFRelease(sOrig);
-
- return rtl::OUString::createFromAscii((sal_Char*)sBuffer);
-}
-
-void SAL_CALL MacOSXLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is())
- {
- rtl::OUString aProxyBypassList;
-
- CFArrayRef rExceptionsList;
- CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL);
-
- if (!rProxyDict)
- rExceptionsList = false;
- else
- rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
-
- if (rExceptionsList)
- {
- for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
- {
- CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
-
- if (idx>0)
- aProxyBypassList += rtl::OUString::createFromAscii( ";" );
-
- aProxyBypassList += CFStringToOUString(rException);
- }
- }
-
- if (rProxyDict)
- CFRelease(rProxyDict);
-
- // override default for ProxyType, which is "0" meaning "No proxies".
- // CAUTION: if you add properties, please increase the sequence size here !
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 1;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( nProperties );
-
- // fill proxy bypass list
- if( aProxyBypassList.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) );
- }
-
- ProxyEntry aHttpProxy;
- ProxyEntry aHttpsProxy;
- ProxyEntry aFtpProxy;
-
- char host[MAXHOSTNAMELEN];
- UInt16 port;
- bool retVal;
-
- retVal = GetProxySetting(sHTTP, host, 100, &port);
-
- if (retVal)
- {
- aHttpProxy.Server = rtl::OUString::createFromAscii( host );
- aHttpProxy.Port = port;
- }
-
- retVal = GetProxySetting(sHTTPS, host, 100, &port);
-
- if (retVal)
- {
- aHttpsProxy.Server = rtl::OUString::createFromAscii( host );
- aHttpsProxy.Port = port;
- }
-
- retVal = GetProxySetting(sFTP, host, 100, &port);
-
- if (retVal)
- {
- aFtpProxy.Server = rtl::OUString::createFromAscii( host );
- aFtpProxy.Port = port;
- }
-
- // http proxy name
- if( aHttpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server );
- }
-
- // http proxy port
- if( aHttpProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port );
- }
-
- // https proxy name
- if( aHttpsProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server );
- }
-
- // https proxy port
- if( aHttpsProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port );
- }
-
- // ftp proxy name
- if( aFtpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server );
- }
-
- // ftp proxy port
- if( aFtpProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port );
- }
-
- // resize the property info list appropriately
- aPropInfoList.realloc(nProperties);
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL MacOSXLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // FIXME: Always new timestamp!?
- rtl::OUString aTimestamp = rtl::OUString::valueOf( time(NULL) );
-
- return aTimestamp;
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString GetOUString( NSString* pStr )
-{
- if( ! pStr )
- return rtl::OUString();
- int nLen = [pStr length];
- if( nLen == 0 )
- return rtl::OUString();
-
- rtl::OUStringBuffer aBuf( nLen+1 );
- aBuf.setLength( nLen );
- [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
- return aBuf.makeStringAndClear();
-}
-
-void SAL_CALL MacOSXPathLayer::readData(
- const uno::Reference<backend::XLayerHandler>& i_xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (m_xLayerContentDescriber.is())
- {
- rtl::OUString aDocDir;
- NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true );
- if( pPaths && [pPaths count] > 0 )
- {
- aDocDir = GetOUString( [pPaths objectAtIndex: 0] );
-
- rtl::OUString aDocURL;
- if( aDocDir.getLength() > 0 &&
- osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None )
- {
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work" ) );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value <<= aDocURL;
-
- m_xLayerContentDescriber->describeLayer(i_xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE( "user documents list contains empty file path or conversion failed" );
- }
- }
- else
- {
- OSL_TRACE( "Got nil or empty list of user document directories" );
- }
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
diff --git a/shell/source/backends/macbe/macbelayer.hxx b/shell/source/backends/macbe/macbelayer.hxx
deleted file mode 100644
index 06e80632da50..000000000000
--- a/shell/source/backends/macbe/macbelayer.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MACBELAYER_HXX_
-#define _MACBELAYER_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star;
-namespace uno = css::uno;
-namespace lang = css::lang;
-namespace backend = css::configuration::backend;
-namespace util = css::util;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class MacOSXLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public:
-
- /**
- Constructor given the requested component name
-
- @param aTimestamp timestamp indicating last modifictaion
- */
- MacOSXLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- virtual ~MacOSXLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
-protected:
-
- rtl::OUString m_aComponent;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
-
-};
-
-class MacOSXPathLayer : public MacOSXLayer
-{
- public:
- MacOSXPathLayer(const uno::Reference<uno::XComponentContext>& i_xContext) :
- MacOSXLayer( i_xContext ) {}
- virtual ~MacOSXPathLayer() {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& i_xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException);
-};
-
-#endif // _MACBELAYER_HXX_
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
index 1d5d68a1f615..7b42c8c577ce 100644
--- a/shell/source/backends/macbe/makefile.mk
+++ b/shell/source/backends/macbe/makefile.mk
@@ -54,8 +54,7 @@ CFLAGSCXX+=$(OBJCXXFLAGS)
SLOFILES= \
$(SLO)$/macbecdef.obj \
- $(SLO)$/macbackend.obj \
- $(SLO)$/macbelayer.obj
+ $(SLO)$/macbackend.obj
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk
index fd87b9268475..0401cb88b7dd 100644
--- a/shell/source/backends/wininetbe/makefile.mk
+++ b/shell/source/backends/wininetbe/makefile.mk
@@ -46,9 +46,8 @@ DLLPRE =
SLOFILES=\
$(SLO)$/wininetbecdef.obj \
- $(SLO)$/wininetbackend.obj \
- $(SLO)$/wininetlayer.obj
-
+ $(SLO)$/wininetbackend.obj
+
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx
index 0734b2cbba3a..e28bab3affe4 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -28,76 +28,331 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+#include "rtl/ustrbuf.hxx"
+
#include "wininetbackend.hxx"
-#include "wininetlayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
+
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#endif
+#include <windows.h>
+#include <wininet.h>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
#define WININET_DLL_NAME "wininet.dll"
+#define EQUAL_SIGN '='
+#define COLON ':'
+#define SPACE ' '
+#define SEMI_COLON ';'
-WinInetBackend::WinInetBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
-{
- m_hWinInetDll = LoadLibrary( WININET_DLL_NAME );
-}
+namespace {
-//------------------------------------------------------------------------------
+struct Library {
+ HMODULE module;
-WinInetBackend::~WinInetBackend(void)
-{
- if ( m_hWinInetDll )
- FreeLibrary( m_hWinInetDll );
-}
+ Library(HMODULE theModule): module(theModule) {}
-//------------------------------------------------------------------------------
+ ~Library() { if (module) FreeLibrary(module); }
+};
-WinInetBackend* WinInetBackend::createInstance(
- const uno::Reference<uno::XComponentContext>& xContext
-)
-{
- return new WinInetBackend(xContext);
}
-// ---------------------------------------------------------------------------------------
+typedef struct
+{
+ rtl::OUString Server;
+ rtl::OUString Port;
+} ProxyEntry;
+
+//------------------------------------------------------------------------
+// helper functions
+//------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL WinInetBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
+namespace // private
{
+ ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i)
+ {
+ ProxyEntry aProxyEntry;
- if( aComponent.equals( getSupportedComponents()[0]) )
+ aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
+ if ( i > -1 )
+ aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
+
+ return aProxyEntry;
+ }
+
+ ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType)
{
- if( ! m_xSystemLayer.is() && m_hWinInetDll )
+ sal_Int32 nIndex = 0;
+
+ do
{
- WinInetLayer::InternetQueryOption_Proc_T lpfnInternetQueryOption =
- reinterpret_cast< WinInetLayer::InternetQueryOption_Proc_T >(
- GetProcAddress( m_hWinInetDll, "InternetQueryOptionA" ) );
+ // get the next token, e.g. ftp=server:port
+ rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
+
+ // split the next token again into the parts separated
+ // through '=', e.g. ftp=server:port -> ftp and server:port
+ sal_Int32 i = 0;
+ if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
+ {
+ if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
+ return ReadProxyEntry(nextToken, i);
+ }
+ else if( aType.getLength() == 0)
+ return ReadProxyEntry(nextToken, i);
+
+ } while ( nIndex >= 0 );
+
+ return ProxyEntry();
+ }
- if( lpfnInternetQueryOption )
- m_xSystemLayer = new WinInetLayer(lpfnInternetQueryOption, m_xContext);
- }
+} // end private namespace
+
+//------------------------------------------------------------------------------
+
+WinInetBackend::WinInetBackend()
+{
+ Library hWinInetDll( LoadLibrary( WININET_DLL_NAME ) );
+ if( hWinInetDll.module )
+ {
+ typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD );
- return m_xSystemLayer;
+ InternetQueryOption_Proc_T lpfnInternetQueryOption =
+ reinterpret_cast< InternetQueryOption_Proc_T >(
+ GetProcAddress( hWinInetDll.module, "InternetQueryOptionA" ) );
+ if (lpfnInternetQueryOption)
+ {
+ LPINTERNET_PROXY_INFO lpi = NULL;
+
+ // query for the neccessary space
+ DWORD dwLength = 0;
+ BOOL bRet = lpfnInternetQueryOption(
+ NULL,
+ INTERNET_OPTION_PROXY,
+ (LPVOID)lpi,
+ &dwLength );
+
+ // allocate sufficient space on the heap
+ // insufficient space on the heap results
+ // in a stack overflow exception, we assume
+ // this never happens, because of the relatively
+ // small amount of memory we need
+ // _alloca is nice because it is fast and we don't
+ // have to free the allocated memory, it will be
+ // automatically done
+ lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
+ _alloca( dwLength ) );
+
+ bRet = lpfnInternetQueryOption(
+ NULL,
+ INTERNET_OPTION_PROXY,
+ (LPVOID)lpi,
+ &dwLength );
+
+ // if a proxy is disabled, InternetQueryOption returns
+ // an empty proxy list, so we don't have to check if
+ // proxy is enabled or not
+
+ rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy );
+ rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
+
+ // override default for ProxyType, which is "0" meaning "No proxies".
+ sal_Int32 nProperties = 1;
+
+ valueProxyType_.IsPresent = true;
+ valueProxyType_.Value <<= nProperties;
+
+ // fill proxy bypass list
+ if( aProxyBypassList.getLength() > 0 )
+ {
+ rtl::OUStringBuffer aReverseList;
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex );
+ if ( aProxyList.indexOf( aToken ) == -1 )
+ {
+ if ( aReverseList.getLength() )
+ {
+ aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) );
+ aReverseList.insert( 0, aToken );
+ }
+ else
+ aReverseList = aToken;
+ }
+ }
+ while ( nIndex >= 0 );
+
+ aProxyBypassList = aReverseList.makeStringAndClear();
+
+ valueNoProxy_.IsPresent = true;
+ valueNoProxy_.Value <<= aProxyBypassList.replace( SPACE, SEMI_COLON );
+ }
+
+ if( aProxyList.getLength() > 0 )
+ {
+ //-------------------------------------------------
+ // this implementation follows the algorithm
+ // of the internet explorer
+ // if there are type-dependent proxy settings
+ // and type independent proxy settings in the
+ // registry the internet explorer chooses the
+ // type independent proxy for all settings
+ // e.g. imagine the following registry entry
+ // ftp=server:port;http=server:port;server:port
+ // the last token server:port is type independent
+ // so the ie chooses this proxy server
+
+ // if there is no port specified for a type independent
+ // server the ie uses the port of an http server if
+ // there is one and it has a port
+ //-------------------------------------------------
+
+ ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
+ ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
+ ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
+
+ ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
+
+ if( aTypeIndepProxy.Server.getLength() )
+ {
+ aHttpProxy.Server = aTypeIndepProxy.Server;
+ aHttpsProxy.Server = aTypeIndepProxy.Server;
+ aFtpProxy.Server = aTypeIndepProxy.Server;
+
+ if( aTypeIndepProxy.Port.getLength() )
+ {
+ aHttpProxy.Port = aTypeIndepProxy.Port;
+ aHttpsProxy.Port = aTypeIndepProxy.Port;
+ aFtpProxy.Port = aTypeIndepProxy.Port;
+ }
+ else
+ {
+ aFtpProxy.Port = aHttpProxy.Port;
+ aHttpsProxy.Port = aHttpProxy.Port;
+ }
+ }
+
+ // http proxy name
+ if( aHttpProxy.Server.getLength() > 0 )
+ {
+ valueHttpProxyName_.IsPresent = true;
+ valueHttpProxyName_.Value <<= aHttpProxy.Server;
+ }
+
+ // http proxy port
+ if( aHttpProxy.Port.getLength() > 0 )
+ {
+ valueHttpProxyPort_.IsPresent = true;
+ valueHttpProxyPort_.Value <<= aHttpProxy.Port.toInt32();
+ }
+
+ // https proxy name
+ if( aHttpsProxy.Server.getLength() > 0 )
+ {
+ valueHttpsProxyName_.IsPresent = true;
+ valueHttpsProxyName_.Value <<= aHttpsProxy.Server;
+ }
+
+ // https proxy port
+ if( aHttpsProxy.Port.getLength() > 0 )
+ {
+ valueHttpsProxyPort_.IsPresent = true;
+ valueHttpsProxyPort_.Value <<= aHttpsProxy.Port.toInt32();
+ }
+
+ // ftp proxy name
+ if( aFtpProxy.Server.getLength() > 0 )
+ {
+ valueFtpProxyName_.IsPresent = true;
+ valueFtpProxyName_.Value <<= aFtpProxy.Server;
+ }
+
+ // ftp proxy port
+ if( aFtpProxy.Port.getLength() > 0 )
+ {
+ valueFtpProxyPort_.IsPresent = true;
+ valueFtpProxyPort_.Value <<= aFtpProxy.Port.toInt32();
+ }
+ }
+ }
}
+}
- return uno::Reference<backend::XLayer>();
+//------------------------------------------------------------------------------
+
+WinInetBackend::~WinInetBackend(void)
+{
}
//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-WinInetBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
+WinInetBackend* WinInetBackend::createInstance()
{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "WinInetBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
+ return new WinInetBackend;
+}
+
+// ---------------------------------------------------------------------------------------
- return NULL;
+void WinInetBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
+
+css::uno::Any WinInetBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ return css::uno::makeAny(valueFtpProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ return css::uno::makeAny(valueFtpProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ return css::uno::makeAny(valueHttpProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ return css::uno::makeAny(valueHttpProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ return css::uno::makeAny(valueHttpsProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ return css::uno::makeAny(valueHttpsProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")))
+ {
+ return css::uno::makeAny(valueNoProxy_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(valueProxyType_);
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
}
//------------------------------------------------------------------------------
@@ -118,9 +373,8 @@ rtl::OUString SAL_CALL WinInetBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.WinInetBackend")) ;
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
return aServiceNameList ;
}
@@ -146,16 +400,3 @@ uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getSupportedServiceNames(v
{
return getBackendServiceNames() ;
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(1);
- aSupportedComponentList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet" )
- );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx b/shell/source/backends/wininetbe/wininetbackend.hxx
index d624d2cefb10..5fe4d5625a9a 100644
--- a/shell/source/backends/wininetbe/wininetbackend.hxx
+++ b/shell/source/backends/wininetbe/wininetbackend.hxx
@@ -28,38 +28,23 @@
#ifndef _FIXEDVALUEBACKEND_HXX_
#define _FIXEDVALUEBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/Optional.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#include <wininet.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service.
- */
class WinInetBackend : public ::cppu::WeakImplHelper2 <
- backend::XSingleLayerStratum,
+ css::beans::XPropertySet,
lang::XServiceInfo > {
public :
- static WinInetBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static WinInetBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL
@@ -86,43 +71,86 @@ class WinInetBackend : public ::cppu::WeakImplHelper2 <
@return service names
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException) ;
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
protected:
/**
Service constructor from a service factory.
@param xContext component context
*/
- WinInetBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ WinInetBackend();
/** Destructor */
~WinInetBackend(void) ;
private:
-
- uno::Reference<uno::XComponentContext> m_xContext ;
- uno::Reference<backend::XLayer> m_xSystemLayer ;
-
- // The wininet.dll module handle
- HMODULE m_hWinInetDll;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueProxyType_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueNoProxy_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpProxyPort_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpsProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpsProxyPort_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueFtpProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueFtpProxyPort_;
} ;
diff --git a/shell/source/backends/wininetbe/wininetbe.xml b/shell/source/backends/wininetbe/wininetbe.xml
index 42364deba3cb..1bf4bd2cd053 100644
--- a/shell/source/backends/wininetbe/wininetbe.xml
+++ b/shell/source/backends/wininetbe/wininetbe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.Win32Backend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx
index 1a941429a3ec..862600009e30 100644
--- a/shell/source/backends/wininetbe/wininetbecdef.cxx
+++ b/shell/source/backends/wininetbe/wininetbecdef.cxx
@@ -39,14 +39,13 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createWinInetBackend(
- const uno::Reference<uno::XComponentContext>& xContext){
+ const uno::Reference<uno::XComponentContext>&){
- return * WinInetBackend::createInstance(xContext);
+ return * WinInetBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +73,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + WinInetBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = WinInetBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( WinInetBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/wininetbe/wininetlayer.cxx b/shell/source/backends/wininetbe/wininetlayer.cxx
deleted file mode 100644
index df00abe0081b..000000000000
--- a/shell/source/backends/wininetbe/wininetlayer.cxx
+++ /dev/null
@@ -1,374 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#ifndef _WININETLAYER_HXX_
-#include "wininetlayer.hxx"
-#endif
-
-#include <malloc.h>
-
-#include <rtl/ustrbuf.hxx>
-
-#define EQUAL_SIGN '='
-#define COLON ':'
-#define SPACE ' '
-#define SEMI_COLON ';'
-
-typedef struct
-{
- rtl::OUString Server;
- rtl::OUString Port;
-} ProxyEntry;
-
-//------------------------------------------------------------------------
-// helper functions
-//------------------------------------------------------------------------
-
-namespace // private
-{
- ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i)
- {
- ProxyEntry aProxyEntry;
-
- aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
- if ( i > -1 )
- aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
-
- return aProxyEntry;
- }
-
- ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType)
- {
- sal_Int32 nIndex = 0;
-
- do
- {
- // get the next token, e.g. ftp=server:port
- rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
-
- // split the next token again into the parts separated
- // through '=', e.g. ftp=server:port -> ftp and server:port
- sal_Int32 i = 0;
- if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
- {
- if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
- return ReadProxyEntry(nextToken, i);
- }
- else if( aType.getLength() == 0)
- return ReadProxyEntry(nextToken, i);
-
- } while ( nIndex >= 0 );
-
- return ProxyEntry();
- }
-
-} // end private namespace
-
-//------------------------------------------------------------------------------
-
-WinInetLayer::WinInetLayer( InternetQueryOption_Proc_T lpfnInternetQueryOption,
- const uno::Reference<uno::XComponentContext>& xContext)
- : m_lpfnInternetQueryOption(lpfnInternetQueryOption)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL WinInetLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is() && m_lpfnInternetQueryOption)
- {
- LPINTERNET_PROXY_INFO lpi = NULL;
-
- // query for the neccessary space
- DWORD dwLength = 0;
- BOOL bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // allocate sufficient space on the heap
- // insufficient space on the heap results
- // in a stack overflow exception, we assume
- // this never happens, because of the relatively
- // small amount of memory we need
- // _alloca is nice because it is fast and we don't
- // have to free the allocated memory, it will be
- // automatically done
- lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
- _alloca( dwLength ) );
-
- bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // if a proxy is disabled, InternetQueryOption returns
- // an empty proxy list, so we don't have to check if
- // proxy is enabled or not
-
- rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy );
- rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
-
- // override default for ProxyType, which is "0" meaning "No proxies".
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 1;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( nProperties );
-
- // fill proxy bypass list
- if( aProxyBypassList.getLength() > 0 )
- {
- rtl::OUStringBuffer aReverseList;
- sal_Int32 nIndex = 0;
- do
- {
- rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex );
- if ( aProxyList.indexOf( aToken ) == -1 )
- {
- if ( aReverseList.getLength() )
- {
- aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) );
- aReverseList.insert( 0, aToken );
- }
- else
- aReverseList = aToken;
- }
- }
- while ( nIndex >= 0 );
-
- aProxyBypassList = aReverseList.makeStringAndClear();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) );
- }
-
- if( aProxyList.getLength() > 0 )
- {
- //-------------------------------------------------
- // this implementation follows the algorithm
- // of the internet explorer
- // if there are type-dependent proxy settings
- // and type independent proxy settings in the
- // registry the internet explorer chooses the
- // type independent proxy for all settings
- // e.g. imagine the following registry entry
- // ftp=server:port;http=server:port;server:port
- // the last token server:port is type independent
- // so the ie chooses this proxy server
-
- // if there is no port specified for a type independent
- // server the ie uses the port of an http server if
- // there is one and it has a port
- //-------------------------------------------------
-
- ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
- ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
- ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
-
- ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
-
- if( aTypeIndepProxy.Server.getLength() )
- {
- aHttpProxy.Server = aTypeIndepProxy.Server;
- aHttpsProxy.Server = aTypeIndepProxy.Server;
- aFtpProxy.Server = aTypeIndepProxy.Server;
-
- if( aTypeIndepProxy.Port.getLength() )
- {
- aHttpProxy.Port = aTypeIndepProxy.Port;
- aHttpsProxy.Port = aTypeIndepProxy.Port;
- aFtpProxy.Port = aTypeIndepProxy.Port;
- }
- else
- {
- aFtpProxy.Port = aHttpProxy.Port;
- aHttpsProxy.Port = aHttpProxy.Port;
- }
- }
-
- // http proxy name
- if( aHttpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server );
- }
-
- // http proxy port
- if( aHttpProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port.toInt32() );
- }
-
- // https proxy name
- if( aHttpsProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server );
- }
-
- // https proxy port
- if( aHttpsProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port.toInt32() );
- }
-
- // ftp proxy name
- if( aFtpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server );
- }
-
- // ftp proxy port
- if( aFtpProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port.toInt32() );
- }
- }
-
- // resize the property info list appropriately
- aPropInfoList.realloc(nProperties);
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL WinInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- rtl::OUString aTimestamp;
-
- if (m_lpfnInternetQueryOption)
- {
- LPINTERNET_PROXY_INFO lpi = NULL;
-
- // query for the neccessary space
- DWORD dwLength = 0;
- BOOL bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // allocate sufficient space on the heap
- // insufficient space on the heap results
- // in a stack overflow exception, we assume
- // this never happens, because of the relatively
- // small amount of memory we need
- // _alloca is nice because it is fast and we don't
- // have to free the allocated memory, it will be
- // automatically done
- lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
- _alloca( dwLength ) );
-
- bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- aTimestamp = rtl::OUString::createFromAscii( lpi->lpszProxy );
- aTimestamp += rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
- }
-
- return aTimestamp;
-}
-
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/wininetbe/wininetlayer.hxx b/shell/source/backends/wininetbe/wininetlayer.hxx
deleted file mode 100644
index 761e174d1df5..000000000000
--- a/shell/source/backends/wininetbe/wininetlayer.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef _WinInetLayer_HXX_
-#define _WinInetLayer_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#include <wininet.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class WinInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
- public :
- typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD );
-
- /**
- Constructor given the requested component name
-
- @param lpfnInternetQueryOption function pointer into wininet.dll
- @param aTimestamp timestamp indicating last modifictaion
- */
- WinInetLayer(InternetQueryOption_Proc_T lpfnInternetQueryOption,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- ~WinInetLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- private :
-
- rtl::OUString m_aComponent ;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- // The InternetQueryOption function pointer
- InternetQueryOption_Proc_T m_lpfnInternetQueryOption;
-} ;
-
-#endif // _WinInetLayer_HXX_
diff --git a/smoketestoo_native/config.pl b/smoketestoo_native/config.pl
index 79e498792896..988d1176ed42 100755
--- a/smoketestoo_native/config.pl
+++ b/smoketestoo_native/config.pl
@@ -1,6 +1,3 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,139 +26,58 @@ eval 'exec perl -wS $0 ${1+"$@"}'
#*************************************************************************
use File::Path;
-use File::Copy;
-### globals ###
+$branddir = $ARGV[0];
+$userinstalldir = $ARGV[1];
+$buildid = $ARGV[2];
-$is_debug = 0;
-
-$gui = $ENV{GUI};
-$cygwin = "cygwin";
-
-if ($^O =~ /cygwin/) {
- $gui = $cygwin;
-}
-
-if (($gui eq "UNX") or ($gui eq $cygwin)) {
- $pathslash = "/";
-}
-else
-{
- $pathslash = "\\";
-}
-
-#### Hardly coded path for
-# \share\registry\data\org\openoffice\Office\Jobs.xcu
-
-$jobs_XML_Path = "share" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash . "Office" . $pathslash . "Jobs.xcu";
-
-# \user\registry\data\org\openoffice\
-
-$User_Path = "user" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash;
-
-# \user\registry\data\org\openoffice\Office\
-
-$User_Office_Path = $User_Path . "Office" . $pathslash;
-
-# \user\registry\data\org\openoffice\Office\OOoImprovement
-
-$OOoImprovement_Path = $User_Office_Path . "OOoImprovement" . $pathslash;
-
-$common_XML = "Common.xcu";
-$setup_XML = "Setup.xcu";
-$oooimprovement_XML = "Settings.xcu";
-
-# $(INPATH)\misc\Common.xcu
-$inpath_Common_XCU = $ENV{INPATH} . $pathslash . "misc" . $pathslash . $common_XML;
-
-### main ###
-
-$idStr = ' $Revision: 1.5 $ ';
-$idStr =~ /Revision:\s+(\S+)\s+\$/
- ? ($cpflat2minor_rev = $1) : ($cpflat2minor_rev = "-");
-
-if ( ($#ARGV >= 3) ) {
- $ARGV[0] =~ s/\"//g;
- $ARGV[1] =~ s/\"//g;
- $ARGV[2] =~ s/\"//g;
- $ARGV[3] =~ s/\"//g;
- chop($ARGV[0]);
- chop($ARGV[1]);
- chop($ARGV[2]);
- chop($ARGV[3]);
-}
-
-if ( ! ( ($#ARGV >= 4) && $ARGV[0] && $ARGV[1] && $ARGV[2] && $ARGV[3] && (-d $ARGV[3]) && $ARGV[4] ) ) {
- print "Usage: config <basispath> <brandpath> <userinstallpath> <datapath> <buildid>\n" ;
- exit(1);
-}
-
-$basisdir = $ARGV[0];
-$branddir = $ARGV[1];
-$userinstalldir = $ARGV[2];
-$datapath = $ARGV[3];
-$buildid = $ARGV[4];
-
-$fullquickstart_path = $branddir . "program" . $pathslash . "quickstart.exe";
-
-print "patching config ... \n";
-if (!-d "$userinstalldir$User_Office_Path") {
- mkpath("$userinstalldir$User_Office_Path", 0, 0777);
-}
-if (!-d "$userinstalldir$OOoImprovement_Path") {
- mkpath("$userinstalldir$OOoImprovement_Path", 0, 0777);
-}
-
-# copy Common.xcu
-print "Patching Common.xcu\n" if $is_debug;
-PatchCommonXcu($buildid);
-print "cp $inpath_Common_XCU $userinstalldir$User_Office_Path$common_XML\n" if $is_debug;
-copy ("$inpath_Common_XCU", "$userinstalldir$User_Office_Path$common_XML");
-
-# copy OOoImprovement/Settings.xcu
-
-print "cp $datapath$oooimprovement_XML $userinstalldir$OOoImprovement_Path$oooimprovement_XML\n" if $is_debug;
-copy ("$datapath$oooimprovement_XML", "$userinstalldir$OOoImprovement_Path$oooimprovement_XML");
-
-# copy Setup.xcu
-
-print "cp $datapath$setup_XML $userinstalldir$User_Path$setup_XML\n" if $is_debug;
-copy ("$datapath$setup_XML", "$userinstalldir$User_Path$setup_XML");
-
-
-# quickstarter loeschen
-if ($gui ne "UNX") {
- print "kill $fullquickstart_path \n";
- unlink( $fullquickstart_path ) or die "cannot unlink $fullquickstart_path";
+if ($ENV{GUI} ne "UNX") {
+ $quickstart = $branddir . "program/quickstart.exe";
+ print "kill $quickstart\n";
+ unlink $quickstart or die "cannot unlink $fullquickstart_path";
}
-#delete joblist
-$fullsource_path = $basisdir . $jobs_XML_Path;
-unlink ($fullsource_path);
-
-exit(0);
-
-############################################################################
-sub PatchCommonXcu #17.04.2009 10:37
-############################################################################
- {
- my $buildid = shift;
- open(INFILE, "< $datapath$common_XML") || die "Can't open $datapath$common_XML (read)\n";
- open(OUTFILE, "> $inpath_Common_XCU") || die "Can't open $inpath_Common_XCU (write)\n";
- my $patch_next_line = 0;
- my $value = "<value>Patch" . $buildid . "</value>\n";
- while ( $line = <INFILE> ) {
- if ( $patch_next_line ) {
- print OUTFILE " $value";
- $patch_next_line = 0;
- } else
- {
- print OUTFILE $line;
- }
- if ( $line =~ /ReminderDate/ ) {
- $patch_next_line = 1;
- }
- }
- close(INFILE);
- close(OUTFILE);
-} ##PatchCommonXcu
+$regpath = $userinstalldir . "user";
+$regfile = $regpath . "/registrymodifications.xcu";
+print "create $regfile\n";
+mkpath($regpath, 0, 0777);
+open (OUT, "> $regfile") or die "cannot open $regfile for writing";
+print OUT << "EOF";
+<oor:items xmlns:oor='http://openoffice.org/2001/registry'>
+ <item oor:path='/org.openoffice.Office.Common/Help/Registration'>
+ <prop oor:name='ReminderDate'>
+ <value>Patch$buildid</value>
+ </prop>
+ </item>
+ <item oor:path='/org.openoffice.Office.Common/Misc'>
+ <prop oor:name='FirstRun'>
+ <value>false</value>
+ </prop>
+ </item>
+ <item oor:path='/org.openoffice.Office.Common/Security/Scripting'>
+ <prop oor:name='MacroSecurityLevel'>
+ <value>0</value>
+ </prop>
+ <prop oor:name='OfficeBasic'>
+ <value>2</value>
+ </prop>
+ </item>
+ <item oor:path='/org.openoffice.Office.OOoImprovement.Settings/Participation'>
+ <prop oor:name='InvitationAccepted'>
+ <value>false</value>
+ </prop>
+ <prop oor:name='ShowedInvitation'>
+ <value>true</value>
+ </prop>
+ </item>
+ <item oor:path='/org.openoffice.Setup/Office'>
+ <prop oor:name='FirstStartWizardCompleted'>
+ <value>true</value>
+ </prop>
+ <prop oor:name='LicenseAcceptDate'>
+ <value>2100-01-01T00:00:00</value>
+ </prop>
+ </item>
+</oor:items>
+EOF
+close OUT;
diff --git a/smoketestoo_native/data/Common.xcu b/smoketestoo_native/data/Common.xcu
deleted file mode 100644
index 8cb90a69b7b6..000000000000
--- a/smoketestoo_native/data/Common.xcu
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.Office" oor:name="Common">
- <node oor:name="Misc">
- <prop oor:name="FirstRun" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
- <node oor:name="Security">
- <node oor:name="Scripting">
- <prop oor:name="OfficeBasic" oor:type="xs:int">
- <value>2</value>
- </prop>
- <prop oor:name="MacroSecurityLevel" oor:type="xs:int">
- <value>0</value>
- </prop>
- </node>
- </node>
- <node oor:name="Help">
- <node oor:name="Registration">
- <prop oor:name="ReminderDate">
- <value/>
- </prop>
- </node>
- </node>
-</oor:component-data>
diff --git a/smoketestoo_native/data/Settings.xcu b/smoketestoo_native/data/Settings.xcu
deleted file mode 100644
index 425e789dabc1..000000000000
--- a/smoketestoo_native/data/Settings.xcu
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Settings" oor:package="org.openoffice.Office.OOoImprovement">
- <node oor:name="Participation">
- <prop oor:name="ShowedInvitation" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="InvitationAccepted" oor:type="xs:boolean">
- <value>false</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/smoketestoo_native/data/Setup.xcu b/smoketestoo_native/data/Setup.xcu
deleted file mode 100644
index cbcd2ef8f1ca..000000000000
--- a/smoketestoo_native/data/Setup.xcu
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Setup" oor:package="org.openoffice">
- <node oor:name="Office">
- <prop oor:name="LicenseAcceptDate" oor:type="xs:string">
- <value>2100-01-01T00:00:00</value>
- </prop>
- <prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/smoketestoo_native/smoketest.pl b/smoketestoo_native/smoketest.pl
index a48b337b3779..f5ef32f31bcb 100755
--- a/smoketestoo_native/smoketest.pl
+++ b/smoketestoo_native/smoketest.pl
@@ -486,7 +486,7 @@ sub doTest {
# patch config (error 3)
- $Command = "$PERL config.pl \"$basisdir \" \"$branddir \" \"$userinstallpath \" \"$DATA \" \"$buildid\"";
+ $Command = "$PERL config.pl \"$branddir\" \"$userinstallpath\" \"$buildid\"";
execute_Command ($Command, $error_patchConfig, $show_Message, $command_normal );
# copy basicscripts (error 9)
diff --git a/solenv/bin/deliver.pl b/solenv/bin/deliver.pl
index 2f642b5b6ed4..a4fc9f21d2b5 100755
--- a/solenv/bin/deliver.pl
+++ b/solenv/bin/deliver.pl
@@ -107,9 +107,17 @@ $opt_checkdlst = 0;
$delete_common = 1; # for "-delete": if defined delete files from common tree also
if ($^O ne 'cygwin') { # iz59477 - cygwin needes a dot "." at the end of filenames to disable
- $maybedot = ''; # some .exe transformation magic.
+ $maybedot = ''; # some .exe transformation magic.
} else {
- $maybedot = '.';
+ my $cygvernum = `uname -r`;
+ my @cygvernum = split( /\./, $cygvernum);
+ $cygvernum = shift @cygvernum;
+ $cygvernum .= shift @cygvernum;
+ if ( $cygvernum < 17 ) {
+ $maybedot = '.';
+ } else {
+ $maybedot = ''; # no longer works with cygwin 1.7. other magic below.
+ }
}
($gui = lc($ENV{GUI})) || die "Can't determine 'GUI'. Please set environment.\n";
@@ -828,6 +836,11 @@ sub copy_if_newer
sleep $try;
$try ++;
$success = rename($temp_file, $to);
+ if ( $^O eq 'cygwin' && $to =~ /\.bin$/) {
+ # hack to survive automatically added .exe for executables renamed to
+ # *.bin - will break if there is intentionally a .bin _and_ .bin.exe file.
+ $success = rename( "$to.exe", $to ) if -f "$to.exe";
+ }
}
if ( $success ) {
# handle special packaging of *.dylib files for Mac OS X
@@ -1200,16 +1213,7 @@ sub zip_files
next if ( $opt_check );
local $work_file = "";
- if ( $ext) {
- # We are delivering into a minor. Zip files must not contain the
- # minor extension, so we have to pre and post process it.
- #
- # Pre process: add minor extension to path, create working copy in
- # temp directory.
- $work_file = get_tempfilename() . ".zip";
- die "Error: temp file $work_file already exists" if ( -e $work_file);
- zipped_path_extension($zip_file, $work_file, $ext, 1) if ( -e $zip_file );
- } elsif ( $zip_file eq $common_zip_file) {
+ if ( $zip_file eq $common_zip_file) {
# Zip file in common tree: work on uniq copy to avoid collisions
$work_file = $zip_file;
$work_file =~ s/\.zip$//;
@@ -1259,14 +1263,9 @@ sub zip_files
print ZIP "$file\n";
}
close(ZIP);
+ fix_broken_cygwin_created_zips($work_file) if $^O eq "cygwin";
}
- if ( $ext ) {
- # Post process: strip minor from stored path again
- zipped_path_extension($work_file, $zip_file, $ext, 0);
- if (( -e $work_file ) && ($work_file ne $zip_file)) {
- unlink $work_file;
- }
- } elsif ( $zip_file eq $common_zip_file) {
+ if ( $zip_file eq $common_zip_file) {
# rename work file back
if ( -e $work_file ) {
if ( -e $zip_file) {
@@ -1290,45 +1289,30 @@ sub zip_files
}
}
-sub zipped_path_extension
+sub fix_broken_cygwin_created_zips
# add given extension to or strip it from stored path
{
require Archive::Zip; import Archive::Zip;
- my ($from, $to, $extension, $with_ext) = @_;
+ my $zip_file = shift;
$zip = Archive::Zip->new();
- if ( -e $from) {
- die 'Error: zip read error' unless $zip->read( $from) == 0;
- my $name;
- my $newmember;
- my $DateTime = 0;
- foreach my $member ( $zip->members() ) {
- $name = $member->fileName();
- if ( $with_ext ) {
- if ( $name !~ m#$extension/# ) {
- $name =~ s#^(.*?)/#$1$extension/#o;
- }
- } else {
- $name =~ s#^(.*?)$extension/#$1/#o;
- }
- $member->fileName( $name );
- if ( $member->lastModTime() ) {
- if ( $DateTime < $member->lastModTime() ) {
- $DateTime = $member->lastModTime();
- }
- }
+ unless ( $zip->read($work_file) == AZ_OK ) {
+ die "Error: can't open zip file '$zip_file' to fix broken cygwin file permissions";
+ }
+ my $latest_member_mod_time = 0;
+ foreach $member ( $zip->members() ) {
+ my $attributes = $member->unixFileAttributes();
+ $attributes &= ~0xFE00;
+ print $member->fileName($name) . ": " . sprintf("%lo", $attributes) if $is_debug;
+ $attributes |= 0x10; # add group write permission
+ print "-> " . sprintf("%lo", $attributes) . "\n" if $is_debug;
+ $member->unixFileAttributes($attributes);
+ if ( $latest_member_mod_time < $member->lastModTime() ) {
+ $latest_member_mod_time = $member->lastModTime();
}
- if ( -e $to ) {
- die 'Error: zip write error' unless $zip->overwrite( ) == 0;
- File::Copy::move( $from, $to) or die "Error $!: cannot move $from $to";
- } else {
- die 'Error: zip write error' unless $zip->writeToFileNamed( $to ) == 0;
- }
- utime $DateTime, $DateTime, $to;
- } else {
- die "Error: file $from does not exist" if ( ! $opt_delete);
}
- return;
+ die "Error: can't overwrite zip file '$zip_file' for fixing permissions" unless $zip->overwrite() == AZ_OK;
+ utime($latest_member_mod_time, $latest_member_mod_time, $zip_file);
}
sub get_tempfilename
diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo
index 7c00a131ece2..fe75d0d562d4 100755
--- a/solenv/bin/linkoo
+++ b/solenv/bin/linkoo
@@ -53,7 +53,7 @@ export OOO_DISABLE_RECOVERY=1
$program_dir = 'program';
$program_dir = 'MacOS' if ($ENV{OS} eq 'MACOSX');
-my @exceptions = ( 'cppuhelper', 'configmgr2', 'sunjavaplugin', 'libjvmfwk' );
+my @exceptions = ( 'cppuhelper', 'sunjavaplugin', 'libjvmfwk' );
%replaceable = (
$program_dir => '\.so',
@@ -294,9 +294,6 @@ sub link_soffice_bin_files()
do_link ($src, $dest, 'intro.bmp', 'intro.bmp', 1);
do_link ("$OOO_INSTALL", "$OOO_BUILD/desktop/$TARGET", 'share', 'share', 1);
- $dest = "$OOO_BUILD/configmgr/$TARGET/lib";
- do_link ($src, $dest, 'configmgrrc', 'configmgrrc', 1);
-
print "\n";
}
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 0aa02451d22e..46512e525046 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -1039,6 +1039,10 @@ sub nsis_language_converter
my $nsislanguage = "";
+ # Assign language used by NSIS.
+ # The files "$nsislanguage.nsh" and "$nsislanguage.nlf"
+ # are needed in the NSIS environment.
+ # Directory: <NSIS-Dir>/Contrib/Language files
if ( $language eq "en-US" ) { $nsislanguage = "English"; }
elsif ( $language eq "sq" ) { $nsislanguage = "Albanian"; }
elsif ( $language eq "ar" ) { $nsislanguage = "Arabic"; }
@@ -1057,6 +1061,7 @@ sub nsis_language_converter
elsif ( $language eq "fr" ) { $nsislanguage = "French"; }
elsif ( $language eq "hu" ) { $nsislanguage = "Hungarian"; }
elsif ( $language eq "he" ) { $nsislanguage = "Hebrew"; }
+ elsif ( $language eq "is" ) { $nsislanguage = "Icelandic"; }
elsif ( $language eq "id" ) { $nsislanguage = "Indonesian"; }
elsif ( $language eq "it" ) { $nsislanguage = "Italian"; }
elsif ( $language eq "lv" ) { $nsislanguage = "Latvian"; }
diff --git a/solenv/bin/modules/installer/environment.pm b/solenv/bin/modules/installer/environment.pm
index 6c0280207173..2ee6fd41af47 100644
--- a/solenv/bin/modules/installer/environment.pm
+++ b/solenv/bin/modules/installer/environment.pm
@@ -76,6 +76,30 @@ sub create_pathvariables
}
##################################################
+# Replacing tilde in pathes, because of
+# problem with deep recursion (task 104830)
+##################################################
+
+sub check_tilde_in_directory
+{
+ if ( $ENV{'HOME'} )
+ {
+ my $home = $ENV{'HOME'};
+ $home =~ s/\Q$installer::globals::separator\E\s*$//;
+ $installer::globals::localinstalldir =~ s/~/$home/;
+ my $infoline = "Info: Changing LOCALINSTALLDIR to $installer::globals::localinstalldir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # exit, because "~" is not allowed, if HOME is not set
+ my $infoline = "ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!", "check_tilde_in_directory");
+ }
+}
+
+##################################################
# Setting some fundamental global variables.
# All these variables can be overwritten
# by parameters.
@@ -107,6 +131,9 @@ sub set_global_environment_variables
if ( $ENV{'SOLAR_JAVA'} ) { $installer::globals::solarjavaset = 1; }
if ( $ENV{'RPM'} ) { $installer::globals::rpm = $ENV{'RPM'}; }
if ( $ENV{'DONTCOMPRESS'} ) { $installer::globals::solarisdontcompress = 1; }
+
+ # Special handling, if LOCALINSTALLDIR contains "~" in the path
+ if ( $installer::globals::localinstalldir =~ /^\s*\~/ ) { check_tilde_in_directory(); }
}
1;
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index d36e2133e825..bbc65d3c1f7a 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -55,7 +55,12 @@ sub create_directory
$infoline = "\nCreated directory: $directory\n";
push(@installer::globals::logfileinfo, $infoline);
- my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ my $localcall = "chmod 0775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ # chmod 0775 is not sufficient on mac to remove sticky tag
+ $localcall = "chmod a-s $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
}
else
{
@@ -1397,7 +1402,11 @@ sub try_to_create_directory
$infoline = "\nCreated directory: $directory\n";
push(@installer::globals::logfileinfo, $infoline);
- my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ my $localcall = "chmod 0775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ # chmod 0775 is not sufficient on mac to remove sticky tag
+ $localcall = "chmod a-s $directory \>\/dev\/null 2\>\&1";
system($localcall);
}
else
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm
index 0d3abe886b03..66731f860092 100644
--- a/solenv/bin/modules/installer/windows/msiglobal.pm
+++ b/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -1877,15 +1877,22 @@ sub set_global_code_variables
if ( $#{$languagesref} > 0 ) # more than one language
{
- if (( ${$languagesref}[1] =~ /jp/ ) ||
- ( ${$languagesref}[1] =~ /ko/ ) ||
- ( ${$languagesref}[1] =~ /zh/ ))
+ if (( $installer::globals::added_english ) && ( $#{$languagesref} == 1 )) # only multilingual because of added English
{
- $onelanguage = "multiasia";
+ $onelanguage = ${$languagesref}[1]; # setting the first language, that is not english
}
else
{
- $onelanguage = "multiwestern";
+ if (( ${$languagesref}[1] =~ /jp/ ) ||
+ ( ${$languagesref}[1] =~ /ko/ ) ||
+ ( ${$languagesref}[1] =~ /zh/ ))
+ {
+ $onelanguage = "multiasia";
+ }
+ else
+ {
+ $onelanguage = "multiwestern";
+ }
}
}
else # only one language
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 94f5cc7461fd..b5b6af308d0e 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -2652,15 +2652,13 @@ sub set_time_stamp
}
}
-##############################################
-# Include only files from install directory
-# in pkgmap file.
-##############################################
-########################################
-# Generating pathes for cygwin.
-########################################
+############################################################
+# Generating pathes for cygwin (first version)
+# This function has problems with cygwin, if $tmpfilename
+# contains many thousand files (OpenOffice SDK).
+############################################################
-sub generate_cygwin_pathes
+sub generate_cygwin_pathes_old
{
my ($filesref) = @_;
@@ -2678,8 +2676,100 @@ sub generate_cygwin_pathes
{
${$filesref}[$i]->{'cyg_sourcepath'} = $cyg_sourcepathlist[$i];
}
+
+}
+
+#################################################
+# Generating pathes for cygwin (second version)
+# This function generates smaller files for
+#################################################
+
+sub generate_cygwin_pathes
+{
+ my ($filesref) = @_;
+
+ installer::logger::include_timestamp_into_logfile("Starting generating cygwin pathes");
+
+ my $infoline = "Generating cygwin pathes (generate_cygwin_pathes)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $max = 5000; # number of pathes in one file
+
+ my @pathcollector = ();
+ my $startnumber = 0;
+ my $counter = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $line = ${$filesref}[$i]->{'sourcepath'} . "\n";
+ push(@pathcollector, $line);
+ $counter++;
+
+ if (( $i == $#{$filesref} ) || ((( $counter % $max ) == 0 ) && ( $i > 0 )))
+ {
+ my $tmpfilename = "cygwinhelper_" . $i . ".txt";
+ my $temppath = $installer::globals::temppath;
+ $temppath =~ s/\Q$installer::globals::separator\E\s*$//;
+ $tmpfilename = $temppath . $installer::globals::separator . $tmpfilename;
+ $infoline = "Creating temporary file for cygwin conversion: $tmpfilename (contains $counter pathes)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( -f $tmpfilename ) { unlink $tmpfilename; }
+
+ installer::files::save_file($tmpfilename, \@pathcollector);
+
+ my $success = 0;
+ my @cyg_sourcepathlist = qx{cygpath -w -f "$tmpfilename"};
+ chomp @cyg_sourcepathlist;
+
+ # Validating the array, it has to contain the correct number of values
+ my $new_pathes = $#cyg_sourcepathlist + 1;
+ if ( $new_pathes == $counter ) { $success = 1; }
+
+ if ($success)
+ {
+ $infoline = "Success: Successfully converted to cygwin pathes!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "ERROR: Failed to convert to cygwin pathes!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Failed to convert to cygwin pathes!", "generate_cygwin_pathes");
+ }
+
+ for ( my $j = 0; $j <= $#cyg_sourcepathlist; $j++ )
+ {
+ my $number = $startnumber + $j;
+ ${$filesref}[$number]->{'cyg_sourcepath'} = $cyg_sourcepathlist[$j];
+ }
+
+ if ( -f $tmpfilename ) { unlink $tmpfilename; }
+
+ @pathcollector = ();
+ $startnumber = $startnumber + $max;
+ $counter = 0;
+ }
+ }
+
+ # Checking existence fo cyg_sourcepath for every file
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ if (( ! exists(${$filesref}[$i]->{'cyg_sourcepath'}) ) || ( ${$filesref}[$i]->{'cyg_sourcepath'} eq "" ))
+ {
+ $infoline = "ERROR: No cygwin sourcepath defined for file ${$filesref}[$i]->{'sourcepath'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: No cygwin sourcepath defined for file ${$filesref}[$i]->{'sourcepath'}!", "generate_cygwin_pathes");
+ }
+ }
+
+ installer::logger::include_timestamp_into_logfile("Ending generating cygwin pathes");
}
+##############################################
+# Include only files from install directory
+# in pkgmap file.
+##############################################
+
sub filter_pkgmapfile
{
my ($pkgmapfile) = @_;
diff --git a/solenv/bin/packregistry.xslt b/solenv/bin/packregistry.xslt
new file mode 100644
index 000000000000..55558d55450c
--- /dev/null
+++ b/solenv/bin/packregistry.xslt
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:oor="http://openoffice.org/2001/registry">
+ <xsl:strip-space elements="*"/>
+ <xsl:preserve-space elements="value"/>
+ <xsl:template match="/">
+ <oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <xsl:copy-of select="list/dependency"/>
+<!--
+ <xsl:copy-of select="document(list/filename)/oor:component-schema"/>
+ <xsl:copy-of select="document(list/filename)/oor:component-data"/>
+
+ instead of the below for-each would only issue warnings, not errors, for
+ non-existing or otherwise bad input files; it is important that the input
+ filename list is already sorted in an order suitable for the configmgr
+ (e.g., xcs files preceeding xcu files).
+-->
+ <xsl:for-each select="list/filename">
+ <xsl:choose>
+ <xsl:when test="count(document(.)/oor:component-schema) = 1">
+ <xsl:apply-templates select="document(.)/oor:component-schema"/>
+ </xsl:when>
+ <xsl:when test="count(document(.)/oor:component-data) = 1">
+ <xsl:apply-templates select="document(.)/oor:component-data"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>cannot process </xsl:text>
+ <xsl:value-of select="."/>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </oor:data>
+ </xsl:template>
+ <xsl:template
+ match="oor:component-schema|oor:component-data|templates|component|group|
+ set|node-ref|prop|item|value|node">
+ <xsl:copy copy-namespaces="no">
+ <!-- prune oor:component-data xmlns:install="..." namespaces (would only
+ work in XSLT 2.0, however) -->
+ <xsl:for-each select="@*">
+ <xsl:attribute name="{name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="info|import|uses|constraints"/>
+ <!-- TODO: no longer strip elements when they are eventually read by
+ configmgr implementation -->
+</xsl:stylesheet>
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
index 907d5295c15c..e0efaf771933 100644
--- a/solenv/config/sdev300.ini
+++ b/solenv/config/sdev300.ini
@@ -69,7 +69,7 @@ common
}
crashdump
{
- ENABLE_CRASHDUMP STATIC
+ ENABLE_CRASHDUMP TRUE
}
hg
{
diff --git a/solenv/config/ssolar.cmn b/solenv/config/ssolar.cmn
index 877d82e566a5..d4b7ee01ee19 100644
--- a/solenv/config/ssolar.cmn
+++ b/solenv/config/ssolar.cmn
@@ -43,6 +43,7 @@ common
BUILD_TOOLS
BUILD_TYPE
BUILD_SPECIAL
+ BUILD_X64
CLASSPATH
CALL_CDECL
COMEX
@@ -69,6 +70,7 @@ common
DIC_ALL
DPKG
DYLD_LIBRARY_PATH
+ LD_LIBRARY_PATH
DMAKE_INC
DMAKE
DRIVE_O
@@ -90,7 +92,7 @@ common
ENABLE_PASF
ENABLE_RANDR
ENABLE_REPORTBUILDER
- ENABLE_REPORTDESIGN
+ ENABLE_REPORTDESIGN
ENABLE_SVCTAGS
ENABLE_VBA
FORCE2ARCHIVE
@@ -117,6 +119,7 @@ common
GCRINC
GCRLIB
GCRPATH
+ GLIBC
GNUCOPY
GXX_INCLUDE_PATH
HBTOOLKIT
@@ -211,6 +214,7 @@ common
SOLARUPD
SOLARVERSION
SOURCE_ROOT_USED
+ SOURCE_ROOT_DIR
STAR_REGISTRY
STAR_RESOURCEPATH
STLPORT4
@@ -247,6 +251,7 @@ common
XAU_LIBS
WINDOWS_VISTA_PSDK
WITH_LDAP
+ WITH_VC_REDIST
WST
XCLASSPATH
XSLTPROC
@@ -270,6 +275,8 @@ common
NO_HIDS
PAM_LINK
PAM
+ PSPRINT
+ PYTHONHOME
PYTHONPATH
SOLAR_PLUGIN
URE_BOOTSTRAP
diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk
index 2ea3b4c890ce..cbde1659ae5d 100644
--- a/solenv/inc/libs.mk
+++ b/solenv/inc/libs.mk
@@ -205,7 +205,7 @@ ZLIB3RDLIB=-lzlib
#i34482# Blackdown/Sun jdk is in the libsearch patch and has a libjpeg :-(
.IF "$(OS)" == "FREEBSD"
JPEG3RDLIB=/usr/local/lib/libjpeg.so
-.ELIF "$(CPUNAME)" == "X86_64"
+.ELIF "$(CPUNAME)" == "X86_64" || "$(CPUNAME)" == "S390X" || "$(CPUNAME)" == "POWERPC64"
JPEG3RDLIB=/usr/lib64/libjpeg.so
.ELSE
JPEG3RDLIB=/usr/lib/libjpeg.so
@@ -340,6 +340,7 @@ PYUNOLIB=-lpyuno
LPSOLVELIB=-llpsolve55
SOFFICELIB=-lsofficeapp
UNOPKGAPPLIB=-lunopkgapp
+CONFIGMGRLIB=-lconfigmgr
.ELSE # ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
@@ -521,5 +522,6 @@ PYUNOLIB=ipyuno.lib
LPSOLVELIB=lpsolve55.lib
SOFFICELIB=isofficeapp.lib
UNOPKGAPPLIB=iunopkgapp.lib
+CONFIGMGRLIB=iconfigmgr.lib
.ENDIF # ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
index 214e8c99e2e1..6e6607f779e1 100644
--- a/solenv/inc/minor.mk
+++ b/solenv/inc/minor.mk
@@ -1,5 +1,5 @@
RSCVERSION=300
-RSCREVISION=300m73(Build:9486)
-BUILD=9486
-LAST_MINOR=m73
+RSCREVISION=300m74(Build:9487)
+BUILD=9487
+LAST_MINOR=m74
SOURCEVERSION=DEV300
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index a2d8c6063881..2fda1819f891 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -766,27 +766,28 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
::getCppuType( (const Sequence< sal_Int16 > *)0 );
rShortSeqType.getDescription( &m_pShortSeqTD );
// script.XInvocation
- typelib_InterfaceTypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = 0;
const Type & rInvType = ::getCppuType(
(const Reference< script::XInvocation > *)0 );
- TYPELIB_DANGER_GET(
- (typelib_TypeDescription **)&pTD, rInvType.getTypeLibType() );
- if( ! pTD->aBase.bComplete )
- typelib_typedescription_complete( (typelib_TypeDescription **)&pTD );
+ TYPELIB_DANGER_GET( &pTD, rInvType.getTypeLibType() );
+ typelib_InterfaceTypeDescription * pITD;
+ pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD);
+ if( ! pITD->aBase.bComplete )
+ typelib_typedescription_complete( &pTD );
::typelib_typedescriptionreference_getDescription(
- &m_pInvokMethodTD, pTD->ppMembers[ 1 ] ); // invoke()
+ &m_pInvokMethodTD, pITD->ppMembers[ 1 ] ); // invoke()
::typelib_typedescriptionreference_getDescription(
- &m_pSetValueTD, pTD->ppMembers[ 2 ] ); // setValue()
+ &m_pSetValueTD, pITD->ppMembers[ 2 ] ); // setValue()
::typelib_typedescriptionreference_getDescription(
- &m_pGetValueTD, pTD->ppMembers[ 3 ] ); // getValue()
+ &m_pGetValueTD, pITD->ppMembers[ 3 ] ); // getValue()
// script.XTypeConverter
const Type & rTCType =
::getCppuType( (const Reference< script::XTypeConverter > *)0 );
- TYPELIB_DANGER_GET(
- (typelib_TypeDescription **)&pTD, rTCType.getTypeLibType() );
+ TYPELIB_DANGER_GET( &pTD, rTCType.getTypeLibType() );
+ pITD = reinterpret_cast<typelib_InterfaceTypeDescription*>(pTD);
::typelib_typedescriptionreference_getDescription(
- &m_pConvertToTD, pTD->ppMembers[ 0 ] ); // convertTo()
- TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *)pTD );
+ &m_pConvertToTD, pITD->ppMembers[ 0 ] ); // convertTo()
+ TYPELIB_DANGER_RELEASE( pTD );
if (!m_pInvokMethodTD || !m_pSetValueTD || !m_pGetValueTD ||
!m_pConvertToTD ||
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
index 045dd00cc96f..7fd2e09a82dd 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -30,22 +30,16 @@
#include <tools/solar.h>
-#ifdef SYSTEM_JPEG
-#define INT32 JPEG_INT32
-#endif
-
extern "C"
{
+ #define INT32 JPEG_INT32
#include "stdio.h"
#include "jpeg.h"
#include "jpeglib.h"
#include "jerror.h"
+ #undef INT32
}
-#ifdef SYSTEM_JPEG
-#undef INT32
-#endif
-
#define _JPEGPRIVATE
#include <vcl/bmpacc.hxx>
#include "jpeg.hxx"
@@ -396,11 +390,7 @@ void* JPEGReader::CreateBitmap( void* pParam )
if(
( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
-#ifndef SYSTEM_JPEG
- ( !bGray && ( BMP_FORMAT_24BIT_TC_BGR == nFormat ) )
-#else
( !bGray && ( BMP_FORMAT_24BIT_TC_RGB == nFormat ) )
-#endif
)
{
pBmpBuf = pAcc->GetBuffer();
@@ -463,15 +453,9 @@ void JPEGReader::FillBitmap()
for( long nX = 0L; nX < nWidth; nX++ )
{
-#ifndef SYSTEM_JPEG
- aColor.SetBlue( *pTmp++ );
- aColor.SetGreen( *pTmp++ );
- aColor.SetRed( *pTmp++ );
-#else
aColor.SetRed( *pTmp++ );
aColor.SetGreen( *pTmp++ );
aColor.SetBlue( *pTmp++ );
-#endif
pAcc->SetPixel( nY, nX, aColor );
}
}
@@ -651,19 +635,11 @@ void* JPEGWriter::GetScanline( long nY )
for( long nX = 0L; nX < nWidth; nX++ )
{
aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
-#ifndef SYSTEM_JPEG
- *pTmp++ = aColor.GetBlue();
- if ( bGreys )
- continue;
- *pTmp++ = aColor.GetGreen();
- *pTmp++ = aColor.GetRed();
-#else
*pTmp++ = aColor.GetRed();
if ( bGreys )
continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetBlue();
-#endif
}
}
else
@@ -671,19 +647,11 @@ void* JPEGWriter::GetScanline( long nY )
for( long nX = 0L; nX < nWidth; nX++ )
{
aColor = pAcc->GetPixel( nY, nX );
-#ifndef SYSTEM_JPEG
- *pTmp++ = aColor.GetBlue();
- if ( bGreys )
- continue;
- *pTmp++ = aColor.GetGreen();
- *pTmp++ = aColor.GetRed();
-#else
*pTmp++ = aColor.GetRed();
if ( bGreys )
continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetBlue();
-#endif
}
}
@@ -738,14 +706,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
if( pAcc )
{
- if ( bGreys )
- bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL );
- else
-#ifndef SYSTEM_JPEG
- bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
-#else
- bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
-#endif
+ bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
if( !bNative )
pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c
index 78602556097b..29b4749a7b51 100644
--- a/svtools/source/filter.vcl/jpeg/jpegc.c
+++ b/svtools/source/filter.vcl/jpeg/jpegc.c
@@ -31,7 +31,8 @@
#include "jpeglib.h"
#include "jerror.h"
#include "jpeg.h"
-
+#include "rtl/alloc.h"
+#include "osl/diagnose.h"
struct my_error_mgr
{
@@ -78,6 +79,9 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
long nWidth;
long nHeight;
long nAlignedWidth;
+ JSAMPLE * range_limit;
+ HPBYTE pScanLineBuffer = NULL;
+ long nScanLineBufferComponents = 0;
// declare bDecompCreated volatile because of gcc
// warning: variable 'bDecompCreated' might be clobbered by `longjmp' or `vfork'
volatile long bDecompCreated = 0;
@@ -103,8 +107,12 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
cinfo.output_gamma = 1.0;
cinfo.raw_data_out = FALSE;
cinfo.quantize_colors = FALSE;
- if ( cinfo.jpeg_color_space != JCS_GRAYSCALE )
+ if ( cinfo.jpeg_color_space == JCS_YCbCr )
cinfo.out_color_space = JCS_RGB;
+ else if ( cinfo.jpeg_color_space == JCS_YCCK )
+ cinfo.out_color_space = JCS_CMYK;
+
+ OSL_ASSERT(cinfo.out_color_space == JCS_CMYK || cinfo.out_color_space == JCS_GRAYSCALE || cinfo.out_color_space == JCS_RGB);
/* change scale for preview import */
if( nPreviewWidth || nPreviewHeight )
@@ -148,6 +156,14 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
aCreateBitmapParam.bGray = cinfo.output_components == 1;
pDIB = CreateBitmap( pJPEGReader, &aCreateBitmapParam );
nAlignedWidth = aCreateBitmapParam.nAlignedWidth;
+ range_limit=cinfo.sample_range_limit;
+
+ if ( cinfo.out_color_space == JCS_CMYK )
+ {
+ nScanLineBufferComponents = cinfo.output_width * 4;
+ pScanLineBuffer = rtl_allocateMemory( nScanLineBufferComponents );
+ }
+
if( pDIB )
{
if( aCreateBitmapParam.bTopDown )
@@ -160,17 +176,37 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines )
for ( *pLines = 0; *pLines < nHeight; (*pLines)++ )
{
+ if (pScanLineBuffer!=NULL) { // in other words cinfo.out_color_space == JCS_CMYK
+ int i;
+ int j;
+ jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pScanLineBuffer, 1 );
+ // convert CMYK to RGB
+ for( i=0, j=0; i < nScanLineBufferComponents; i+=4, j+=3 )
+ {
+ int c_=255-pScanLineBuffer[i+0];
+ int m_=255-pScanLineBuffer[i+1];
+ int y_=255-pScanLineBuffer[i+2];
+ int k_=255-pScanLineBuffer[i+3];
+ pTmp[j+0]=range_limit[ 255L - ( c_ + k_ ) ];
+ pTmp[j+1]=range_limit[ 255L - ( m_ + k_ ) ];
+ pTmp[j+2]=range_limit[ 255L - ( y_ + k_ ) ];
+ }
+ } else {
jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pTmp, 1 );
-
+ }
/* PENDING ??? */
if ( cinfo.err->msg_code == 113 )
- break;
+ break;
pTmp += nAlignedWidth;
}
}
jpeg_finish_decompress( &cinfo );
+ if (pScanLineBuffer!=NULL) {
+ rtl_freeMemory( pScanLineBuffer );
+ pScanLineBuffer=NULL;
+ }
Exit:
diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk
index 653ca77ed7eb..c782c520324c 100644
--- a/svtools/source/filter.vcl/jpeg/makefile.mk
+++ b/svtools/source/filter.vcl/jpeg/makefile.mk
@@ -35,10 +35,6 @@ TARGET=jpeg
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/svt.pmk
-.IF "$(SYSTEM_JPEG)" == "YES"
-CFLAGS+=-DSYSTEM_JPEG
-.ENDIF
-
SOLARINC+=-I../../inc
# --- Files --------------------------------------------------------
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 00a8ec6b825c..55fc0901a7e0 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -83,6 +83,13 @@ class IDocumentMarkAccess
const ::rtl::OUString& rProposedName,
MarkType eMark) =0;
+ virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType) = 0;
+ virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType) = 0;
+
/** Returns a mark in the document for a paragraph.
If there is none, a mark will be created.
diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index a1b4c6583ffa..6a46ae01d49e 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -31,6 +31,7 @@
#include <calbck.hxx>
#include <pam.hxx>
#include <boost/operators.hpp>
+#include <map>
#ifndef SW_DECL_SWSERVEROBJECT_DEFINED
#define SW_DECL_SWSERVEROBJECT_DEFINED
@@ -76,6 +77,8 @@ namespace sw { namespace mark
{ return GetMarkEnd() < rPos; }
bool EndsAfter(const SwPosition& rPos) const
{ return GetMarkEnd() > rPos; }
+
+ virtual rtl::OUString ToString( ) const =0;
};
class IBookmark
@@ -92,13 +95,17 @@ namespace sw { namespace mark
: virtual public IMark
{
public:
+ typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any> parameter_map_t;
//getters
virtual ::rtl::OUString GetFieldname() const =0;
virtual ::rtl::OUString GetFieldHelptext() const =0;
+ virtual parameter_map_t* GetParameters() =0;
+ virtual const parameter_map_t* GetParameters() const =0;
//setters
virtual void SetFieldname(const ::rtl::OUString& rFieldname) =0;
virtual void SetFieldHelptext(const ::rtl::OUString& rFieldHelptext) =0;
+ virtual void Invalidate() = 0;
};
class ICheckboxFieldmark
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 9bc96c943792..bcf511aa2a5b 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -107,8 +107,9 @@ struct SwContentAtPos
SW_REFMARK = 0x0100,
SW_NUMLABEL = 0x0200, // #i23726#
SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <--
- SW_SMARTTAG = 0x0800
-#ifdef DBG_UTIL
+ SW_SMARTTAG = 0x0800,
+ SW_FORMCTRL = 0x1000
+#ifndef PRODUCT
,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen
,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen
#endif
@@ -119,6 +120,7 @@ struct SwContentAtPos
const SfxPoolItem* pAttr;
const SwRedline* pRedl;
SwCntntNode * pNode; // #i23726#
+ const sw::mark::IFieldmark* pFldmark;
} aFnd;
int nDist; // #i23726#
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 8cb9cbd5f26a..b2483f21a75a 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -41,6 +41,7 @@
#include <com/sun/star/linguistic2/ProofreadingResult.hpp>
#include <fldupde.hxx>
#include <tblenum.hxx>
+#include <IMark.hxx>
#include <vector>
#include <swundo.hxx>
@@ -413,6 +414,9 @@ public:
const SwTOXType* GetTOXType(TOXTypes eTyp, USHORT nId) const;
void InsertTOXType(const SwTOXType& rTyp);
+ // new field stuff
+ BOOL UpdateField(sw::mark::IFieldmark &fieldBM);
+
//AutoMark file
const String& GetTOIAutoMarkURL() const;
void SetTOIAutoMarkURL(const String& rSet);
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 5f0c663b4a60..8a6f536ad46b 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -41,12 +41,8 @@
#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
#define CH_TXT_ATR_SUBST_FIELDSTART ("[")
#define CH_TXT_ATR_SUBST_FIELDEND ("]")
-//#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)'#')
#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
-/*
-#define FIELD_BOOKMARK_PREFIX "__"
-#define FIELD_FORM_BOOKMARK_PREFIX "__FORM"
-*/
+
/*
* Hier kommen erst mal die enums fuer die Hints
*/
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 1ded0d912d2a..62277e6d48b0 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -269,6 +269,7 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPaM);
String GetTxt() const;
+ void InvalidatePaM();
};
diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx
index a8dea497c3f7..fdd5df4c8a6c 100644
--- a/sw/inc/unobookmark.hxx
+++ b/sw/inc/unobookmark.hxx
@@ -198,6 +198,34 @@ public:
};
+class SwXFieldmarkParameters
+ : public ::cppu::WeakImplHelper1< ::com::sun::star::container::XNameContainer>
+ , private SwClient
+{
+ public:
+ SwXFieldmarkParameters(::sw::mark::IFieldmark* const pFieldmark)
+ {
+ pFieldmark->Add(this);
+ }
+
+ // XNameContainer
+ virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XNameReplace
+ virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+ // XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ //SwClient
+ virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ private:
+ ::sw::mark::IFieldmark::parameter_map_t* getCoreParameters() throw (::com::sun::star::uno::RuntimeException);
+};
+
typedef cppu::ImplInheritanceHelper1< SwXBookmark,
::com::sun::star::text::XFormField > SwXFieldmark_Base;
@@ -219,19 +247,11 @@ public:
::com::sun::star::text::XTextRange > & xTextRange)
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
-
- virtual ::rtl::OUString SAL_CALL getDescription()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int16 SAL_CALL getType()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int16 SAL_CALL getRes()
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL setDescription(const ::rtl::OUString& rDescription)
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setType(::sal_Int16 fieldType)
+ virtual ::rtl::OUString SAL_CALL getFieldType(void)
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setFieldType(const ::rtl::OUString& description )
throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setRes(::sal_Int16 res)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getParameters( )
throw (::com::sun::star::uno::RuntimeException);
};
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 6752f70e5eaf..11060352b6c3 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -41,12 +41,14 @@
#include <undobj.hxx>
#include <unobookmark.hxx>
#include <rtl/random.h>
+#include <xmloff/odffields.hxx>
SV_IMPL_REF( SwServerObject )
using namespace ::sw::mark;
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
namespace
{
@@ -75,20 +77,20 @@ namespace
const sal_Unicode aStartMark,
const sal_Unicode aEndMark)
{
- const SwPosition& rStart = pField->GetMarkStart();
- const SwPosition& rEnd = pField->GetMarkEnd();
+ SwPosition& rStart = pField->GetMarkStart();
+ SwPosition& rEnd = pField->GetMarkEnd();
SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode();
SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode();
const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(rEnd.nContent.GetIndex()-1);
- const SwPaM aStartPaM(rStart);
- const SwPaM aEndPaM(rEnd);
+ SwPaM aStartPaM(rStart);
+ SwPaM aEndPaM(rEnd);
io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
if(ch_start != aStartMark)
{
io_pDoc->InsertString(aStartPaM, aStartMark);
}
- if(aEndMark && ch_end != aEndMark)
+ if ( aEndMark && ( ch_end != aEndMark ) && ( rStart != rEnd ) )
{
io_pDoc->InsertString(aEndPaM, aEndMark);
}
@@ -112,6 +114,11 @@ namespace sw { namespace mark
}
}
+ bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const
+ {
+ return GetMarkStart() <= rPos && rPos <= GetMarkEnd();
+ }
+
void MarkBase::SetMarkPos(const SwPosition& rNewPos)
{
::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
@@ -124,6 +131,17 @@ namespace sw { namespace mark
//lcl_FixPosition(*m_pPos2);
}
+ rtl::OUString MarkBase::ToString( ) const
+ {
+ rtl::OUStringBuffer buf;
+ buf.appendAscii( "Mark: ( Name, [ Node1, Index1 ] ): ( " );
+ buf.append( m_aName ).appendAscii( ", [ " );
+ buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
+ buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) ).appendAscii( " ] )" );
+
+ return buf.makeStringAndClear( );
+ }
+
MarkBase::~MarkBase()
{ }
@@ -145,7 +163,7 @@ namespace sw { namespace mark
return aResult.append(nCount++).append(sUniquePostfix).makeStringAndClear();
}
- // SwClient
+
void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
SwModify::Modify(pOld, pNew);
@@ -250,6 +268,7 @@ namespace sw { namespace mark
uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject()
{
+ // create new SwXBookmark
SwDoc *const pDoc( GetMarkPos().GetDoc() );
OSL_ENSURE(pDoc, "Bookmark::MakeUnoObject: no doc?");
const uno::Reference< rdf::XMetadatable> xMeta(
@@ -265,6 +284,28 @@ namespace sw { namespace mark
SetOtherMarkPos(GetMarkPos());
}
+ rtl::OUString Fieldmark::ToString( ) const
+ {
+ rtl::OUStringBuffer buf;
+ buf.appendAscii( "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " );
+ buf.append( m_aName ).appendAscii( ", " );
+ buf.append( m_aFieldname ).appendAscii( ", [ " );
+ buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
+ buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" );
+ buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
+ buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " );
+
+ return buf.makeStringAndClear( );
+ }
+
+ void Fieldmark::Invalidate( )
+ {
+ // @TODO: Does exist a better solution to trigger a format of the
+ // fieldmark portion? If yes, please use it.
+ SwPaM aPaM( this->GetMarkPos(), this->GetOtherMarkPos() );
+ aPaM.InvalidatePaM();
+ }
+
const ::rtl::OUString Fieldmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__Fieldmark__");
TextFieldmark::TextFieldmark(const SwPaM& rPaM)
@@ -282,12 +323,24 @@ namespace sw { namespace mark
void CheckboxFieldmark::InitDoc(SwDoc* const io_pDoc)
{
- lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
- }
+ lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FORMELEMENT, CH_TXT_ATR_FIELDEND);
+ // For some reason the end mark is moved from 1 by the Insert: we don't
+ // want this for checkboxes
+ this->GetMarkEnd( ).nContent--;
+ }
void CheckboxFieldmark::SetChecked(bool checked)
- { m_isChecked = checked; }
+ {
+ (*GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT)] = makeAny(checked);
+ }
bool CheckboxFieldmark::IsChecked() const
- { return m_isChecked; }
+ {
+ bool bResult = false;
+ parameter_map_t::const_iterator pResult = GetParameters()->find(::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_RESULT));
+ if(pResult != GetParameters()->end())
+ pResult->second >>= bResult;
+ return bResult;
+ }
+
}}
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index 4e0d1a4151e9..dc083801ee8e 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -64,7 +64,7 @@ namespace sw { namespace mark
MarkBase::SetMarkPos(rNewPos);
}
- const SwPosition& CrossRefBookmark::GetOtherMarkPos() const
+ SwPosition& CrossRefBookmark::GetOtherMarkPos() const
{
OSL_PRECOND(false,
"<SwCrossRefBookmark::GetOtherMarkPos(..)>"
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 56986a9cf5e7..818ccc6e228f 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1172,6 +1172,17 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
+ if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
+ {
+ IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
+ sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
+ if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
+ rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
+ rCntntAtPos.aFnd.pFldmark = pFldBookmark;
+ bRet=TRUE;
+ }
+ }
+
if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos )
{
if( aTmpState.bFtnNoInfo )
diff --git a/sw/source/core/crsr/makefile.mk b/sw/source/core/crsr/makefile.mk
index 6d579171dc02..a2571901c068 100644
--- a/sw/source/core/crsr/makefile.mk
+++ b/sw/source/core/crsr/makefile.mk
@@ -47,6 +47,7 @@ CDEFS+=-Dmydebug
EXCEPTIONSFILES= \
$(SLO)$/crbm.obj \
$(SLO)$/crsrsh.obj \
+ $(SLO)$/bookmrk.obj \
$(SLO)$/viscrs.obj
SLOFILES = \
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 565669bd7a35..ec30b5aefbe0 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -53,6 +53,7 @@
#include <ndtxt.hxx> // #111827#
#include <IMark.hxx>
+#include <hints.hxx>
// fuer den dummen ?MSC-? Compiler
inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd )
@@ -824,16 +825,21 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
}
//FIXME FieldBk
// TODO: Form Protection when Enhanced Fields are enabled
-// if( !bRet )
-// {
-// const SwDoc *pDoc=GetDoc();
-// SwBookmark *pA = ( pDoc && pPoint ? pDoc->getFieldmarkFor( *pPoint ) : NULL );
-// SwBookmark *pB = ( pDoc && pMark ? pDoc->getFieldmarkFor( *pMark ) : pA );
-// bRet = ( pA != pB );
-// bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
-// if( bProtectForm )
-// bRet |= ( pA==NULL || pB==NULL );
-// }
+ if (!bRet) {
+ const SwDoc *pDoc = GetDoc();
+ sw::mark::IMark* pA = NULL;
+ sw::mark::IMark* pB = NULL;
+ if ( pDoc )
+ {
+ const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
+ pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
+ pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
+ bRet = ( pA != pB );
+ }
+ bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
+ if ( bProtectForm )
+ bRet |= ( pA == NULL || pB == NULL );
+ }
return bRet;
}
@@ -1220,6 +1226,20 @@ BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b)
return !(*b.End() <= *a.Start() || *a.End() <= *b.End());
}
+void SwPaM::InvalidatePaM()
+{
+ const SwNode *_pNd=this->GetNode();
+ const SwTxtNode *_pTxtNd=(_pNd!=NULL?_pNd->GetTxtNode():NULL);
+ if (_pTxtNd!=NULL)
+ {
+ // pretent that the PaM marks inserted text to recalc the portion...
+ SwInsTxt aHint( Start()->nContent.GetIndex(),
+ End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 );
+ SwModify *_pModify=(SwModify*)_pTxtNd;
+ _pModify->Modify( 0, &aHint);
+ }
+}
+
BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b)
{
return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End());
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 12edc1858b87..1e058867ba32 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -37,6 +37,7 @@
#include <dcontact.hxx>
#include <doc.hxx>
#include <docary.hxx>
+#include <xmloff/odffields.hxx>
#include <editsh.hxx>
#include <errhdl.hxx>
#include <fmtanchr.hxx>
@@ -305,6 +306,17 @@ namespace sw { namespace mark
: m_pDoc(&rDoc)
{ }
+ void MarkManager::dumpFieldmarks( ) const
+ {
+ const_iterator_t pIt = m_vFieldmarks.begin();
+ for (; pIt != m_vFieldmarks.end( ); pIt++)
+ {
+ rtl::OUString str = (*pIt)->ToString();
+ OSL_TRACE("%s\n",
+ ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+
::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM,
const ::rtl::OUString& rName,
const IDocumentMarkAccess::MarkType eType)
@@ -410,6 +422,30 @@ namespace sw { namespace mark
return pMark.get();
}
+ ::sw::mark::IFieldmark* MarkManager::makeFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType )
+ {
+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
+ IDocumentMarkAccess::TEXT_FIELDMARK );
+ sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
+ pFieldMark->SetFieldname( rType );
+
+ return pFieldMark;
+ }
+
+ ::sw::mark::IFieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType)
+ {
+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
+ IDocumentMarkAccess::CHECKBOX_FIELDMARK );
+ sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
+ pFieldMark->SetFieldname( rType );
+
+ return pFieldMark;
+ }
+
::sw::mark::IMark* MarkManager::getMarkForTxtNode(const SwTxtNode& rTxtNode,
const IDocumentMarkAccess::MarkType eType)
{
@@ -763,12 +799,7 @@ namespace sw { namespace mark
{
const_iterator_t pFieldmark = find_if(
m_vFieldmarks.begin(),
- // we do not need to check marks starting behind the positon
- lower_bound(
- m_vFieldmarks.begin(),
- m_vFieldmarks.end(),
- rPos,
- bind(&IMark::StartsAfter, _1, _2)),
+ m_vFieldmarks.end( ),
bind(&IMark::IsCoveringPosition, _1, rPos));
if(pFieldmark == m_vFieldmarks.end()) return NULL;
return dynamic_cast<IFieldmark*>(pFieldmark->get());
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 97b2531cdbe2..d6fb64577e11 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -57,6 +57,9 @@
#ifndef _STATSTR_HRC
#include <statstr.hrc>
#endif
+#include <bookmrk.hxx>
+#include <xmloff/odffields.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
@@ -232,6 +235,25 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
return bRet;
}
+BOOL SwEditShell::UpdateField( sw::mark::IFieldmark &fieldBM)
+{
+// SwDocShell* pDocSh = pDoc->GetDocShell();
+ //@TODO implement me...; add undo etc...
+ if ( pDoc && fieldBM.IsExpanded( ) ) {
+ SwPosition aSttPos = fieldBM.GetMarkStart( );
+ aSttPos.nContent++;
+
+ SwPosition aEndPos = fieldBM.GetMarkEnd( );
+ aEndPos.nContent--;
+
+ SwPaM aPaM( aSttPos, aEndPos );
+ pDoc->DeleteRange(aPaM);
+ pDoc->InsertString(aPaM, String::CreateFromAscii("Implement me ;-)") );
+ }
+ return TRUE;
+}
+
+
/*--------------------------------------------------------------------
Beschreibung: Aktuelles Verzeichnis vor oder in dem der Cursor
steht
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index faaa487d7467..1a5cd1724050 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -40,8 +40,18 @@ namespace sw { namespace mark
public:
MarkManager(/*[in/out]*/ SwDoc& rDoc);
+ void dumpFieldmarks( ) const;
+
// IDocumentMarkAccess
virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, IDocumentMarkAccess::MarkType eMark);
+
+ virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType);
+ virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
+ const rtl::OUString& rType);
+
virtual ::sw::mark::IMark* getMarkForTxtNode(const SwTxtNode& rTxtNode, IDocumentMarkAccess::MarkType eMark);
virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM);
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 1b341a57ae2e..90c6a44fa239 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -34,6 +34,7 @@
#include <boost/scoped_ptr.hpp>
#include <boost/noncopyable.hpp>
+#include <map>
#include <IMark.hxx>
@@ -53,26 +54,31 @@ namespace sw { namespace mark
{
public:
//getters
- virtual const SwPosition& GetMarkPos() const
+ virtual SwPosition& GetMarkPos() const
{ return *m_pPos1; }
virtual const ::rtl::OUString& GetName() const
{ return m_aName; }
- virtual bool IsCoveringPosition(const SwPosition& rPos) const
- { return GetMarkStart() <= rPos && rPos <= GetMarkEnd(); };
- virtual const SwPosition& GetOtherMarkPos() const
+ virtual bool IsCoveringPosition(const SwPosition& rPos) const;
+ virtual SwPosition& GetOtherMarkPos() const
{
OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I have no other Pos set." );
return *m_pPos2;
}
- virtual const SwPosition& GetMarkStart() const
+ virtual SwPosition& GetMarkStart() const
{
- if(!m_pPos2 /* !IsExpanded()*/) return *m_pPos1;
- return *m_pPos1 < *m_pPos2 ? *m_pPos1 : *m_pPos2;
+ if( !IsExpanded() ) return GetMarkPos( );
+ if ( GetMarkPos( ) < GetOtherMarkPos( ) )
+ return GetMarkPos();
+ else
+ return GetOtherMarkPos( );
}
- virtual const SwPosition& GetMarkEnd() const
+ virtual SwPosition& GetMarkEnd() const
{
- if(!m_pPos2 /* !IsExpanded()*/ ) return *m_pPos1;
- return *m_pPos1 > *m_pPos2 ? *m_pPos1 : *m_pPos2;
+ if( !IsExpanded() ) return GetMarkPos();
+ if ( GetMarkPos( ) > GetOtherMarkPos( ) )
+ return GetMarkPos( );
+ else
+ return GetOtherMarkPos( );
}
virtual bool IsExpanded() const
{ return m_pPos2; }
@@ -85,6 +91,8 @@ namespace sw { namespace mark
virtual void ClearOtherMarkPos()
{ m_pPos2.reset(); }
+ virtual rtl::OUString ToString( ) const;
+
virtual void Swap()
{
if(m_pPos2)
@@ -120,7 +128,6 @@ namespace sw { namespace mark
class NavigatorReminder
: public MarkBase
- , virtual public IMark
{
public:
NavigatorReminder(const SwPaM& rPaM);
@@ -204,24 +211,31 @@ namespace sw { namespace mark
Fieldmark(const SwPaM& rPaM);
// getters
- ::rtl::OUString GetFieldname() const
+ virtual ::rtl::OUString GetFieldname() const
{ return m_aFieldname; }
- ::rtl::OUString GetFieldHelptext() const
+ virtual ::rtl::OUString GetFieldHelptext() const
{ return m_aFieldHelptext; }
+ virtual IFieldmark::parameter_map_t* GetParameters()
+ { return &m_vParams; }
+
+ virtual const IFieldmark::parameter_map_t* GetParameters() const
+ { return &m_vParams; }
+
// setters
- void SetFieldname(const ::rtl::OUString& aFieldname)
+ virtual void SetFieldname(const ::rtl::OUString& aFieldname)
{ m_aFieldname = aFieldname; }
- void SetFieldHelptext(const ::rtl::OUString& aFieldHelptext)
+ virtual void SetFieldHelptext(const ::rtl::OUString& aFieldHelptext)
{ m_aFieldHelptext = aFieldHelptext; }
- private:
- //int fftype; // Type: 0 = Text, 1 = Check Box, 2 = List
- //bool ffprot;
+ virtual void Invalidate();
+ virtual rtl::OUString ToString() const;
+ private:
::rtl::OUString m_aFieldname;
::rtl::OUString m_aFieldHelptext;
- static const ::rtl::OUString our_sNamePrefix;
+ IFieldmark::parameter_map_t m_vParams;
+ static const ::rtl::OUString our_sNamePrefix;
};
class TextFieldmark
@@ -230,9 +244,6 @@ namespace sw { namespace mark
public:
TextFieldmark(const SwPaM& rPaM);
virtual void InitDoc(SwDoc* const io_pDoc);
- private:
- //int fftypetxt; // Type of text field: 0 = Regular text, 1 = Number, 2 = Date, 3 = Current date, 4 = Current time, 5 = Calculation
- //int ffmaxlen; // Number of characters for text field. Zero means unlimited.
};
class CheckboxFieldmark
@@ -244,11 +255,6 @@ namespace sw { namespace mark
virtual void InitDoc(SwDoc* const io_pDoc);
bool IsChecked() const;
void SetChecked(bool checked);
- private:
- bool m_isChecked;
- //bool ffsize; // 0 = Auto, 1=Exact (see ffhps)
- //bool ffrecalc;
- //int ffhps; // Check box size (half-point sizes).
};
}}
diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx
index cfacf26c65d5..27f920be7651 100644
--- a/sw/source/core/inc/crossrefbookmark.hxx
+++ b/sw/source/core/inc/crossrefbookmark.hxx
@@ -45,10 +45,10 @@ namespace sw { namespace mark
const ::rtl::OUString& rPrefix);
// getters
- virtual const SwPosition& GetOtherMarkPos() const;
- virtual const SwPosition& GetMarkStart() const
+ virtual SwPosition& GetOtherMarkPos() const;
+ virtual SwPosition& GetMarkStart() const
{ return *m_pPos1; }
- virtual const SwPosition& GetMarkEnd() const
+ virtual SwPosition& GetMarkEnd() const
{ return *m_pPos1; }
virtual bool IsExpanded() const
{ return false; }
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 9341206dfa71..f7c96d9dc745 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1142,27 +1142,30 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked)
{
SwRect aIntersect;
CalcRect( rPor, &aIntersect, 0 );
- if ( aIntersect.HasArea() ) {
- if (OnWin()) {
- OutputDevice* pOutDev = (OutputDevice*)GetOut();
- pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- pOutDev->SetLineColor( Color(220, 233, 245));
- pOutDev->SetFillColor( Color(220, 233, 245));
- pOutDev->DrawRect( aIntersect.SVRect() );
- pOutDev->Pop();
- }
- const int delta=10;
- Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
- pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- pOut->SetLineColor( Color(0, 0, 0));
- pOut->SetFillColor();
- pOut->DrawRect( r );
- if (checked) {
- pOut->DrawLine(r.TopLeft(), r.BottomRight());
- pOut->DrawLine(r.TopRight(), r.BottomLeft());
+ if ( aIntersect.HasArea() )
+ {
+ if (OnWin() && SwViewOption::IsFieldShadings() &&
+ !GetOpt().IsPagePreview())
+ {
+ OutputDevice* pOut_ = (OutputDevice*)GetOut();
+ pOut_->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pOut_->SetFillColor( SwViewOption::GetFieldShadingsColor() );
+ pOut_->SetLineColor();
+ pOut_->DrawRect( aIntersect.SVRect() );
+ pOut_->Pop();
+ }
+ const int delta=10;
+ Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
+ pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pOut->SetLineColor( Color(0, 0, 0));
+ pOut->SetFillColor();
+ pOut->DrawRect( r );
+ if (checked) {
+ pOut->DrawLine(r.TopLeft(), r.BottomRight());
+ pOut->DrawLine(r.TopRight(), r.BottomLeft());
+ }
pOut->Pop();
}
- }
}
/*************************************************************************
@@ -1216,14 +1219,22 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
}
}
bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx()));
- if(pFieldmark) OSL_TRACE("Found Fieldmark");
+ if(pFieldmark) {
+ OSL_TRACE("Found Fieldmark");
+#if DEBUG
+ rtl::OUString str = pFieldmark->ToString( );
+ fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) );
+#endif
+ }
if(bIsStartMark) OSL_TRACE("Found StartMark");
- if (OnWin() && (pFieldmark!=NULL || bIsStartMark))
+ if (OnWin() && (pFieldmark!=NULL || bIsStartMark) &&
+ SwViewOption::IsFieldShadings() &&
+ !GetOpt().IsPagePreview())
{
OutputDevice* pOutDev = (OutputDevice*)GetOut();
pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
- pOutDev->SetLineColor( Color(220, 233, 245));
- pOutDev->SetFillColor( Color(220, 233, 245));
+ pOutDev->SetFillColor( SwViewOption::GetFieldShadingsColor() );
+ pOutDev->SetLineColor( );
pOutDev->DrawRect( aIntersect.SVRect() );
pOutDev->Pop();
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 3eedc0c8c983..b1d236cb0471 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -52,11 +52,13 @@
#include <IMark.hxx>
#include <pam.hxx>
#include <doc.hxx>
+#include <xmloff/odffields.hxx>
#if OSL_DEBUG_LEVEL > 1
const sal_Char *GetLangName( const MSHORT nLang );
#endif
+using namespace ::sw::mark;
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n::ScriptType;
@@ -349,7 +351,7 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
// C2 break iterator does not found a possible line break at all:
// ==> line break
- // case A: line not yet full
+ // case A: line not yet full
if ( !bFull )
{
Width( aGuess.BreakWidth() );
@@ -655,7 +657,7 @@ xub_StrLen SwTxtPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf,
long SwTxtPortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo &rInf ) const
{
- xub_StrLen nCnt = 0;
+ xub_StrLen nCnt = 0;
if ( InExpGrp() )
{
@@ -766,9 +768,10 @@ void SwHolePortion::HandlePortion( SwPortionHandler& rPH ) const
rPH.Text( GetLen(), GetWhichPor() );
}
-void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & rInf) const
+void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & /*rInf*/) const
{
- SwTxtPortion::Paint(rInf);
+ // These shouldn't be painted!
+ // SwTxtPortion::Paint(rInf);
}
sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & )
@@ -778,38 +781,96 @@ sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & )
return ret;
}
+namespace {
+ static sal_Int32 getCurrentListIndex( IFieldmark* pBM,
+ ::rtl::OUString* io_pCurrentText = NULL )
+ {
+ const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters();
+ sal_Int32 nCurrentIdx = 0;
+ const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT));
+ if(pResult != pParameters->end())
+ pResult->second >>= nCurrentIdx;
+ if(io_pCurrentText)
+ {
+ const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY));
+ if(pListEntries != pParameters->end())
+ {
+ uno::Sequence< ::rtl::OUString > vListEntries;
+ pListEntries->second >>= vListEntries;
+ if(nCurrentIdx < vListEntries.getLength())
+ *io_pCurrentText = vListEntries[nCurrentIdx];
+ }
+ }
+ return nCurrentIdx;
+ }
+}
//FIXME Fieldbk
-//void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
-void SwFieldFormPortion::Paint( const SwTxtPaintInfo& ) const
+void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
{
-// SwTxtNode *pNd=const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode());
-// const SwDoc *doc=pNd->GetDoc();
-// SwIndex aIndex( pNd, rInf.GetIdx() );
-// SwPosition aPosition(*pNd, aIndex);
-// pMark = dynamic_cast< doc->getFieldmarkFor(aPosition);
-// OSL_ENSURE(pMark,
-// "SwFieldFormPortion::Paint(..)"
-// " - Where is my form field bookmark???");
-
-// bool checked=(pBM!=NULL?pBM->IsChecked():false);
-// rInf.DrawCheckBox(*this , checked);
-}
+ SwTxtNode* pNd = const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode());
+ const SwDoc *doc=pNd->GetDoc();
+ SwIndex aIndex( pNd, rInf.GetIdx() );
+ SwPosition aPosition(*pNd, aIndex);
-sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo &rInf )
-{
- sal_Bool ret=0;
-// ret=SwTxtPortion::Format(rInf);
+ IFieldmark* pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition );
+
+ OSL_ENSURE( pBM,
+ "SwFieldFormPortion::Paint(..)"
+ " - Where is my form field bookmark???");
- Width(rInf.GetTxtHeight());
- Height(rInf.GetTxtHeight());
- SetAscent(rInf.GetAscent());
- //int h=rInf.GetTxtHeight();
+ if ( pBM != NULL )
+ {
+ if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ { // a checkbox...
+ ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM);
+ bool checked = pCheckboxFm->IsChecked();
+ rInf.DrawCheckBox(*this, checked);
+ }
+ else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ { // a list...
+ rtl::OUString aTxt;
+ rInf.DrawViewOpt( *this, POR_FLD );
+ rInf.DrawText( aTxt, *this, 0, 0/*aTxt.getLength()*/, false );
+ }
+ else
+ {
+ assert(0); // unknown type...
+ }
+ }
+}
-/*
- Height(100);
- SetAscent(100);
-*/
+sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf )
+{
+ sal_Bool ret = 0;
+ SwTxtNode *pNd = const_cast < SwTxtNode * >( rInf.GetTxtFrm( )->GetTxtNode( ) );
+ const SwDoc *doc = pNd->GetDoc( );
+ SwIndex aIndex( pNd, rInf.GetIdx( ) );
+ SwPosition aPosition( *pNd, aIndex );
+ IFieldmark *pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition );
+ ASSERT( pBM != NULL, "Where is my form field bookmark???" );
+ if ( pBM != NULL )
+ {
+ if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ {
+ Width( rInf.GetTxtHeight( ) );
+ Height( rInf.GetTxtHeight( ) );
+ SetAscent( rInf.GetAscent( ) );
+ }
+ else if ( pBM->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) )
+ {
+ ::rtl::OUString aTxt;
+ getCurrentListIndex( pBM, &aTxt );
+ SwPosSize aPosSize = rInf.GetTxtSize( aTxt );
+ Width( aPosSize.Width( ) );
+ Height( aPosSize.Height( ) );
+ SetAscent( rInf.GetAscent( ) );
+ }
+ else
+ {
+ assert( 0 ); // unknown type...
+ }
+ }
return ret;
}
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 5f487bce1184..590ddb6e803e 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -49,6 +49,7 @@
#include <docsh.hxx>
+using namespace ::sw::mark;
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -520,67 +521,131 @@ SwXFieldmark::SwXFieldmark(bool _isReplacementObject, ::sw::mark::IMark* pBkm, S
, isReplacementObject(_isReplacementObject)
{ }
-void SwXFieldmark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
- throw( lang::IllegalArgumentException, uno::RuntimeException )
+void SwXFieldmarkParameters::insertByName(const OUString& aName, const uno::Any& aElement)
+ throw (lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{
- attachToRangeEx(xTextRange, (isReplacementObject?IDocumentMarkAccess::CHECKBOX_FIELDMARK:IDocumentMarkAccess::TEXT_FIELDMARK));
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ IFieldmark::parameter_map_t* pParameters = getCoreParameters();
+ if(pParameters->find(aName) != pParameters->end())
+ throw container::ElementExistException();
+ (*pParameters)[aName] = aElement;
}
-::rtl::OUString SwXFieldmark::getDescription(void) throw( ::com::sun::star::uno::RuntimeException )
+void SwXFieldmarkParameters::removeByName(const OUString& aName)
+ throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
-// TODO implement...
-// if(!GetBookmark())
- ::sw::mark::IFieldmark const * const pMark =
- dynamic_cast< ::sw::mark::IFieldmark const * const>(GetBookmark());
- if(!pMark)
- throw uno::RuntimeException();
- return pMark->GetFieldHelptext();
+ if(!getCoreParameters()->erase(aName))
+ throw container::NoSuchElementException();
}
-::sal_Int16 SAL_CALL SwXFieldmark::getType() throw (::com::sun::star::uno::RuntimeException)
+void SwXFieldmarkParameters::replaceByName(const OUString& aName, const uno::Any& aElement)
+ throw (lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox =
- dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark());
- if(pAsCheckbox)
- return 1;
- return 0;
+ IFieldmark::parameter_map_t* pParameters = getCoreParameters();
+ IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName);
+ if(pEntry == pParameters->end())
+ throw container::NoSuchElementException();
+ pEntry->second = aElement;
}
-::sal_Int16 SAL_CALL SwXFieldmark::getRes() throw (::com::sun::star::uno::RuntimeException)
+uno::Any SwXFieldmarkParameters::getByName(const OUString& aName)
+ throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox =
- dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark());
- if(pAsCheckbox && pAsCheckbox->IsChecked())
- return 1;
- return 0;
+ IFieldmark::parameter_map_t* pParameters = getCoreParameters();
+ IFieldmark::parameter_map_t::iterator pEntry = pParameters->find(aName);
+ if(pEntry == pParameters->end())
+ throw container::NoSuchElementException();
+ return pEntry->second;
+}
+
+uno::Sequence<OUString> SwXFieldmarkParameters::getElementNames()
+ throw (uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ IFieldmark::parameter_map_t* pParameters = getCoreParameters();
+ uno::Sequence<OUString> vResult(pParameters->size());
+ OUString* pOutEntry = vResult.getArray();
+ for(IFieldmark::parameter_map_t::iterator pEntry = pParameters->begin(); pEntry!=pParameters->end(); ++pEntry, ++pOutEntry)
+ *pOutEntry = pEntry->first;
+ return vResult;
+}
+
+::sal_Bool SwXFieldmarkParameters::hasByName(const OUString& aName)
+ throw (uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ IFieldmark::parameter_map_t* pParameters = getCoreParameters();
+ return (pParameters->find(aName) != pParameters->end());
+}
+
+uno::Type SwXFieldmarkParameters::getElementType()
+ throw (uno::RuntimeException)
+{
+ return ::cppu::UnoType< ::cppu::UnoVoidType>::get();
+}
+
+::sal_Bool SwXFieldmarkParameters::hasElements()
+ throw (uno::RuntimeException)
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ return !getCoreParameters()->empty();
}
-//FIXME Remove Method
-void SAL_CALL SwXFieldmark::setType( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException)
+void SwXFieldmarkParameters::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+{
+ ClientModify(this, pOld, pNew);
+}
+
+
+IFieldmark::parameter_map_t* SwXFieldmarkParameters::getCoreParameters()
+ throw (uno::RuntimeException)
+{
+ const IFieldmark* pFieldmark = dynamic_cast< const IFieldmark* >(GetRegisteredIn());
+ if(!pFieldmark)
+ throw uno::RuntimeException();
+ return const_cast< IFieldmark* >(pFieldmark)->GetParameters();
+}
+
+
+void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTextRange )
+ throw(lang::IllegalArgumentException, uno::RuntimeException)
+{
+ attachToRangeEx( xTextRange,
+ ( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) );
+}
+
+::rtl::OUString SwXFieldmark::getFieldType(void)
+ throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- throw uno::RuntimeException();
+ const IFieldmark *pBkm = dynamic_cast<const IFieldmark*>(GetBookmark());
+ if(!pBkm)
+ throw uno::RuntimeException();
+ return pBkm->GetFieldname();
}
-//FIXME Remove Method
-void SAL_CALL SwXFieldmark::setRes( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException)
+void SwXFieldmark::setFieldType(const::rtl::OUString & fieldType)
+ throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- throw uno::RuntimeException();
+ IFieldmark *pBkm = const_cast<IFieldmark*>(
+ dynamic_cast<const IFieldmark*>(GetBookmark()));
+ if(!pBkm)
+ throw uno::RuntimeException();
+ pBkm->SetFieldname(fieldType);
}
-void SAL_CALL SwXFieldmark::setDescription( const ::rtl::OUString& description )
- throw (::com::sun::star::uno::RuntimeException)
+uno::Reference<container::XNameContainer> SwXFieldmark::getParameters()
+ throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
- const ::sw::mark::IFieldmark* pMark =
- dynamic_cast<const ::sw::mark::IFieldmark*>(GetBookmark());
- if(pMark)
- const_cast< ::sw::mark::IFieldmark*>(pMark)->SetFieldHelptext(description);
- else
+ IFieldmark *pBkm = const_cast<IFieldmark*>(
+ dynamic_cast<const IFieldmark*>(GetBookmark()));
+ if(!pBkm)
throw uno::RuntimeException();
+ return uno::Reference<container::XNameContainer>(new SwXFieldmarkParameters(pBkm));
}
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index 37638044a44c..46aa1d0d71a8 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -88,6 +88,20 @@ private:
};
+class SwEscherExGlobal : public EscherExGlobal
+{
+public:
+ explicit SwEscherExGlobal();
+ virtual ~SwEscherExGlobal();
+
+private:
+ /** Overloaded to create a new memory stream for picture data. */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ ::std::auto_ptr< SvStream > mxPicStrm;
+};
+
class SwBasicEscherEx : public EscherEx
{
private:
@@ -95,7 +109,6 @@ private:
protected:
WW8Export& rWrt;
SvStream* pEscherStrm;
- SvStream* pPictStrm;
long mnEmuMul, mnEmuDiv;
virtual INT32 WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType,
@@ -112,13 +125,11 @@ protected:
INT32 ToFract16(INT32 nVal, UINT32 nMax) const;
- SvStream* QueryPicStream();
-
virtual void SetPicId(const SdrObject &, UINT32, EscherPropertyContainer &);
SdrLayerID GetInvisibleHellId() const;
public:
- SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt, UINT32 nDrawings = 1);
+ SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt);
INT32 WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
INT32 WriteOLEFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
void WriteEmptyFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId);
@@ -166,7 +177,7 @@ public:
virtual void WriteFrmExtraData(const SwFrmFmt& rFmt);
EscherExHostAppData* StartShape(const com::sun::star::uno::Reference<
- com::sun::star::drawing::XShape > &) {return &aHostData;}
+ com::sun::star::drawing::XShape > &, const Rectangle*) {return &aHostData;}
private:
//No copying
SwEscherEx(const SwEscherEx&);
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index d85a54885e43..6686ae5b13d7 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1308,16 +1308,14 @@ void WW8Export::WriteEscher()
void SwEscherEx::WritePictures()
{
- if (pPictStrm)
+ if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() )
{
// set the blip - entries to the correct stream pos
INT32 nEndPos = rWrt.Strm().Tell();
- SetNewBlipStreamOffset( nEndPos );
+ mxGlobal->SetNewBlipStreamOffset( nEndPos );
- pPictStrm->Seek( 0 );
- rWrt.Strm() << *pPictStrm;
-
- delete pPictStrm, pPictStrm = 0;
+ pPicStrm->Seek( 0 );
+ rWrt.Strm() << *pPicStrm;
}
Flush();
}
@@ -1326,10 +1324,24 @@ void SwEscherEx::WritePictures()
// Output- Routines for Escher Export
-SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt,
- UINT32 nDrawings)
- : EscherEx(*pStrm, nDrawings), rWrt(rWW8Wrt), pEscherStrm(pStrm),
- pPictStrm(0)
+SwEscherExGlobal::SwEscherExGlobal()
+{
+}
+
+SwEscherExGlobal::~SwEscherExGlobal()
+{
+}
+
+SvStream* SwEscherExGlobal::ImplQueryPictureStream()
+{
+ // this function will be called exactly once
+ mxPicStrm.reset( new SvMemoryStream );
+ mxPicStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
+ return mxPicStrm.get();
+}
+
+SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
+ : EscherEx( EscherExGlobalRef( new SwEscherExGlobal ), *pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm)
{
Init();
}
@@ -1442,8 +1454,8 @@ INT32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, UINT32 nShapeId)
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, aSize );
- sal_uInt32 nBlibId = GetBlibID( *QueryPicStream(), aUniqueId,
- aRect, NULL, 0 );
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
+ aUniqueId, aRect, NULL, 0 );
if (nBlibId)
aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
}
@@ -1651,8 +1663,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
Point aEmptyPoint = Point();
Rectangle aRect(aEmptyPoint, aSize);
- sal_uInt32 nBlibId = GetBlibID(*QueryPicStream(), aUniqueId,
- aRect, NULL, 0);
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
+ aUniqueId, aRect, NULL, 0);
if (nBlibId)
rPropOpt.AddOpt(ESCHER_Prop_fillBlip,nBlibId,sal_True);
}
@@ -1894,16 +1906,6 @@ INT32 SwBasicEscherEx::ToFract16(INT32 nVal, UINT32 nMax) const
return 0;
}
-SvStream* SwBasicEscherEx::QueryPicStream()
-{
- if (!pPictStrm)
- {
- pPictStrm = new SvMemoryStream;
- pPictStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- }
- return pPictStrm;
-}
-
SdrLayerID SwBasicEscherEx::GetInvisibleHellId() const
{
return rWrt.pDoc->GetInvisibleHellId();
@@ -1911,22 +1913,19 @@ SdrLayerID SwBasicEscherEx::GetInvisibleHellId() const
void SwBasicEscherEx::WritePictures()
{
- ASSERT(pPictStrm, "no picture!");
- if (pPictStrm)
+ if( SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() )
{
// set the blip - entries to the correct stream pos
- INT32 nEndPos = pPictStrm->Tell();
- WriteBlibStoreEntry(*pEscherStrm, 1, sal_True, nEndPos);
-
- pPictStrm->Seek(0);
- *pEscherStrm << *pPictStrm;
+ INT32 nEndPos = pPicStrm->Tell();
+ mxGlobal->WriteBlibStoreEntry(*pEscherStrm, 1, sal_True, nEndPos);
- delete pPictStrm, pPictStrm = 0;
+ pPicStrm->Seek(0);
+ *pEscherStrm << *pPicStrm;
}
}
SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
- : SwBasicEscherEx(pStrm, rWW8Wrt, rWW8Wrt.pHFSdrObjs->size() ? 2 : 1),
+ : SwBasicEscherEx(pStrm, rWW8Wrt),
pTxtBxs(0)
{
aHostData.SetClientData(&aWinwordAnchoring);
@@ -1964,7 +1963,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
EnterGroup( 0 );
- ULONG nSecondShapeId = pSdrObjs == rWrt.pSdrObjs ? GetShapeID() : 0;
+ ULONG nSecondShapeId = pSdrObjs == rWrt.pSdrObjs ? GenerateShapeId() : 0;
// write now all Writer-/DrawObjects
DrawObjPointerVector aSorted;
@@ -1990,7 +1989,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
nBorderThick = WriteFlyFrm(*pObj, nShapeId, aSorted);
break;
case sw::Frame::eFormControl:
- WriteOCXControl(rFmt, nShapeId=GetShapeID());
+ WriteOCXControl(rFmt, nShapeId = GenerateShapeId());
break;
case sw::Frame::eDrawing:
aWinwordAnchoring.SetAnchoring(rFmt);
@@ -2560,10 +2559,10 @@ INT32 SwEscherEx::WriteFlyFrm(const DrawObj &rObj, UINT32 &rShapeId,
switch( aIdx.GetNode().GetNodeType() )
{
case ND_GRFNODE:
- nBorderThick = WriteGrfFlyFrame( rFmt, rShapeId = GetShapeID() );
+ nBorderThick = WriteGrfFlyFrame( rFmt, rShapeId = GenerateShapeId() );
break;
case ND_OLENODE:
- nBorderThick = WriteOLEFlyFrame( rFmt, rShapeId = GetShapeID() );
+ nBorderThick = WriteOLEFlyFrame( rFmt, rShapeId = GenerateShapeId() );
break;
default:
if (const SdrObject* pObj = rFmt.FindRealSdrObject())
@@ -2702,7 +2701,8 @@ void SwBasicEscherEx::WriteOLEPicture(EscherPropertyContainer &rPropOpt,
aRect.SetPos(Point(0,0));
aRect.Right() = DrawModelToEmu(aRect.Right());
aRect.Bottom() = DrawModelToEmu(aRect.Bottom());
- sal_uInt32 nBlibId = GetBlibID(*QueryPicStream(), aId, aRect, pVisArea, 0); // SJ: the fourth parameter (VisArea) should be set..
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
+ aId, aRect, pVisArea, 0); // SJ: the fourth parameter (VisArea) should be set..
if (nBlibId)
rPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
}
@@ -2774,7 +2774,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
bNeedsShapeId = true;
}
- ULONG nShapeId = bNeedsShapeId ? GetShapeID() : 0;
+ ULONG nShapeId = bNeedsShapeId ? GenerateShapeId() : 0;
aFollowShpIds.Insert(nShapeId, n);
}
@@ -2789,12 +2789,12 @@ UINT32 SwEscherEx::GetFlyShapeId(const SwFrmFmt& rFmt,
{
if (0 == (nShapeId = aFollowShpIds[nPos]))
{
- nShapeId = GetShapeID();
+ nShapeId = GenerateShapeId();
aFollowShpIds[ nPos ] = nShapeId;
}
}
else
- nShapeId = GetShapeID();
+ nShapeId = GenerateShapeId();
return nShapeId;
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index a50bdb775837..23fa8ecb2c34 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -103,12 +103,53 @@
#include <ndgrf.hxx>
#include <ndole.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
using namespace sw::util;
using namespace sw::types;
+using namespace sw::mark;
using namespace nsFieldFlags;
+
+static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
+ ASSERT(pFieldmark!=NULL, "where is my fieldmark???");
+ if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) {
+ return String::CreateFromAscii(" FORMTEXT ");
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) {
+ return String::CreateFromAscii(" FORMDROPDOWN ");
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) {
+ return String::CreateFromAscii(" FORMCHECKBOX ");
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) {
+ return String::CreateFromAscii(" TOC ");
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) {
+ return String::CreateFromAscii(" HYPERLINK ");
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) {
+ return String::CreateFromAscii(" PAGEREF ");
+ } else {
+ return pFieldmark->GetFieldname();
+ }
+}
+
+ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
+ ASSERT(pFieldmark!=NULL, "where is my fieldmark???");
+ if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) ) {
+ return ww::eFORMTEXT;
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ) {
+ return ww::eFORMDROPDOWN;
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) ) {
+ return ww::eFORMCHECKBOX;
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_TOC ) ) {
+ return ww::eTOC;
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) ) {
+ return ww::eHYPERLINK;
+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_PAGEREF ) ) {
+ return ww::ePAGEREF;
+ } else {
+ return ww::eUNKNOWN;
+ }
+}
+
/* */
MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport )
@@ -259,22 +300,40 @@ SwAttrIter::SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
nAktSwPos = SearchNext(1);
}
+xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 )
+{
+ xub_StrLen min = STRING_NOTFOUND;
+ if ( pos1 == STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
+ min = pos2;
+ else if ( pos2 == STRING_NOTFOUND && pos1 != STRING_NOTFOUND )
+ min = pos1;
+ else if ( pos2 != STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
+ {
+ if ( pos1 < pos2 )
+ min = pos1;
+ else
+ min = pos2;
+ }
+
+ return min;
+}
+
xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos )
{
xub_StrLen nPos;
xub_StrLen nMinPos = STRING_MAXLEN;
+ xub_StrLen i=0;
+
const String aTxt = rNd.GetTxt();
- xub_StrLen pos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos);
- if( pos==STRING_NOTFOUND )
- {
- pos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos);
- if( pos==STRING_NOTFOUND )
- pos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos);
- }
- if( pos!=STRING_NOTFOUND )
- nMinPos=pos;
+ xub_StrLen fieldEndPos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos);
+ xub_StrLen fieldStartPos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos);
+ xub_StrLen formElementPos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos);
- xub_StrLen i=0;
+ xub_StrLen pos = lcl_getMinPos( fieldEndPos, fieldStartPos );
+ pos = lcl_getMinPos( pos, formElementPos );
+
+ if (pos!=STRING_NOTFOUND)
+ nMinPos=pos;
// first the redline, then the attributes
if( pCurRedline )
@@ -1692,12 +1751,14 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
- if ( pFieldmark )
- AppendBookmark( pFieldmark->GetName(), true );
- OutputField( NULL, ww::eFORMTEXT, String::CreateFromAscii( " FORMTEXT " ), WRITEFIELD_START | WRITEFIELD_CMD_START );
- if ( pFieldmark )
+ if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) )
+ AppendBookmark( pFieldmark->GetName(), false );
+ OutputField( NULL, lcl_getFieldId( pFieldmark ), lcl_getFieldCode( pFieldmark ), WRITEFIELD_START | WRITEFIELD_CMD_START );
+ if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMTEXT ) )
WriteFormData( *pFieldmark );
- OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CMD_END );
+ else if ( pFieldmark->GetFieldname( ).equalsAscii( ODF_HYPERLINK ) )
+ WriteHyperlinkData( *pFieldmark );
+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
}
else if ( ch == CH_TXT_ATR_FIELDEND )
{
@@ -1705,8 +1766,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
- OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CLOSE );
- if ( pFieldmark )
+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE );
+ if ( pFieldmark->GetFieldname().equalsAscii( ODF_FORMTEXT ) )
AppendBookmark( pFieldmark->GetName(), false );
}
else if ( ch == CH_TXT_ATR_FORMELEMENT )
@@ -1715,13 +1776,18 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
- if ( pFieldmark )
- AppendBookmark( pFieldmark->GetName(), true );
- OutputField( NULL, ww::eFORMCHECKBOX, String::CreateFromAscii( " FORMCHECKBOX " ), WRITEFIELD_START | WRITEFIELD_CMD_START );
- if ( pFieldmark )
+ bool isDropdownOrCheckbox = pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMDROPDOWN ) ||
+ pFieldmark->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX );
+
+ if ( isDropdownOrCheckbox )
+ AppendBookmark( pFieldmark->GetName(), 0 );
+ OutputField( NULL, lcl_getFieldId( pFieldmark ),
+ lcl_getFieldCode( pFieldmark ),
+ WRITEFIELD_START | WRITEFIELD_CMD_START );
+ if ( isDropdownOrCheckbox )
WriteFormData( *pFieldmark );
- OutputField( NULL, ww::eFORMCHECKBOX, String(), WRITEFIELD_CMD_END | WRITEFIELD_CLOSE );
- if ( pFieldmark )
+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE );
+ if ( isDropdownOrCheckbox )
AppendBookmark( pFieldmark->GetName(), false );
}
nLen -= static_cast< USHORT >( ofs );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index ddb0a55cd5fa..6bf7ecbb8cdf 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -94,7 +94,7 @@
#include <fmtline.hxx>
#include <fmtfsize.hxx>
#include <comphelper/extract.hxx>
-
+#include <comphelper/stlunosequence.hxx>
#include <writerfilter/doctok/sprmids.hxx>
#include "writerhelper.hxx"
@@ -102,6 +102,7 @@
#include "ww8attributeoutput.hxx"
#include <IDocumentMarkAccess.hxx>
+#include <xmloff/odffields.hxx>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -2379,33 +2380,33 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t
m_rWW8Export.pO->Insert( static_cast<BYTE>(nBoxes0 * 10),
m_rWW8Export.pO->Count() );
- for ( sal_uInt8 n = 0; n < nBoxes0; n++ )
- {
- const SwTableBox * pBox1 = rTabBoxes[n];
- const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt();
- const SfxPoolItem * pI = NULL;
- Color aColor;
+ for ( sal_uInt8 n = 0; n < nBoxes0; n++ )
+ {
+ const SwTableBox * pBox1 = rTabBoxes[n];
+ const SwFrmFmt * pFrmFmt = pBox1->GetFrmFmt();
+ const SfxPoolItem * pI = NULL;
+ Color aColor;
if ( SFX_ITEM_ON ==
pFrmFmt->GetAttrSet().
GetItemState( RES_BACKGROUND, false, &pI ) )
- {
- aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor();
- }
- else
- aColor = COL_AUTO;
+ {
+ aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor();
+ }
+ else
+ aColor = COL_AUTO;
- WW8SHDLong aSHD;
- aSHD.setCvFore( 0xFF000000 );
+ WW8SHDLong aSHD;
+ aSHD.setCvFore( 0xFF000000 );
- sal_uInt32 nBgColor = aColor.GetColor();
- if ( nBgColor == COL_AUTO )
- aSHD.setCvBack( 0xFF000000 );
- else
- aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) );
+ sal_uInt32 nBgColor = aColor.GetColor();
+ if ( nBgColor == COL_AUTO )
+ aSHD.setCvBack( 0xFF000000 );
+ else
+ aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) );
- aSHD.Write( m_rWW8Export );
- }
+ aSHD.Write( m_rWW8Export );
+ }
}
}
}
@@ -2709,18 +2710,19 @@ void WW8Export::WriteFkpPlcUsw()
if ( pSttbfAssoc )
// <--
{
- ::std::vector<String> aStrings;
- ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings();
- ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end();
- for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin();
- aIt != aItEnd; aIt++)
- {
- String aStr(aIt->getStr());
- aStrings.push_back(aStr);
- }
+ ::std::vector<String> aStrings;
- WriteAsStringTable(aStrings, pFib->fcSttbfAssoc,
- pFib->lcbSttbfAssoc);
+ ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings();
+ ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end();
+ for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin();
+ aIt != aItEnd; aIt++)
+ {
+ String aStr(aIt->getStr());
+ aStrings.push_back(aStr);
+ }
+
+ WriteAsStringTable(aStrings, pFib->fcSttbfAssoc,
+ pFib->lcbSttbfAssoc);
}
}
Strm().Seek( 0 );
@@ -2728,18 +2730,17 @@ void WW8Export::WriteFkpPlcUsw()
// Reclaim stored FIB data from document.
::ww8::WW8FibData * pFibData = dynamic_cast<ww8::WW8FibData *>
(pDoc->getExternalData(::sw::FIB).get());
- // --> OD 2009-10-19 #i106057#
+
if ( pFibData )
// <--
{
- pFib->fReadOnlyRecommended =
- pFibData->getReadOnlyRecommended() ? 1 : 0;
- pFib->fWriteReservation =
- pFibData->getWriteReservation() ? 1 : 0;
+ pFib->fReadOnlyRecommended =
+ pFibData->getReadOnlyRecommended() ? 1 : 0;
+ pFib->fWriteReservation =
+ pFibData->getWriteReservation() ? 1 : 0;
}
pFib->Write( Strm() ); // FIB
-
}
void WW8Export::StoreDoc1()
@@ -3527,11 +3528,23 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark;
const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark );
+
+ ASSERT(rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) || rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ), "Unknown field type!!!");
+ if ( ! ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMTEXT ) ||
+ rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) ||
+ rFieldmark.GetFieldname().equalsAscii( ODF_FORMCHECKBOX ) ) )
+ return;
+
int type = 0; // TextFieldmark
if ( pAsCheckbox )
type = 1;
+ if ( rFieldmark.GetFieldname().equalsAscii( ODF_FORMDROPDOWN ) )
+ type=2;
- const ::rtl::OUString ffname = rFieldmark.GetFieldname();
+ ::sw::mark::IFieldmark::parameter_map_t::const_iterator pNameParameter = rFieldmark.GetParameters()->find(::rtl::OUString::createFromAscii("name"));
+ ::rtl::OUString ffname;
+ if(pNameParameter != rFieldmark.GetParameters()->end())
+ pNameParameter->second >>= ffname;
ULONG nDataStt = pDataStrm->Tell();
pChpPlc->AppendFkpEntry(Strm().Tell());
@@ -3553,15 +3566,37 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
sal_uInt8 aFldHeader[] =
{
0xFF, 0xFF, 0xFF, 0xFF, // Unicode Marker...
- 0, 0, 0, 0//, 0, 0, 0, 0
+ 0, 0, 0, 0,// 0, 0, 0, 0
};
aFldHeader[4] |= (type & 0x03);
- int ffres = 0; // rFieldmark.GetFFRes();
+ sal_Int32 ffres = 0; // rFieldmark.GetFFRes();
if ( pAsCheckbox && pAsCheckbox->IsChecked() )
ffres = 1;
+ else if ( type == 2 )
+ {
+ ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN));
+ if(pResParameter != rFieldmark.GetParameters()->end())
+ pResParameter->second >>= ffres;
+ else
+ ffres = 0;
+ }
aFldHeader[4] |= ( (ffres<<2) & 0x7C );
+ std::vector< ::rtl::OUString > aListItems;
+ if (type==2)
+ {
+ aFldHeader[5] |= 0x80; // ffhaslistbox
+ const ::sw::mark::IFieldmark::parameter_map_t* const pParameters = rFieldmark.GetParameters();
+ ::sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY));
+ if(pListEntries != pParameters->end())
+ {
+ uno::Sequence< ::rtl::OUString > vListEntries;
+ pListEntries->second >>= vListEntries;
+ copy(::comphelper::stl_begin(vListEntries), ::comphelper::stl_end(vListEntries), back_inserter(aListItems));
+ }
+ }
+
const ::rtl::OUString ffdeftext;
const ::rtl::OUString ffformat;
const ::rtl::OUString ffhelptext;
@@ -3569,6 +3604,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
const ::rtl::OUString ffentrymcr;
const ::rtl::OUString ffexitmcr;
+
const sal_uInt8 aFldData[] =
{
0x44,0, // the start of "next" data
@@ -3578,7 +3614,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // | /16
0,0,0,0, // / /4
};
- sal_uInt32 slen=sizeof(sal_uInt32)
+ sal_uInt32 slen = sizeof(sal_uInt32)
+ sizeof(aFldData)
+ sizeof( aFldHeader )
+ 2*ffname.getLength() + 4
@@ -3588,6 +3624,15 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
+ 2*ffstattext.getLength() + 4
+ 2*ffentrymcr.getLength() + 4
+ 2*ffexitmcr.getLength() + 4;
+ if ( type==2 ) {
+ slen += 2; // for 0xFF, 0xFF
+ slen += 4; // for num of list items
+ const int items = aListItems.size();
+ for( int i = 0; i < items; i++ ) {
+ rtl::OUString item = aListItems[i];
+ slen += 2 * item.getLength() + 2;
+ }
+ }
*pDataStrm << slen;
@@ -3597,6 +3642,7 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
len = sizeof( aFldHeader );
OSL_ENSURE( len == 8, "SwWW8Writer::WriteFormData(..) - wrong aFldHeader length" );
+
pDataStrm->Write( aFldHeader, len );
SwWW8Writer::WriteString_xstz( *pDataStrm, ffname, true ); // Form field name
@@ -3611,11 +3657,20 @@ void WW8Export::WriteFormData( const ::sw::mark::IFieldmark& rFieldmark )
SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffstattext ), true );
SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffentrymcr ), true );
SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffexitmcr ), true );
-// if (type==2) {
-// // 0xFF, 0xFF
-// // sal_uInt32 number of strings
-// // (sal_uInt16 len; sal_uInt16 unicode char[len])*num of strings
-// }
+ if (type==2) {
+ *pDataStrm<<(sal_uInt16)0xFFFF;
+ const int items=aListItems.size();
+ *pDataStrm<<(sal_uInt32)items;
+ for(int i=0;i<items;i++) {
+ rtl::OUString item=aListItems[i];
+ SwWW8Writer::WriteString_xstz( *pDataStrm, item, false );
+ }
+ }
+}
+
+void WW8Export::WriteHyperlinkData( const sw::mark::IFieldmark& /*rFieldmark*/ )
+{
+ //@TODO implement me !!!
}
void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index ca96f617c5fd..21295ba11ca4 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -706,6 +706,7 @@ public:
/// Write the data of the form field
virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) = 0;
+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ) = 0;
virtual void DoComboBox(const rtl::OUString &rName,
const rtl::OUString &rHelp,
@@ -1073,6 +1074,7 @@ public:
/// Write the data of the form field
virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
/// Fields.
WW8_WrPlcFld* CurrentFieldPlc() const;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0285b3451b6f..a290e8f30790 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1508,7 +1508,6 @@ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
maOldApos.push_back(false);
maOldApos.swap(pRdr->maApos);
maOldFieldStack.swap(pRdr->maFieldStack);
- maFieldCtxStack.swap(pRdr->maNewFieldCtxStack);
}
void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
@@ -1555,7 +1554,6 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
pRdr->pPlcxMan->RestoreAllPLCFx(maPLCFxSave);
pRdr->maApos.swap(maOldApos);
pRdr->maFieldStack.swap(maOldFieldStack);
- pRdr->maNewFieldCtxStack.swap(maFieldCtxStack);
}
void SwWW8ImplReader::Read_HdFtFtnText( const SwNodeIndex* pSttIdx,
@@ -2673,29 +2671,6 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
case 0x15:
if( !bSpec ) // Juristenparagraph
cInsert = '\xa7';
- else
- {
- // 0x15 is special --> so it's our field end mark...;
- // hmmm what about field marks not handled by us??, maybe a problem with nested fields;
- // probably an area of bugs... [well release quick and release often....]
- if (!maNewFieldCtxStack.empty() && pPaM!=NULL && pPaM->GetPoint()!=NULL)
- {
- ::boost::scoped_ptr<WW8NewFieldCtx> pFieldCtx(maNewFieldCtxStack.back());
- maNewFieldCtxStack.pop_back();
- SwPosition aEndPos = *pPaM->GetPoint();
- SwPaM aFldPam(pFieldCtx->GetPtNode(), pFieldCtx->GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
- IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess();
- ::sw::mark::IFieldmark* pFieldmark =
- dynamic_cast< ::sw::mark::IFieldmark*>(pMarkAccess->makeMark(
- aFldPam,
- pFieldCtx->GetBookmarkName(),
- IDocumentMarkAccess::TEXT_FIELDMARK));
- OSL_ENSURE(pFieldmark!=NULL,
- "hmmm; why was the bookmark not created?");
- if (pFieldmark)
- pFieldCtx->SetCurrentFieldParamsTo(pFieldmark);
- }
- }
break;
case 0x9:
cInsert = '\x9'; // Tab
@@ -3507,7 +3482,14 @@ void wwSectionManager::InsertSegments()
bool bInsertSection = (aIter != aStart) ? (aIter->IsContinous() && bThisAndPreviousAreCompatible): false;
bool bInsertPageDesc = !bInsertSection;
- bool bProtected = !bUseEnhFields && SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this...
+ bool bProtected = SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this...
+ if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected()) {
+ // here we have the special case that the whole document is protected, with the execption of this section.
+ // I want to address this when I do the section rework, so for the moment we disable the overall protection then...
+ mrReader.rDoc.set(IDocumentSettingAccess::PROTECT_FORM, false );
+ }
+
+
if (bInsertPageDesc)
{
/*
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 6d731ea1204e..099ecca83d6a 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -57,6 +57,8 @@
#include "ww8glsy.hxx"
#include "wrtww8.hxx"
#include "../inc/msfilter.hxx"
+#include <xmloff/odffields.hxx>
+#include <IMark.hxx>
class SwDoc;
class SwPaM;
@@ -359,43 +361,35 @@ namespace sw
Position(const SwPosition &rPos);
Position(const Position &rPos);
operator SwPosition() const;
+ SwNodeIndex GetPtNode() { return maPtNode; };
+ xub_StrLen GetPtCntnt() { return mnPtCntnt; };
};
}
}
class FieldEntry
{
-public:
- sw::hack::Position maStartPos;
- sal_uInt16 mnFieldId;
- FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
- FieldEntry(const FieldEntry &rOther) throw();
- FieldEntry &operator=(const FieldEntry &rOther) throw();
- void Swap(FieldEntry &rOther) throw();
-};
-
-class WW8NewFieldCtx
-{
-private:
- SwNodeIndex maPtNode;
- xub_StrLen mnPtCntnt;
- ::rtl::OUString msBookmarkName;
- ::rtl::OUString msMarkType;
- typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> Param_t;
- typedef ::std::vector< Param_t > Params_t;
- Params_t maParams;
- SwPaM * mpPaM;
-
-public:
- WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType);
- ~WW8NewFieldCtx();
-
- SwNodeIndex GetPtNode() { return maPtNode; };
- xub_StrLen GetPtCntnt() { return mnPtCntnt; };
- ::rtl::OUString GetBookmarkName();
- ::rtl::OUString GetMarkType();
- void AddParam(::rtl::OUString name, ::rtl::OUString value);
- void SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark);
+ private:
+ ::rtl::OUString msBookmarkName;
+ ::rtl::OUString msMarkType;
+ ::sw::mark::IFieldmark::parameter_map_t maParams;
+
+ public:
+ sw::hack::Position maStartPos;
+ sal_uInt16 mnFieldId;
+ FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
+ FieldEntry(const FieldEntry &rOther) throw();
+ FieldEntry &operator=(const FieldEntry &rOther) throw();
+ void Swap(FieldEntry &rOther) throw();
+
+ SwNodeIndex GetPtNode() { return maStartPos.GetPtNode(); };
+ xub_StrLen GetPtCntnt() { return maStartPos.GetPtCntnt(); };
+
+ ::rtl::OUString GetBookmarkName();
+ ::rtl::OUString GetBookmarkType();
+ void SetBookmarkName(::rtl::OUString bookmarkName);
+ void SetBookmarkType(::rtl::OUString bookmarkType);
+ ::sw::mark::IFieldmark::parameter_map_t& getParameters();
};
@@ -431,7 +425,6 @@ private:
bool mbWasParaEnd;
bool mbHasBorder;
bool mbFirstPara;
- std::deque<WW8NewFieldCtx *> maFieldCtxStack;
public:
WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1);
void Restore(SwWW8ImplReader* pRdr);
@@ -886,9 +879,6 @@ private:
std::deque<FieldEntry> maFieldStack;
typedef std::deque<FieldEntry>::const_iterator mycFieldIter;
- typedef std::deque<WW8NewFieldCtx *> WW8NewFieldCtxStack_t;
- WW8NewFieldCtxStack_t maNewFieldCtxStack;
-
/*
A stack of open footnotes. Should only be one in it at any time.
*/
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 984f5792e5ac..465d07c0d2b5 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <comphelper/extract.hxx>
+#include <comphelper/stlunosequence.hxx>
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -93,66 +94,15 @@
#include <IMark.hxx>
#include <unotools/fltrcfg.hxx>
+#include <xmloff/odffields.hxx>
#include <stdio.h>
+#include <algorithm>
using namespace com::sun::star;
using namespace sw::util;
using namespace sw::types;
-
-WW8NewFieldCtx::WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType)
- : maPtNode(aStartPos.nNode)
- , mnPtCntnt(aStartPos.nContent.GetIndex())
- , msBookmarkName(sBookmarkName)
- , msMarkType(sMarkType)
- , mpPaM(NULL)
-{
-}
-
-
-WW8NewFieldCtx::~WW8NewFieldCtx()
-{
- if (mpPaM) delete mpPaM;
-}
-
-::rtl::OUString WW8NewFieldCtx::GetBookmarkName()
-{
- return msBookmarkName;
-}
-
-::rtl::OUString WW8NewFieldCtx::GetMarkType()
-{
- return msMarkType;
-}
-
-void WW8NewFieldCtx::AddParam(::rtl::OUString name, ::rtl::OUString value)
-{
- maParams.push_back( Param_t(name, value) );
-}
-
-void WW8NewFieldCtx::SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark)
-{
- for(Params_t::iterator i=maParams.begin();i!=maParams.end();i++)
- {
- ::rtl::OUString aName=i->first;
- ::rtl::OUString aValue=i->second;
- if(aName.compareToAscii("Description")==0)
- {
- pFieldmark->SetFieldHelptext(aValue);
- }
- else if(aName.compareToAscii("Name")==0)
- {
- pFieldmark->SetFieldname(aValue);
- }
- else if(aName.compareToAscii("Result")==0)
- {
- ::sw::mark::ICheckboxFieldmark* pAsCheckbox =
- dynamic_cast< ::sw::mark::ICheckboxFieldmark* >(pFieldmark);
- if(pAsCheckbox)
- pAsCheckbox->SetChecked(aValue.toInt32()==0);
- }
- }
-}
+using namespace sw::mark;
//-----------------------------------------
// UNO-Controls
@@ -230,10 +180,10 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr )
if (aBookmarkName.Len()>0) {
- WW8NewFieldCtx *pFieldCtx=new WW8NewFieldCtx(*pPaM->GetPoint(), aBookmarkName, ::rtl::OUString::createFromAscii("ecma.office-open-xml.field.FORMTEXT"));
- maNewFieldCtxStack.push_back(pFieldCtx);
- pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
- pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Name"), aFormula.sTitle);
+ maFieldStack.back().SetBookmarkName(aBookmarkName);
+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_FORMTEXT));
+ maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Description")] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
+ maFieldStack.back().getParameters()[::rtl::OUString::createFromAscii("Name")] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
}
return FLD_TEXT;
}
@@ -276,19 +226,20 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr )
aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
}
- if (aBookmarkName.Len()>0) {
- ::sw::mark::ICheckboxFieldmark* pFieldmark =
- dynamic_cast< ::sw::mark::ICheckboxFieldmark*>(rDoc.getIDocumentMarkAccess()->makeMark(
- *pPaM,
- aBookmarkName,
- IDocumentMarkAccess::CHECKBOX_FIELDMARK));
- OSL_ENSURE(pFieldmark,
- "hmmm; why was the bookmark not created?");
- if(pFieldmark)
- {
- pFieldmark->SetFieldname(aFormula.sTitle);
- pFieldmark->SetFieldHelptext(aFormula.sToolTip);
- pFieldmark->SetChecked(aFormula.nChecked!=0);
+ if (aBookmarkName.Len()>0)
+ {
+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
+ IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark(
+ *pPaM, aBookmarkName,
+ rtl::OUString::createFromAscii( ODF_FORMCHECKBOX ) ) );
+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+ if (pFieldmark!=NULL) {
+ IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters();
+ ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark);
+ (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_NAME)] = uno::makeAny(::rtl::OUString(aFormula.sTitle));
+ (*pParameters)[::rtl::OUString::createFromAscii(ODF_FORMCHECKBOX_HELPTEXT)] = uno::makeAny(::rtl::OUString(aFormula.sToolTip));
+ if(pCheckboxFm)
+ pCheckboxFm->SetChecked(aFormula.nChecked);
// set field data here...
}
}
@@ -303,24 +254,71 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr)
if (0x01 == rStr.GetChar(writer_cast<xub_StrLen>(pF->nLCode-1)))
ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_DROPDOWN);
- SwDropDownField aFld(
- (SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN));
-
- aFld.SetName(aFormula.sTitle);
- aFld.SetHelp(aFormula.sHelp);
- aFld.SetToolTip(aFormula.sToolTip);
+ const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
- if (!aFormula.maListEntries.empty())
+ if (!bUseEnhFields)
{
- aFld.SetItems(aFormula.maListEntries);
- int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size()
- ? aFormula.fDropdownIndex : 0;
- aFld.SetSelectedItem(aFormula.maListEntries[nIndex]);
+ SwDropDownField aFld((SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN));
+
+ aFld.SetName(aFormula.sTitle);
+ aFld.SetHelp(aFormula.sHelp);
+ aFld.SetToolTip(aFormula.sToolTip);
+
+ if (!aFormula.maListEntries.empty())
+ {
+ aFld.SetItems(aFormula.maListEntries);
+ int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0;
+ aFld.SetSelectedItem(aFormula.maListEntries[nIndex]);
+ }
+
+ rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
+ return FLD_OK;
}
+ else
+ {
+ // TODO: review me
+ String aBookmarkName;
+ WW8PLCFx_Book* pB = pPlcxMan->GetBook();
+ if (pB!=NULL)
+ {
+ WW8_CP currentCP=pF->nSCode;
+ WW8_CP currentLen=pF->nLen;
- rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
+ USHORT bkmFindIdx;
+ String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
- return FLD_OK;
+ if (aBookmarkFind.Len()>0)
+ {
+ pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
+ if (aBookmarkFind.Len()>0)
+ aBookmarkName=aBookmarkFind;
+ }
+ }
+
+ if (pB!=NULL && aBookmarkName.Len()==0)
+ aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
+
+ if (aBookmarkName.Len()>0)
+ {
+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
+ IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>(
+ pMarksAccess->makeNoTextFieldBookmark( *pPaM, aBookmarkName,
+ ::rtl::OUString::createFromAscii( ODF_FORMDROPDOWN ) ) );
+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+ if ( pFieldmark != NULL )
+ {
+ uno::Sequence< ::rtl::OUString > vListEntries(aFormula.maListEntries.size());
+ ::std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), ::comphelper::stl_begin(vListEntries));
+ (*pFieldmark->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)] = uno::makeAny(vListEntries);
+ sal_Int32 nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0;
+ (*pFieldmark->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = uno::makeAny(nIndex);
+ // set field data here...
+ }
+ }
+
+ return FLD_OK;
+ }
}
void SwWW8ImplReader::DeleteFormImpl()
@@ -2137,11 +2135,6 @@ bool SwWW8ImplReader::ImportFormulaControl(WW8FormulaControl &aFormula,
if((aPic.lcb > 0x3A) && !pDataStream->GetError() )
{
- pDataStream->Seek( nPicLocFc + aPic.cbHeader );
- int len=aPic.lcb-aPic.cbHeader;
- char *pBuf=(char*)malloc(len);
- pDataStream->Read( pBuf, len);
- pDataStream->Seek( nPicLocFc + aPic.cbHeader );
aFormula.FormulaRead(nWhich,pDataStream);
bRet = true;
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index ee3bdaf38beb..255b17e04638 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -79,22 +79,26 @@
#include <fmtclds.hxx>
#include <pagedesc.hxx>
#include <SwStyleNameMapper.hxx>
-
+#include <IMark.hxx>
#include "ww8scan.hxx" // WW8FieldDesc
#include "ww8par.hxx"
#include "ww8par2.hxx"
#include "writerhelper.hxx"
#include "fields.hxx"
+#include <unotools/fltrcfg.hxx>
#include <algorithm> // #i24377#
+//#define WW_NATIVE_TOC 0
+
#define MAX_FIELDLEN 64000
#define WW8_TOX_LEVEL_DELIM ':'
using namespace ::com::sun::star;
using namespace sw::util;
+using namespace sw::mark;
using namespace std; // #i24377#
using namespace nsSwDocInfoSubType;
@@ -319,9 +323,11 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
//"_Toc*" and "_Hlt*" are unnecessary
const String* pName = pB->GetName();
+#if !defined(WW_NATIVE_TOC)
if( !pName || pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 )
|| pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) )
return 0;
+#endif
//JP 16.11.98: ToUpper darf auf keinen Fall gemacht werden, weil der
//Bookmark- name ein Hyperlink-Ziel sein kann!
@@ -663,6 +669,9 @@ sal_uInt16 SwWW8ImplReader::End_Field()
if (!pF || !pF->EndPosIsFieldEnd())
return nRet;
+ const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+
ASSERT(!maFieldStack.empty(), "Empty field stack\n");
if (!maFieldStack.empty())
{
@@ -674,9 +683,42 @@ sal_uInt16 SwWW8ImplReader::End_Field()
nRet = maFieldStack.back().mnFieldId;
switch (nRet)
{
+ case 70:
+ if (bUseEnhFields && pPaM!=NULL && pPaM->GetPoint()!=NULL) {
+ SwPosition aEndPos = *pPaM->GetPoint();
+ SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
+ IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeFieldBookmark(
+ aFldPam, maFieldStack.back().GetBookmarkName(), ::rtl::OUString::createFromAscii(ODF_FORMTEXT ) ) );
+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+ if (pFieldmark!=NULL) {
+ const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters();
+ pFieldmark->GetParameters()->insert(pParametersToAdd.begin(), pParametersToAdd.end());
+ }
+ }
+ break;
+#if defined(WW_NATIVE_TOC)
+ case 8: // TOX_INDEX
+ case 13: // TOX_CONTENT
+ case 88: // HYPERLINK
+ case 37: // REF
+ if (pPaM!=NULL && pPaM->GetPoint()!=NULL) {
+
+ SwPosition aEndPos = *pPaM->GetPoint();
+ SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
+ SwFieldBookmark *pFieldmark=(SwFieldBookmark*)rDoc.makeFieldBookmark(aFldPam, maFieldStack.back().GetBookmarkName(), maFieldStack.back().GetBookmarkType());
+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
+ if (pFieldmark!=NULL) {
+ const IFieldmark::parameter_map_t& pParametersToAdd = maFieldStack.back().getParameters();
+ pFieldmark->GetParameters()->insert(pParameters.begin(), pParameters.end());
+ }
+ }
+ break;
+#else
case 88:
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT);
break;
+#endif
case 36:
case 68:
//Move outside the section associated with this type of field
@@ -694,6 +736,10 @@ bool AcceptableNestedField(sal_uInt16 nFieldCode)
{
switch (nFieldCode)
{
+#if defined(WW_NATIVE_TOC)
+ case 8: // allow recursive field in TOC...
+ case 13: // allow recursive field in TOC...
+#endif
case 36:
case 68:
case 79:
@@ -732,6 +778,32 @@ FieldEntry &FieldEntry::operator=(const FieldEntry &rOther) throw()
return *this;
}
+::rtl::OUString FieldEntry::GetBookmarkName()
+{
+ return msBookmarkName;
+}
+
+::rtl::OUString FieldEntry::GetBookmarkType()
+{
+ return msMarkType;
+}
+
+void FieldEntry::SetBookmarkName(::rtl::OUString bookmarkName)
+{
+ msBookmarkName=bookmarkName;
+}
+
+void FieldEntry::SetBookmarkType(::rtl::OUString bookmarkType)
+{
+ msMarkType=bookmarkType;
+}
+
+
+::sw::mark::IFieldmark::parameter_map_t& FieldEntry::getParameters() {
+ return maParams;
+}
+
+
// Read_Field liest ein Feld ein oder, wenn es nicht gelesen werden kann,
// wird 0 zurueckgegeben, so dass das Feld vom Aufrufer textuell gelesen wird.
// Returnwert: Gesamtlaenge des Feldes ( zum UEberlesen )
@@ -2061,6 +2133,17 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr )
String sName(GetMappedBookmark(sOrigName));
+#if defined(WW_NATIVE_TOC)
+ if (1) {
+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_REF");
+ maFieldStack.back().SetBookmarkName(aBookmarkName);
+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_PAGEREF));
+ maFieldStack.back().AddParam(rtl::OUString(), sName);
+ return FLD_TEXT;
+ }
+#endif
+
+
SwGetRefField aFld(
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName,
REF_BOOKMARK, 0, REF_PAGE );
@@ -2759,6 +2842,16 @@ USHORT lcl_GetMaxValidWordTOCLevel(const SwForm &rForm)
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
{
+#if defined(WW_NATIVE_TOC)
+ if (1) {
+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC");
+ maFieldStack.back().SetBookmarkName(aBookmarkName);
+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_TOC));
+// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
+ return FLD_TEXT;
+ }
+#endif
+
if (pF->nLRes < 3)
return FLD_TEXT; // ignore (#i25440#)
@@ -3277,6 +3370,16 @@ eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/)
eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
{
+#if defined(WW_NATIVE_TOC)
+ if (1) {
+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_HYPERLINK");
+ maFieldStack.back().SetBookmarkName(aBookmarkName);
+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ODF_HYPERLINK));
+// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
+ return FLD_TEXT;
+ }
+#endif
+
String sURL, sTarget, sMark;
bool bDataImport = false;
//HYPERLINk "filename" [switches]
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 3801d72186e8..6fcc3701aae1 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -137,6 +137,7 @@
#include <IMark.hxx>
#include <doc.hxx>
+#include <xmloff/odffields.hxx>
#include "PostItMgr.hxx"
#include "postit.hxx"
@@ -146,6 +147,7 @@
//#define TEST_FOR_BUG91313
#endif
+using namespace sw::mark;
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
@@ -2311,6 +2313,12 @@ KEYINPUT_CHECKTABLE_INSDEL:
ChgToEnEmDash | SetINetAttr |
Autocorrect ) &&
!rSh.HasReadonlySel() )
+ /* {
+ pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
+ ChgFractionSymbol | ChgOrdinalNumber |
+ ChgToEnEmDash | SetINetAttr |
+ Autocorrect ) &&
+ !rSh.HasReadonlySel() ) */
{
FlushInBuffer();
rSh.AutoCorrect( *pACorr, static_cast< sal_Unicode >('\0') );
@@ -3608,10 +3616,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
pAnchorMarker->ChgHdl( pHdl );
if( aNew.X() || aNew.Y() )
{
- pAnchorMarker->SetPos( aNew );
- pAnchorMarker->SetLastPos( aDocPt );
- //OLMpSdrView->RefreshAllIAOManagers();
- }
+ pAnchorMarker->SetPos( aNew );
+ pAnchorMarker->SetLastPos( aDocPt );
+ //OLMpSdrView->RefreshAllIAOManagers();
+ }
}
else
{
@@ -4177,7 +4185,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
SwContentAtPos aCntntAtPos( SwContentAtPos::SW_CLICKFIELD |
SwContentAtPos::SW_INETATTR |
- SwContentAtPos::SW_SMARTTAG );
+ SwContentAtPos::SW_SMARTTAG | SwContentAtPos::SW_FORMCTRL);
if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, TRUE ) )
{
@@ -4198,6 +4206,29 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if ( bExecSmarttags && SwSmartTagMgr::Get().IsSmartTagsEnabled() )
rView.ExecSmartTagPopup( aDocPt );
}
+ else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos )
+ {
+ ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
+ if ( aCntntAtPos.aFnd.pFldmark != NULL)
+ {
+ IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
+ //SwDocShell* pDocSh = rView.GetDocShell();
+ //SwDoc *pDoc=pDocSh->GetDoc();
+ if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
+ {
+ ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM);
+ pCheckboxFm->SetChecked(!pCheckboxFm->IsChecked());
+ pCheckboxFm->Invalidate();
+ rSh.InvalidateWindows( rView.GetVisArea() );
+ } else if (fieldBM->GetFieldname().equalsAscii( ODF_FORMDROPDOWN) ) {
+ rView.ExecFieldPopup( aDocPt, fieldBM );
+ fieldBM->Invalidate();
+ rSh.InvalidateWindows( rView.GetVisArea() );
+ } else {
+ // unknown type..
+ }
+ }
+ }
else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos )
{
if ( bExecHyperlinks )
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index f243202a01ac..7cff88c897cc 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -40,6 +40,7 @@
#include <swtypes.hxx>
#include <shellid.hxx>
#include <layout/layout.hxx>
+#include <IMark.hxx>
class SwBaseShell;
class Button;
@@ -92,6 +93,7 @@ struct SwConversionArgs;
class Graphic;
class GraphicFilter;
class SwPostItMgr;
+class SwFieldBookmark;
namespace com{ namespace sun { namespace star {
namespace view{ class XSelectionSupplier; }
@@ -463,7 +465,7 @@ public:
DECL_LINK( SpellError, LanguageType * );
BOOL ExecSpellPopup( const Point& rPt );
-
+ BOOL ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
// SMARTTAGS
BOOL ExecSmartTagPopup( const Point& rPt );
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 90180b86110b..2a65e1b36ff7 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -32,6 +32,7 @@
#include <fesh.hxx>
#include <sortopt.hxx>
#include <swurl.hxx>
+#include <IMark.hxx>
class Window;
class OutputDevice;
@@ -319,6 +320,9 @@ typedef BOOL (SwWrtShell:: *FNSimpleMove)();
void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
BOOL UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
+ // new fields
+ BOOL UpdateField( sw::mark::IFieldmark &fieldBM);
+
// Numerierung und Bullets
/**
Turns on numbering or bullets.
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index 65e6aa20f546..05191276e0d0 100644
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -70,7 +70,7 @@
#include <edtwin.hxx>
#include <crsskip.hxx>
#include <ndtxt.hxx>
-
+#include <vcl/lstbox.hxx>
#include <cmdid.h>
#include <globals.hrc>
#include <comcore.hrc> // STR_MULT_INTERACT_SPELL_WARN
@@ -97,10 +97,13 @@
#include <svx/dialogs.hrc>
#include <svtools/langtab.hxx>
#include <unomid.h>
+#include <IMark.hxx>
+#include <xmloff/odffields.hxx>
#include <memory>
#include <editeng/editerr.hxx>
+using namespace sw::mark;
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -916,3 +919,142 @@ sal_Bool SwView::ExecSmartTagPopup( const Point& rPt )
return bRet;
}
+
+
+class SwFieldPopup : public PopupMenu
+{
+public:
+ SwFieldPopup() {
+ InsertItem(1, ::rtl::OUString::createFromAscii("Hello"));
+ }
+};
+
+class SwFieldListBox : public ListBox
+{
+public:
+ SwFieldListBox(Window* pParent) : ListBox(pParent /*, WB_DROPDOWN*/) {
+ }
+
+ void *GetImplWin() {
+ return NULL; //FIXME!!!
+// return mpImplWin;
+ }
+
+protected:
+ virtual void LoseFocus() {
+// printf("ListBox: lose focus!!\n");
+ ListBox::LoseFocus();
+ }
+
+ virtual void Select() {
+// printf("SELECT!!! IsTravelSelect=%i\n", IsTravelSelect());
+ ListBox::Select();
+ }
+};
+
+class SwFieldDialog : public Dialog
+{
+private:
+ SwFieldListBox aListBox;
+ Edit aText;
+ int selection;
+
+ DECL_LINK( MyListBoxHandler, ListBox * );
+
+public:
+ SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) {
+
+ assert(fieldBM!=NULL);
+ if (fieldBM!=NULL) {
+ const IFieldmark::parameter_map_t* const pParameters = fieldBM->GetParameters();
+ IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY));
+ if(pListEntries != pParameters->end())
+ {
+ Sequence< ::rtl::OUString> vListEntries;
+ pListEntries->second >>= vListEntries;
+ for( ::rtl::OUString* pCurrent = vListEntries.getArray();
+ pCurrent != vListEntries.getArray() + vListEntries.getLength();
+ ++pCurrent)
+ {
+ aListBox.InsertEntry(*pCurrent);
+ }
+ }
+ }
+ Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED);
+ lbSize.Width()+=50;
+ lbSize.Height()+=20;
+ aListBox.SetSizePixel(lbSize);
+ aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) );
+ aListBox.Show();
+ aText.SetText(rtl::OUString::createFromAscii("Cancel"));
+ Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED);
+ aText.SetSizePixel(Size(lbSize.Width(), tSize.Height()));
+ aText.SetPosPixel(Point(0, lbSize.Height()));
+ aText.Show();
+ SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height()));
+// SetSizePixel(Size(200, 200));
+ }
+
+ int getSelection() {
+ return selection;
+ }
+protected:
+ /*
+ virtual void LoseFocus() {
+ printf("lose focus!!\n");
+ Dialog::LoseFocus();
+ printf("close:\n");
+ EndDialog(8);
+ }
+ */
+
+ virtual long PreNotify( NotifyEvent& rNEvt ) {
+ if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) {
+ EndDialog(8);
+ return 1;
+ }
+ if (rNEvt.GetType() == EVENT_KEYINPUT) {
+// printf("PreNotify::KEYINPUT\n");
+ }
+ return Dialog::PreNotify(rNEvt);
+ }
+};
+
+IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox )
+{
+// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect());
+ if (pBox->IsTravelSelect()) {
+ return 0;
+ } else {
+ this->selection=pBox->GetSelectEntryPos();
+ EndDialog(9); //@TODO have meaningfull returns...
+ return 1;
+ }
+}
+
+
+BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
+{
+ sal_Bool bRet = sal_False;
+ const sal_Bool bOldViewLock = pWrtShell->IsViewLocked();
+ pWrtShell->LockView( sal_True );
+ pWrtShell->Push();
+
+ bRet=sal_True;
+ const Point aPixPos = GetEditWin().LogicToPixel( rPt );
+
+ SwFieldDialog aFldDlg(pEditWin, fieldBM);
+ aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos));
+
+ /*short ret=*/aFldDlg.Execute();
+ sal_Int32 selection=aFldDlg.getSelection();
+ if (selection>=0) {
+ (*fieldBM->GetParameters())[::rtl::OUString::createFromAscii(ODF_FORMDROPDOWN_RESULT)] = makeAny(selection);
+ }
+
+ pWrtShell->Pop( sal_False );
+ pWrtShell->LockView( bOldViewLock );
+
+ return bRet;
+}
+
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index c3a8ae118f8a..389f6eac69e3 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -108,6 +108,8 @@
#include <paratr.hxx>
#include <ndtxt.hxx>
#include <editeng/acorrcfg.hxx>
+//#include <svx/acorrcfg.hxx>
+#include <IMark.hxx>
// -> #111827#
#include <SwRewriter.hxx>
@@ -122,6 +124,7 @@
#include "PostItMgr.hxx"
+using namespace sw::mark;
using namespace com::sun::star;
#define COMMON_INI_LIST \
@@ -1750,6 +1753,12 @@ SwWrtShell::SwWrtShell( SwWrtShell& rSh, Window *_pWin, SwView &rShell )
SetSfxViewShell( (SfxViewShell *)&rShell );
SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
+
+ // place the cursor on the first field...
+ IFieldmark *pBM = NULL;
+ if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=NULL ) {
+ GotoFieldmark(pBM);
+ }
}
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index a2477349ee44..4d0172a5461b 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -239,6 +239,13 @@ BOOL SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
return bResult;
}
+BOOL SwWrtShell::UpdateField( sw::mark::IFieldmark &fieldBM )
+{
+ return SwEditShell::UpdateField(fieldBM);
+}
+
+
+
// ein Klick aus das angegebene Feld. Der Cursor steht auf diesem.
// Fuehre die vor definierten Aktionen aus.
diff --git a/testautomation/chart2/optional/ch2_lvl1.bas b/testautomation/chart2/optional/ch2_lvl1.bas
index 026ba32f1c6c..7d13d601ec18 100755
--- a/testautomation/chart2/optional/ch2_lvl1.bas
+++ b/testautomation/chart2/optional/ch2_lvl1.bas
@@ -33,14 +33,14 @@
sub main
use "chart2\tools\ch_tools_common.inc"
- use "chart2\tools\ch_tools_select.inc"
+ use "chart2\tools\ch_tools_select.inc"
use "chart2\optional\includes\ch2_lvl1a.inc"
Call hStatusIn ( "Chart2", "ch2_lvl1.bas" )
- Call ch2_lvl1a
+ Call ch2_lvl1a
- Call hStatusOut
+ Call hStatusOut
end sub
diff --git a/testautomation/chart2/optional/includes/ch2_lvl1a.inc b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
index 952c75a37f22..42ee8ff48bd1 100644
--- a/testautomation/chart2/optional/includes/ch2_lvl1a.inc
+++ b/testautomation/chart2/optional/includes/ch2_lvl1a.inc
@@ -33,7 +33,8 @@
sub ch2_lvl1a
- Call tPlotOptions
+ Call tPlotOptions
+ Call tChartShapes
end sub
@@ -143,3 +144,117 @@ testcase tPlotOptions
Call hCloseDocument
endcase
+
+'
+'-------------------------------------------------------------------------
+'
+testcase tChartShapes
+
+ Dim sLocalFile as string
+ Dim sLocalFileXLS as string
+ Dim sFormatXLS as string
+ sLocalFile = convertpath(gOfficepath & "user\work\chartshapes.ods")
+ sLocalFileXLS = convertpath(gOfficepath & "user\work\chartshapes.xls")
+ sFormatXLS = "MS Excel 97"
+
+ printlog " Load simple chart document"
+ if fLoadVerySimpleChartAndSaveLocal() > 0 then
+ warnlog "Loading test document seems to have failed -> Check this out!"
+ goto endsub
+ endif
+ printlog " Select chart using navigator"
+ call fSelectFirstOLE
+ printlog " Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Verify that the drawbar is visible"
+ Kontext "DrawBar"
+
+ qaerrorlog "#i107003# disabled because of bug in toolbars"
+' if Not DrawBar.Exists then
+' Call hToolbarSelect("Drawing", true)
+' endif
+
+ printlog " Insert a shape to the chart by <STRG-RETURN>"
+ Kontext "DrawBar"
+ sleep (1)
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<MOD1 RETURN>",TRUE
+ printlog " Rename inserted shape"
+ Kontext "DocumentChart"
+ sleep (1)
+ DocumentChart.OpenContextMenu
+ sleep (1)
+ hMenuSelectNr (6)
+ Kontext "NameDlgObject"
+ NameField.SetText "ChartShape1"
+ NameDlgObject.OK
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
+ printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Check if shape is still there"
+ Kontext "DocumentChart"
+ DocumentChart.typekeys "<SHIFT TAB>"
+ Sleep (1)
+ Kontext "Toolbar"
+ if ChartElementSelector.GetSelText <> "ChartShape1" then
+ warnlog "Something is wrong with the shape"
+ endif
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog " Save document with the default calc filter"
+ call hFileSaveAsKill ( sLocalFile )
+ printlog " Save document to xls"
+ if NOT hFileSaveAsWithFilterKill ( sLocalFileXLS , sFormatXLS ) then
+ warnlog "Saving test document localy failed -> Aborting"
+ call hCloseDocument
+ goto endsub
+ end if
+ printlog " Close document"
+ call hCloseDocument
+ printlog " Open document"
+ call hFileOpen ( sLocalFile )
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
+ printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Check if shape is still there"
+ Kontext "DocumentChart"
+ DocumentChart.typekeys "<SHIFT TAB>"
+ Sleep (1)
+ Kontext "Toolbar"
+ if ChartElementSelector.GetSelText <> "ChartShape1" then
+ warnlog "Something is wrong with the shape"
+ endif
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog " Close document"
+ Call hCloseDocument
+ call hFileOpen ( sLocalFileXLS )
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
+ printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Check if shape is still there"
+ Kontext "DocumentChart"
+ DocumentChart.typekeys "<SHIFT TAB>"
+ Sleep (1)
+ Kontext "Toolbar"
+ if ChartElementSelector.GetSelText <> "ChartShape1" then
+ warnlog "Something is wrong with the shape"
+ endif
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog " Close document"
+ Call hCloseDocument
+
+endcase
diff --git a/testautomation/chart2/required/ch2_updt_calc.bas b/testautomation/chart2/required/ch2_updt_calc.bas
index 261424c87cd9..7dba15ead84f 100755..100644
--- a/testautomation/chart2/required/ch2_updt_calc.bas
+++ b/testautomation/chart2/required/ch2_updt_calc.bas
@@ -128,7 +128,7 @@ sub main
printlog Chr(13) + "--------- Chart2 Window Menu ---------"
Call tWindowNewWindowAndClose
printLog Chr(13) + "---------- Chart2 Toolbars -----------"
- Call tdummyToolbar
+ Call tDrawBar
printLog Chr(13) + "--------- Chart2 as OLE object ---------"
Call tChartOLE("WRITER")
Call tChartOLE("CALC")
@@ -146,7 +146,7 @@ sub LoadIncludeFiles
use "global\system\includes\master.inc"
use "global\system\includes\gvariabl.inc"
use "global\tools\includes\optional\t_set_standard_controls.inc"
+ use "global\tools\includes\optional\t_ole.inc"
Call GetUseFiles
gApplication = "CALC"
end sub
-
diff --git a/testautomation/chart2/required/includes/ch2_menu.inc b/testautomation/chart2/required/includes/ch2_menu.inc
index 7c24c3857b60..7461fbc1461c 100644
--- a/testautomation/chart2/required/includes/ch2_menu.inc
+++ b/testautomation/chart2/required/includes/ch2_menu.inc
@@ -108,13 +108,13 @@ testcase tMainMenu
end if
call hMenuClose()
- printlog "check if there are 4 items in the VIEW/TOOLBAR menu."
+ printlog "check if there are 5 items in the VIEW/TOOLBAR menu."
DocumentCalc.UseMenu
hMenuSelectNr(3) ' VIEW
hMenuSelectNr(1) ' TOOLBAR
iCount = hMenuItemGetCount()
- if (iCount <> 4) then
- warnlog "There should 4 items in the VIEW/TOOLBAR menu but there are " + iCount + " items."
+ if (iCount <> 5) then
+ warnlog "There should 5 items in the VIEW/TOOLBAR menu but there are " + iCount + " items."
end if
call hMenuClose()
diff --git a/testautomation/chart2/required/includes/ch2_toolbars.inc b/testautomation/chart2/required/includes/ch2_toolbars.inc
index c1cf8f195584..c447078131fc 100644
--- a/testautomation/chart2/required/includes/ch2_toolbars.inc
+++ b/testautomation/chart2/required/includes/ch2_toolbars.inc
@@ -31,11 +31,138 @@
'*
'************************************************************************
'*
-' #1 tdummyToolbar
+' #1 tDrawBar
'*
'\************************************************************************
-testcase tdummyToolbar
- QAErrorLog "Implement test for toolbar features when toolbars are ready"
+testcase tDrawBar
+
+ printlog " Load simple chart document"
+ if fLoadVerySimpleChartAndSaveLocal() > 0 then
+ warnlog "Loading test document seems to have failed -> Check this out!"
+ goto endsub
+ endif
+ printlog " Select chart using navigator"
+ call fSelectFirstOLE
+ printlog " Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Verify that the drawbar is visible"
+ Kontext "DrawBar"
+
+ qaerrorlog "#i107003# disabled because of bug in toolbars"
+' if Not DrawBar.Exists then
+' Call hToolbarSelect("Drawing", true)
+' endif
+
+ printlog " Check if all items on drawbar are available"
+ if DrawBar.GetItemCount <> 16 then
+ warnlog "There are " & DrawBar.GetItemCount & " instead of 16 items on drawbar"
+ endif
+ printlog " Click on every button on the Drawingbar"
+ Auswahl.click
+ Linie.click
+ LineArrowEnd.click
+ Rechteck.click
+ Ellipse.click
+ Freihand.click
+ Textobjekt.click
+ Legende.click
+ BasicShapes.click
+ SymbolShapes.click
+ BlockArrows.click
+ Flowcharts.click
+ Callouts.click
+ Stars.click
+ printlog " Open menubutton BasicShapes"
+ BasicShapes.TearOff
+ Kontext "BasicShapes"
+ printlog " Check that there are 25 BasicShapes"
+ if BasicShapes.GetItemCount <> 25 then
+ warnlog "There are " & BasicShapes.GetItemCount & " instead of 25 BasicShapes"
+ endif
+ BasicShapes.close
+ Kontext "DrawBar"
+ printlog " Open menubutton SymbolShapes"
+ SymbolShapes.TearOff
+ Kontext "SymbolShapes"
+ printlog " Check that there are 20 SymbolShapes"
+ if SymbolShapes.GetItemCount <> 20 then
+ warnlog "There are " & SymbolShapes.GetItemCount & " instead of 25 SymbolShapes"
+ endif
+ SymbolShapes.close
+ Kontext "DrawBar"
+ printlog " Open menubutton BlockArrows"
+ BlockArrows.TearOff
+ Kontext "ArrowShapes"
+ printlog " Check that there are 30 ArrowShapes"
+ if ArrowShapes.GetItemCount <> 30 then
+ warnlog "There are " & ArrowShapes.GetItemCount & " instead of 25 ArrowShapes"
+ endif
+ ArrowShapes.close
+ Kontext "DrawBar"
+ printlog " Open menubutton Flowcharts"
+ Flowcharts.TearOff
+ Kontext "Flowchart"
+ printlog " Check that there are 32 FlowChartShapes"
+ if Flowchart.GetItemCount <> 32 then
+ warnlog "There are " & Flowchart.GetItemCount & " instead of 32 Flowchartshapes"
+ endif
+ Flowchart.close
+ Kontext "DrawBar"
+ printlog " Open menubutton Callouts"
+ Callouts.TearOff
+ Kontext "Callouts"
+ printlog " Check that there are 7 Callouts"
+ if Callouts.GetItemCount <> 7 then
+ warnlog "There are " & Callouts.GetItemCount & " instead of 7 Callouts"
+ endif
+ Callouts.close
+ Kontext "DrawBar"
+ printlog " Open menubutton Stars"
+ Stars.TearOff
+ Kontext "Starshapes"
+ printlog " Check that there are 13 StarShapes"
+ if Starshapes.GetItemCount <> 13 then
+ warnlog "There are " & Starshapes.GetItemCount & " instead of 13 StarShapes"
+ endif
+ Starshapes.close
+ printlog " Insert a shape to the chart by <STRG-RETURN>"
+ Kontext "DrawBar"
+ sleep (1)
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<TAB>",TRUE
+ DrawBar.typekeys "<MOD1 RETURN>",TRUE
+ printlog " Rename inserted shape"
+ Kontext "DocumentChart"
+ DocumentChart.OpenContextMenu
+ sleep (1)
+ hMenuSelectNr (6)
+ sleep (1)
+ Kontext "NameDlgObject"
+ NameField.SetText "ChartShape1"
+ NameDlgObject.OK
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog "Select chart using navigator"
+ call fSelectFirstOLE
+ printlog "Invoke Edit::Object::Edit to enter Inplace Mode"
+ EditObjectEdit
+ printlog " Check if shape is still there"
+ Kontext "DocumentChart"
+ DocumentChart.typekeys "<SHIFT TAB>",TRUE
+ Sleep (1)
+ Kontext "Toolbar"
+ if ChartElementSelector.GetSelText <> "ChartShape1" then
+ warnlog "Something is wrong with the shape"
+ endif
+ printlog " Leave Chart"
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "<Escape>"
+ printlog " Close document"
+ Call hCloseDocument
+
endcase
diff --git a/testautomation/chart2/tools/ch_tools_common.inc b/testautomation/chart2/tools/ch_tools_common.inc
index 67f67d3e3f23..311e8c354f74 100644
--- a/testautomation/chart2/tools/ch_tools_common.inc
+++ b/testautomation/chart2/tools/ch_tools_common.inc
@@ -42,6 +42,8 @@
sub fInsertOLE as BOOLEAN
'Insert Chart OLE in Document
+ 'Get localised OLE names
+ call GetOleDefaultNames()
fInsertOLE = FALSE
'/// Insert / Object / OLE
InsertObjectOLEObject
@@ -51,9 +53,8 @@ sub fInsertOLE as BOOLEAN
if Objekttyp.getItemcount < 1 then
warnlog "There are no OLE-Objects in the listbox"
endif
- '/// Select 3rd entry in listbox (which should be the chart)
- Objekttyp.TypeKeys "<HOME>"
- Objekttyp.TypeKeys "<Down>", 2
+ '/// Select chart in listbox
+ Objekttyp.Select gOLEChart
'/// Quit dialog using OK
OLEObjektEinfuegen.OK
sleep(2)
diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc
index b5c1f12a101d..3fe642ea8ec6 100644
--- a/testautomation/framework/optional/includes/basic_delete_modules.inc
+++ b/testautomation/framework/optional/includes/basic_delete_modules.inc
@@ -37,20 +37,20 @@ testcase tDeleteModulesAtRunningBasic
dim brc as boolean
const MAX_WAIT = 3000
-
+ dim iMenuItemCount as integer
printlog( "Open a new writer-doc" )
gApplication = "WRITER"
-
Call hNewDocument()
- printlog( "Create a new module " )
+ printlog( "Open the BASIC Organizer" )
brc = hOpenBasicOrganizerFromDoc()
if ( not brc ) then
warnlog( "Unable to open BASIC organizer for the document" )
goto endsub
endif
-
+
+ printlog( "Create a new module for the current document" )
brc = hCreateModuleForDoc()
if ( not brc ) then
warnlog( "Unable to create a basic module for the document" )
@@ -76,15 +76,14 @@ testcase tDeleteModulesAtRunningBasic
Tabbar.OpenContextMenu()
try
- if ( hMenuItemGetCount() = 5 ) then
- warnlog( "#i101972# - Disabled entries are shown in context menu on tab bar" )
- end if
-
-
- if ( hMenuItemGetCount() = 3 ) then
- warnlog( "Delete is active in context menu for a running macro => BUG!" )
- end if
-
+ iMenuItemCount = hMenuItemGetCount()
+
+ select case ( iMenuItemCount )
+ case 2 : printlog( "Correct number of items in menu: " & iMenuItemCount )
+ case 3 : warnlog ( "Delete is active in context menu for a running macro => BUG!" )
+ case 5 : warnlog ( "#i101972# - Disabled entries are shown in context menu on tab bar" )
+ default : warnlog ( "Incorrect itemcount in context menu: " & iMenuItemCount )
+ end select
catch
warnlog( "Unable to retrieve the number of menuitems" )
endcatch
@@ -98,8 +97,7 @@ testcase tDeleteModulesAtRunningBasic
warnlog( "Slot not finished, timeout reached" )
endif
- Call hCloseDocument()
- Call hCloseDocument()
+ Call hFileCloseAll()
endcase
diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc
index 47173efb8ef5..d5d12b1aa12f 100644
--- a/testautomation/framework/optional/includes/basic_documents.inc
+++ b/testautomation/framework/optional/includes/basic_documents.inc
@@ -35,12 +35,8 @@ private const IDOCS = 5
testcase tBasicDocuments
- qaerrorlog( "#i90435# Untitled documents unnumbered in BASIC organizer" )
- goto endsub
-
const CFN = "tBasicDocuments::"
-
dim brc as boolean
dim sFileWriter as string
dim sFileCalc as string
@@ -55,61 +51,66 @@ testcase tBasicDocuments
' in the Macro Organizer
const DOC_NAME = "basic"
- printlog( "" )
+ printlog( "Set macro security level to medium" )
iSecLevel = hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_MEDIUM )
-
+
+ printlog( "Open one single unchanged Writer document" )
hInitSingleDoc()
kontext "DocumentWriter"
DocumentWriter.typeKeys( "tBasicDocuments - initial document - discard after test" )
gApplication = "WRITER"
- printlog( "" )
+ printlog( "Create a Writer workfilename (build path and filename)" )
brc = hCreateBasicWorkFiles()
sFileWriter = hGetBasicWorkFile( "current" )
gApplication = "CALC"
- printlog( "" )
+ printlog( "Create a Calc workfilename (build path and filename)" )
brc = hCreateBasicWorkFiles()
sFileCalc = hGetBasicWorkFile( "current" )
- printlog( "" )
+ printlog( "Open the writer file" )
brc = hFileOpen( sFileWriter )
brc = hAllowMacroExecution()
if ( not brc ) then
warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
endif
+
+ printlog( "Open the Calc file" )
brc = hFileOpen( sFileCalc )
brc = hAllowMacroExecution()
if ( not brc ) then
warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
endif
- printlog( "" )
+ printlog( "Open the BASIC organizer" )
brc = hOpenBasicOrganizerFromDoc()
+ printlog( "Retreive the names of all nodes from the treelist" )
hGetVisibleNodeNames( MakroAus , cNodeListA() )
- printlog( "" )
+ printlog( "Verify that both documents are listed - one Writer, one Calc with identical names" )
iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME )
if ( iHitCount <> 2 ) then
warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
endif
-
+
+ printlog( "Click Manage..." )
verwalten.click()
- printlog( "" )
+ printlog( "Get the nodes list from the object organizer tabs - first tab" )
brc = hSelectBasicObjectOrganizerTab( 1 )
ListAllDelete( cNodeListB() )
hGetVisibleNodeNames( ModulListe , cNodeListB() )
- printlog( "" )
+ printlog( "Verify that both documents are listed on both relevant tabpages" )
iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME )
if ( iHitCount <> 2 ) then
warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
endif
- printlog( "" )
+ printlog( "Switch to second tab" )
brc = hSelectBasicObjectOrganizerTab( 2 )
ListAllDelete( cNodeListB() )
hGetVisibleNodeNames( ModuleList , cNodeListB() )
@@ -118,34 +119,33 @@ testcase tBasicDocuments
hListPrint( cNodeListB() , "List of objects found in treelist" )
endif
- printlog( "" )
+ printlog( "Verify" )
iHitCount = hCountMatchesInList( cNodeListB() , DOC_NAME )
if ( iHitCount <> 2 ) then
warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
endif
- printlog( "" )
+ printlog( "Third tab (should not list the document" )
brc = hSelectBasicObjectOrganizerTab( 3 )
brc = hTestLibraryListBox( cNodeListA() )
- printlog( "" )
printlog( CFN & "Closing dialogs..." )
TabBibliotheken.cancel()
-
+
+ printlog( "Cleanup: Close macro organizer" )
Kontext "Makro"
Makro.cancel()
- brc = hDestroyDocument()
- brc = hDestroyDocument()
-
+ printlog( "Cleanup: Close all files" )
+ hFileCloseAll()
+
+ printlog( "Cleanup: Remove workfiles" )
brc = hDeleteFile( sFileWriter )
brc = hDeleteFile( sFileCalc )
-
+
+ printlog( "Rest macro security level" )
hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
- hDestroyDocument()
-
-
endcase
'*******************************************************************************
@@ -154,15 +154,11 @@ function hTestLibraryListBox( cNodeList() ) as boolean
const CFN = "hTestLibraryListBox::"
-
-
dim iEntry as integer
dim cEntry as string
- dim brc as boolean
+ dim brc as boolean : brc = true
dim irc as integer
- brc = true
-
if ( bibliothek.getItemCount() <> IDOCS ) then
warnlog( CFN & "Incorrect number of items in listbox" )
printlog( CFN & "Expected: " & bibliothek.getItemCount() )
@@ -186,5 +182,4 @@ function hTestLibraryListBox( cNodeList() ) as boolean
next iEntry
-
end function
diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc
index 5abdade49ccf..7ea54855eb5d 100644
--- a/testautomation/framework/optional/includes/f_usage_tracking.inc
+++ b/testautomation/framework/optional/includes/f_usage_tracking.inc
@@ -31,22 +31,19 @@
'*
'\******************************************************************************
-' Concept
-' The usage tracking functionality is disabled during test init.
-' Configuration is done in Tools/Options. There a tabpage must exist that
-' offers the functionality to enable/disable tracking and to show what has
-' logged.
-
private const LOGFILE = "user\temp\Feedback\Current.csv"
'*******************************************************************************
testcase tUsageTracking1
- printlog( "Test case 1: Presence of the Usage Tracking featureset (API)" )
+ printlog( "Test case 1: Presence of the Usage Tracking featureset" )
+
+ ' Broken in CWS sb111'
+ ' Currently missing: Check for Office brand, StarOffice should always have OOoImp enabled'
if ( not gOOoImprovementIsEnabled ) then
- warnlog( "Could not access API for usage tracking program" )
+ warnlog( "Usage tracking program is not enabled for this build" )
endif
endcase
@@ -87,14 +84,20 @@ testcase tUsageTracking3
if ( TabOOoImprovement.exists( 1 ) ) then
if ( not ParticipateNo.isChecked() ) then
- qaerrorlog( "#i98736# - UI should reflect current status for usage tracking: No" )
+ warnlog( "#i98736# - UI should reflect current status for usage tracking: No" )
endif
if ( ShowData.isEnabled() ) then
- qaerrorlog( "#i97340# - Show data button should not be enabled if nothing is logged" )
+ warnlog( "#i97340# - Show data button should not be enabled if nothing is logged" )
ShowData.click()
+ kontext "FilterAuswahl"
+ if ( FilterAuswahl.exists( 2 ) ) then
+ warnlog( "Filter Selection dialog is not expected at this point, ")
+ FilterAuswahl.cancel()
+ endif
+
kontext "Active"
if ( Active.exists( 2 ) ) then
qaerrorlog( "Messagebox not required as control should not be enabled (see #i97340#)" )
@@ -118,7 +121,7 @@ testcase tUsageTracking3
else
warnlog( "OOo Improvement Tabpage (Tools/Options) is missing" )
endif
-
+
kontext "OptionenDlg"
OptionenDlg.cancel()
diff --git a/testautomation/framework/optional/includes/help_bookmarks.inc b/testautomation/framework/optional/includes/help_bookmarks.inc
index bfa2384c8eca..c4aebad1af9d 100644
--- a/testautomation/framework/optional/includes/help_bookmarks.inc
+++ b/testautomation/framework/optional/includes/help_bookmarks.inc
@@ -155,23 +155,27 @@ testcase tHelpBookmarks
printlog( "Verify that the renamed bookmark still exists")
Kontext "BookmarksPage"
- Bookmarks.select( 1 )
- cStringBookmark = Bookmarks.getSelText()
- if ( cStringBookmark = MYBOOKMARK ) then
- printlog( "The bookmark has the correct name")
- else
- warnlog( "Incorrect name displayed in bookmarks list")
- endif
-
- printlog( "Delete the Bookmark (using context menu)")
- hUseBookmarksContextMenu( "delete")
-
- printlog( "verify that the bookmark has been deleted (none left)")
- kontext "Bookmarks"
- if ( bookmarks.getItemCount = 0 ) then
- printlog( "Bookmark has been deleted")
+ if ( Bookmarks.getItemCount() > 0 ) then
+ Bookmarks.select( 1 )
+ cStringBookmark = Bookmarks.getSelText()
+ if ( cStringBookmark = MYBOOKMARK ) then
+ printlog( "The bookmark has the correct name")
+ else
+ warnlog( "Incorrect name displayed in bookmarks list")
+ endif
+
+ printlog( "Delete the Bookmark (using context menu)")
+ hUseBookmarksContextMenu( "delete")
+
+ printlog( "verify that the bookmark has been deleted (none left)")
+ kontext "Bookmarks"
+ if ( bookmarks.getItemCount = 0 ) then
+ printlog( "Bookmark has been deleted")
+ else
+ warnlog( "There are bookmarks left over, please check")
+ endif
else
- warnlog( "There are bookmarks left over, please check")
+ warnlog( "Bookmarks are lost on program restart")
endif
printlog( "Close the help")
diff --git a/testautomation/framework/optional/includes/ole_1.inc b/testautomation/framework/optional/includes/ole_1.inc
index 3e5d7af304a1..a90d517620a1 100644
--- a/testautomation/framework/optional/includes/ole_1.inc
+++ b/testautomation/framework/optional/includes/ole_1.inc
@@ -41,13 +41,13 @@ testcase tOLEWriter
Call hNewDocument
PrintLog "- Writer : Chart without table"
- InsertObjectChart
- sleep(4)
+ hUseAsyncSlot( "InsertObjectChart" )
+
Kontext "DocumentChart"
- if DocumentChart.Exists(5) then
+ if ( DocumentChart.Exists( 5 ) ) then
FormatChartType
Kontext "ChartType"
- if ChartType.Exists(5) then
+ if ( ChartType.Exists( 5 ) ) then
ChartType.Cancel
else
warnlog "Chart Type dialog did bot occour."
@@ -56,18 +56,22 @@ testcase tOLEWriter
DocumentChart.TypeKeys "<ESCAPE>"
Kontext "DocumentWriter"
DocumentWriter.TypeKeys "<DELETE>"
- sleep(1)
else
warnlog "Chart has not been inserted."
end if
- sleep(4)
+
PrintLog "- Writer : Chart out of a table only with numbers"
- InsertTableWriter
+ hUseAsyncSlot( "InsertTableWriter" )
Kontext "TabelleEinfuegenWriter"
- Spalten.SetText "3"
- Zeilen.SetText "10"
- TabelleEinfuegenWriter.OK
+ if ( TabelleEinfuegenWriter.exists( 1 ) ) then
+ Spalten.SetText "3"
+ Zeilen.SetText "10"
+ TabelleEinfuegenWriter.OK
+ TabelleEinfuegenWriter.notExists( 2 )
+ else
+ warnlog( "Dialog <TabelleEinfuegenWriter> did not open" )
+ endif
Kontext "DocumentWriter"
for i%=1 to 10
@@ -80,7 +84,7 @@ testcase tOLEWriter
DocumentWriter.TypeKeys "<Left>", 3
next i%
- InsertObjectChart
+ hUseAsyncSlot( "InsertObjectChart" )
hStepThroughChartWizard()
Kontext "DocumentChart"
@@ -90,16 +94,19 @@ testcase tOLEWriter
Sleep 1
DocumentWriter.TypeKeys "<Down>", 20
DocumentWriter.TypeKeys "<Return>", 2
- Sleep 1
-
PrintLog "- Writer : Chart out of a table only with chars"
- InsertTableWriter
+ hUseAsyncSlot( "InsertTableWriter" )
Kontext "TabelleEinfuegenWriter"
- Spalten.SetText "3"
- Zeilen.SetText "10"
- TabelleEinfuegenWriter.OK
+ if ( TabelleEinfuegenWriter.exists( 1 ) ) then
+ Spalten.SetText "3"
+ Zeilen.SetText "10"
+ TabelleEinfuegenWriter.OK
+ TabelleEinfuegenWriter.notExists( 2 )
+ else
+ warnlog( "Dialog <TabelleEinfuegenWriter> did not open" )
+ endif
Kontext "DocumentWriter"
for i%=1 to 10
@@ -112,8 +119,7 @@ testcase tOLEWriter
DocumentWriter.TypeKeys "<Left>", 3
next i%
- InsertObjectChart
-
+ hUseAsyncSlot( "InsertObjectChart" )
hStepThroughChartWizard()
Kontext "DocumentChart"
@@ -123,30 +129,32 @@ testcase tOLEWriter
Sleep 1
DocumentWriter.TypeKeys "<Down>", 20
DocumentWriter.TypeKeys "<Return>", 2
- Sleep 1
PrintLog "- Writer : Math"
- InsertObjectFormulaWriter
+ hUseAsyncSlot( "InsertObjectFormulaWriter" )
gMouseClick ( 1, 1)
Kontext "DocumentWriter"
DocumentWriter.TypeKeys "<Delete>"
- Sleep 1
PrintLog "- Writer : floating frame"
+ hUseAsyncSlot( "InsertFloatingFrame" )
- 'warnlog( "#148094# - Crash when deselecting floating frame in Writer" )
-
- InsertFloatingFrame
-
+ printlog( "Properties dialog for floating frame should open" )
Kontext "TabEigenschaften"
- FrameName.SetText "Hallo"
- Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
-
- TabEigenschaften.OK
- Sleep 2
+ if ( TabEigenschaften.exists( 1 ) and TabEigenschaften.isVisible() ) then
+
+ printlog( "Name the floating frame, close the dialog" )
+ FrameName.SetText "Hallo"
+ Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
+
+ TabEigenschaften.OK
+ TabEigenSchaften.notExists( 2 )
+
+ endif
+ printlog( "Close the writer document" )
Kontext "DocumentWriter"
DocumentWriter.TypeKeys "<Delete>"
Sleep 1
@@ -327,7 +335,7 @@ testcase tOLEDraw
MenuSelect(0)
try
- InsertObjectChart
+ hUseAsyncSlot( "InsertObjectChart" )
Sleep ( 2 )
Kontext "DocumentChart"
@@ -407,7 +415,7 @@ testcase tOLEImpress
PrintLog "- Impress : Chart"
try
- InsertObjectChart
+ hUseAsyncSlot( "InsertObjectChart" )
sleep 2
gMouseClick ( 1 , 1 )
diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc
index 33811d35a7b7..eaceab3691b9 100644
--- a/testautomation/framework/optional/includes/security_recommend_password.inc
+++ b/testautomation/framework/optional/includes/security_recommend_password.inc
@@ -81,7 +81,6 @@ testcase tRecommendPassword( filetypeID as string )
if ( rc = 0 ) then
if AutomatischeDateinamenserweiterung.Exists then
- QAErrorLog "OBSOLETE: Check-box Automatic file extension in file dialog will be removed soon!"
AutomatischeDateinamenserweiterung.Uncheck
endif
diff --git a/testautomation/framework/required/includes/basic_macroassignment.inc b/testautomation/framework/required/includes/basic_macroassignment.inc
index 3d0d09fee347..2db0c680967c 100644
--- a/testautomation/framework/required/includes/basic_macroassignment.inc
+++ b/testautomation/framework/required/includes/basic_macroassignment.inc
@@ -100,20 +100,28 @@ testcase tUpdtMacroAssignment
Kontext "AssignMacro"
printlog( "Current Dialog: Assign Macro" )
- call dialogtest( AssignMacro )
- printlog( "Click the Assign-Button on the Macro-Assignment-Dialog" )
- AssignButton.click()
-
- Kontext "ScriptSelector"
- printlog( "Current Dialog: ScriptSelector" )
- call dialogtest( ScriptSelector )
- printlog( "Cancel the scriptselector" )
- ScriptSelector.cancel()
-
- Kontext "AssignMacro"
- printlog( "Current Dialog: Assign Macro" )
- printlog( "Cancel the Script-Assignement-Dialog" )
- AssignMacro.cancel()
+ if ( AssignMacro.exists( 1 ) ) then
+ call dialogtest( AssignMacro )
+ printlog( "Click the Assign-Button on the Macro-Assignment-Dialog" )
+ AssignButton.click()
+
+ Kontext "ScriptSelector"
+ printlog( "Current Dialog: ScriptSelector" )
+ if ( ScriptSelector.exists( 1 ) ) then
+ call dialogtest( ScriptSelector )
+ printlog( "Cancel the scriptselector" )
+ ScriptSelector.cancel()
+ else
+ warnlog( "Failed to open/access <ScriptSelector>" )
+ endif
+
+ Kontext "AssignMacro"
+ printlog( "Current Dialog: Assign Macro" )
+ printlog( "Cancel the Script-Assignement-Dialog" )
+ AssignMacro.cancel()
+ else
+ warnlog( "Failed to open/access <AssignMacro> dialog" )
+ endif
endif
diff --git a/testautomation/framework/tools/includes/help_tools.inc b/testautomation/framework/tools/includes/help_tools.inc
index 613aadc17393..ed55c319fd40 100644
--- a/testautomation/framework/tools/includes/help_tools.inc
+++ b/testautomation/framework/tools/includes/help_tools.inc
@@ -50,51 +50,25 @@ function hOpenHelp() as boolean
'///<u>Description</u>:
'///<ul>
+
const CFN = "hOpenHelp::"
- dim iTry as integer
- dim brc as boolean
- brc = false
-
- printlog( CFN & "Enter" )
+ HelpContents
- '///+<li>Open the help Browser using the slot</li>
- try
- HelpContents
- catch
- printlog( CFN & "Failed to open help, slot failed" )
- hOpenHelp() = false
- exit function
- endcatch
-
- '///+<li>Verify that the help is indeed open (max 10 sec.)</li>
- Kontext "StarOfficeHelp"
- for iTry = 1 to 10
-
- if ( StarOfficeHelp.exists() ) then
- brc = true
- exit for
- endif
-
- sleep( 1 )
-
- next iTry
-
- '///+<li>Print a status to the log, return TRUE or FALSE</li>
- if ( brc ) then
- printlog( CFN & "Exit: Help is open" )
+ if ( WaitSlot( 3000 ) <> WSFinished ) then
+ printlog( CFN & "Failed to open help" )
+ hOpenHelp() = FALSE
else
- printlog( CFN & "Exit: Help is not open" )
- kontext "Active"
- if ( Active.exists( 2 ) ) then
- printlog( "Msgbox: " & Active.getText()
- Active.ok()
+ kontext "StarOfficeHelp"
+ if ( StarOfficeHelp.exists() ) then
+ printlog( CFN & "Help was opened" )
+ hOpenHelp() = TRUE
+ else
+ printlog( CFN & "Help was not opened" )
+ hOpenHelp() = FALSE
endif
endif
-
- '///</ul>
- hOpenHelp() = brc
-
+
end function
'*******************************************************************************
@@ -116,38 +90,26 @@ function hCloseHelp() as boolean
'///</ul>
'///</ol>
- '///<u>Description</u>:
- '///<ul>
const CFN = "hCloseHelp::"
- dim brc as boolean
-
- printlog( CFN & "Enter" )
-
- '///+<li>Verify that the Help Browser is Open</li>
- kontext "StarOfficeHelp"
- if ( not StarOfficeHelp.exists() ) then
- printlog( CFN & "Help is not open" )
- hCloseHelp() = false
- exit function
- endif
-
- '///+<li>Close the Help Browser by typing CTRL+F4</li>
- StarOfficeHelp.typeKeys( "<MOD1 F4>" )
- '///+<li>Verify that the Help Browser is not open (anymore)</li>
kontext "StarOfficeHelp"
if ( StarOfficeHelp.exists() ) then
- printlog( CFN & "Exit: Help is still open" )
- brc = false
+
+ hUseAsyncSlot( "FileClose")
+ StarOfficeHelp.notExists( 3 )
+
+ if ( StarOfficeHelp.Exists() ) then
+ printlog( CFN & "Help was not closed")
+ hCloseHelp() = FALSE
+ else
+ printlog( CFN & "Help was closed")
+ hCloseHelp() = TRUE
+ endif
else
- printlog( CFN & "Exit: Help has been closed" )
- brc = true
+ printlog( CFN & "Help is not open, no action taken")
+ hCloseHelp() = TRUE
endif
- '///+<li>Return TRUE or FALSE</li>
- '///</ul>
- hCloseHelp() = brc
-
end function
'******************************************************************************
diff --git a/testautomation/framework/tools/includes/pbrowser_tools.inc b/testautomation/framework/tools/includes/pbrowser_tools.inc
index 47eb5e933985..fefc739e48ea 100644
--- a/testautomation/framework/tools/includes/pbrowser_tools.inc
+++ b/testautomation/framework/tools/includes/pbrowser_tools.inc
@@ -61,36 +61,38 @@ function hOpenPropertyBrowser() as boolean
'///<ul>
const CFN = "hOpenPropertyBrowser::"
+ dim irc as integer
'///+<li>Open the property browser (call slot)</li>
- try
- ContextProperties
-
- '///+<li>Verify that the property browser is open</li>
- kontext "ControlPropertiesTabControl"
- if ( ControlPropertiesTabControl.exists( 2 ) ) then
-
- '///+<li>Activate General-tabpage</li>
- ControlPropertiesTabControl.setPage( TabGeneralControl )
-
- '///+<li>Verify that the General-tabpage is visible</li>
- kontext "TabGeneralControl"
- if ( TabGeneralControl.isVisible() ) then
- printlog( CFN & "ok" )
- hOpenPropertyBrowser() = true
- else
- printlog( CFN & "General-tab is not visible." )
- hOpenPropertyBrowser() = false
- endif
- else
- printlog( CFN & "Could not open property browser" )
- hOpenPropertyBrowser() = false
- endif
- catch
+ irc = hUseAsyncSlot( "ContextProperties" )
+
+ ' Check that the slot did indeed get executed. If not: Warn and exit
+ if ( irc = -1 ) then
+ warnlog( CFN & "hUseAsyncSlot timed out for <ContextProperties>" )
hOpenPropertyBrowser() = false
- printlog( CFN & "Slot <ContextProperties> not available" )
- endcatch
+ exit function
+ endif
+ '///+<li>Verify that the property browser is open</li>
+ kontext "ControlPropertiesTabControl"
+ if ( ControlPropertiesTabControl.exists( 2 ) ) then
+
+ '///+<li>Activate General-tabpage</li>
+ ControlPropertiesTabControl.setPage( TabGeneralControl )
+
+ '///+<li>Verify that the General-tabpage is visible</li>
+ kontext "TabGeneralControl"
+ if ( TabGeneralControl.isVisible() ) then
+ printlog( CFN & "ok" )
+ hOpenPropertyBrowser() = true
+ else
+ printlog( CFN & "General-tab is not visible." )
+ hOpenPropertyBrowser() = false
+ endif
+ else
+ printlog( CFN & "Could not open property browser" )
+ hOpenPropertyBrowser() = false
+ endif
'///</ul>
end function
diff --git a/testautomation/global/sid/e_all.sid b/testautomation/global/sid/e_all.sid
index 82b161d7f51d..ee67a5f57624 100644..100755
--- a/testautomation/global/sid/e_all.sid
+++ b/testautomation/global/sid/e_all.sid
@@ -954,3 +954,6 @@ MigrateMacros .uno:DBMigrateScripts
' *** UNO Slots for Basic IDE ***
' ****
ContextProperties SID_SHOW_PROPERTYBROWSER
+
+' Crash the office, allows to provide an automated test for the crash reporter
+Crash .uno:Crash
diff --git a/testautomation/global/system/includes/iniinfo.inc b/testautomation/global/system/includes/iniinfo.inc
index 24a0812a8ea0..a5ef11521e5f 100644
--- a/testautomation/global/system/includes/iniinfo.inc
+++ b/testautomation/global/system/includes/iniinfo.inc
@@ -298,50 +298,11 @@ end function
sub GetLanguageInformation
'/// Extracts the language information from <i>Setup.xcu</i>.
'/// <u>note</u>: It uses the <b>fgetL10Nvalue</b>.
- Dim i as integer
- Dim iTimeOut as integer
Dim sLanOutIni as string
- Dim SetupXML as String
- Dim ChildsOfSetupNodes as integer
- Dim ArtOfInst as string
- Dim SetupXMLNet as string
- Dim SetupXMLDefault as string
- dim SetupXcuPath as string
-
- SetupXcuPath = ConvertPath("share\registry\data\org\openoffice\Setup.xcu")
- SetupXML = gOfficePath & ConvertPath("user\registry\data\org\openoffice\Setup.xcu")
-
- if gNetzInst = TRUE then
- SetupXMLNet = gNetzOfficePath & SetupXcuPath
- ArtOfInst = "NET- / Workstation Inst."
- else
- SetupXMLDefault = gOfficePath & SetupXcuPath
- ArtOfInst = "FAT Inst."
- end if
-
- ' Issue #i97875 (JSK) experimental delay
- ' If we're too fast we might encounter that the Setup.xcu is not created yet.
- ' So we retry a couple of times
- while( not FileExists( SetupXML ) )
- iTimeOut = iTimeOut + 1
- if ( iTimeOut = 10 ) then
- warnlog "GetLanguageInformation(" & ArtOfInst & "): " & SetupXML & " not found => can't get the correct Office-Language! Default (01) will be used."
- iSprache = 01
- Exit sub
- endif
- wait( 100 )
- wend
' function 'fgetL10Nvalue' is also in this library
- sLanOutIni = fgetL10Nvalue(SetupXML)
+ sLanOutIni = fgetL10Nvalue()
' BugID 98315 -> looking in networkpath for the language until bug will be fixed.
- if sLanOutIni = "" and gNetzInst = TRUE then
- sLanOutIni = fgetL10Nvalue(SetupXMLNet)
- end if
- ' It is an English FAT version 645m9s2 or higher.
- if sLanOutIni = "" and gNetzInst = FALSE then
- sLanOutIni = fgetL10Nvalue(SetupXMLDefault)
- end if
if sLanOutIni = "" then
warnlog "=> default is now 01 = en_US"
@@ -693,54 +654,15 @@ end function
'-------------------------------------------------------------------------
-function fgetL10Nvalue ( setupxcu as string) as string
-'/// Gets the value of the child from
-'///+ <ul><li>node: oor:name=&quot;L10N&quot;<ul><li>node: oor:name = &quot;ooLocale&quot;</li><ul><li>element: value</li></ul></ul></li></ul>
-'///+ in a file (normaly <b>Setup.xcu</b> in network path or installation path).
-'/// <u>Note</u>: The structure is hard coded and specified. A change must be announced by feature mail!
-'/// <u><i>Description</i></u>:
- Dim i as integer
- Dim ChildsOfSetupNodes as integer
-
- fgetL10Nvalue = ""
-
-'///<ul><li>Open the file given as parameter.</li>
- SAXReadFile(setupxcu)
-'///+<li>Go to the DOM (Document Object Model) root.</li>
- SAXSeekElement("/")
-'///+<li>Go <b>into</b> the first <b>node</b> of the tree.</li>
- SAXSeekElement(1)
-'///+<li>Get the <b>count of children</b> (nodes/elements) in that node.</li>
- ChildsOfSetupNodes = SAXGetChildCount
- for i = 1 to ChildsOfSetupNodes
-'///+<li>Run in a for next loop of going <b>into</b> the next node and existing it until ...</li>
- SAXSeekElement(i)
-'///+<li>...the <i>oor:name</i> attribute value is identical to &quot;L10N&quot;</li>
- if SaxGetAttributeValue("oor:name") = "L10N" then
-'///+<li>Go <b>into</b> the next node (&quot;prop&quot;)</li>
- SAXSeekElement("prop")
-'///+<li>If the attribute value of &quot;oor:name&quot; is identical to &quot;ooLocale&quot;...</li>
- if SAXgetAttributeValue("oor:name") = "ooLocale" then
-'///+<li>go <b>into</b> that node and also into the next one, named &quot;value&quot;.</li>
- SAXSeekElement("value")
-'///+<li>Go <b>into</b> the next node - a <i>node type</i> <b>character</b>...</li>
- SAXSeekElement(1)
- if SAXGetNodeType = NodeTypeCharacter then
-'///+<li>...and get the characters out in the string which will be returned from this function.</li>
- fgetL10Nvalue = SAXGetChars
-'///+<li><i>Release()</i> the DOM.</li>
- SAXRelease()
-'///+<li>Exit the function.</li></ul>
- Exit function
- end if
- else
- SAXRelease()
-'/// If the result is empty exit the function without warning.</ul>
- Exit function
- end if
- end if
- SAXSeekElement(0)
- next i
+function fgetL10Nvalue() as string
+ dim args(0) as new com.sun.star.beans.NamedValue
+ args(0).Name = "nodepath"
+ args(0).Value = "/org.openoffice.Setup/L10N"
+ fgetL10Nvalue = hGetUNOService()._
+ createInstance("com.sun.star.configuration.DefaultProvider")._
+ createInstanceWithArguments(_
+ "com.sun.star.configuration.ConfigurationAccess", args())._
+ getByName("ooLocale")
end function
'-------------------------------------------------------------------------
diff --git a/testautomation/global/system/includes/master.inc b/testautomation/global/system/includes/master.inc
index bd750c4a4d21..6f8acdf04853 100644
--- a/testautomation/global/system/includes/master.inc
+++ b/testautomation/global/system/includes/master.inc
@@ -923,7 +923,7 @@ sub mMakeGeneralOptionsAPI
endcatch
'///+ OOo Improvement - only if BUILD_SPECIAL is set we have this file created.
- sTempPath = gOfficeBasisPath & "share/registry/modules/org/openoffice/Office/Jobs/Jobs-oooimprovement.xcu"
+ sTempPath = gOfficeBasisPath & "share/registry/oooimprovement.xcd"
sTempPath = ConvertPath( sTempPath )
if ( FileExists( sTempPath ) ) then
diff --git a/testautomation/global/tools/includes/optional/t_filetools.inc b/testautomation/global/tools/includes/optional/t_filetools.inc
index c113c6f2e353..76cbb35b153c 100644
--- a/testautomation/global/tools/includes/optional/t_filetools.inc
+++ b/testautomation/global/tools/includes/optional/t_filetools.inc
@@ -143,17 +143,17 @@ function hHandleActivesOnLoad( iTries as integer , iAdd as integer ) as boolean
kontext "Active"
if ( Active.exists( 1 ) ) then
if ( Active.getButtonCount() = 2 ) then
- printlog( CFN & "Probably the dreaded <File corrupted warning>" )
+ printlog( CFN & "<Update links dialog> or <File corruption warning>" )
active.yes()
hFileWait( FALSE )
kontext "Active"
if ( Active.exists( 2 ) ) then
+ qaerrorlog( "#105670# - File corruption warning, the template is broken" )
qaerrorlog( CFN & "Trying to recover." )
Active.ok()
hHandleActivesOnLoad() = FALSE
exit function
endif
- qaerrorlog( "#105670# - File corruption warning, the template is broken" )
endif
endif
diff --git a/testautomation/global/tools/includes/required/t_doc1.inc b/testautomation/global/tools/includes/required/t_doc1.inc
index d8af032955cd..ed74336dfc72 100644
--- a/testautomation/global/tools/includes/required/t_doc1.inc
+++ b/testautomation/global/tools/includes/required/t_doc1.inc
@@ -224,33 +224,12 @@ end function
'
'-------------------------------------------------------------------------------
'
-sub hCloseDocument ( optional bANewDoc )
- '/// hCloseDocument : close a document without saving ///'
- '///+ all documents will be closed without saving ///'
- Dim sFehler$
+function hCloseDocument()
- if IsMissing ( bANewDoc ) <> TRUE then
- if bANewDoc = TRUE then
- gNoNewDoc = FALSE
- else
- gNoNewDoc = TRUE
- end if
- end if
+ '/// Trigger FileClose slot'
+ hUseAsyncSlot( "FileClose")
- ' if no new document was created, it isn't closed
- if gNoNewDoc = TRUE then
- exit sub
- end if
-
- Sleep 3
- try
- FileClose
- catch
- Exceptlog
- exit sub
- endcatch
-
- Sleep 1
+ '/// Accept to lose changes'
Kontext "Active"
if Active.Exists(2) then
try
@@ -259,8 +238,11 @@ sub hCloseDocument ( optional bANewDoc )
Active.Click ( 202 )
endcatch
end if
- Sleep (2)
-end sub
+
+ '/// Wait for FileClose to complete'
+ WaitSlot( 2000 )
+
+end function
'
'-------------------------------------------------------------------------------
'
diff --git a/testautomation/global/tools/includes/required/t_doc2.inc b/testautomation/global/tools/includes/required/t_doc2.inc
index 1c4b2305b1fe..fc5efb302231 100644
--- a/testautomation/global/tools/includes/required/t_doc2.inc
+++ b/testautomation/global/tools/includes/required/t_doc2.inc
@@ -126,6 +126,24 @@ function sMakeReadOnlyDocumentEditable() as boolean
if ( VERBOSE ) then printlog( CFN & "Making document editable (create a copy) if it is readonly" )
+ ' We still run into synchronization problems with the "Make document editable" feature
+ ' because we do not know when this button becomes available and ready for use: The
+ ' document has to be loaded, then we have to wait for the toolbar to get populated.
+ ' One thing appears to work though: Try to execute the slot using hUseAsyncSlot.
+ ' This is a little bit tricky because the state of the document is altered but if
+ ' the slot has been executed once we know for sure that the button on the toolbar is
+ ' available and can check its state and - if need be - chenge the document state back.
+
+ ' ========== Workaround begin ==========
+ hUseAsyncSlot( "EditDoc" )
+ kontext "Active"
+ if ( Active.exists() ) then
+ if ( VERBOSE ) then printlog( "Handling create copy message" )
+ Active.yes()
+ wait( 1000 )
+ endif
+ ' ========== Workaround end ==========
+
Kontext "Standardbar"
if ( Bearbeiten.IsEnabled() ) then
diff --git a/testautomation/global/tools/includes/required/t_tools1.inc b/testautomation/global/tools/includes/required/t_tools1.inc
index 21f268b027a7..a908af39e5af 100644
--- a/testautomation/global/tools/includes/required/t_tools1.inc
+++ b/testautomation/global/tools/includes/required/t_tools1.inc
@@ -1006,9 +1006,6 @@ sub sResetTheOffice as boolean
Dim sDefaultLocaleCJK as string
Dim sDefaultLocaleCTL as string
Dim sfgetL10Nvalue as string
- Dim SetupXML as String
- Dim SetupXMLNet as string
- Dim SetupXMLDefault as string
Dim sLanOutIni as string
sString = "qa:qatesttool:calc:options:inc:coption1.inc:: "
@@ -1017,25 +1014,11 @@ sub sResetTheOffice as boolean
' only run on UNIX platforms; there is a problem with the quickstarter on win32
if ("unx" = gPlatgroup) then
try
- SetupXML = gOfficePath & ConvertPath("user\registry\data\org\openoffice\Setup.xcu")
- ' function 'fgetL10Nvalue' is also in this library
- sLanOutIni = fgetL10Nvalue(SetupXML)
+ sLanOutIni = fgetL10Nvalue()
catch
- try
- ' BugID 98315 -> looking in networkpath for the language until bug will be fixed.
- SetupXMLNet = gNetzOfficePath & ConvertPath("share\registry\data\org\openoffice\Setup.xcu")
- sLanOutIni = fgetL10Nvalue(SetupXMLNet)
- catch
- try
- ' It is an English FAT version 645m9s2 or higher.
- SetupXMLDefault = gOfficePath & ConvertPath("share\registry\data\org\openoffice\Setup.xcu")
- sLanOutIni = fgetL10Nvalue(SetupXMLDefault)
- catch
- warnlog sString & SetupXML & " not found => can't get the correct Office-Language!."
- sResetTheOffice = FALSE
- Exit sub
- endcatch
- endcatch
+ warnlog sString & "can't get the correct Office-Language!."
+ sResetTheOffice = FALSE
+ Exit sub
endcatch
uno=hGetUnoService()
@@ -1273,6 +1256,10 @@ function hUseAsyncSlot( cSlot as string ) as integer
case "formatpagewriter" : FormatPageWriter
case "insertindexesbibliographyentry" : InsertIndexesBibliographyEntry
+ case "insertobjectchart" : InsertObjectChart
+ case "inserttablewriter" : InsertTableWriter
+ case "insertobjectformulawriter" : InsertObjectFormulaWriter
+ case "insertfloatingframe" : InsertFloatingFrame
case "contextpositionandsize" : ContextPositionAndSize
@@ -1282,6 +1269,9 @@ function hUseAsyncSlot( cSlot as string ) as integer
case "toolsupdatelinks" : ToolsUpdateLinks
case "toolslanguagehangulhanjaconversion" : ToolsLanguageHangulHanjaConversion
+ ' This is the property browser in the BASIC IDE
+ case "contextproperties" : ContextProperties
+
case else : warnlog( "Unknown slot called: " & cSlot )
end select
diff --git a/testautomation/global/tools/includes/required/t_tools2.inc b/testautomation/global/tools/includes/required/t_tools2.inc
index 8ea2ed6315ee..2301c2e5648f 100644
--- a/testautomation/global/tools/includes/required/t_tools2.inc
+++ b/testautomation/global/tools/includes/required/t_tools2.inc
@@ -31,52 +31,6 @@
'*
'\*************************************************************************************
-sub GetOLEDefaultNames
-
- '/// Reads the names of all OLE objects from a reference file.
-'///+ The OLE name-files are language dependent and should be created
-'///+ using the the <i>getnames.bas</i> script running on Windows
-'///+ The files are (per this revision) written and read utf-8 encoded.
-'///+ The OLE names are stored in global variables.
-
- const CFN = "t_tools2::GetOLEDefaultNames():"
-
- dim sPath as string
- sPath = gTesttoolPath & "global\input\olenames\" & gProductName
-
- dim sFile as String ' the file that contains the OLE names
- sFile = convertpath( sPath & "\ole_" & iSprache & ".txt" )
-
- dim sFilterList(20) as String ' the list that temporarily holds the OLE names
- sFilterlist( 0 ) = "0"
-
- printlog( CFN & "Using OLE names from: " & sFile )
-
- ' Find the reference file. Warn if not found and exit
- if ( Dir ( sFile ) = "" ) then
-
- Warnlog( CFN & " The file for default-filter-names is missing."
- PrintLog( "Please create the list with ..\global\tools\getnames.bas::GetFilterNames!" )
- exit sub
-
- end if
-
- ' Read the file data into an array (sFilterList), utf-8 encoded
- call ListRead ( sFilterList(), sFile, "utf8" )
-
- ' Evaluate the array and assign the data to global variables.
- gOLEWriter = hGetValueForKeyAsString( sFilterList() , "WRITER" )
- gOLECalc = hGetValueForKeyAsString( sFilterList() , "CALC" )
- gOLEImpress = hGetValueForKeyAsString( sFilterList() , "IMPRESS" )
- gOLEDraw = hGetValueForKeyAsString( sFilterList() , "DRAW" )
- gOLEMath = hGetValueForKeyAsString( sFilterList() , "MATH" )
- gOLEChart = hGetValueForKeyAsString( sFilterList() , "CHART" )
- gOLEOthers = hGetValueForKeyAsString( sFilterList() , "OTHER" )
-
-end sub
-
-'-------------------------------------------------------------------------
-
function hSetLocaleStrings (fLocale as String, TBOstringLocale() as String ) as Boolean
'TODO: JSI, make real description from it!
' creator: TBO @ 25.10.2001
diff --git a/testautomation/global/win/bars.win b/testautomation/global/win/bars.win
index bbd72a12bf82..e29318019aa5 100755
--- a/testautomation/global/win/bars.win
+++ b/testautomation/global/win/bars.win
@@ -251,6 +251,7 @@ Textobjekt .uno:DrawText
Toolbox SID_DRAW_SELECT
VerticalCallout .uno:VerticalCaption
VerticalText .uno:VerticalText
+LineArrowEnd .uno:LineArrowEnd
BasicShapes .uno:BasicShapes
SymbolShapes .uno:SymbolShapes
BlockArrows .uno:ArrowShapes
@@ -355,7 +356,7 @@ ExtrusionLightingFloater .uno:ExtrusionLightingFloater
ExtrusionSurfaceFloater .uno:ExtrusionSurfaceFloater
Extrusion3DColor .uno:Extrusion3DColor
'-------------------------------------------------------------------------
-Flowchart .HelpId:flowchartshapes
+*Flowchart .HelpId:flowchartshapes
'-------------------------------------------------------------------------
Process .uno:FlowChartShapes.flowchart-process
AlternateProcess .uno:FlowChartShapes.flowchart-alternate-process
diff --git a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
index 393dd7f68fff..186fe00ae9e4 100644
--- a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
+++ b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc
@@ -57,7 +57,7 @@ testcase tIBIS111099
if SwitchControlDesignMode.getState(2) = 0 then
printlog "OK, design mode is disabled"
else
- warnlog "Document is opened in design mode -> #111099#"
+ warnlog "#i108315# Document is opened in design mode -> #111099#"
end if
else
printlog "Form controls toolbar was not enabled."
@@ -84,23 +84,20 @@ testcase tIBIS111158
sleep(2)
Kontext "FormControls"
try
- if SwitchControlDesignMode.IsEnabled then
+ if SwitchControlDesignMode.GetState(2) = 0 then
'/// Click on 'Design Mode on/off' button on 'Form Controls'-toolbar
SwitchControlDesignMode.click
sleep(2)
- '/// Click on 'Form Design' button on 'Form Controls'-toolbar
- FormDesignTools.Click
- sleep(2)
- else
- printlog "Form controls toolbar was not enabled."
end if
catch
- QAErrorlog "Document is opened in design mode -> #111099#"
- QAErrorlog "No need to test if that one isn't fixed -> aborted"
+ warnlog "Form controls toolbar was not enabled, maybe the doc is writeprotected."
+ Call hToolbarSelect("CONTROLS", false)
call hCloseDocument
goto endsub
endcatch
-
+ '/// Click on 'Form Design' button on 'Form Controls'-toolbar
+ FormDesignTools.Click
+ sleep(2)
Kontext "FormDesignTools"
if FormDesignTools.Exists(2) then
If ShowFmExplorer.IsEnabled then
diff --git a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
index 4c1f18bf6cfe..5bf718203a47 100644
--- a/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
+++ b/testautomation/spreadsheet/required/includes/c_upd_filemenu.inc
@@ -500,7 +500,7 @@ testcase tFileSaveAsDBF
Kontext
if Active.exists(2) then
printlog " "
- warnlog "The following warning exists. This could be #i87325:"
+ warnlog "#i87325# - Unexpected messagebox"
Printlog Active.GetText
Printlog " "
Active.OK
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index a2bbce09bf8d..9500db4f45b6 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -1567,7 +1567,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValue(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
@@ -1851,7 +1853,9 @@ void SAL_CALL PersistentPropertySet::addProperty(
// Set state ( always "default" )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DEFAULT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DEFAULT_VALUE ) ) );
// Set attributes
xNameReplace->replaceByName(
@@ -2327,7 +2331,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index 451c629694c6..4debb1728bfe 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -337,12 +337,14 @@ static Reference< XContent > getContent(
if ( xProvider.is() )
{
Reference< XContent > xContent;
+ rtl::OUString msg;
try
{
xContent = xProvider->queryContent( xId );
}
- catch ( IllegalIdentifierException const & )
+ catch ( IllegalIdentifierException const & e )
{
+ msg = e.Message;
// handled below.
}
@@ -355,7 +357,7 @@ static Reference< XContent > getContent(
throw ContentCreationException(
rtl::OUString::createFromAscii(
- "Unable to create Content!" ),
+ "Unable to create Content! " ) + msg,
Reference< XInterface >(),
ContentCreationError_CONTENT_CREATION_FAILED );
}
diff --git a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
index bd37f64cf714..96b8957683ff 100644
--- a/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
+++ b/udkapi/com/sun/star/reflection/XInterfaceAttributeTypeDescription2.idl
@@ -35,7 +35,8 @@ module com { module sun { module star { module reflection {
interface XCompoundTypeDescription;
/**
- Reflects a singleton, supporting interface-based singletons.
+ Reflects an interface attribute, supporting extended attributes that are
+ bound or raise exceptions.
<p>This type supersedes <type>XInterfaceAttributeTypeDescription</type>,
which does not support extended attributes.</p>
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index eda74f873b5f..e191f471057a 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -600,9 +600,9 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
else
pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]);
}
- #ifdef DBG_UTIL
catch(Exception& rEx)
{
+#if OSL_DEBUG_LEVEL > 0
OString sMsg("XHierarchicalNameAccess: ");
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
@@ -619,10 +619,10 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
pNames[i].getLength(),
RTL_TEXTENCODING_ASCII_US);
OSL_ENSURE(sal_False, sMsg.getStr());
- }
#else
- catch(Exception&){}
+ (void) rEx; // avoid warning
#endif
+ }
}
// In special mode "ALL_LOCALES" we must convert localized values to Sequence< PropertyValue >.
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index f196ebba0863..802a63782cf9 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -159,7 +159,6 @@ namespace utl
if (getEscape())
{
Reference< XStringEscape > xEscaper(m_xDirectAccess, UNO_QUERY);
- OSL_ENSURE(xEscaper.is(), "OConfigurationNode::normalizeName: missing an interface!");
if (xEscaper.is() && sName.getLength())
{
try
@@ -333,8 +332,6 @@ namespace utl
void OConfigurationNode::setEscape(sal_Bool _bEnable)
{
m_bEscapeNames = _bEnable && Reference< XStringEscape >::query(m_xDirectAccess).is();
- OSL_ENSURE(m_bEscapeNames || !_bEnable,
- "OConfigurationNode::setEscape: escaping not enabled - missing the appropriate interface on the node!");
}
//------------------------------------------------------------------------
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index f9a12e900b7d..94f7ff07d7d7 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -531,7 +531,7 @@ void SvtFilterOptions::SetWriter2WinWord( BOOL bFlag )
BOOL SvtFilterOptions::IsUseEnhancedFields() const
{
return false; // disable for now;
-// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
+// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
}
void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag )
diff --git a/wizards/com/sun/star/wizards/common/Configuration.java b/wizards/com/sun/star/wizards/common/Configuration.java
index 076c8633c1c4..103fdc5848a2 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.java
+++ b/wizards/com/sun/star/wizards/common/Configuration.java
@@ -365,12 +365,6 @@ public abstract class Configuration
}
}
- public static XNameAccess getChildNodebyIndex(Object _oNode, int _index)
- {
- XNameAccess xNameAccessNode = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, _oNode);
- return getChildNodebyIndex(xNameAccessNode, _index);
- }
-
public static XNameAccess getChildNodebyIndex(XNameAccess _xNameAccess, int _index)
{
try
diff --git a/wizards/com/sun/star/wizards/table/CGCategory.java b/wizards/com/sun/star/wizards/table/CGCategory.java
index c39bf5a65f4c..ea74b33f09ad 100644
--- a/wizards/com/sun/star/wizards/table/CGCategory.java
+++ b/wizards/com/sun/star/wizards/table/CGCategory.java
@@ -56,12 +56,14 @@ public class CGCategory
xMSF = _xMSF;
}
- public void initialize(int _index)
+ public void initialize(String category)
{
try
{
oconfigView = Configuration.getConfigurationRoot(xMSF, CGROOTPATH, false); //business/Tables
- xNameAccessCurBusinessNode = Configuration.getChildNodebyIndex(oconfigView, _index);
+ xNameAccessCurBusinessNode = Configuration.getChildNodebyName(
+ UnoRuntime.queryInterface(XNameAccess.class, oconfigView),
+ category);
}
catch (Exception e)
{
diff --git a/wizards/com/sun/star/wizards/table/FieldDescription.java b/wizards/com/sun/star/wizards/table/FieldDescription.java
index ff7be38e9193..d26e58783aba 100644
--- a/wizards/com/sun/star/wizards/table/FieldDescription.java
+++ b/wizards/com/sun/star/wizards/table/FieldDescription.java
@@ -39,8 +39,6 @@ import com.sun.star.wizards.common.Properties;
public class FieldDescription
{
-
- int category;
private String tablename = "";
// String fieldname;
private String keyname;
@@ -60,7 +58,6 @@ public class FieldDescription
{
xMSF = _xMSF;
aLocale = _aLocale;
- category = _curscenarioselector.getCategory();
tablename = _curscenarioselector.getTableName();
Name = _fieldname;
keyname = _keyname;
diff --git a/wizards/com/sun/star/wizards/table/ScenarioSelector.java b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
index d603ad18793e..4f985c18e055 100644
--- a/wizards/com/sun/star/wizards/table/ScenarioSelector.java
+++ b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
@@ -165,19 +165,6 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
initializeCategory(BUSINESS);
}
- public int getCategory()
- {
- if (optBusiness.getState())
- {
- curcategory = BUSINESS;
- }
- else
- {
- curcategory = PRIVATE;
- }
- return curcategory;
- }
-
public void selectCategory()
{
if (optBusiness.getState())
@@ -194,7 +181,8 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
{
try
{
- oCGCategory.initialize(_iCategory);
+ oCGCategory.initialize(
+ _iCategory == PRIVATE ? "private" : "business");
xTableListBox.removeItems((short) 0, xTableListBox.getItemCount());
xTableListBox.addItems(oCGCategory.getTableNames(), (short) _iCategory);
initializeTable(0);
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index b472daec5a62..a2c70ca45b71 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -134,26 +134,11 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
return aRetURL;
}
-
-// Hold Packages to improve performance (#i106100)
-// The PackageManager implementation seems to completely throw away all cached data
-// as soon as the last reference to a XPackage dies. Maybe this should be changed.
-struct ImplPackageSequenceHolder
-{
- Sequence< Reference< deployment::XPackage > > m_aUserPackagesSeq;
- Sequence< Reference< deployment::XPackage > > m_aSharedPackagesSeq;
-};
-
-static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
-
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
const rtl::OUString& productName,
const rtl::OUString& productVersion,
- const rtl::OUString& vendorName,
- const rtl::OUString& vendorVersion,
- const rtl::OUString& vendorShort,
const rtl::OUString& styleSheet,
Reference< uno::XComponentContext > xContext )
: m_xContext( xContext ),
@@ -185,9 +170,7 @@ Databases::Databases( sal_Bool showBasic,
m_vReplacement[0] = productName;
m_vReplacement[1] = productVersion;
- m_vReplacement[2] = vendorName;
- m_vReplacement[3] = vendorVersion;
- m_vReplacement[4] = vendorShort;
+ // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings
m_vReplacement[5] = productName;
m_vReplacement[6] = productVersion;
@@ -196,7 +179,6 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
- GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
Databases::~Databases()
@@ -244,8 +226,6 @@ Databases::~Databases()
++it;
}
}
-
- delete GpPackageSequenceHolder;
}
static bool impl_getZipFile(
@@ -1567,9 +1547,6 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
m_aUserPackagesSeq = xUserManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
- if( GpPackageSequenceHolder != NULL )
- GpPackageSequenceHolder->m_aUserPackagesSeq = m_aUserPackagesSeq;
-
m_bUserPackagesLoaded = true;
}
@@ -1599,9 +1576,6 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
- if( GpPackageSequenceHolder != NULL )
- GpPackageSequenceHolder->m_aSharedPackagesSeq = m_aSharedPackagesSeq;
-
m_bSharedPackagesLoaded = true;
}
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 4bdb2a605dd7..6468c5732c6b 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -189,9 +189,6 @@ namespace chelp {
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
const rtl::OUString& productName,
const rtl::OUString& productVersion,
- const rtl::OUString& vendorName,
- const rtl::OUString& vendorVersion,
- const rtl::OUString& vendorShort,
const rtl::OUString& styleSheet,
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext );
@@ -291,9 +288,6 @@ namespace chelp {
rtl::OUString getProductName() const { return m_vReplacement[0]; }
rtl::OUString getProductVersion() const { return m_vReplacement[1]; }
- rtl::OUString getVendorName() const { return m_vReplacement[2]; }
- rtl::OUString getVendorVersion() const { return m_vReplacement[3]; }
- rtl::OUString getVendorShort() const { return m_vReplacement[4]; }
rtl::OUString expandURL( const rtl::OUString& aURL );
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 1f0b7c59f92c..c21b5aca3ba5 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -45,7 +45,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -308,9 +307,6 @@ void ContentProvider::init()
* now determing
* productname,
* productversion,
- * vendorname,
- * vendorversion,
- * vendorshort
*/
xHierAccess = getHierAccess( sProvider, "org.openoffice.Setup" );
@@ -351,20 +347,6 @@ void ContentProvider::init()
rtl::OUString::createFromAscii( " " ) +
setupextension );
- xHierAccess = getHierAccess( sProvider, "org.openoffice.Webtop.Common" );
- rtl::OUString vendorname(
- getKey( xHierAccess,"Product/ooName" ) );
-
- setupversion = rtl::OUString(
- getKey( xHierAccess,"Product/ooSetupVersion" ) );
- setupextension = rtl::OUString(
- getKey( xHierAccess,"Product/ooSetupExtension") );
- rtl::OUString vendorversion(
- setupversion +
- rtl::OUString::createFromAscii( " " ) +
- setupextension );
- rtl::OUString vendorshort = vendorname;
-
uno::Sequence< rtl::OUString > aImagesZipPaths( 2 );
xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" );
@@ -392,9 +374,6 @@ void ContentProvider::init()
aImagesZipPaths,
productname,
productversion,
- vendorname,
- vendorversion,
- vendorshort,
stylesheet,
xContext );
}
@@ -405,17 +384,6 @@ ContentProvider::getConfiguration() const
uno::Reference< lang::XMultiServiceFactory > sProvider;
if( m_xSMgr.is() )
{
- uno::Any aAny;
- aAny <<= rtl::OUString::createFromAscii( "plugin" );
- beans::PropertyValue aProp(
- rtl::OUString::createFromAscii( "servertype" ),
- -1,
- aAny,
- beans::PropertyState_DIRECT_VALUE );
-
- uno::Sequence< uno::Any > seq(1);
- seq[0] <<= aProp;
-
try
{
rtl::OUString sProviderService =
@@ -423,8 +391,7 @@ ContentProvider::getConfiguration() const
"com.sun.star.configuration.ConfigurationProvider" );
sProvider =
uno::Reference< lang::XMultiServiceFactory >(
- m_xSMgr->createInstanceWithArguments(
- sProviderService,seq ),
+ m_xSMgr->createInstance( sProviderService ),
uno::UNO_QUERY );
}
catch( const uno::Exception& )
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 64d3051782d3..9268ec19cd7f 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -992,20 +992,11 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
parString[last++] = "'css'";
parString[last++] = "vendorname";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorName().getStr(),
- pDatabases->getVendorName().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
parString[last++] = "vendorversion";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorVersion().getStr(),
- pDatabases->getVendorVersion().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
parString[last++] = "vendorshort";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorShort().getStr(),
- pDatabases->getVendorShort().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
}
// Do we need to add extension path?
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index a0e7cf32ef7d..478562fca7b7 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -39,7 +39,6 @@
#include <osl/file.hxx>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -674,22 +673,6 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
// replace anything like $(instpath);
subst( xSMgr,instPath );
-
- /**********************************************************************/
- /* reading Webtop.Common */
- /**********************************************************************/
-
- xHierAccess = getHierAccess( sProvider,
- "org.openoffice.Webtop.Common" );
- rtl::OUString vendorName( getKey( xHierAccess,"Product/ooName" ) );
-
- rtl::OUString setupversion( getKey( xHierAccess,"Product/ooSetupVersion" ) );
- rtl::OUString setupextension( getKey( xHierAccess,"Product/ooSetupExtension") );
- rtl::OUString vendorVersion( setupversion +
- rtl::OUString::createFromAscii( " " ) +
- setupextension );
- rtl::OUString vendorShort = vendorName;
-
/**********************************************************************/
/* reading setup */
/**********************************************************************/
@@ -698,8 +681,8 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
"org.openoffice.Setup" );
rtl::OUString productName( getKey( xHierAccess,"Product/ooName" ) );
- setupversion = getKey( xHierAccess,"Product/ooSetupVersion" );
- setupextension = rtl::OUString();
+ rtl::OUString setupversion( getKey( xHierAccess,"Product/ooSetupVersion" ) );
+ rtl::OUString setupextension;
try
{
@@ -813,9 +796,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
configData.m_vAdd[4] = 12;
configData.m_vReplacement[0] = productName;
configData.m_vReplacement[1] = productVersion;
- configData.m_vReplacement[2] = vendorName;
- configData.m_vReplacement[3] = vendorVersion;
- configData.m_vReplacement[4] = vendorShort;
+ // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings
configData.system = system;
configData.locale = locale;
@@ -843,23 +824,13 @@ TVChildTarget::getConfiguration(const Reference< XMultiServiceFactory >& m_xSMgr
Reference< XMultiServiceFactory > sProvider;
if( m_xSMgr.is() )
{
- Any aAny;
- aAny <<= rtl::OUString::createFromAscii( "plugin" );
- PropertyValue aProp( rtl::OUString::createFromAscii( "servertype" ),
- -1,
- aAny,
- PropertyState_DIRECT_VALUE );
-
- Sequence< Any > seq(1);
- seq[0] <<= aProp;
-
try
{
rtl::OUString sProviderService =
rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" );
sProvider =
Reference< XMultiServiceFactory >(
- m_xSMgr->createInstanceWithArguments( sProviderService,seq ),
+ m_xSMgr->createInstance( sProviderService ),
UNO_QUERY );
}
catch( const com::sun::star::uno::Exception& )
diff --git a/configmgr/source/inc/simpletypehelper.hxx b/xmloff/inc/xmloff/odffields.hxx
index 55c1130de996..2be06b578acd 100644
--- a/configmgr/source/inc/simpletypehelper.hxx
+++ b/xmloff/inc/xmloff/odffields.hxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: $
+ * $Revision: $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -25,29 +28,29 @@
*
************************************************************************/
-#ifndef CONFIGMGR_SIMPLETYPEHELPER_HXX
-#define CONFIGMGR_SIMPLETYPEHELPER_HXX
+/*
+ * Copyright 2008 by Novell, Inc.
+ */
+
+#ifndef _ODFFIELDS_HXX
+#define _ODFFIELDS_HXX
+
-#include <com/sun/star/uno/Type.hxx>
+#define ODF_FORMTEXT "vnd.oasis.opendocument.field.FORMTEXT"
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
+#define ODF_FORMCHECKBOX "vnd.oasis.opendocument.field.FORMCHECKBOX"
+#define ODF_FORMCHECKBOX_HELPTEXT "Checkbox_HelpText"
+#define ODF_FORMCHECKBOX_NAME "Checkbox_Name"
+#define ODF_FORMCHECKBOX_RESULT "Checkbox_Checked"
- namespace SimpleTypeHelper
- {
- uno::Type getBooleanType();
+#define ODF_FORMDROPDOWN "vnd.oasis.opendocument.field.FORMDROPDOWN"
+#define ODF_FORMDROPDOWN_LISTENTRY "Dropdown_ListEntry"
+#define ODF_FORMDROPDOWN_RESULT "Dropdown_Selected"
- uno::Type getShortType();
- uno::Type getIntType();
- uno::Type getLongType();
+#define ODF_TOC "vnd.oasis.opendocument.field.TOC"
- uno::Type getDoubleType();
+#define ODF_HYPERLINK "vnd.oasis.opendocument.field.HYPERLINK"
- uno::Type getStringType();
+#define ODF_PAGEREF "vnd.oasis.opendocument.field.PAGEREF"
- uno::Type getBinaryType();
- uno::Type getAnyType();
- }
-}
-#endif
+#endif /* _ODFFIELDS_HXX */
diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst
index 686b4b70a0ae..ae4f8cd13ffb 100644
--- a/xmloff/prj/d.lst
+++ b/xmloff/prj/d.lst
@@ -10,6 +10,7 @@ mkdir: %_DEST%\inc%_EXT%\xmloff
..\dtd\* %_DEST%\bin%_EXT%
+..\inc\xmloff\odffields.hxx %_DEST%\inc%_EXT%\xmloff\odffields.hxx
..\inc\xmloff\dllapi.h %_DEST%\inc%_EXT%\xmloff\dllapi.h
..\inc\xmloff\attrlist.hxx %_DEST%\inc%_EXT%\xmloff\attrlist.hxx
..\inc\i18nmap.hxx %_DEST%\inc%_EXT%\xmloff\i18nmap.hxx
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index dd16ab983a7b..91fe01dfcc3a 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -38,6 +38,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlimp.hxx>
#include <xmloff/nmspmap.hxx>
+#include <xmloff/odffields.hxx>
#include "xmlnmspe.hxx"
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/text/XTextContent.hpp>
@@ -135,6 +136,33 @@ static SvXMLEnumMapEntry __READONLY_DATA lcl_aMarkTypeMap[] =
{ XML_TOKEN_INVALID, 0 },
};
+
+static const char *lcl_getFormFieldmarkName(rtl::OUString &name)
+{
+ static const char sCheckbox[]=ODF_FORMCHECKBOX;
+ static const char sFormDropDown[]=ODF_FORMDROPDOWN;
+ if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0)
+ return sCheckbox;
+ else if (name.compareToAscii(ODF_FORMCHECKBOX)==0)
+ return sCheckbox;
+ if (name.compareToAscii(ODF_FORMDROPDOWN)==0)
+ return sFormDropDown;
+ else
+ return NULL;
+}
+
+static rtl::OUString lcl_getFieldmarkName(rtl::OUString &name)
+{
+ static const char sFormtext[]=ODF_FORMTEXT;
+ if (name.compareToAscii("msoffice.field.FORMTEXT")==0)
+ return rtl::OUString::createFromAscii(sFormtext);
+ else if (name.compareToAscii(ODF_FORMTEXT)==0)
+ return rtl::OUString::createFromAscii(sFormtext);
+ else
+ return name;
+}
+
+
void XMLTextMarkImportContext::StartElement(
const Reference<XAttributeList> & xAttrList)
{
@@ -191,7 +219,8 @@ void XMLTextMarkImportContext::EndElement()
case TypeFieldmark:
case TypeBookmark:
{
- bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && m_sFieldName.compareToAscii("msoffice.field.FORMCHECKBOX")==0); // for now only import FORMCHECKBOX boxes
+ const char *formFieldmarkName=lcl_getFormFieldmarkName(m_sFieldName);
+ bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && formFieldmarkName!=NULL); //@TODO handle abbreviation cases..
// export point bookmark
const Reference<XInterface> xContent(
CreateAndInsertMark(GetImport(),
@@ -210,10 +239,8 @@ void XMLTextMarkImportContext::EndElement()
if (xContent.is() && bImportAsField) {
// setup fieldmark...
Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
- xFormField->setType(1); // Checkbox...
+ xFormField->setFieldType(rtl::OUString::createFromAscii(formFieldmarkName));
if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
-// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO CHECKBOX"));
-// xFormField->setRes(1);
m_rHelper.setCurrentFieldParamsTo(xFormField);
}
}
@@ -260,11 +287,6 @@ void XMLTextMarkImportContext::EndElement()
xInsertionCursor, UNO_QUERY);
bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmarkEnd && m_rHelper.hasCurrentFieldCtx());
- if (bImportAsField) {
- ::rtl::OUString currentFieldType =
- m_rHelper.getCurrentFieldType();
- bImportAsField=currentFieldType.compareToAscii("msoffice.field.FORMTEXT")==0; // for now only import FORMTEXT boxes
- }
// insert reference
const Reference<XInterface> xContent(
@@ -285,10 +307,12 @@ void XMLTextMarkImportContext::EndElement()
if (xContent.is() && bImportAsField) {
// setup fieldmark...
Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
- xFormField->setType(0); // Text
if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
+ rtl::OUString givenTypeName=m_rHelper.getCurrentFieldType();
+ rtl::OUString fieldmarkTypeName=lcl_getFieldmarkName(givenTypeName);
+
+ xFormField->setFieldType(fieldmarkTypeName);
m_rHelper.setCurrentFieldParamsTo(xFormField);
-// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO"));
}
}
m_rHelper.popFieldCtx();
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index a7b7b4cb6782..cd09ba7f646f 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -89,6 +89,8 @@
// --> OD 2008-04-25 #refactorlists#
#include <txtlists.hxx>
// <--
+#include <xmloff/odffields.hxx>
+#include <comphelper/stlunosequence.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -110,6 +112,8 @@ using namespace ::com::sun::star::ucb;
using ::comphelper::UStringLess;
+
+
static __FAR_DATA SvXMLTokenMapEntry aTextElemTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_P, XML_TOK_TEXT_P },
@@ -444,6 +448,70 @@ static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] =
#define MAX_COMBINED_CHARACTERS 6
+namespace
+{
+ class FieldParamImporter
+ {
+ public:
+ typedef pair<OUString,OUString> field_param_t;
+ typedef vector<field_param_t> field_params_t;
+ FieldParamImporter(const field_params_t* const pInParams, Reference<XNameContainer> xOutParams)
+ : m_pInParams(pInParams)
+ , m_xOutParams(xOutParams)
+ { };
+ void Import();
+
+ private:
+ const field_params_t* const m_pInParams;
+ Reference<XNameContainer> m_xOutParams;
+ };
+
+ void FieldParamImporter::Import()
+ {
+ ::std::vector<OUString> vListEntries;
+ ::std::map<OUString, Any> vOutParams;
+ for(field_params_t::const_iterator pCurrent = m_pInParams->begin();
+ pCurrent != m_pInParams->end();
+ ++pCurrent)
+ {
+ if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_RESULT))
+ {
+ // sal_Int32
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second.toInt32());
+ }
+ else if(pCurrent->first.equalsAscii(ODF_FORMCHECKBOX_RESULT))
+ {
+ // bool
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second.toBoolean());
+ }
+ else if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_LISTENTRY))
+ {
+ // sequence
+ vListEntries.push_back(pCurrent->second);
+ }
+ else
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second);
+ }
+ if(!vListEntries.empty())
+ {
+ Sequence<OUString> vListEntriesSeq(vListEntries.size());
+ copy(vListEntries.begin(), vListEntries.end(), ::comphelper::stl_begin(vListEntriesSeq));
+ vOutParams[OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)] = makeAny(vListEntriesSeq);
+ }
+ for(::std::map<OUString, Any>::const_iterator pCurrent = vOutParams.begin();
+ pCurrent != vOutParams.end();
+ ++pCurrent)
+ {
+ try
+ {
+ m_xOutParams->insertByName(pCurrent->first, pCurrent->second);
+ }
+ catch(ElementExistException)
+ { }
+ }
+ }
+}
+
XMLTextImportHelper::XMLTextImportHelper(
const Reference < XModel >& rModel,
SvXMLImport& rImport,
@@ -2277,18 +2345,9 @@ bool XMLTextImportHelper::hasCurrentFieldCtx()
void XMLTextImportHelper::setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField)
{
DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty() && xFormField.is()) {
- field_params_t &params=aFieldStack.top().second;
- for (field_params_t::iterator i=params.begin();i!=params.end();i++) {
- rtl::OUString name=i->first;
- rtl::OUString value=i->second;
- if (name.compareToAscii("Description")==0){
- xFormField->setDescription(value);
- } else if (name.compareToAscii("Result")==0){
- xFormField->setRes((sal_Int16)value.toInt32());
- }
-
- }
+ if (!aFieldStack.empty() && xFormField.is())
+ {
+ FieldParamImporter(&aFieldStack.top().second, xFormField->getParameters()).Import();
}
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index cc2e74b425e7..f1cf89cb0640 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -116,6 +116,7 @@
#include "MultiPropertySetHelper.hxx"
#include <xmloff/formlayerexport.hxx>
#include "XMLTextCharStyleNamesElementExport.hxx"
+#include <comphelper/stlunosequence.hxx>
// --> OD 2008-04-25 #refactorlists#
#include <txtlists.hxx>
@@ -231,6 +232,21 @@ namespace
const OUString BoundFrames::our_sAnchorType = OUString::createFromAscii("AnchorType");
const OUString BoundFrames::our_sAnchorFrame = OUString::createFromAscii("AnchorFrame");
+ class FieldParamExporter
+ {
+ public:
+ FieldParamExporter(SvXMLExport* const pExport, Reference<XNameContainer> xFieldParams)
+ : m_pExport(pExport)
+ , m_xFieldParams(xFieldParams)
+ { };
+ void Export();
+
+ private:
+ SvXMLExport* const m_pExport;
+ const Reference<XNameContainer> m_xFieldParams;
+
+ void ExportParameter(const OUString& sKey, const OUString& sValue);
+ };
}
namespace xmloff
@@ -386,6 +402,55 @@ BoundFrameSets::BoundFrameSets(const Reference<XInterface> xModel)
&lcl_ShapeFilter));
};
+void FieldParamExporter::Export()
+{
+ static const Type aStringType = ::getCppuType((OUString*)0);
+ static const Type aBoolType = ::getCppuType((sal_Bool*)0);
+ static const Type aSeqType = ::getCppuType((Sequence<OUString>*)0);
+ static const Type aIntType = ::getCppuType((sal_Int32*)0);
+ Sequence<OUString> vParameters(m_xFieldParams->getElementNames());
+ for(const OUString* pCurrent=::comphelper::stl_begin(vParameters); pCurrent!=::comphelper::stl_end(vParameters); ++pCurrent)
+ {
+ const Any aValue = m_xFieldParams->getByName(*pCurrent);
+ const Type aValueType = aValue.getValueType();
+ if(aValueType == aStringType)
+ {
+ OUString sValue;
+ aValue >>= sValue;
+ ExportParameter(*pCurrent,sValue);
+ }
+ else if(aValueType == aBoolType)
+ {
+ sal_Bool bValue = false;
+ aValue >>= bValue;
+ ExportParameter(*pCurrent,OUString::createFromAscii(bValue ? "true" : "false"));
+ }
+ else if(aValueType == aSeqType)
+ {
+ Sequence<OUString> vValue;
+ aValue >>= vValue;
+ for(OUString* pSeqCurrent = ::comphelper::stl_begin(vValue); pSeqCurrent != ::comphelper::stl_end(vValue); ++pSeqCurrent)
+ {
+ ExportParameter(*pCurrent, *pSeqCurrent);
+ }
+ }
+ else if(aValueType == aIntType)
+ {
+ sal_Int32 nValue = 0;
+ aValue >>= nValue;
+ ExportParameter(*pCurrent, OUStringBuffer().append(nValue).makeStringAndClear());
+ }
+ }
+}
+
+void FieldParamExporter::ExportParameter(const OUString& sKey, const OUString& sValue)
+{
+ m_pExport->AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, sKey);
+ m_pExport->AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, sValue);
+ m_pExport->StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ m_pExport->EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+}
+
void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
const Reference < XPropertySet > & rPropSet,
const XMLPropertyState** ppAddStates, bool bDontSeek )
@@ -2237,19 +2302,19 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
else if (sType.equals(sTextFieldStart))
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xBookmark.is()) {
+ if (xBookmark.is())
+ {
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
}
Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMTEXT"));
+ if (xFormField.is())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, xFormField->getFieldType());
}
GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ if (xFormField.is())
+ {
+ FieldParamExporter(&GetExport(), xFormField->getParameters()).Export();
}
GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
}
@@ -2261,32 +2326,19 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
else if (sType.equals(sTextFieldStartEnd))
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xBookmark.is()) {
+ if (xBookmark.is())
+ {
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
}
Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xFormField.is()) {
- sal_Int16 fftype=xFormField->getType();
- switch (fftype) {
- case 1:
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMCHECKBOX"));
- break;
- default:
- DBG_ASSERT(false, "hey ---- add your export stuff here!!");
- break;
- }
+ if (xFormField.is())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, xFormField->getFieldType());
}
GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
-
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Result"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, ::rtl::OUString::valueOf((sal_Int32 )xFormField->getRes()));
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ if (xFormField.is())
+ {
+ FieldParamExporter(&GetExport(), xFormField->getParameters()).Export();
}
GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d746f6831e4a..9c505800388f 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -260,24 +260,27 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
}
}
-::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) {
- if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) {
- char* subject ;
+::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException)
+{
+ if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL )
+ {
+ wchar_t* subject ;
DWORD cbSubject ;
- cbSubject = CertNameToStr(
+ cbSubject = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,
&( m_pCertContext->pCertInfo->Subject ),
CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG ,
NULL, 0
) ;
- if( cbSubject != 0 ) {
- subject = new char[ cbSubject ] ;
+ if( cbSubject != 0 )
+ {
+ subject = new wchar_t[ cbSubject ] ;
if( subject == NULL )
throw RuntimeException() ;
- cbSubject = CertNameToStr(
+ cbSubject = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,
&( m_pCertContext->pCertInfo->Subject ),
CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG ,
@@ -289,22 +292,17 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
throw RuntimeException() ;
}
- // By CP , for correct encoding
- sal_uInt16 encoding ;
- rtl_Locale *pLocale = NULL ;
- osl_getProcessLocale( &pLocale ) ;
- encoding = osl_getTextEncodingFromLocale( pLocale ) ;
- // CP end
-
- if(subject[cbSubject-1] == 0) cbSubject--; //delimit the last 0x00;
- OUString xSubject(subject , cbSubject ,encoding ) ; //By CP
+ OUString xSubject(subject);
delete [] subject ;
return replaceTagSWithTagST(xSubject);
- } else {
+ } else
+ {
return OUString() ;
}
- } else {
+ }
+ else
+ {
return OUString() ;
}
}
diff --git a/xmlsecurity/test_docs/CAs/README.txt b/xmlsecurity/test_docs/CAs/README.txt
new file mode 100755
index 000000000000..b454f1fafdd8
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/README.txt
@@ -0,0 +1,383 @@
+This folder contains the directory structures needed by openssl to create
+and manager certificates.
+
+
+
+################################################################################
+
+Root 1
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 1
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+User 1 Sub CA 1 Root 1
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = NO
+
+################################################################################
+
+Root 2
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 2
+===============
+Valid intermediate CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+User 1 Sub CA 1 Root 2
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = NO
+
+################################################################################
+
+Root 3
+======
+Valid root CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 3
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+User 1 Sub CA 1 Root 3
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = NO
+
+################################################################################
+
+Root 4
+======
+Valid root CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Revoked certificates:
+
+- Sub CA 2 Root 4
+
+
+Sub CA 1 Root 4
+===============
+Valid intermediate CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+Revoked certificates:
+
+- User 2 Sub CA 1 Root 4
+
+
+User 1 Sub CA 1 Root 4
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = NO
+
+User 2 Sub CA 1 Root 4
+======================
+Revoked end certificate.
+CRLDP = NO
+AIA = NO
+
+Sub CA 2 Root 4
+===============
+Revoked intermediate CA certificate. Reason = keyCompromise
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+Revoked certificates:
+
+- User 2 Sub CA 2 Root 4
+
+User 1 Sub CA 2 Root 4
+======================
+Valid end certificate. Issuer is revoked.
+CRLDP = NO
+AIA = NO
+
+User 2 Sub CA 2 Root 4
+======================
+Revoked end certificate. Reason = keyCompromise. Issuer is revoked.
+CRLDP = NO
+AIA = NO
+
+################################################################################
+
+Root 5
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 5
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+CRLDP = URL=http://localhost:8901/demoCA/crl/Root_5.crl
+AIA = NO
+
+User 1 Sub CA 1 Root 5
+======================
+Valid end certificate.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl
+AIA = NO
+
+
+################################################################################
+
+Root 6
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+
+Sub CA 1 Root 6
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = URL=http://localhost:8901/demoCA/crl/Root_6.crl
+AIA = NO
+
+User 1 Sub CA 1 Root 6
+======================
+Valid end certificate.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl
+AIA = NO
+
+################################################################################
+
+Root 7
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+
+Revoked certificates:
+
+- Sub CA 2 Root 7
+
+
+Sub CA 1 Root 7
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+CRLDP = URL=http://localhost:8901/demoCA/crl/Root_7.crl
+AIA = NO
+
+Revoked certificates:
+
+- User 2 Sub CA 1 Root 7
+
+
+User 1 Sub CA 1 Root 7
+======================
+Valid end certificate.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl
+AIA = NO
+
+User 2 Sub CA 1 Root 7
+======================
+Revoked end certificate. Reason = CACompromise.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl
+AIA = NO
+
+Sub CA 2 Root 7
+===============
+Revoked intermediate CA certificate. Reason = keyCompromise
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+CRLDP = URL=http://localhost:8901/demoCA/crl/Root_7.crl
+AIA = NO
+
+Revoked certificates:
+
+- User 2 Sub CA 2 Root 7
+
+User 1 Sub CA 2 Root 7
+======================
+Valid end certificate. Issuer is revoked.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+AIA = NO
+
+User 2 Sub CA 2 Root 7
+======================
+Revoked end certificate. Reason = CACompromise. Issuer is revoked.
+CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+AIA = NO
+
+################################################################################
+
+Root 8
+======
+Valid root CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = YES
+
+Revoked certificates:
+
+- Sub CA 2 Root 8
+
+
+Sub CA 1 Root 8
+===============
+Valid intermediate CA certificate.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = YES
+CRLDP =
+AIA = OCSP;URI:http://localhost:8888
+
+Revoked certificates:
+
+- User 2 Sub CA 1 Root 8
+
+
+User 1 Sub CA 1 Root 8
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = OCSP;URI:http://localhost:8889
+
+User 2 Sub CA 1 Root 8
+======================
+Revoked end certificate. Reason = superseded.
+CRLDP = NO
+AIA = OCSP;URI:http://localhost:8889
+
+Sub CA 2 Root 8
+===============
+Revoked intermediate CA certificate. Reason = superseded.
+Provides CRL = NO
+Provides CRL via HTTP = NO
+Provides OCSP = YES
+CRLDP = NO
+AIA = OCSP;URI:http://localhost:8888
+
+Revoked certificates:
+
+- User 2 Sub CA 2 Root 8
+
+User 1 Sub CA 2 Root 8
+======================
+Valid end certificate. Issuer is revoked.
+CRLDP = NO
+AIA = OCSP;URI:http://localhost:8889
+
+User 2 Sub CA 2 Root 8
+======================
+Revoked end certificate. Reason = superseded. Issuer is revoked.
+CRLDP = NO
+AIA = OCSP;URI:http://localhost:8889
+
+################################################################################
+
+Root 9
+======
+Valid root CA certificate. (Not installed.)
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 9
+===============
+Valid intermediate CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+User 1 Sub CA 1 Root 9
+======================
+Valid end certificate.
+CRLDP = NO
+AIA = NO
+
+################################################################################
+
+Root 10
+======
+Valid root CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+Sub CA 1 Root 10
+===============
+Valid intermediate CA certificate. (Not installed.)
+Provides CRL = NO
+Provides CRL via HTTP = YES
+Provides OCSP = NO
+CRLDP = NO
+AIA = NO
+
+User 1 Sub CA 1 Root 10
+======================
+Valid end certificate.
+CRLDP = URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl
+AIA = caIssuers;URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt
+
+################################################################################
+
+Root 11
+======
+Valid root CA certificate.
+Provides CRL = YES
+Provides CRL via HTTP = NO
+Provides OCSP = NO
+
+User x Root 11
+======================
+All certificate issues by Root 11 are valid end certificate. Currently there are
+31 certificates.
+
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem
new file mode 100755
index 000000000000..091052e3ab93
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAJWwBSvtwjktMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMTAeFw0wOTEx
+MTgxNDU1NDFaFw0zNDExMTIxNDU1NDFaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAvrD6NFWcOQQVxIuXw5Pzpy667PZbBP80ow2Bbnj+RFCI/LbgfQTsC8Bw
+eSlQGX7IqMHkCTuWNJw7CoNeOLFhRMtm0DEKnEkZlM0t6kpFshbs12jZu9okcnII
+F5uIoKxx/thbD5AbC1Q74vZr6XOXY5Sc+k9Ic6Jwhe9ZyEt6SUsCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUD/rG69/OuLuzqT5Cprrs0pPKR6QwgZEGA1UdIwSBiTCBhoAU
+D/rG69/OuLuzqT5Cprrs0pPKR6ShY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMYIJAJWwBSvtwjktMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqORur4HQGdQOQCaiyZR5u0+9mM/0w79y
+r8Cmt+H8WB5BBeDgCyOcmaZjF0eEoRBF/ZhtlO54i4CH/yb/Pl6gGlxfGZL9iLu0
+tv4HRIIibnoi0N7Z0r/dhJcrTHo4Ha8EARhAqxoNUSlGVBsaKUfjW9RyCjv4Akyi
+WUSwsmtd/sY=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt
new file mode 100755
index 000000000000..9a6e64301b43
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt
@@ -0,0 +1 @@
+V 341112150713Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 1
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..be26aa5d8f4b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 1
+ Validity
+ Not Before: Nov 18 15:07:13 2009 GMT
+ Not After : Nov 12 15:07:13 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d9:3a:8d:64:95:87:76:76:e8:61:c3:e9:65:f4:
+ a6:b7:0c:77:0e:4b:10:e8:14:a3:e1:84:69:7c:8e:
+ 97:d2:7d:01:ad:b2:dc:5c:cd:c6:91:a1:f3:93:7c:
+ 54:36:64:e3:ca:22:ca:00:cb:c6:91:ab:6b:26:88:
+ 69:60:9a:61:d7:59:17:db:93:7d:09:36:da:28:cb:
+ ec:2d:a4:26:bb:1a:42:20:b8:08:b2:0f:b9:77:a6:
+ 80:71:cf:13:f5:37:a2:90:4d:ab:e8:97:49:d2:80:
+ 94:8f:b1:9d:5a:b4:9f:de:ff:fa:b6:d6:e0:45:5f:
+ cc:d4:10:1e:32:46:7b:ba:55
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A
+ X509v3 Authority Key Identifier:
+ keyid:0F:FA:C6:EB:DF:CE:B8:BB:B3:A9:3E:42:A6:BA:EC:D2:93:CA:47:A4
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 1
+ serial:95:B0:05:2B:ED:C2:39:2D
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 18:f6:02:5e:75:04:5f:eb:3b:07:41:85:c0:9e:08:29:58:3d:
+ b5:6f:c2:aa:24:0d:93:1d:17:fc:be:d6:43:ac:43:d7:4d:a0:
+ 2c:40:fd:3d:d5:7e:91:46:25:49:62:ba:e9:7f:67:c2:fc:8a:
+ c3:a0:37:bf:ec:f9:54:bf:61:10:35:dd:5b:bb:da:7c:70:54:
+ 32:13:b9:ae:7d:ea:a5:7d:aa:55:3e:ef:0a:ef:12:fd:c3:f6:
+ e5:25:98:97:34:02:64:fd:88:79:b3:e2:f4:fc:ff:e7:d3:98:
+ f1:d9:d5:18:d9:b4:62:ae:99:88:61:2e:ff:02:6a:13:35:fe:
+ 37:c7
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxMB4XDTA5MTExODE1MDcx
+M1oXDTM0MTExMjE1MDcxM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDZOo1klYd2duhhw+ll9Ka3DHcOSxDoFKPhhGl8jpfSfQGtstxczcaR
+ofOTfFQ2ZOPKIsoAy8aRq2smiGlgmmHXWRfbk30JNtooy+wtpCa7GkIguAiyD7l3
+poBxzxP1N6KQTavol0nSgJSPsZ1atJ/e//q21uBFX8zUEB4yRnu6VQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBQ3cXSBRN0esWCWQbdLOMS3eRvPijCBkQYDVR0jBIGJMIGG
+gBQP+sbr3864u7OpPkKmuuzSk8pHpKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxggkAlbAFK+3COS0wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAY9gJedQRf6zsHQYXAnggpWD21b8Kq
+JA2THRf8vtZDrEPXTaAsQP091X6RRiVJYrrpf2fC/IrDoDe/7PlUv2EQNd1bu9p8
+cFQyE7mufeqlfapVPu8K7xL9w/blJZiXNAJk/Yh5s+L0/P/n05jx2dUY2bRirpmI
+YS7/AmoTNf43xw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..6d38b24e6fe9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,2D2CC3782F59A842
+
+901JcMMdeCfHjfY05bkyLIsgMxwu4SFJPXZH75ebFtJQpkQQf5WNhSlo3sgKJ5MF
+GZeqQw4w9CmN+CNqQENZOOGrVKxT+sFtWIgSLVk4hrLzPtsT7domHc1yUKfpBH/w
+xo/bsL5wZPqcsxSdlmd4FA0PKzW/rhyYvRxF0oKQx2PVnJKT29WbhwlYurI3+2gG
+pS+N6f7awWjmgyqYvFuFo7DWhERDDL/Bi/sJ7qFinijtfp1CkVG1XWFZ8Tu9ij+t
+KPT3fpWbh4sV0V1ZGng7EPb4c+p/+GHvKsGM9N5kuyxufllNzAeIy6hfTR3mxn0i
+Ep4CoufMi0JwNEfgwBB+o47k1hVoBTn0ofXc2iP6iQWsoC5ZoPPGLLklWK3Tur7P
+kpng8UECTxV2s6J3nYkAoHfy+TzK+nssFPpE8zDmaprpeTj9oh3KrPTn0IdoPHcx
+oI3yqWqDK9uErJBBCAjLF0SPJWAsmp0HsJaGnj5ErVe0yy3jBxVWogVDSWkoWU0W
++umK1pSQrS1A/oKErsnbhPi8XAD/gd4etEaKdcY538QKgE2tdPvhLoAeXxslyOfG
+UiPohtmcm2Mva7vT0Iu1MGKplw76DxmmM1Rpf3+u7Kwf/+K6bMOSBGZQJhjE2AuZ
+aPyHX8gCNlZfqB6eeuWdbqIHhTN5dS2Bba3QquvS84Vgb3O2ck+vdjmdPEeetvA7
+7S4WZYHBRmz1ZHwdfSvwyBkdTRP5YrUhrIthbqy2NjcP9TkpQmJaDIlWXsGY738q
+zTsjCkcnS06x0/JvHe1I8IAib+MFsmGI7Dw25fzgY3ReS4wZRZdU0A==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg
new file mode 100755
index 000000000000..bf73e3549d66
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem
new file mode 100755
index 000000000000..72e6c66e2eb3
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBzCCAnCgAwIBAgIJAL/ID7vZoDprMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxEDAOBgNVBAMTB1Jvb3QgMTAwHhcNMDkx
+MTIzMTUwNzA0WhcNMzQxMTE3MTUwNzA0WjBgMQswCQYDVQQGEwJERTEQMA4GA1UE
+CBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0Rl
+dmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQC5qE1pk/tI2i60IrVhlwS77j7jAyktxRuwKJqBECd2ZD2/goO8wcwD
+R/wfrh+zuLWRwFb57PF1O7ig+WNhQk3GDhXhMbuB82Bwjb/n5phKDWHsAIqDRbH4
+vpl/7sWYXvE46zf41PpQPgudOtqpeL1ENFoHKZOJthkBc4Yx6HTUSQIDAQABo4HI
+MIHFMB0GA1UdDgQWBBTIp6OAIHRsb+wReva+JhA3MYewejCBkgYDVR0jBIGKMIGH
+gBTIp6OAIHRsb+wReva+JhA3MYeweqFkpGIwYDELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMIIJAL/ID7vZoDprMA8GA1UdEwEB
+/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAroDDzqZQL+7NeQuePohejcGfFR/0
+vtbQ3AYViQ2JS42gQpaNaMNcVCvO0nUwLHldLNVdQsn9P0ultu6KcUKkBbY4/2Xp
+er6RMQWsrKVLnszgIi2gk1NiNwZ+N9RISJvElaQuIciZs+8sM6LOPybVTArMjxEo
+U3VqHTViFfOvWC0=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt
new file mode 100755
index 000000000000..2db3924cea70
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt
@@ -0,0 +1 @@
+V 341117151448Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 10
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..1f27b97b3d17
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 10
+ Validity
+ Not Before: Nov 23 15:14:48 2009 GMT
+ Not After : Nov 17 15:14:48 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e4:d5:66:14:88:9f:79:41:50:b0:d1:a0:1b:98:
+ bf:b0:21:34:30:36:70:58:6f:8b:58:f1:b9:58:3a:
+ ce:29:6b:65:b6:11:f7:0d:c8:a6:c3:be:db:0f:2a:
+ 4e:c7:42:df:c9:0e:13:c0:00:0f:af:b5:71:c4:bc:
+ dd:82:fc:4a:27:c0:ee:af:ba:e1:7b:67:de:6b:bb:
+ ac:4c:fe:88:01:1a:73:4e:f5:32:15:3a:d0:cb:6b:
+ 97:84:1b:6c:d0:d6:91:a8:a4:5a:87:2a:69:61:36:
+ 1d:42:cc:16:d0:03:9c:c6:90:5c:61:20:8b:b1:be:
+ b6:54:24:5b:6f:1f:a9:5a:6f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39
+ X509v3 Authority Key Identifier:
+ keyid:C8:A7:A3:80:20:74:6C:6F:EC:11:7A:F6:BE:26:10:37:31:87:B0:7A
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 10
+ serial:BF:C8:0F:BB:D9:A0:3A:6B
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6b:0f:75:6d:56:b0:4e:45:19:65:ad:50:ef:4e:87:6c:95:5d:
+ 05:39:5a:43:5c:b4:51:25:9a:ec:f4:93:d1:f0:f6:91:dd:a3:
+ 77:95:0c:74:3c:a9:7c:c2:f6:62:ce:bf:58:5f:66:1f:d0:55:
+ ca:d8:2d:c4:1e:29:3a:ad:55:2c:9d:2c:8f:8e:9e:ce:ac:17:
+ 7e:1b:d1:16:d9:12:76:5c:2d:3f:9d:70:66:aa:39:34:f0:ec:
+ 31:4b:4b:5a:14:0c:c5:5b:3c:c8:47:02:90:cb:77:d7:4f:88:
+ 10:a7:80:3d:ca:19:5c:b5:04:c9:f0:e1:1b:5a:5f:fb:61:b2:
+ 14:b5
+-----BEGIN CERTIFICATE-----
+MIIDCTCCAnKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMDAeFw0wOTExMjMxNTE0
+NDhaFw0zNDExMTcxNTE0NDhaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxGTAXBgNVBAMTEFN1YiBDQSAxIFJvb3QgMTAwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAOTVZhSIn3lBULDRoBuYv7AhNDA2cFhvi1jxuVg6zilrZbYR9w3I
+psO+2w8qTsdC38kOE8AAD6+1ccS83YL8SifA7q+64Xtn3mu7rEz+iAEac071MhU6
+0Mtrl4QbbNDWkaikWocqaWE2HULMFtADnMaQXGEgi7G+tlQkW28fqVpvAgMBAAGj
+gcgwgcUwHQYDVR0OBBYEFBFjob6L41YH5qOfIzlyfeMitlM5MIGSBgNVHSMEgYow
+gYeAFMino4AgdGxv7BF69r4mEDcxh7B6oWSkYjBgMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwggkAv8gPu9mgOmswDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBrD3VtVrBORRllrVDvTodslV0F
+OVpDXLRRJZrs9JPR8PaR3aN3lQx0PKl8wvZizr9YX2Yf0FXK2C3EHik6rVUsnSyP
+jp7OrBd+G9EW2RJ2XC0/nXBmqjk08OwxS0taFAzFWzzIRwKQy3fXT4gQp4A9yhlc
+tQTJ8OEbWl/7YbIUtQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..f75ccc08ef67
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,78CCF9A24E7B5044
+
+ppKSX6K7DHnU4EvbmBAIzWDJ35yGppjzNdWRKpB7rkGW60dW0Cw0Jmbxf1dfbUC+
+UTWtxE+i0x159jF7jGobPvLFQnAg1ZPUUIgeXJt+fqf/OghY4i8x82BdSlaKJ293
+GgwR9m1N1I2/6ydob+9KwzJhOPhmylyUyRJVAx/OF86E9G4nxtuJA1c1nzSBgwR5
+7uHU0LiY5A42iTDiMmu7Jw4vj6Cy81P88hmyoVzo4JQG8YFuJyLz2ei+DJ3/572z
+BCefqDKmlmI2vvayZW1jgpLDlTwmqiIGUDBBipN4vDmqZAdEbv/9BjLkS4Svy3PU
+xaFs1tFQzv8ivGpyPWU5naoTKhmMhOEAKpEi6YqWbcD/qKn1pRrYSyVyD9zNXHEK
+QrXjTP+D/DMSHNJTo5WI4kxvwSZtPI97vaCTmxkrjnIXDPD5L4v9dJUdejnngsqn
+cHB/C/05dR0RLEp5CHrl0hwGiIY1IgQXmGHY2HEUyQYttyJ5jdY0pdnn9n0eQxHr
+9Mg3WneWC42XHw0pyqEsgiMmr8SjaF42MSrMB6y4WEVtBstn03LTdFnRIFTgZ5Mj
+l/O2mSk+YUBR4CYTUTRaWpzCAZmFVy98I8KQgrhi8t96wrRe0+9tB1uC5PoDNR5P
+CcgsmiEPeqolPZwOmnDdij+DcIiT43Sx2vDYGfDtqc+kur/O6noYyX8Kf7wzcpan
+V4gHTCEOrlcRiEcVIxAQFDpB8CERG9fJvnBdZE9Gjepz6OatRpE/2kDZMelwRcEx
+V5zeE1qNS51gdq2dE0qYkdyU1yfbNUouqtFy/z1sXU6Q5nR1r21jFQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg
new file mode 100755
index 000000000000..cc9663bbd5c5
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem
new file mode 100755
index 000000000000..8cfffd9a6c35
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBzCCAnCgAwIBAgIJAI3gSU2IIGPLMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxEDAOBgNVBAMTB1Jvb3QgMTEwHhcNMTAw
+MTE0MTEzNzA1WhcNMzUwMTA4MTEzNzA2WjBgMQswCQYDVQQGEwJERTEQMA4GA1UE
+CBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0Rl
+dmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDExMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDKGrq6yC3tyctcBo+iz31MF2yvDiQ7YFgez8TswNvb3USOPOUPsCaB
+ufVN6ULSqmGi5BzFIW7CVAj5L+iCrrwMtPyG86fKbvgdWmLepz5a4S1y+vydnQ0B
+rJCNdxmLdQK+l/P7jzrH5xhcR62DPQ2lLabvmixvylHv4H6cFjJ98wIDAQABo4HI
+MIHFMB0GA1UdDgQWBBToarvCkOpscCI+9vZIGwPmvremVTCBkgYDVR0jBIGKMIGH
+gBToarvCkOpscCI+9vZIGwPmvremVaFkpGIwYDELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMYIJAI3gSU2IIGPLMA8GA1UdEwEB
+/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAZRXdBfSqhY+xELs28/gjsZ4/mUvu
+LKL3PruRCNqUgIOznEdxsQXsmLIQhEPZ4a4jd31srFD2j5gJmZ8KdeFXII9NRvIX
+RpRcrl2uclHXWbIC7s6xiATDWumrL2nXB5bU4qYMZ0ybytXprIwkzqRFXUrEHcYm
+OXJCSKayIviQ6G0=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt
new file mode 100755
index 000000000000..7061a98fa15f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt
@@ -0,0 +1,34 @@
+V 350108161110Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAC\xB3 j\xCE\xAC\xCE\xAD\xCE\xAE
+V 350108161614Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAD\x86 j\xCE\xAC\xCE\xAD\xCE\xAE
+V 350112144417Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x04\x0F\x04\x10\x04\x11\x04\x12\x04\x13\x04\x14
+V 350112153942Z 1003 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x01y\x01z\x01{\x00 \x03\xA6\x03\xA7\x03\xA8\x03\xA9
+V 350112160038Z 1004 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"
+V 350112160547Z 1005 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00"\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"\x00"
+V 350112160921Z 1006 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00"\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+V 350112161153Z 1007 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+V 350112161405Z 1008 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+V 350112161631Z 1009 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00"\x00q\x00u\x00o\x00t\x00e
+V 350112161857Z 100A unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00"\x00"\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113090237Z 100B unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+V 350113094852Z 100C unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x001\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113095110Z 100D unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x002\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+V 350113095308Z 100E unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x003\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"
+V 350113095502Z 100F unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+V 350113095752Z 1010 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\
+V 350113095922Z 1011 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00\\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\\x00\
+V 350113100207Z 1012 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00\\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+V 350113100436Z 1013 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113100550Z 1014 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+V 350113100707Z 1015 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00\\x00q\x00u\x00o\x00t\x00e
+V 350113100950Z 1016 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00\\x00\\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113101153Z 1017 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+V 350113101338Z 1018 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x003\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113101450Z 1019 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x002\x004\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+V 350113101610Z 101A unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x005\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+V 350113101745Z 101B unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x002\x006\x00\\x00,\x00 \x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+V 350113101913Z 101C unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=comma, comma, comma ,
+V 350113102047Z 101D unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=equal CN=User 28
+V 350113102213Z 101E unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 29+OU=ooo
+V 350113102601Z 101F unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x003\x000\x00<\x00 \x00>\x00#\x00;\x00 \x00"\x00+\x00"
+V 350113102847Z 1020 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x003\x001\x00 \x00\\x00"\x00a\x00,\x00b\x00"\x00+\x00C\x00N\x00=\x00U\x00S\x00,\x00 \x00>\x00 \x00\\x00\\x00d\x00e\x00 \x00<
+V 350113104059Z 1021 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..6efde26f7e69
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem
@@ -0,0 +1,57 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 14 16:11:10 2010 GMT
+ Not After : Jan 8 16:11:10 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAC\xB3 j\xCE\xAC\xCE\xAD\xCE\xAE
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c5:8e:23:dc:00:60:ab:13:ac:00:15:c8:2f:13:
+ 04:4a:05:15:38:1e:ea:43:cb:68:8e:e3:08:cc:a4:
+ bb:ef:78:3e:4a:d3:3c:89:50:95:c4:16:6f:a4:89:
+ 97:4a:07:ad:17:b4:96:1e:54:87:82:ed:22:a4:15:
+ f7:cf:09:83:b7:4d:ee:75:70:8c:71:5a:b8:e7:4d:
+ 27:b4:f8:eb:19:67:8f:58:3f:4c:5f:b3:ca:aa:bd:
+ 5b:95:d7:b4:ba:d4:bc:0e:69:01:52:b9:8a:2d:55:
+ 83:9e:4d:3f:01:0c:f1:d7:bd:c9:82:54:d2:71:d6:
+ 51:9c:55:4c:a3:82:43:35:2f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ CA:DF:DA:1A:F7:9C:D8:41:19:34:69:EA:67:74:68:CA:A3:24:0F:9F
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 28:3a:db:4b:fd:15:4c:bb:ea:74:b4:53:4f:75:2a:92:3c:78:
+ b6:86:aa:39:bc:b0:67:3a:5a:00:f1:1e:74:5c:c7:2b:19:4f:
+ f4:c0:4d:ff:01:4c:b2:0f:b5:49:14:c3:9a:96:ce:61:b6:c7:
+ 37:82:44:75:76:fc:bd:5d:74:f9:22:ae:f2:36:cb:20:b7:e3:
+ c8:c8:01:ae:d5:01:f6:5e:b4:cb:ca:76:fe:72:98:f3:0a:c3:
+ ac:76:fa:41:67:b4:5c:92:67:fa:ca:17:02:80:00:d8:b6:d5:
+ 01:03:89:25:97:96:60:86:0c:0b:d8:64:94:c9:77:43:28:06:
+ f9:4e
+-----BEGIN CERTIFICATE-----
+MIIClzCCAgCgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTQxNjEx
+MTBaFw0zNTAxMDgxNjExMTBaMHExCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxITAfBgNVBAMUGMW5xbrFu8W8xb3FviDvrLMgas6szq3OrjCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAxY4j3ABgqxOsABXILxMESgUVOB7qQ8tojuMIzKS7
+73g+StM8iVCVxBZvpImXSgetF7SWHlSHgu0ipBX3zwmDt03udXCMcVq4500ntPjr
+GWePWD9MX7PKqr1blde0utS8DmkBUrmKLVWDnk0/AQzx173JglTScdZRnFVMo4JD
+NS8CAwEAAaNPME0wCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTK39oa95zYQRk0aepn
+dGjKoyQPnzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTANBgkqhkiG
+9w0BAQUFAAOBgQAoOttL/RVMu+p0tFNPdSqSPHi2hqo5vLBnOloA8R50XMcrGU/0
+wE3/AUyyD7VJFMOals5htsc3gkR1dvy9XXT5Iq7yNssgt+PIyAGu1QH2XrTLynb+
+cpjzCsOsdvpBZ7Rckmf6yhcCgADYttUBA4kll5ZghgwL2GSUyXdDKAb5Tg==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem
new file mode 100755
index 000000000000..037410ad798b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4098 (0x1002)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 14:44:17 2010 GMT
+ Not After : Jan 12 14:44:17 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x04\x0F\x04\x10\x04\x11\x04\x12\x04\x13\x04\x14
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b4:d3:fd:a0:56:2b:d9:72:66:e3:fc:4b:5b:70:
+ fb:9c:23:10:0b:b9:8a:c4:d1:dd:1d:37:cd:20:f4:
+ 9d:52:c3:8f:80:14:26:c4:3e:dc:3d:af:38:86:70:
+ 2f:e1:54:1c:a6:5e:b6:6a:2d:73:b4:2d:88:7c:ed:
+ eb:63:34:bf:ef:d0:a8:e0:00:ea:f0:24:50:68:3b:
+ ff:03:4a:22:e0:eb:5c:a4:e8:65:e4:c7:e7:38:e9:
+ ce:0c:44:3e:36:08:fe:82:d8:50:b9:13:43:3b:17:
+ 77:09:ef:7b:cc:9f:b4:7d:5d:f7:ab:8e:ab:c0:11:
+ bc:7a:07:ea:98:51:c0:27:1f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 49:1F:9A:43:D9:43:B9:89:0C:00:D9:90:C8:BC:9C:67:CD:8D:3E:C6
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 2 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 03:bc:24:ba:71:8b:4f:cc:3a:60:5a:04:13:15:4e:b0:79:e7:
+ 94:6c:9b:3b:4c:5d:d8:26:75:f5:94:04:71:5a:3e:b9:8c:5f:
+ b5:3d:e0:bb:8b:64:71:8f:0d:9a:99:b8:ff:ec:14:c0:c0:ca:
+ 63:5a:4e:1d:75:77:7a:2f:fb:12:90:25:44:ba:d8:2f:03:39:
+ 86:ef:88:4a:cc:69:79:0b:ff:a6:66:83:45:08:17:0b:0c:05:
+ f9:25:7c:6a:30:05:b3:61:df:1a:fe:2c:ca:49:e9:73:bd:b3:
+ 11:6b:bf:04:b0:a6:46:76:21:40:95:5c:78:b3:aa:4b:fd:03:
+ ee:51
+-----BEGIN CERTIFICATE-----
+MIICszCCAhygAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNDQ0
+MTdaFw0zNTAxMTIxNDQ0MTdaMGUxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxFTATBgNVBAMeDAQPBBAEEQQSBBMEFDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAtNP9oFYr2XJm4/xLW3D7nCMQC7mKxNHdHTfNIPSdUsOPgBQmxD7cPa84
+hnAv4VQcpl62ai1ztC2IfO3rYzS/79Co4ADq8CRQaDv/A0oi4OtcpOhl5MfnOOnO
+DEQ+Ngj+gthQuRNDOxd3Ce97zJ+0fV33q46rwBG8egfqmFHAJx8CAwEAAaN3MHUw
+CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBRJH5pD2UO5iQwA2ZDIvJxnzY0+xjAfBgNV
+HSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAmBgNVHREEHzAdpBswGTEXMBUG
+A1UEAxMOVXNlciAyIFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAA7wkunGLT8w6
+YFoEExVOsHnnlGybO0xd2CZ19ZQEcVo+uYxftT3gu4tkcY8Nmpm4/+wUwMDKY1pO
+HXV3ei/7EpAlRLrYLwM5hu+ISsxpeQv/pmaDRQgXCwwF+SV8ajAFs2HfGv4syknp
+c72zEWu/BLCmRnYhQJVceLOqS/0D7lE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem
new file mode 100755
index 000000000000..95589b227122
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4099 (0x1003)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 15:39:42 2010 GMT
+ Not After : Jan 12 15:39:42 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x01y\x01z\x01{\x00 \x03\xA6\x03\xA7\x03\xA8\x03\xA9
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d6:d8:62:3c:69:c9:dd:93:b3:e9:65:63:89:03:
+ 4e:f8:8a:e1:8b:9d:92:c6:43:ca:8e:af:fd:6e:9c:
+ c7:66:31:48:f4:ce:5e:be:38:c5:6c:1b:48:c9:61:
+ f5:78:8a:e9:74:ac:a8:98:9c:83:f9:b0:74:e3:25:
+ 7c:5a:bb:df:5f:73:ef:fc:a0:dc:6a:ac:07:a2:b8:
+ 52:ea:7a:42:ba:9f:74:3c:00:cc:26:46:ba:90:5d:
+ 45:78:02:57:e7:47:9f:8e:94:9c:5a:31:ab:f3:ff:
+ bc:9f:7f:d9:b0:a6:f6:86:70:a6:9d:52:ff:c8:19:
+ 47:88:75:78:6a:73:d5:97:e9
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ E3:01:F6:1E:51:6D:FC:DB:BF:82:A9:12:21:4B:E2:46:FF:E8:EE:FF
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 1 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 68:f0:88:18:d5:98:63:da:42:39:47:bf:51:22:f6:0b:8e:46:
+ b0:8c:83:b0:4d:07:a4:e3:a9:66:76:4d:41:23:1a:6b:dc:d8:
+ d1:85:b1:bf:4f:f9:e6:01:4a:36:a9:a3:26:2d:0b:33:cc:36:
+ 97:c6:40:b6:77:26:1c:06:f2:1b:fa:0a:ef:5c:61:8d:0d:9c:
+ 3c:d3:0f:db:dd:60:69:8c:24:c6:70:bc:f8:3b:38:19:90:7a:
+ f3:4f:7e:7c:b7:69:b6:0f:55:e1:4b:da:77:cd:b1:fe:5f:f1:
+ c1:8a:f8:3d:26:10:3d:40:6f:83:17:0a:d8:dd:da:a1:27:10:
+ a1:73
+-----BEGIN CERTIFICATE-----
+MIICtzCCAiCgAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNTM5
+NDJaFw0zNTAxMTIxNTM5NDJaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxGTAXBgNVBAMeEAF5AXoBewAgA6YDpwOoA6kwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANbYYjxpyd2Ts+llY4kDTviK4YudksZDyo6v/W6cx2YxSPTOXr44
+xWwbSMlh9XiK6XSsqJicg/mwdOMlfFq7319z7/yg3GqsB6K4Uup6QrqfdDwAzCZG
+upBdRXgCV+dHn46UnFoxq/P/vJ9/2bCm9oZwpp1S/8gZR4h1eGpz1ZfpAgMBAAGj
+dzB1MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQU4wH2HlFt/Nu/gqkSIUviRv/o7v8w
+HwYDVR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkx
+FzAVBgNVBAMTDlVzZXIgMSBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGjwiBjV
+mGPaQjlHv1Ei9guORrCMg7BNB6TjqWZ2TUEjGmvc2NGFsb9P+eYBSjapoyYtCzPM
+NpfGQLZ3JhwG8hv6Cu9cYY0NnDzTD9vdYGmMJMZwvPg7OBmQevNPfny3abYPVeFL
+2nfNsf5f8cGK+D0mED1Ab4MXCtjd2qEnEKFz
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem
new file mode 100755
index 000000000000..6f57ca684532
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4100 (0x1004)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:00:38 2010 GMT
+ Not After : Jan 12 16:00:38 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c9:ff:37:16:4d:7a:ad:59:bd:f2:c4:dc:4f:79:
+ 6a:f6:21:c7:ef:cd:af:f1:39:34:24:92:f4:46:d3:
+ 8b:43:31:55:11:3e:22:2b:85:19:38:ed:0b:35:3c:
+ 73:fc:b9:17:e8:73:99:21:a2:20:30:b4:e9:11:c6:
+ 7a:61:fa:fa:fe:eb:c8:30:c4:73:5f:77:f2:fc:42:
+ b7:10:29:ac:9e:8a:c2:df:25:9b:44:17:05:a3:39:
+ d9:1b:58:62:fb:2c:86:07:f7:f0:28:7b:5a:38:1b:
+ 6a:de:88:fb:ad:32:f4:53:e2:a1:c5:0f:68:db:64:
+ ae:39:2a:5e:02:d0:b5:38:07
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 86:2F:46:D0:A9:F9:3F:22:BD:57:83:51:35:F9:67:11:A2:00:AB:33
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 3 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ bb:f6:61:ae:30:94:3a:4a:d6:d5:cb:b5:50:bb:ca:0e:ab:9f:
+ 09:e9:78:d4:2f:20:fe:18:4e:d8:61:db:97:28:a9:d9:dc:e5:
+ 06:f8:6c:41:c2:5a:95:53:47:7e:a7:73:c9:45:4f:6b:30:fc:
+ fd:17:9a:7b:a9:d8:27:57:a9:fd:8d:e7:7e:4b:3e:98:11:42:
+ 00:39:1a:55:4b:3d:a5:de:75:3c:43:5a:33:10:d3:cf:4e:04:
+ 0a:71:d4:93:2b:0b:2b:15:82:7b:04:46:9b:50:da:18:84:66:
+ 31:75:36:5b:09:eb:82:5d:7d:e1:35:a3:a4:6c:b2:ac:c8:fa:
+ bd:5f
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAQwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjAw
+MzhaFw0zNTAxMTIxNjAwMzhaMH0xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxLTArBgNVBAMeJAAiAGUAbgBjAGwAbwBzAGkAbgBnACAAcQB1AG8AdABlAHMA
+IjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyf83Fk16rVm98sTcT3lq9iHH
+782v8Tk0JJL0RtOLQzFVET4iK4UZOO0LNTxz/LkX6HOZIaIgMLTpEcZ6Yfr6/uvI
+MMRzX3fy/EK3ECmsnorC3yWbRBcFoznZG1hi+yyGB/fwKHtaOBtq3oj7rTL0U+Kh
+xQ9o22SuOSpeAtC1OAcCAwEAAaN3MHUwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBSG
+L0bQqfk/Ir1Xg1E1+WcRogCrMzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPm
+vremVTAmBgNVHREEHzAdpBswGTEXMBUGA1UEAxMOVXNlciAzIFJvb3QgMTEwDQYJ
+KoZIhvcNAQEFBQADgYEAu/ZhrjCUOkrW1cu1ULvKDqufCel41C8g/hhO2GHblyip
+2dzlBvhsQcJalVNHfqdzyUVPazD8/Reae6nYJ1ep/Y3nfks+mBFCADkaVUs9pd51
+PENaMxDTz04ECnHUkysLKxWCewRGm1DaGIRmMXU2Wwnrgl194TWjpGyyrMj6vV8=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem
new file mode 100755
index 000000000000..3a2f7522d19d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4101 (0x1005)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:05:47 2010 GMT
+ Not After : Jan 12 16:05:47 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00"\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:de:4d:31:93:c5:1b:7c:2b:85:86:da:89:3d:06:
+ 6f:6d:44:a5:de:6c:6a:06:28:b0:96:7b:40:34:01:
+ af:e4:b1:f4:93:f1:25:78:b0:43:ea:92:2a:87:60:
+ e8:be:7e:c9:b6:02:f8:14:93:1b:b8:5f:cb:2c:24:
+ e2:80:24:f0:5c:6d:77:f2:dc:ef:90:d6:d1:78:22:
+ 53:f0:7f:45:ad:f2:1a:9d:25:08:13:c8:62:6b:9e:
+ 88:79:3d:9e:b4:0a:05:11:79:7d:a1:b2:46:89:f3:
+ 45:ce:f3:22:2e:17:ab:e1:a9:b1:04:93:3b:f3:ca:
+ e6:60:c0:fd:91:7f:34:80:65
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ C1:6E:6A:FB:5A:B1:0C:67:07:C8:7E:F1:8D:86:F6:D0:27:56:6D:73
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 4 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 61:72:4b:33:1d:60:91:08:19:4f:ff:ec:8e:9e:83:71:d7:00:
+ 96:0a:b5:82:b7:8c:a6:3f:70:64:36:ac:25:a7:f1:a9:83:f1:
+ 63:f8:29:06:fa:58:86:8a:fd:25:9e:77:38:dd:c7:3b:cd:68:
+ 91:8e:f4:57:42:c9:6b:88:87:ec:24:57:38:84:fb:c0:d9:bc:
+ 6c:1c:6e:9d:9d:b9:da:cc:7e:fe:f9:bd:29:be:14:26:6f:63:
+ 1f:6f:6a:f1:dd:fd:d2:03:69:f2:36:e1:35:e0:57:72:d5:e3:
+ 09:ee:6a:08:45:b4:73:e9:d1:18:c2:38:1d:86:53:53:6d:bf:
+ f0:1e
+-----BEGIN CERTIFICATE-----
+MIIC3jCCAkegAwIBAgICEAUwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjA1
+NDdaFw0zNTAxMTIxNjA1NDdaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT8wPQYDVQQDHjYAIgAiAGQAbwB1AGIAbABlACAAZQBuAGMAbABvAHMAaQBu
+AGcAIABxAHUAbwB0AGUAcwAiACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AN5NMZPFG3wrhYbaiT0Gb21Epd5sagYosJZ7QDQBr+Sx9JPxJXiwQ+qSKodg6L5+
+ybYC+BSTG7hfyywk4oAk8Fxtd/Lc75DW0XgiU/B/Ra3yGp0lCBPIYmueiHk9nrQK
+BRF5faGyRonzRc7zIi4Xq+GpsQSTO/PK5mDA/ZF/NIBlAgMBAAGjdzB1MAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUwW5q+1qxDGcHyH7xjYb20CdWbXMwHwYDVR0jBBgw
+FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkxFzAVBgNVBAMT
+DlVzZXIgNCBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGFySzMdYJEIGU//7I6e
+g3HXAJYKtYK3jKY/cGQ2rCWn8amD8WP4KQb6WIaK/SWedzjdxzvNaJGO9FdCyWuI
+h+wkVziE+8DZvGwcbp2dudrMfv75vSm+FCZvYx9vavHd/dIDafI24TXgV3LV4wnu
+aghFtHPp0RjCOB2GU1Ntv/Ae
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem
new file mode 100755
index 000000000000..cb72b8d1610a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4102 (0x1006)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:09:21 2010 GMT
+ Not After : Jan 12 16:09:21 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00"\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d1:a4:91:c7:28:84:f8:54:63:09:1f:bc:2e:4e:
+ a3:be:54:01:42:2e:f7:ef:4f:b8:46:a9:35:b1:b3:
+ 29:0e:8b:f7:b5:fa:b7:71:5b:33:03:ac:e6:b5:f6:
+ ba:f5:ba:21:72:ed:7d:ea:f0:f1:2c:55:2a:a9:c6:
+ d8:54:ef:12:f0:f5:37:ca:57:b2:3c:ce:7c:5a:57:
+ 86:68:a2:51:82:80:bd:58:a5:04:1c:e8:cf:f6:5b:
+ 4e:d2:6a:79:63:eb:ac:52:7c:61:8c:fe:0a:6b:b2:
+ f6:16:9c:94:ae:a6:f6:69:b9:d5:0b:26:0d:01:7f:
+ 62:d2:58:c2:02:53:25:63:0d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 45:DF:D7:35:D1:13:E4:8F:E3:0D:E3:7E:A9:9A:5D:56:00:64:4E:43
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 5 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 9d:bd:dc:dc:8e:a8:e8:e4:15:cb:14:c1:6a:ab:d8:ab:e6:e5:
+ 4f:f5:a8:8b:2c:ab:80:e2:31:f9:89:d8:12:ba:9c:4f:b3:f5:
+ bb:7e:ee:8b:df:58:d3:b2:ee:f8:c5:46:c3:5d:2e:a9:35:d0:
+ 7a:1e:80:18:14:4d:78:6e:f1:c8:9a:51:db:86:3e:2c:04:4a:
+ 0a:2f:f1:7a:01:e3:1b:31:d7:1d:f1:32:c4:04:db:b9:7e:c4:
+ fd:b0:c1:41:3f:8a:b3:88:4f:4a:9c:a6:38:11:2a:4a:0f:8b:
+ d0:9a:8a:2c:33:fe:7f:42:b5:93:8d:54:df:de:2b:b1:08:5c:
+ d9:0d
+-----BEGIN CERTIFICATE-----
+MIIC6DCCAlGgAwIBAgICEAYwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjA5
+MjFaFw0zNTAxMTIxNjA5MjFaMIGZMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MUkwRwYDVQQDHkAAIgAiAHQAdwBvACAAcwB0AGEAcgB0AGkAbgBnACAAbwBu
+AGUAIABlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQAiMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDRpJHHKIT4VGMJH7wuTqO+VAFCLvfvT7hGqTWxsykOi/e1+rdx
+WzMDrOa19rr1uiFy7X3q8PEsVSqpxthU7xLw9TfKV7I8znxaV4ZoolGCgL1YpQQc
+6M/2W07Sanlj66xSfGGM/gprsvYWnJSupvZpudULJg0Bf2LSWMICUyVjDQIDAQAB
+o3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFEXf1zXRE+SP4w3jfqmaXVYAZE5D
+MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1UdEQQfMB2kGzAZ
+MRcwFQYDVQQDEw5Vc2VyIDUgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQCdvdzc
+jqjo5BXLFMFqq9ir5uVP9aiLLKuA4jH5idgSupxPs/W7fu6L31jTsu74xUbDXS6p
+NdB6HoAYFE14bvHImlHbhj4sBEoKL/F6AeMbMdcd8TLEBNu5fsT9sMFBP4qziE9K
+nKY4ESpKD4vQmoosM/5/QrWTjVTf3iuxCFzZDQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem
new file mode 100755
index 000000000000..ce9b36d12d7a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4103 (0x1007)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:11:53 2010 GMT
+ Not After : Jan 12 16:11:53 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d1:99:9c:20:2e:65:ee:0f:ce:cb:8a:d8:70:c8:
+ 04:3c:ac:2f:14:7c:6c:8f:5e:95:36:f8:53:74:5b:
+ 88:bf:a1:43:73:04:ab:3a:42:b4:7c:2c:3c:3b:63:
+ 7e:ef:82:c5:bb:b1:28:9b:8b:b7:29:72:3d:30:08:
+ e9:a2:d7:4b:08:e2:2e:e6:d4:9f:75:29:31:23:be:
+ b4:30:5d:94:30:41:38:a1:d5:34:bc:69:f5:d8:8d:
+ c6:08:cc:28:4a:92:22:2b:19:89:f5:ad:7c:49:89:
+ b3:63:c6:e5:6c:86:d7:62:05:1b:97:db:2d:fb:c2:
+ 47:e5:51:a6:f0:50:6f:e3:53
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 5F:DA:34:F6:6F:BA:9E:12:99:DC:02:2A:4C:3E:8C:0D:14:A1:9B:2B
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 6 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 24:af:11:b6:1a:5c:d1:bf:70:93:85:c0:2e:10:96:4d:b7:ad:
+ 4e:d7:c4:7e:87:a1:3b:20:d7:bf:04:07:cc:91:13:0c:ad:66:
+ 08:d6:2e:b6:d0:aa:d0:45:0e:c0:92:3d:7c:a6:82:19:04:3c:
+ 9a:b3:5e:e8:fe:9e:5c:d6:17:75:73:e3:3c:64:0c:ae:5d:92:
+ 2a:eb:0e:ef:04:f5:ce:a5:7f:1f:2f:1d:05:a0:70:f4:24:80:
+ c3:38:35:2d:e5:ac:a7:11:4a:3e:a2:b2:d1:14:91:ba:b0:d8:
+ 5f:be:80:8a:34:2c:72:fb:00:47:88:47:9e:34:65:12:ad:9f:
+ ff:99
+-----BEGIN CERTIFICATE-----
+MIICxTCCAi6gAwIBAgICEAcwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjEx
+NTNaFw0zNTAxMTIxNjExNTNaMHcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxJzAlBgNVBAMeHgAiAHMAdABhAHIAdABpAG4AZwAgAHEAdQBvAHQAZTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0ZmcIC5l7g/Oy4rYcMgEPKwvFHxsj16V
+NvhTdFuIv6FDcwSrOkK0fCw8O2N+74LFu7Eom4u3KXI9MAjpotdLCOIu5tSfdSkx
+I760MF2UMEE4odU0vGn12I3GCMwoSpIiKxmJ9a18SYmzY8blbIbXYgUbl9st+8JH
+5VGm8FBv41MCAwEAAaN3MHUwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBRf2jT2b7qe
+EpncAipMPowNFKGbKzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAm
+BgNVHREEHzAdpBswGTEXMBUGA1UEAxMOVXNlciA2IFJvb3QgMTEwDQYJKoZIhvcN
+AQEFBQADgYEAJK8Rthpc0b9wk4XALhCWTbetTtfEfoehOyDXvwQHzJETDK1mCNYu
+ttCq0EUOwJI9fKaCGQQ8mrNe6P6eXNYXdXPjPGQMrl2SKusO7wT1zqV/Hy8dBaBw
+9CSAwzg1LeWspxFKPqKy0RSRurDYX76AijQscvsAR4hHnjRlEq2f/5k=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem
new file mode 100755
index 000000000000..8d6f2bd25c05
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4104 (0x1008)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:14:05 2010 GMT
+ Not After : Jan 12 16:14:05 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a6:a8:3f:60:a7:9a:3b:20:c9:2c:8c:4f:cd:11:
+ 1f:0d:a9:2a:2c:eb:12:80:0c:55:8a:4d:06:ef:b2:
+ 5f:2e:47:be:0d:10:22:8a:15:57:29:4a:90:63:f9:
+ 1c:13:85:47:c7:c9:b9:76:09:10:a9:b1:94:5c:8d:
+ c9:f4:01:26:43:e4:d4:98:d6:00:1a:d4:cd:2a:d1:
+ cd:7e:4c:4e:ab:18:78:5a:fb:b2:ec:a3:87:a1:0e:
+ 84:3f:70:cf:ca:02:24:c8:d7:1b:83:a3:ac:a5:f0:
+ 10:c5:de:b7:a2:6c:0b:0c:9d:ab:32:a3:1a:c9:ae:
+ 9b:48:a8:65:cd:50:db:0b:cf
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 91:32:56:26:62:63:A1:32:B0:BC:D0:91:F1:D8:F2:94:CB:10:F1:91
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 7 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 4c:d5:2f:ab:fb:83:f8:11:c9:d2:df:aa:dc:e9:b8:38:2e:53:
+ e1:3a:5b:bb:0a:bf:72:f7:47:b5:57:de:82:8a:e6:bb:7d:62:
+ af:1b:9c:8e:4a:f5:cf:0b:ac:e9:06:16:ca:59:f1:7f:d7:45:
+ c0:88:84:ee:f4:c7:8b:e0:39:aa:c7:b7:95:b9:fe:a2:4a:3a:
+ 41:df:d0:02:bf:6f:54:30:9a:9a:0a:a6:04:5f:f4:17:52:d6:
+ c2:39:43:5e:b9:a3:86:0f:3d:ad:eb:a3:81:f4:cc:90:29:17:
+ dc:46:5e:6b:9c:f6:70:0f:b2:0f:dc:0f:9c:9f:09:6c:fa:31:
+ 6c:01
+-----BEGIN CERTIFICATE-----
+MIICwTCCAiqgAwIBAgICEAgwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE0
+MDVaFw0zNTAxMTIxNjE0MDVaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxIzAhBgNVBAMeGgBlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQAiMIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQCmqD9gp5o7IMksjE/NER8NqSos6xKADFWKTQbv
+sl8uR74NECKKFVcpSpBj+RwThUfHybl2CRCpsZRcjcn0ASZD5NSY1gAa1M0q0c1+
+TE6rGHha+7Lso4ehDoQ/cM/KAiTI1xuDo6yl8BDF3reibAsMnasyoxrJrptIqGXN
+UNsLzwIDAQABo3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFJEyViZiY6EysLzQ
+kfHY8pTLEPGRMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1Ud
+EQQfMB2kGzAZMRcwFQYDVQQDEw5Vc2VyIDcgUm9vdCAxMTANBgkqhkiG9w0BAQUF
+AAOBgQBM1S+r+4P4EcnS36rc6bg4LlPhOlu7Cr9y90e1V96Ciua7fWKvG5yOSvXP
+C6zpBhbKWfF/10XAiITu9MeL4Dmqx7eVuf6iSjpB39ACv29UMJqaCqYEX/QXUtbC
+OUNeuaOGDz2t66OB9MyQKRfcRl5rnPZwD7IP3A+cnwls+jFsAQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem
new file mode 100755
index 000000000000..c1a94dae5d59
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4105 (0x1009)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:16:31 2010 GMT
+ Not After : Jan 12 16:16:31 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00"\x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b4:3b:c7:b0:6c:b5:f2:b3:a5:79:89:54:de:af:
+ 03:3c:0e:c9:57:15:8e:73:2a:48:83:18:59:ce:b4:
+ 12:fb:5c:92:28:69:75:18:f9:0f:24:15:95:38:b2:
+ 4c:81:07:90:97:3b:d7:3a:ab:a6:92:5a:9f:5a:1f:
+ fe:14:ac:4d:b5:5e:6a:a6:0f:98:55:08:07:09:07:
+ a5:fb:79:9e:a0:2d:73:99:92:ad:6e:bc:75:36:d0:
+ b5:f1:1c:91:3a:d4:49:8a:60:1e:a7:01:2f:bc:d9:
+ cd:b4:f4:70:b4:38:d1:3c:d3:ee:00:df:b3:83:45:
+ 63:5c:5d:28:47:bc:b1:b9:57
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ D6:18:38:7B:14:4B:D6:72:42:A9:53:E2:1D:BE:81:88:26:DB:0A:06
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 8 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 98:f3:ac:db:7b:a0:00:d2:58:be:74:21:ff:09:29:4c:0c:1a:
+ 7a:1f:dd:e2:f3:f4:9a:52:5d:da:ac:10:30:f9:b8:93:10:60:
+ 46:bf:48:47:bd:af:87:a1:d9:c6:46:81:b3:0d:a4:f8:ba:ca:
+ 17:7c:f2:f9:46:03:62:7f:32:6b:f0:7c:75:a4:05:44:cb:10:
+ 42:36:ce:12:c0:b9:e5:5f:e0:7b:c6:c8:39:5c:0c:50:30:a0:
+ f6:fe:e1:a2:e6:00:b3:fc:86:56:11:66:d8:41:81:e3:4e:15:
+ e5:68:9d:1c:b0:c4:4f:ab:86:75:55:fa:39:58:3f:7c:68:03:
+ e0:76
+-----BEGIN CERTIFICATE-----
+MIICwTCCAiqgAwIBAgICEAkwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE2
+MzFaFw0zNTAxMTIxNjE2MzFaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxIzAhBgNVBAMeGgBtAGkAZABkAGwAZQAgACIAcQB1AG8AdABlMIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQC0O8ewbLXys6V5iVTerwM8DslXFY5zKkiDGFnO
+tBL7XJIoaXUY+Q8kFZU4skyBB5CXO9c6q6aSWp9aH/4UrE21XmqmD5hVCAcJB6X7
+eZ6gLXOZkq1uvHU20LXxHJE61EmKYB6nAS+82c209HC0ONE80+4A37ODRWNcXShH
+vLG5VwIDAQABo3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNYYOHsUS9ZyQqlT
+4h2+gYgm2woGMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1Ud
+EQQfMB2kGzAZMRcwFQYDVQQDEw5Vc2VyIDggUm9vdCAxMTANBgkqhkiG9w0BAQUF
+AAOBgQCY86zbe6AA0li+dCH/CSlMDBp6H93i8/SaUl3arBAw+biTEGBGv0hHva+H
+odnGRoGzDaT4usoXfPL5RgNifzJr8Hx1pAVEyxBCNs4SwLnlX+B7xsg5XAxQMKD2
+/uGi5gCz/IZWEWbYQYHjThXlaJ0csMRPq4Z1Vfo5WD98aAPgdg==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem
new file mode 100755
index 000000000000..a3a79bf83111
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4106 (0x100a)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 18 16:18:57 2010 GMT
+ Not After : Jan 12 16:18:57 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00"\x00"\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e5:3f:d4:e1:d6:26:2a:c9:40:1d:34:3c:1e:e8:
+ f4:54:67:6b:6c:a5:b7:fe:04:bb:cb:0e:c0:2d:26:
+ 61:c1:81:80:9d:da:1b:fd:d3:7a:7a:57:78:c5:f6:
+ e6:4b:ad:2d:a2:8d:49:b3:ac:18:ca:1c:25:67:44:
+ 7c:8e:b5:ab:ec:f7:a8:da:b7:37:ed:77:76:b2:8f:
+ bb:15:b2:e3:45:5f:b2:2a:aa:27:b7:f1:bc:37:8f:
+ b7:b4:c5:ff:45:fd:67:04:25:47:2c:1a:a7:63:1e:
+ 97:f6:ac:d7:39:cf:ef:24:63:a1:87:9b:36:97:92:
+ fa:d9:4d:a9:fa:dd:c9:fb:75
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 62:F1:43:E3:B1:7B:98:0D:69:A4:8F:CF:32:F7:6D:E6:88:D6:23:90
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 9 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ ab:46:88:13:e8:02:63:4e:f2:a0:5a:48:7e:35:a4:c2:f8:55:
+ 33:cb:ef:45:55:30:81:a1:9e:c2:c7:43:cd:19:23:1f:df:3f:
+ 8b:b8:7e:69:5e:98:06:b1:47:dd:e5:05:e2:3a:19:cf:af:e3:
+ dd:7b:75:e5:53:b0:bc:4e:58:40:bf:3b:d2:9c:7f:9e:b1:66:
+ f8:3f:58:c4:5f:ab:be:1f:03:fb:89:47:a4:25:8a:1e:10:e0:
+ 20:33:70:07:13:92:32:e1:bf:92:6a:d5:89:03:2c:ad:e1:85:
+ 8c:b3:1d:ee:0c:35:70:2f:aa:e5:e0:77:97:b0:9b:a3:0d:22:
+ 6f:dc
+-----BEGIN CERTIFICATE-----
+MIIC0jCCAjugAwIBAgICEAowDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE4
+NTdaFw0zNTAxMTIxNjE4NTdaMIGDMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTMwMQYDVQQDHioAZABvAHUAYgBsAGUAIAAiACIAbQBpAGQAZABsAGUAIABx
+AHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOU/1OHWJirJQB00
+PB7o9FRna2ylt/4Eu8sOwC0mYcGBgJ3aG/3TenpXeMX25kutLaKNSbOsGMocJWdE
+fI61q+z3qNq3N+13drKPuxWy40VfsiqqJ7fxvDePt7TF/0X9ZwQlRywap2Mel/as
+1znP7yRjoYebNpeS+tlNqfrdyft1AgMBAAGjdzB1MAsGA1UdDwQEAwIF4DAdBgNV
+HQ4EFgQUYvFD47F7mA1ppI/PMvdt5ojWI5AwHwYDVR0jBBgwFoAU6Gq7wpDqbHAi
+Pvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkxFzAVBgNVBAMTDlVzZXIgOSBSb290
+IDExMA0GCSqGSIb3DQEBBQUAA4GBAKtGiBPoAmNO8qBaSH41pML4VTPL70VVMIGh
+nsLHQ80ZIx/fP4u4fmlemAaxR93lBeI6Gc+v4917deVTsLxOWEC/O9Kcf56xZvg/
+WMRfq74fA/uJR6Qlih4Q4CAzcAcTkjLhv5Jq1YkDLK3hhYyzHe4MNXAvquXgd5ew
+m6MNIm/c
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem
new file mode 100755
index 000000000000..75684732d762
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4107 (0x100b)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:02:37 2010 GMT
+ Not After : Jan 13 09:02:37 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ae:9f:8e:b8:88:8e:ed:53:aa:2a:2c:ed:f1:6c:
+ 99:47:9f:ab:8b:4e:8e:d8:2e:c2:78:2c:54:f9:29:
+ 14:27:b9:6a:3c:33:3f:06:51:ba:76:15:0a:16:60:
+ db:f2:f0:db:af:5b:38:be:18:42:b4:31:02:ba:6f:
+ 19:00:57:be:d0:f3:7c:6b:34:36:e8:7c:45:77:0d:
+ f5:d0:7c:0e:23:64:7c:59:02:5c:54:15:71:82:be:
+ 98:3f:c9:2d:f0:9e:d5:f0:32:02:44:61:5b:2f:71:
+ 16:13:9a:b3:2b:28:ff:d5:d8:3d:00:9c:eb:ec:b7:
+ 04:e2:b6:15:42:45:e5:ef:3f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 8C:2C:B6:8B:82:43:DC:41:EC:AC:D4:75:E8:DA:D8:3F:A9:A0:F5:31
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 10 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 48:a6:51:46:5b:44:a5:be:18:ed:8f:d4:c6:d2:3c:86:8f:e7:
+ e5:f4:a2:5d:51:aa:00:9b:bc:d8:b1:d3:f4:24:a0:a1:0d:80:
+ 2e:7e:62:26:ee:8c:4b:bd:79:0c:39:bd:6e:af:db:92:b6:03:
+ b1:b0:49:95:a7:59:28:54:30:33:fc:7e:2f:0f:a2:ce:90:27:
+ 29:b9:d8:3f:99:36:e9:81:9f:f5:fa:cb:f9:f2:05:b5:48:60:
+ 4d:50:4d:1e:ba:45:fd:f1:99:84:a6:79:0b:6b:76:eb:73:9d:
+ 5c:47:27:be:0d:23:0b:97:cc:9d:5a:80:fa:9b:ff:66:e7:37:
+ 60:a4
+-----BEGIN CERTIFICATE-----
+MIIC3zCCAkigAwIBAgICEAswDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTAy
+MzdaFw0zNTAxMTMwOTAyMzdaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT8wPQYDVQQDHjYAcABhAHIAdABpAGEAbABsAHkAIAAiAGUAbgBjAGwAbwBz
+AGkAbgBnACAAcQB1AG8AdABlACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AK6fjriIju1Tqios7fFsmUefq4tOjtguwngsVPkpFCe5ajwzPwZRunYVChZg2/Lw
+269bOL4YQrQxArpvGQBXvtDzfGs0Nuh8RXcN9dB8DiNkfFkCXFQVcYK+mD/JLfCe
+1fAyAkRhWy9xFhOasyso/9XYPQCc6+y3BOK2FUJF5e8/AgMBAAGjeDB2MAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUjCy2i4JD3EHsrNR16NrYP6mg9TEwHwYDVR0jBBgw
+FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT
+D1VzZXIgMTAgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBIplFGW0Slvhjtj9TG
+0jyGj+fl9KJdUaoAm7zYsdP0JKChDYAufmIm7oxLvXkMOb1ur9uStgOxsEmVp1ko
+VDAz/H4vD6LOkCcpudg/mTbpgZ/1+sv58gW1SGBNUE0eukX98ZmEpnkLa3brc51c
+Rye+DSMLl8ydWoD6m/9m5zdgpA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem
new file mode 100755
index 000000000000..115190ca6780
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4108 (0x100c)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:48:52 2010 GMT
+ Not After : Jan 13 09:48:52 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x001\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e2:8b:a9:94:06:b0:cb:e7:1b:a3:fd:7c:70:d1:
+ 66:e6:2d:aa:c7:ec:2e:e3:08:c3:39:3f:48:47:fd:
+ 09:67:2d:16:17:87:c0:e3:4d:c1:cc:6b:3f:c4:7b:
+ 74:d5:71:70:d6:74:8a:a2:17:fd:39:78:f8:c7:b3:
+ 42:54:ac:f7:07:d7:6f:55:da:03:15:11:e0:c2:d8:
+ 95:d2:87:c3:9c:3d:94:96:9d:01:81:5d:61:43:aa:
+ 4c:92:d5:68:aa:6c:73:88:52:7b:ee:9b:76:65:0d:
+ 2a:ae:3d:83:71:41:44:8b:23:7d:a6:f9:3c:81:56:
+ 6c:9b:52:96:87:c8:97:18:8d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 48:89:BE:3C:AA:C9:5A:38:6B:CA:FA:C8:B2:BB:F7:E1:44:4B:7B:08
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 11 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 23:c9:5b:f5:9f:59:ff:97:0b:79:35:2d:32:db:b7:4b:b1:c9:
+ 2b:1e:cf:88:7b:b4:4e:f0:ed:13:a3:64:85:8f:d6:70:b5:ed:
+ 2a:57:92:a0:b4:14:96:48:7a:aa:a4:19:59:df:d9:a9:0f:86:
+ a3:e5:ec:b5:67:ef:c3:ee:23:dd:c3:3e:24:86:6c:09:03:59:
+ ab:93:d6:c7:0a:4c:ef:c5:4a:be:d6:ff:0f:2e:81:8e:18:d5:
+ 44:21:3a:0e:86:04:aa:86:8a:38:1e:d6:07:75:d0:08:be:ef:
+ 29:7d:d2:fc:85:8d:0c:d3:bd:ea:47:be:40:bb:fa:2f:29:fc:
+ c6:d8
+-----BEGIN CERTIFICATE-----
+MIIC2TCCAkKgAwIBAgICEAwwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTQ4
+NTJaFw0zNTAxMTMwOTQ4NTJaMIGJMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTkwNwYDVQQDHjAAIgBVAHMAZQByACAAMQAxACwAIABzAHQAYQByAHQAaQBu
+AGcAIABxAHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOKLqZQG
+sMvnG6P9fHDRZuYtqsfsLuMIwzk/SEf9CWctFheHwONNwcxrP8R7dNVxcNZ0iqIX
+/Tl4+MezQlSs9wfXb1XaAxUR4MLYldKHw5w9lJadAYFdYUOqTJLVaKpsc4hSe+6b
+dmUNKq49g3FBRIsjfab5PIFWbJtSlofIlxiNAgMBAAGjeDB2MAsGA1UdDwQEAwIF
+4DAdBgNVHQ4EFgQUSIm+PKrJWjhryvrIsrv34URLewgwHwYDVR0jBBgwFoAU6Gq7
+wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIg
+MTEgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAjyVv1n1n/lwt5NS0y27dLsckr
+Hs+Ie7RO8O0To2SFj9Zwte0qV5KgtBSWSHqqpBlZ39mpD4aj5ey1Z+/D7iPdwz4k
+hmwJA1mrk9bHCkzvxUq+1v8PLoGOGNVEIToOhgSqhoo4HtYHddAIvu8pfdL8hY0M
+073qR75Au/ovKfzG2A==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem
new file mode 100755
index 000000000000..95e419a174a3
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4109 (0x100d)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:51:10 2010 GMT
+ Not After : Jan 13 09:51:10 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x002\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:bf:4f:93:6b:6b:86:76:30:31:3b:0e:eb:b7:a6:
+ b9:a3:3e:84:ea:d5:31:50:5a:df:f4:3f:67:11:5a:
+ a5:28:23:58:37:67:a5:5c:72:6d:f2:fc:80:81:55:
+ 78:86:28:e9:60:c2:0a:d0:17:3c:3a:e9:a8:01:71:
+ 64:b8:27:f4:42:e0:d7:69:f5:4e:ef:14:07:69:fd:
+ de:7b:af:c8:a4:0c:9c:56:00:8b:76:67:d1:ba:a9:
+ e7:40:63:77:da:44:d3:89:5c:a7:5a:ea:d5:f3:9b:
+ 15:43:f3:08:2d:bc:8a:bf:4a:5b:57:01:f0:c7:97:
+ fe:b0:93:b2:1b:79:a0:4e:ad
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 0A:A2:A6:09:88:23:56:82:9E:60:8B:79:23:61:CA:BF:D4:F7:ED:A9
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 12 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 64:3e:b6:a6:5e:0d:6f:b3:e7:f6:c7:1f:4a:48:96:4c:fe:13:
+ 3c:4a:7b:e7:46:51:56:45:66:02:e4:79:1a:7f:15:a4:e9:5b:
+ f7:4c:68:cf:cf:b0:7b:e2:ba:57:37:23:c6:cd:ba:75:85:e8:
+ eb:d5:ca:a2:6d:9a:75:84:4b:7b:47:38:58:bc:0a:4b:cc:2c:
+ 2a:0d:eb:7e:ac:36:6f:0b:a5:26:b7:d3:0b:0f:e7:cc:26:db:
+ bb:01:48:5b:38:49:f5:3e:2d:75:c0:d6:11:ad:3e:a0:b6:8a:
+ 8e:7f:4d:10:2c:7b:d7:03:0d:de:da:6b:e0:07:06:90:73:1f:
+ dd:f1
+-----BEGIN CERTIFICATE-----
+MIIC1TCCAj6gAwIBAgICEA0wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTUx
+MTBaFw0zNTAxMTMwOTUxMTBaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADEAMgAsACAAZQBuAGQAaQBuAGcAIABx
+AHUAbwB0AGUAIjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAv0+Ta2uGdjAx
+Ow7rt6a5oz6E6tUxUFrf9D9nEVqlKCNYN2elXHJt8vyAgVV4hijpYMIK0Bc8Oumo
+AXFkuCf0QuDXafVO7xQHaf3ee6/IpAycVgCLdmfRuqnnQGN32kTTiVynWurV85sV
+Q/MILbyKv0pbVwHwx5f+sJOyG3mgTq0CAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G
+A1UdDgQWBBQKoqYJiCNWgp5gi3kjYcq/1PftqTAfBgNVHSMEGDAWgBToarvCkOps
+cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxMiBS
+b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGQ+tqZeDW+z5/bHH0pIlkz+EzxKe+dG
+UVZFZgLkeRp/FaTpW/dMaM/PsHviulc3I8bNunWF6OvVyqJtmnWES3tHOFi8CkvM
+LCoN636sNm8LpSa30wsP58wm27sBSFs4SfU+LXXA1hGtPqC2io5/TRAse9cDDd7a
+a+AHBpBzH93x
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem
new file mode 100755
index 000000000000..f91766a0a8f1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4110 (0x100e)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:53:08 2010 GMT
+ Not After : Jan 13 09:53:08 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x003\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e0:b2:b3:77:34:32:23:3c:45:ce:1f:5f:9a:60:
+ c5:59:af:2f:bf:73:8e:be:3d:88:8d:97:4f:fe:8a:
+ 00:b9:71:7f:07:3a:1e:6a:5b:37:8a:ff:58:8f:f1:
+ b3:e5:0b:9d:35:58:57:6d:da:d1:15:cd:52:7f:e2:
+ 15:25:16:d4:d6:1e:71:a6:f3:f7:c5:6d:01:64:fc:
+ 20:d4:4e:6a:f2:f9:b9:2a:36:f8:ae:e6:17:a8:f9:
+ 8e:7c:bb:75:e5:24:39:ad:4c:18:c8:bb:07:22:cd:
+ d1:a6:52:93:7f:24:5f:90:dd:0f:64:07:70:42:67:
+ 39:9b:1f:ea:5e:bb:cd:df:ab
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 75:49:D0:1F:A0:B3:A2:C6:F2:7F:CF:16:A3:4C:4B:DF:D6:4C:07:9D
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 13 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 5d:60:60:06:aa:8a:2d:ee:20:2a:ee:fb:b5:99:8c:ed:d8:67:
+ 28:30:d8:26:a7:e0:1c:6e:5d:e1:4c:5e:c8:f9:02:e2:2e:c4:
+ 1e:58:e9:84:bc:d7:79:4e:d5:c5:ea:ba:74:aa:4e:30:9d:2b:
+ 98:c8:0b:fe:7f:eb:fb:e9:24:5f:f8:17:27:a9:ce:7c:ff:4b:
+ 88:15:3e:25:18:71:73:bf:b6:bf:c5:51:6b:1d:db:32:1d:ae:
+ 00:bf:ed:a5:65:99:16:43:8d:d2:6d:27:53:fc:65:9a:91:94:
+ 7b:44:c8:58:a1:f1:2b:95:86:0b:2d:2d:94:10:6f:5e:be:f8:
+ 7b:8e
+-----BEGIN CERTIFICATE-----
+MIIC3zCCAkigAwIBAgICEA4wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTUz
+MDhaFw0zNTAxMTMwOTUzMDhaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT8wPQYDVQQDHjYAIgBVAHMAZQByACAAMQAzACwAIABlAG4AYwBsAG8AcwBp
+AG4AZwAgAHEAdQBvAHQAZQBzACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AOCys3c0MiM8Rc4fX5pgxVmvL79zjr49iI2XT/6KALlxfwc6HmpbN4r/WI/xs+UL
+nTVYV23a0RXNUn/iFSUW1NYecabz98VtAWT8INROavL5uSo2+K7mF6j5jny7deUk
+Oa1MGMi7ByLN0aZSk38kX5DdD2QHcEJnOZsf6l67zd+rAgMBAAGjeDB2MAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUdUnQH6Czosbyf88Wo0xL39ZMB50wHwYDVR0jBBgw
+FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT
+D1VzZXIgMTMgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBdYGAGqoot7iAq7vu1
+mYzt2GcoMNgmp+Acbl3hTF7I+QLiLsQeWOmEvNd5TtXF6rp0qk4wnSuYyAv+f+v7
+6SRf+Bcnqc58/0uIFT4lGHFzv7a/xVFrHdsyHa4Av+2lZZkWQ43SbSdT/GWakZR7
+RMhYofErlYYLLS2UEG9evvh7jg==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem
new file mode 100755
index 000000000000..34a9b97c5f60
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4111 (0x100f)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:55:02 2010 GMT
+ Not After : Jan 13 09:55:02 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d7:b7:68:39:6e:80:18:83:2e:d7:0a:e5:f1:3f:
+ 27:80:68:59:a8:05:ac:7f:d9:6e:5d:7f:1c:58:86:
+ b7:74:b5:51:3d:64:09:4a:a0:ff:e7:10:0e:bc:8a:
+ f0:d1:54:18:0a:ed:68:0a:a2:33:e5:9f:f0:3d:7f:
+ 24:9c:46:34:ba:45:8f:05:59:51:2d:fb:32:1d:79:
+ 51:37:1a:4b:f8:6e:c5:49:c0:49:9e:ef:2b:ae:aa:
+ 03:fa:ff:55:08:69:85:0d:b4:06:53:ee:20:4e:74:
+ 6c:ca:b8:98:8d:64:8f:b5:99:a9:06:37:32:ca:ca:
+ eb:31:16:ce:97:e8:17:0d:9d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ A7:D8:65:FB:E9:A1:F6:A4:16:76:1C:2E:5B:F3:1B:8E:08:B1:1D:7F
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 14 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 35:54:0f:d2:d3:ec:9e:a6:ea:e6:51:69:27:a3:f1:ae:ea:ef:
+ f9:da:ca:2a:50:f1:9e:2a:7c:74:43:d6:7f:91:ad:5a:5c:e2:
+ da:f3:cb:27:a2:78:99:75:0b:9e:e9:3a:bd:3e:31:14:6a:06:
+ b7:3f:59:d1:0a:67:03:a4:32:63:cd:b1:b6:5c:68:bb:bb:e2:
+ 23:a6:ff:8e:55:e5:92:a6:a8:b3:87:3d:25:21:9c:2a:6f:ab:
+ 09:ad:f5:e6:e6:d8:37:62:f2:30:ac:51:da:f4:9c:1d:06:f6:
+ f3:73:2f:6a:3b:7f:53:0d:c0:2e:ad:cc:6e:81:fe:ce:e3:53:
+ 0e:23
+-----BEGIN CERTIFICATE-----
+MIIC1zCCAkCgAwIBAgICEA8wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU1
+MDJaFw0zNTAxMTMwOTU1MDJaMIGHMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTcwNQYDVQQDHi4AVQBzAGUAcgAgADEANAAgACIALABtAGkAZABkAGwAZQAg
+AHEAdQBvAHQAZQAiMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXt2g5boAY
+gy7XCuXxPyeAaFmoBax/2W5dfxxYhrd0tVE9ZAlKoP/nEA68ivDRVBgK7WgKojPl
+n/A9fyScRjS6RY8FWVEt+zIdeVE3Gkv4bsVJwEme7yuuqgP6/1UIaYUNtAZT7iBO
+dGzKuJiNZI+1makGNzLKyusxFs6X6BcNnQIDAQABo3gwdjALBgNVHQ8EBAMCBeAw
+HQYDVR0OBBYEFKfYZfvpofakFnYcLlvzG44IsR1/MB8GA1UdIwQYMBaAFOhqu8KQ
+6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDE0
+IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEANVQP0tPsnqbq5lFpJ6Pxrurv+drK
+KlDxnip8dEPWf5GtWlzi2vPLJ6J4mXULnuk6vT4xFGoGtz9Z0QpnA6QyY82xtlxo
+u7viI6b/jlXlkqaos4c9JSGcKm+rCa315ubYN2LyMKxR2vScHQb283Mvajt/Uw3A
+Lq3MboH+zuNTDiM=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem
new file mode 100755
index 000000000000..ae0a4174738d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4112 (0x1010)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:57:52 2010 GMT
+ Not After : Jan 13 09:57:52 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a1:cc:00:2b:07:2b:e7:ac:80:29:cb:40:37:e3:
+ 1f:a3:c5:13:86:16:63:6b:cc:b8:c1:aa:54:fd:57:
+ 0f:de:4c:69:2f:e5:5f:f0:a9:bb:25:74:48:ee:36:
+ 77:6b:08:b5:95:a9:00:aa:15:31:9e:d8:f6:25:53:
+ 78:9d:bc:2b:8f:7a:19:32:12:8c:13:60:7d:76:1e:
+ 4e:b1:e4:51:c7:43:c0:e6:ee:d9:61:df:85:90:a0:
+ 95:3c:a2:81:83:3d:22:f6:8d:42:ee:69:fa:5c:ae:
+ 1c:b5:52:02:fb:ec:a6:12:2f:bb:fb:6c:a8:61:95:
+ 08:6c:d2:e5:1e:90:61:a6:27
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 2F:C9:F6:94:E6:1E:91:13:CE:75:A1:17:FD:1D:93:7E:45:CE:4D:67
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 15 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 19:d0:dc:4c:c8:59:f0:7a:14:f2:51:54:e5:9e:5a:b3:27:0b:
+ d7:36:0f:74:38:07:26:65:1a:b5:94:1a:1f:b2:b7:3d:ee:b1:
+ 90:05:83:41:6a:98:5f:25:b4:cb:5c:49:12:24:35:d6:97:cf:
+ 50:2e:0a:17:41:0b:75:e9:6a:a4:fb:bb:c2:cc:c1:94:64:03:
+ 81:c4:25:d2:3f:3e:8f:d1:29:44:db:a9:3c:7f:0c:2c:6d:48:
+ 38:cb:8f:56:82:9c:d3:f3:f3:20:1f:45:19:8e:ea:91:9c:c1:
+ 25:cf:20:1d:bb:70:7e:b9:a0:c5:34:78:93:5f:2b:d9:fd:d5:
+ de:ad
+-----BEGIN CERTIFICATE-----
+MIICzDCCAjWgAwIBAgICEBAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU3
+NTJaFw0zNTAxMTMwOTU3NTJaMH0xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxLTArBgNVBAMeJABcAGUAbgBjAGwAbwBzAGkAbgBnACAAcQB1AG8AdABlAHMA
+XDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAocwAKwcr56yAKctAN+Mfo8UT
+hhZja8y4wapU/VcP3kxpL+Vf8Km7JXRI7jZ3awi1lakAqhUxntj2JVN4nbwrj3oZ
+MhKME2B9dh5OseRRx0PA5u7ZYd+FkKCVPKKBgz0i9o1C7mn6XK4ctVIC++ymEi+7
++2yoYZUIbNLlHpBhpicCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQv
+yfaU5h6RE851oRf9HZN+Rc5NZzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPm
+vremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxNSBSb290IDExMA0G
+CSqGSIb3DQEBBQUAA4GBABnQ3EzIWfB6FPJRVOWeWrMnC9c2D3Q4ByZlGrWUGh+y
+tz3usZAFg0FqmF8ltMtcSRIkNdaXz1AuChdBC3XpaqT7u8LMwZRkA4HEJdI/Po/R
+KUTbqTx/DCxtSDjLj1aCnNPz8yAfRRmO6pGcwSXPIB27cH65oMU0eJNfK9n91d6t
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem
new file mode 100755
index 000000000000..21222706f476
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4113 (0x1011)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 09:59:22 2010 GMT
+ Not After : Jan 13 09:59:22 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00\\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a4:e3:64:10:9f:0a:e4:35:bb:e3:e1:f0:28:86:
+ 8a:f2:6e:d3:f8:44:ac:58:7b:f5:dd:1c:71:17:bf:
+ 3e:14:29:55:f0:5c:c9:ed:36:c0:7f:e7:cc:7c:a3:
+ c4:9a:13:4f:7d:6c:b3:1e:ab:24:ba:1a:ff:48:96:
+ 67:a5:ca:e5:75:30:24:70:3a:94:d2:92:db:29:2b:
+ 69:1f:1d:a4:da:37:91:57:03:79:d7:0a:c7:a9:09:
+ 14:a8:70:60:b5:a3:62:4f:b8:bf:0a:22:0a:9c:83:
+ 3a:4d:1a:47:06:97:f1:4a:38:78:95:45:10:9e:44:
+ 90:fb:6e:13:ba:3a:1b:b7:4b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ A5:32:FD:E7:0D:90:82:17:34:E1:AD:2A:48:5D:78:27:2B:C9:2A:B8
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 16 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 96:ee:46:fc:41:4f:55:0d:bc:46:27:5a:3c:09:7c:17:6c:e3:
+ 9e:3a:85:eb:3b:e2:f7:a5:ab:b5:ae:aa:44:81:d7:b7:29:39:
+ b8:20:40:1e:36:da:a8:03:8b:3a:96:c3:2e:ba:cd:81:b9:af:
+ a0:a5:95:b0:3b:55:c1:85:9d:3d:c2:d0:7b:a4:d0:0e:16:7c:
+ 26:ba:85:e5:96:f0:f9:cc:28:c4:ed:83:e8:6f:30:a8:22:7a:
+ 7e:3b:99:d6:b2:3d:a2:90:1e:c9:9b:70:0a:af:04:d9:7c:46:
+ 52:e2:5a:d3:57:d6:18:a9:e9:55:ee:00:e8:10:a1:84:ed:ca:
+ 2b:bf
+-----BEGIN CERTIFICATE-----
+MIIC3zCCAkigAwIBAgICEBEwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU5
+MjJaFw0zNTAxMTMwOTU5MjJaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT8wPQYDVQQDHjYAXABcAGQAbwB1AGIAbABlACAAZQBuAGMAbABvAHMAaQBu
+AGcAIABxAHUAbwB0AGUAcwBcAFwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AKTjZBCfCuQ1u+Ph8CiGivJu0/hErFh79d0ccRe/PhQpVfBcye02wH/nzHyjxJoT
+T31ssx6rJLoa/0iWZ6XK5XUwJHA6lNKS2ykraR8dpNo3kVcDedcKx6kJFKhwYLWj
+Yk+4vwoiCpyDOk0aRwaX8Uo4eJVFEJ5EkPtuE7o6G7dLAgMBAAGjeDB2MAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUpTL95w2Qghc04a0qSF14JyvJKrgwHwYDVR0jBBgw
+FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT
+D1VzZXIgMTYgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQCW7kb8QU9VDbxGJ1o8
+CXwXbOOeOoXrO+L3pau1rqpEgde3KTm4IEAeNtqoA4s6lsMuus2Bua+gpZWwO1XB
+hZ09wtB7pNAOFnwmuoXllvD5zCjE7YPobzCoInp+O5nWsj2ikB7Jm3AKrwTZfEZS
+4lrTV9YYqelV7gDoEKGE7corvw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem
new file mode 100755
index 000000000000..b75551711c37
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4114 (0x1012)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:02:07 2010 GMT
+ Not After : Jan 13 10:02:07 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00\\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e9:8c:31:90:52:8d:ef:c6:6a:10:17:7d:37:a3:
+ ef:00:34:19:dd:a4:1a:f6:cc:37:b0:19:c8:9d:f6:
+ 9f:f8:3d:15:c9:cf:73:ab:0a:42:f2:54:5b:cc:12:
+ fb:64:35:54:c9:50:36:18:6c:b6:b0:cf:d6:1e:30:
+ 0b:0d:fa:f3:25:99:d7:49:20:dd:cc:04:d7:bb:07:
+ 00:b9:b9:87:8c:75:e5:28:a6:74:a9:b4:96:36:b8:
+ 15:62:84:0c:7a:a2:f3:07:9c:5c:8f:7a:22:3d:ba:
+ a4:06:69:f6:ce:d2:36:a0:62:e1:ae:67:aa:23:24:
+ ac:1d:53:ac:bf:b6:30:74:f7
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ C0:28:3E:BA:44:88:99:A0:80:67:AA:3E:B6:D4:12:A7:35:DA:A6:BB
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 17 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 06:5b:fb:65:55:34:ca:2c:1a:c2:2d:2a:97:1b:a1:68:f6:0c:
+ 13:18:03:44:f9:0d:37:a1:8c:b1:f7:bc:b7:74:a8:aa:c1:e7:
+ 36:e7:b9:e0:64:79:76:63:98:7b:1d:d8:80:8c:d9:26:61:a8:
+ e7:07:96:60:e9:8a:24:78:cb:9c:f3:35:15:c9:d9:0c:2e:68:
+ 68:48:9c:df:6b:56:3f:aa:47:34:36:b0:ef:0e:d2:e0:ee:a9:
+ a9:6a:27:93:60:27:5f:42:76:9c:e0:aa:74:6c:b9:aa:de:fe:
+ 86:98:5a:3d:73:c5:15:38:c8:ff:09:8e:ed:da:06:74:fb:67:
+ 92:51
+-----BEGIN CERTIFICATE-----
+MIIC6TCCAlKgAwIBAgICEBIwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDAy
+MDdaFw0zNTAxMTMxMDAyMDdaMIGZMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MUkwRwYDVQQDHkAAXABcAHQAdwBvACAAcwB0AGEAcgB0AGkAbgBnACAAbwBu
+AGUAIABlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqGSIb3DQEBAQUA
+A4GNADCBiQKBgQDpjDGQUo3vxmoQF303o+8ANBndpBr2zDewGcid9p/4PRXJz3Or
+CkLyVFvMEvtkNVTJUDYYbLawz9YeMAsN+vMlmddJIN3MBNe7BwC5uYeMdeUopnSp
+tJY2uBVihAx6ovMHnFyPeiI9uqQGafbO0jagYuGuZ6ojJKwdU6y/tjB09wIDAQAB
+o3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFMAoPrpEiJmggGeqPrbUEqc12qa7
+MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAa
+MRgwFgYDVQQDEw9Vc2VyIDE3IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEABlv7
+ZVU0yiwawi0qlxuhaPYMExgDRPkNN6GMsfe8t3SoqsHnNue54GR5dmOYex3YgIzZ
+JmGo5weWYOmKJHjLnPM1FcnZDC5oaEic32tWP6pHNDaw7w7S4O6pqWonk2AnX0J2
+nOCqdGy5qt7+hphaPXPFFTjI/wmO7doGdPtnklE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem
new file mode 100755
index 000000000000..2b48a29b0efb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4115 (0x1013)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:04:36 2010 GMT
+ Not After : Jan 13 10:04:36 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:bb:73:a4:4e:45:8e:80:b1:65:b6:d8:3b:96:c8:
+ 3b:c4:2e:40:98:2a:a9:0d:2e:75:29:df:dd:28:8f:
+ dc:65:4e:2f:8b:24:55:f4:5b:95:5e:d8:29:c8:31:
+ aa:53:41:a6:1b:2a:cc:8d:67:b6:d8:5f:56:7d:bd:
+ 0e:17:88:9b:28:b8:fc:54:ff:0e:1f:d9:59:f7:6f:
+ 99:46:76:86:69:87:f7:07:51:f6:1a:76:91:37:40:
+ 96:de:5a:0e:c1:20:7f:b5:1b:79:c2:63:13:50:dc:
+ f0:35:11:2c:4a:30:e0:68:8f:dc:51:4c:2b:61:ba:
+ a5:e6:ad:72:8b:c4:e1:2d:73
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 31:AE:51:BD:37:3E:EB:D6:98:7D:BD:DF:45:0C:92:4E:73:58:35:AA
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 18 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 51:34:24:4b:78:89:95:5d:43:15:3e:62:fc:40:a0:34:a5:6e:
+ 83:b5:ee:f0:93:ae:8a:27:97:9c:66:54:c9:aa:f5:9b:96:88:
+ 43:25:76:b6:0d:06:36:6c:0e:08:5f:15:45:c6:cc:d1:62:18:
+ 6b:fa:cd:af:53:7c:7c:97:30:13:a7:03:ac:db:04:25:bb:22:
+ 7d:49:70:30:69:9f:c8:22:94:32:40:83:d3:d1:9d:1c:2a:64:
+ cf:a9:42:0c:ce:0c:b8:3d:63:33:bb:e1:85:45:a7:79:89:ac:
+ 0c:1b:b5:a4:e0:1d:4d:99:d6:68:9b:c2:67:97:9c:9d:2c:57:
+ 12:fe
+-----BEGIN CERTIFICATE-----
+MIICxjCCAi+gAwIBAgICEBMwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA0
+MzZaFw0zNTAxMTMxMDA0MzZaMHcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxJzAlBgNVBAMeHgBcAHMAdABhAHIAdABpAG4AZwAgAHEAdQBvAHQAZTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu3OkTkWOgLFlttg7lsg7xC5AmCqpDS51
+Kd/dKI/cZU4viyRV9FuVXtgpyDGqU0GmGyrMjWe22F9Wfb0OF4ibKLj8VP8OH9lZ
+92+ZRnaGaYf3B1H2GnaRN0CW3loOwSB/tRt5wmMTUNzwNREsSjDgaI/cUUwrYbql
+5q1yi8ThLXMCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQxrlG9Nz7r
+1ph9vd9FDJJOc1g1qjAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAn
+BgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxOCBSb290IDExMA0GCSqGSIb3
+DQEBBQUAA4GBAFE0JEt4iZVdQxU+YvxAoDSlboO17vCTroonl5xmVMmq9ZuWiEMl
+drYNBjZsDghfFUXGzNFiGGv6za9TfHyXMBOnA6zbBCW7In1JcDBpn8gilDJAg9PR
+nRwqZM+pQgzODLg9YzO74YVFp3mJrAwbtaTgHU2Z1mibwmeXnJ0sVxL+
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem
new file mode 100755
index 000000000000..a2027e9d8a43
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4116 (0x1014)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:05:50 2010 GMT
+ Not After : Jan 13 10:05:50 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ca:cc:98:77:0c:10:dd:0e:87:a2:da:b6:e6:97:
+ 91:36:71:54:de:2b:f8:de:18:b7:23:eb:e5:e3:57:
+ ae:cf:0b:6d:86:0f:63:f0:c4:4e:2a:66:48:33:c4:
+ e3:0b:2c:f5:e6:e5:e5:0f:f8:e0:a1:bc:11:06:a1:
+ 19:16:ec:44:77:a6:db:7d:d6:78:29:1f:57:f1:9d:
+ 3c:b4:3a:2b:3b:94:64:6d:e3:ce:b3:fa:d8:28:e2:
+ ed:76:9a:97:41:64:7c:0d:48:b8:1d:6a:56:e3:f9:
+ 4c:88:e9:1a:3c:b8:af:7a:13:67:19:59:36:46:79:
+ 52:72:ea:51:80:65:be:e2:0f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ D2:D8:8D:EE:39:D7:EA:15:23:00:7C:9D:48:1C:51:17:F8:80:86:CE
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 19 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 6e:05:c4:48:32:4a:62:6f:a3:8c:23:af:47:dd:d4:c7:c1:91:
+ 17:7e:cd:36:73:39:a3:7b:c9:ae:da:f6:e1:bd:82:d6:72:17:
+ 78:20:a2:27:ad:f5:d2:3f:10:66:e0:d8:ba:10:00:c3:76:5b:
+ de:36:cb:2a:91:25:89:08:0e:2a:6a:81:d0:a7:49:70:42:f3:
+ 94:a3:bf:6c:6b:b9:fa:fd:f9:d4:1f:6f:75:27:b9:0d:d3:d2:
+ fd:5d:0d:dc:f5:34:29:a2:3a:2f:04:ab:48:41:6d:d7:2b:fd:
+ 42:02:99:3c:cf:aa:6b:98:66:17:83:39:4a:6f:47:36:ad:db:
+ 22:6e
+-----BEGIN CERTIFICATE-----
+MIICwjCCAiugAwIBAgICEBQwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA1
+NTBaFw0zNTAxMTMxMDA1NTBaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxIzAhBgNVBAMeGgBlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQDKzJh3DBDdDoei2rbml5E2cVTeK/jeGLcj6+Xj
+V67PC22GD2PwxE4qZkgzxOMLLPXm5eUP+OChvBEGoRkW7ER3ptt91ngpH1fxnTy0
+Ois7lGRt486z+tgo4u12mpdBZHwNSLgdalbj+UyI6Ro8uK96E2cZWTZGeVJy6lGA
+Zb7iDwIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNLYje451+oVIwB8
+nUgcURf4gIbOMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1Ud
+EQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDE5IFJvb3QgMTEwDQYJKoZIhvcNAQEF
+BQADgYEAbgXESDJKYm+jjCOvR93Ux8GRF37NNnM5o3vJrtr24b2C1nIXeCCiJ631
+0j8QZuDYuhAAw3Zb3jbLKpEliQgOKmqB0KdJcELzlKO/bGu5+v351B9vdSe5DdPS
+/V0N3PU0KaI6LwSrSEFt1yv9QgKZPM+qa5hmF4M5Sm9HNq3bIm4=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem
new file mode 100755
index 000000000000..d9d3f941e628
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4117 (0x1015)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:07:07 2010 GMT
+ Not After : Jan 13 10:07:07 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00\\x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f0:7c:07:f6:13:52:ce:13:cf:8a:5f:7f:5f:3c:
+ d4:93:c8:a0:43:1f:e2:fc:3f:62:63:be:b5:17:e0:
+ 32:b0:d0:c2:9a:35:9e:3b:29:30:b4:13:78:18:ae:
+ 80:ba:fb:f3:fc:81:ad:aa:47:18:eb:fc:d1:76:de:
+ b6:cf:55:65:5e:3e:15:93:8e:9c:39:4e:a3:ae:1d:
+ c0:49:22:dc:25:09:33:95:0d:b5:62:7c:96:0b:05:
+ b6:10:ae:ee:f8:18:24:9f:d4:ed:b3:4c:a9:4d:f2:
+ be:6c:66:37:b9:17:cb:14:df:52:b4:a8:de:63:0d:
+ 4f:78:58:16:ab:f2:3f:f6:a9
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 41:CC:3D:88:34:10:21:13:A2:34:24:B6:4E:F9:33:3C:B3:FA:56:BC
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 20 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ a7:17:c3:92:37:10:ee:9a:12:65:32:82:56:93:82:fa:0e:40:
+ 9f:ae:30:6a:b1:6f:85:18:7f:ff:9c:30:49:b7:56:bf:a3:86:
+ d7:dd:5d:79:d1:7f:9a:95:b6:bd:1d:43:cc:2c:aa:7a:40:c4:
+ de:17:02:22:74:ec:a9:cd:8d:93:f6:6c:98:7e:bb:6a:68:70:
+ 66:d4:a0:8f:1a:7a:8e:9e:38:35:aa:87:6a:e5:db:80:69:51:
+ 51:68:46:4f:3d:da:17:df:6f:22:60:77:95:55:d3:12:1b:11:
+ c1:6f:c1:96:78:00:47:61:af:53:c0:37:44:6b:92:67:7f:14:
+ 79:80
+-----BEGIN CERTIFICATE-----
+MIICwjCCAiugAwIBAgICEBUwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA3
+MDdaFw0zNTAxMTMxMDA3MDdaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxIzAhBgNVBAMeGgBtAGkAZABkAGwAZQAgAFwAcQB1AG8AdABlMIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQDwfAf2E1LOE8+KX39fPNSTyKBDH+L8P2JjvrUX
+4DKw0MKaNZ47KTC0E3gYroC6+/P8ga2qRxjr/NF23rbPVWVePhWTjpw5TqOuHcBJ
+ItwlCTOVDbVifJYLBbYQru74GCSf1O2zTKlN8r5sZje5F8sU31K0qN5jDU94WBar
+8j/2qQIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFEHMPYg0ECETojQk
+tk75Mzyz+la8MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1Ud
+EQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDIwIFJvb3QgMTEwDQYJKoZIhvcNAQEF
+BQADgYEApxfDkjcQ7poSZTKCVpOC+g5An64warFvhRh//5wwSbdWv6OG191dedF/
+mpW2vR1DzCyqekDE3hcCInTsqc2Nk/ZsmH67amhwZtSgjxp6jp44NaqHauXbgGlR
+UWhGTz3aF99vImB3lVXTEhsRwW/BlngAR2GvU8A3RGuSZ38UeYA=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem
new file mode 100755
index 000000000000..9f4e006f02eb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4118 (0x1016)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:09:50 2010 GMT
+ Not After : Jan 13 10:09:50 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00\\x00\\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:cd:22:93:9a:93:18:34:2f:50:e0:cc:23:f4:60:
+ bc:96:60:d5:a5:f9:da:45:9a:5b:a3:0a:fb:71:25:
+ 4c:bd:60:84:19:f5:93:28:c1:5d:b9:8d:05:05:4d:
+ 01:85:aa:9e:5b:08:9c:01:f8:32:90:fe:ef:7f:eb:
+ cb:b3:8b:b2:c8:d1:79:d6:47:a3:d8:df:f1:d0:56:
+ 04:04:bd:41:72:fc:98:75:10:d2:9b:b5:bc:55:a1:
+ fa:19:01:67:93:09:48:0a:67:ec:4d:12:47:37:6f:
+ c2:53:0e:c9:7a:30:ec:1d:9d:a5:e2:64:d8:92:4d:
+ ed:ec:b2:bb:10:96:76:28:47
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ DC:FF:9A:2B:49:51:1E:FB:A7:3A:90:94:1B:E0:3E:34:89:13:48:EE
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 21 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 16:aa:a6:b7:0e:e3:d2:ba:7e:9b:59:f6:cc:ce:5d:4d:2a:f2:
+ 95:60:46:24:dd:ea:e8:08:e6:60:9c:33:82:8c:34:a2:d8:38:
+ fb:75:fe:31:79:10:78:7d:93:44:3b:00:90:83:a4:15:52:8d:
+ 3a:b4:9c:c0:6f:95:2c:4f:d8:b3:3b:cf:69:ab:3c:41:3a:43:
+ 1b:0a:8b:b0:b4:aa:8b:bf:6f:96:e2:65:4a:00:3a:49:bc:9a:
+ a1:cd:13:b1:24:93:f6:44:cd:d3:71:91:da:4f:dd:75:3d:68:
+ 5c:6b:49:14:8a:23:b5:b6:4f:b6:41:d0:a7:16:7c:67:4c:b3:
+ 0a:88
+-----BEGIN CERTIFICATE-----
+MIIC0zCCAjygAwIBAgICEBYwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA5
+NTBaFw0zNTAxMTMxMDA5NTBaMIGDMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTMwMQYDVQQDHioAZABvAHUAYgBsAGUAIABcAFwAbQBpAGQAZABsAGUAIABx
+AHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM0ik5qTGDQvUODM
+I/RgvJZg1aX52kWaW6MK+3ElTL1ghBn1kyjBXbmNBQVNAYWqnlsInAH4MpD+73/r
+y7OLssjRedZHo9jf8dBWBAS9QXL8mHUQ0pu1vFWh+hkBZ5MJSApn7E0SRzdvwlMO
+yXow7B2dpeJk2JJN7eyyuxCWdihHAgMBAAGjeDB2MAsGA1UdDwQEAwIF4DAdBgNV
+HQ4EFgQU3P+aK0lRHvunOpCUG+A+NIkTSO4wHwYDVR0jBBgwFoAU6Gq7wpDqbHAi
+Pvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIgMjEgUm9v
+dCAxMTANBgkqhkiG9w0BAQUFAAOBgQAWqqa3DuPSun6bWfbMzl1NKvKVYEYk3ero
+COZgnDOCjDSi2Dj7df4xeRB4fZNEOwCQg6QVUo06tJzAb5UsT9izO89pqzxBOkMb
+CouwtKqLv2+W4mVKADpJvJqhzROxJJP2RM3TcZHaT911PWhca0kUiiO1tk+2QdCn
+FnxnTLMKiA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem
new file mode 100755
index 000000000000..7bb12fa78903
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4119 (0x1017)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:11:53 2010 GMT
+ Not After : Jan 13 10:11:53 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e7:c9:bb:89:11:2f:2c:39:bc:d3:f5:d9:86:d4:
+ 8e:d7:20:11:81:75:30:25:7e:2b:29:70:61:83:38:
+ 24:d1:0f:cc:0b:88:71:29:06:05:a5:53:d2:00:2f:
+ 12:0c:7d:42:e6:47:33:de:cc:f8:7b:2a:5d:d9:cb:
+ 69:24:91:38:bf:0c:1a:12:cf:1e:f9:44:c2:1c:e8:
+ 6f:ea:ab:8b:92:4c:93:8c:69:61:b9:57:b3:1d:d0:
+ 03:3e:13:9d:30:bd:b2:b9:d9:c7:9b:4d:18:45:b0:
+ 19:19:15:58:4c:bd:5a:a1:59:4f:f0:1f:99:26:3b:
+ 4e:76:c6:bb:21:3c:94:bc:d9
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 43:E4:70:39:E3:91:80:2A:C3:BC:1A:F4:A3:51:4B:99:C5:20:93:A6
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 22 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 28:ce:8c:f0:bf:56:c6:a4:02:df:dd:1d:75:dc:cf:62:a0:92:
+ 58:64:91:8c:bb:96:3c:52:d5:66:6c:31:7e:1c:d9:a8:e5:1c:
+ a6:9f:5e:26:3f:69:71:c6:d7:5d:02:4f:a7:42:a5:85:fa:38:
+ 01:43:36:54:75:4c:51:a2:99:5d:72:05:9a:9b:fc:5e:83:9b:
+ a0:ef:11:b1:a4:dd:a5:50:2f:d0:14:dd:04:0f:8b:93:7e:4b:
+ 3e:24:04:45:d0:98:46:49:74:9f:d7:b4:68:09:dc:b6:ac:35:
+ 3f:5d:f9:ee:77:a4:35:46:75:a4:6a:d6:c1:53:4f:d2:0c:38:
+ 3c:df
+-----BEGIN CERTIFICATE-----
+MIIC3zCCAkigAwIBAgICEBcwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDEx
+NTNaFw0zNTAxMTMxMDExNTNaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT8wPQYDVQQDHjYAcABhAHIAdABpAGEAbABsAHkAIABcAGUAbgBjAGwAbwBz
+AGkAbgBnACAAcQB1AG8AdABlAFwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AOfJu4kRLyw5vNP12YbUjtcgEYF1MCV+KylwYYM4JNEPzAuIcSkGBaVT0gAvEgx9
+QuZHM97M+HsqXdnLaSSROL8MGhLPHvlEwhzob+qri5JMk4xpYblXsx3QAz4TnTC9
+srnZx5tNGEWwGRkVWEy9WqFZT/AfmSY7TnbGuyE8lLzZAgMBAAGjeDB2MAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUQ+RwOeORgCrDvBr0o1FLmcUgk6YwHwYDVR0jBBgw
+FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT
+D1VzZXIgMjIgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAozozwv1bGpALf3R11
+3M9ioJJYZJGMu5Y8UtVmbDF+HNmo5Rymn14mP2lxxtddAk+nQqWF+jgBQzZUdUxR
+opldcgWam/xeg5ug7xGxpN2lUC/QFN0ED4uTfks+JARF0JhGSXSf17RoCdy2rDU/
+Xfnud6Q1RnWkatbBU0/SDDg83w==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem
new file mode 100755
index 000000000000..d134dc5f3ea5
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4120 (0x1018)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:13:38 2010 GMT
+ Not After : Jan 13 10:13:38 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x003\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b9:e3:64:f8:02:be:98:47:de:c6:f4:22:14:4f:
+ 22:fe:17:8c:14:7f:b8:27:44:51:9d:5a:79:33:b4:
+ d0:21:27:b0:ed:f9:9f:3d:54:ef:ba:3a:d8:89:2a:
+ ca:a8:8f:f3:f6:a7:6b:5f:0a:58:2d:a0:e3:05:3a:
+ 26:a6:1e:b6:89:a1:e1:71:11:e7:16:93:29:69:f8:
+ 14:a2:e3:d7:4e:e5:60:40:d7:40:c5:37:d6:95:7c:
+ 4f:35:fd:a8:82:7f:90:32:1d:99:e7:8a:b9:93:a4:
+ f3:23:0a:a5:f9:56:31:73:d8:e3:cb:d6:0e:2f:2b:
+ ee:8e:b5:ca:eb:63:82:1c:0b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 80:A8:F7:13:E3:E8:F8:A6:60:94:21:C1:FE:54:54:89:AC:4B:DF:45
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 23 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ be:31:bd:4a:56:80:64:f0:1e:ea:77:4a:f3:e3:ec:f0:ad:27:
+ cc:05:01:fa:d2:12:7c:8e:85:5b:37:54:9c:4f:96:2d:1c:81:
+ e4:21:3d:4b:d9:86:1a:6c:29:5e:88:f2:ae:04:f1:70:87:25:
+ b9:9a:4a:ef:dd:21:f9:17:33:ee:a1:eb:38:fb:c4:73:72:70:
+ 0c:67:58:96:95:8c:2c:5a:4a:31:28:50:52:64:65:5c:63:60:
+ de:24:df:a0:e9:0d:c0:b6:d6:4c:51:a7:5a:e8:dd:f6:ff:49:
+ e6:6f:7f:86:38:5d:c7:f9:eb:55:f1:b2:89:3b:cd:41:f7:5d:
+ a8:b0
+-----BEGIN CERTIFICATE-----
+MIIC2TCCAkKgAwIBAgICEBgwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDEz
+MzhaFw0zNTAxMTMxMDEzMzhaMIGJMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTkwNwYDVQQDHjAAXABVAHMAZQByACAAMgAzACwAIABzAHQAYQByAHQAaQBu
+AGcAIABxAHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALnjZPgC
+vphH3sb0IhRPIv4XjBR/uCdEUZ1aeTO00CEnsO35nz1U77o62IkqyqiP8/ana18K
+WC2g4wU6JqYetomh4XER5xaTKWn4FKLj107lYEDXQMU31pV8TzX9qIJ/kDIdmeeK
+uZOk8yMKpflWMXPY48vWDi8r7o61yutjghwLAgMBAAGjeDB2MAsGA1UdDwQEAwIF
+4DAdBgNVHQ4EFgQUgKj3E+Po+KZglCHB/lRUiaxL30UwHwYDVR0jBBgwFoAU6Gq7
+wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIg
+MjMgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQC+Mb1KVoBk8B7qd0rz4+zwrSfM
+BQH60hJ8joVbN1ScT5YtHIHkIT1L2YYabCleiPKuBPFwhyW5mkrv3SH5FzPuoes4
++8RzcnAMZ1iWlYwsWkoxKFBSZGVcY2DeJN+g6Q3AttZMUada6N32/0nmb3+GOF3H
++etV8bKJO81B912osA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem
new file mode 100755
index 000000000000..66c3f15bfdbf
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4121 (0x1019)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:14:50 2010 GMT
+ Not After : Jan 13 10:14:50 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x002\x004\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:9c:cd:78:e7:11:1d:61:d4:0c:c6:87:c9:28:47:
+ 84:23:6b:86:c3:38:37:62:5a:9a:4b:50:fc:b7:f3:
+ d9:4b:1b:20:ff:06:42:bb:22:33:c5:22:12:2c:bb:
+ e6:c8:08:69:0e:af:e9:22:45:9f:ef:2c:26:46:d7:
+ 1b:36:db:70:58:32:bc:3d:d7:7d:64:27:44:54:6c:
+ 89:12:88:d7:31:3d:3f:5c:96:cb:69:9f:b1:a9:e0:
+ 9a:de:50:b7:ad:d8:29:bf:bc:3c:21:e9:a2:79:21:
+ 46:81:ea:90:df:44:0c:6c:bb:f8:47:c8:e9:79:d1:
+ 8d:40:1b:5d:d3:75:9b:e4:0b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 81:14:09:35:7F:F6:7A:83:6B:19:C2:22:24:92:E6:D4:EF:52:1C:0B
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 24 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 7c:65:0b:e2:cd:ca:00:e8:40:0f:37:70:a1:89:54:5d:03:06:
+ 2c:60:56:dc:2f:b7:01:ac:75:58:f6:82:8f:91:63:e2:91:d1:
+ 17:7b:bd:63:b9:9c:4e:46:86:3e:a6:f5:a6:56:ac:90:2a:f4:
+ d8:a0:6c:02:15:6e:d9:f6:2a:f8:9a:c4:48:bd:cd:54:82:55:
+ c6:d5:52:76:09:e3:3d:17:8d:5c:46:16:ae:9e:56:df:9f:c3:
+ 05:15:6f:ae:d0:b5:76:67:48:2d:5a:3c:59:da:1b:13:c3:84:
+ 5e:2a:57:8d:86:9a:f1:8a:5d:01:47:93:44:62:af:65:03:e1:
+ df:10
+-----BEGIN CERTIFICATE-----
+MIIC1TCCAj6gAwIBAgICEBkwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE0
+NTBaFw0zNTAxMTMxMDE0NTBaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADIANAAsACAAZQBuAGQAaQBuAGcAIABx
+AHUAbwB0AGUAXDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnM145xEdYdQM
+xofJKEeEI2uGwzg3YlqaS1D8t/PZSxsg/wZCuyIzxSISLLvmyAhpDq/pIkWf7ywm
+RtcbNttwWDK8Pdd9ZCdEVGyJEojXMT0/XJbLaZ+xqeCa3lC3rdgpv7w8IemieSFG
+geqQ30QMbLv4R8jpedGNQBtd03Wb5AsCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G
+A1UdDgQWBBSBFAk1f/Z6g2sZwiIkkubU71IcCzAfBgNVHSMEGDAWgBToarvCkOps
+cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAyNCBS
+b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAHxlC+LNygDoQA83cKGJVF0DBixgVtwv
+twGsdVj2go+RY+KR0Rd7vWO5nE5Ghj6m9aZWrJAq9NigbAIVbtn2KviaxEi9zVSC
+VcbVUnYJ4z0XjVxGFq6eVt+fwwUVb67QtXZnSC1aPFnaGxPDhF4qV42GmvGKXQFH
+k0Rir2UD4d8Q
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem
new file mode 100755
index 000000000000..ba352d83d135
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4122 (0x101a)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:16:10 2010 GMT
+ Not After : Jan 13 10:16:10 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x005\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ad:20:4a:85:d2:a8:2a:f8:0e:4c:b5:2d:72:a5:
+ 1d:0e:b1:8a:76:2c:b0:bf:7a:48:b8:57:29:cb:40:
+ c5:8a:e8:0e:d3:f6:f9:b1:90:a6:4a:bb:82:45:fd:
+ c2:ff:03:fa:fc:4a:5d:93:0b:52:a2:17:10:b1:7e:
+ 13:1d:9d:28:26:e3:44:bd:fd:26:da:b2:7b:47:e1:
+ c4:35:ea:53:1b:94:76:cc:f2:f6:c1:86:f2:18:46:
+ e1:71:c0:5d:e5:8f:0a:10:7a:ea:61:af:d0:ba:28:
+ 22:13:77:0f:7d:9e:e0:0a:f0:92:ce:dd:b3:5d:a6:
+ df:c1:eb:a8:29:57:e6:71:65
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ C3:EE:4A:7E:AC:46:2D:BA:42:F7:33:1F:E7:49:FA:21:D3:BC:DD:49
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 25 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ bf:63:34:12:e3:4b:83:4e:e5:c5:08:c3:b3:ea:be:38:33:38:
+ 3c:99:c3:ca:08:84:05:d4:21:53:7a:7d:43:86:c2:63:e2:d3:
+ 7c:21:3c:72:fa:c6:f3:bf:2b:10:5e:ca:4b:2c:2c:1c:e3:10:
+ eb:7c:ff:b1:20:b2:47:1b:b3:3e:77:b6:74:fb:83:85:ac:b8:
+ c9:5b:ca:8a:14:2f:e4:81:6e:04:6f:c8:37:c0:9f:c0:41:0f:
+ b4:6e:21:82:69:51:e8:68:09:72:c4:8c:72:db:47:0b:a5:52:
+ d7:e7:b3:5d:10:9c:ed:14:af:1c:fd:0b:11:a3:fd:f9:b9:2d:
+ 48:b5
+-----BEGIN CERTIFICATE-----
+MIIC3TCCAkagAwIBAgICEBowDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE2
+MTBaFw0zNTAxMTMxMDE2MTBaMIGNMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MT0wOwYDVQQDHjQAXABVAHMAZQByACAAMgA1ACwAIABlAG4AYwBsAG8AcwBp
+AG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCt
+IEqF0qgq+A5MtS1ypR0OsYp2LLC/eki4VynLQMWK6A7T9vmxkKZKu4JF/cL/A/r8
+Sl2TC1KiFxCxfhMdnSgm40S9/SbasntH4cQ16lMblHbM8vbBhvIYRuFxwF3ljwoQ
+euphr9C6KCITdw99nuAK8JLO3bNdpt/B66gpV+ZxZQIDAQABo3gwdjALBgNVHQ8E
+BAMCBeAwHQYDVR0OBBYEFMPuSn6sRi26QvczH+dJ+iHTvN1JMB8GA1UdIwQYMBaA
+FOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9V
+c2VyIDI1IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAv2M0EuNLg07lxQjDs+q+
+ODM4PJnDygiEBdQhU3p9Q4bCY+LTfCE8cvrG878rEF7KSywsHOMQ63z/sSCyRxuz
+Pne2dPuDhay4yVvKihQv5IFuBG/IN8CfwEEPtG4hgmlR6GgJcsSMcttHC6VS1+ez
+XRCc7RSvHP0LEaP9+bktSLU=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem
new file mode 100755
index 000000000000..4c03562a8ea9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4123 (0x101b)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:17:45 2010 GMT
+ Not After : Jan 13 10:17:45 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x002\x006\x00\\x00,\x00 \x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ec:4c:2b:ba:b1:e5:ba:83:e8:64:6c:67:fe:f9:
+ 84:9a:71:68:0b:10:b0:2e:2c:21:d8:6d:c8:cc:de:
+ 82:76:15:b8:74:a0:4b:3c:39:f0:ee:3a:08:6c:0e:
+ 0c:36:51:ed:44:04:ca:2b:76:30:6f:85:d4:f6:f0:
+ 7e:53:2b:17:90:6a:7b:79:e0:c2:00:f2:5f:dd:19:
+ 8f:09:7a:a2:c8:85:95:24:e0:41:39:ec:75:e1:c7:
+ 03:ba:6d:e9:81:48:8b:36:38:e0:99:3e:58:04:e3:
+ 03:8d:e4:3b:95:98:0a:23:96:f1:96:50:06:5d:71:
+ 6f:02:e1:c5:cd:e0:5c:c4:7b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 1D:A3:64:F0:93:51:C2:F2:1A:BB:D0:2D:20:95:5E:19:94:4C:72:BB
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 26 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 8c:c1:56:7d:d9:a8:f7:af:4b:57:4a:a5:2a:32:11:12:e0:d8:
+ 0e:10:39:8f:17:53:25:f5:c6:57:55:e4:f0:16:f2:11:cc:af:
+ cc:44:6b:23:6f:8e:2a:df:ee:ff:f0:d4:3f:0a:85:7e:19:de:
+ f8:cf:69:be:8b:59:ad:3c:be:3c:d7:32:ac:ba:82:91:28:23:
+ 71:ba:b5:29:05:e4:98:ee:2b:bb:56:04:7f:8b:69:c5:f9:4c:
+ 1b:0b:2e:3a:46:41:8e:da:16:68:9f:c7:57:71:8e:97:0d:b0:
+ a1:92:ae:7c:75:46:ef:b4:6d:8e:e7:53:07:23:a4:e1:e0:f0:
+ e7:3b
+-----BEGIN CERTIFICATE-----
+MIIC1TCCAj6gAwIBAgICEBswDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE3
+NDVaFw0zNTAxMTMxMDE3NDVaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADIANgBcACwAIABtAGkAZABkAGwAZQAg
+AHEAdQBvAHQAZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA7EwrurHluoPo
+ZGxn/vmEmnFoCxCwLiwh2G3IzN6CdhW4dKBLPDnw7joIbA4MNlHtRATKK3Ywb4XU
+9vB+UysXkGp7eeDCAPJf3RmPCXqiyIWVJOBBOex14ccDum3pgUiLNjjgmT5YBOMD
+jeQ7lZgKI5bxllAGXXFvAuHFzeBcxHsCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G
+A1UdDgQWBBQdo2Twk1HC8hq70C0glV4ZlExyuzAfBgNVHSMEGDAWgBToarvCkOps
+cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAyNiBS
+b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAIzBVn3ZqPevS1dKpSoyERLg2A4QOY8X
+UyX1xldV5PAW8hHMr8xEayNvjirf7v/w1D8KhX4Z3vjPab6LWa08vjzXMqy6gpEo
+I3G6tSkF5JjuK7tWBH+LacX5TBsLLjpGQY7aFmifx1dxjpcNsKGSrnx1Ru+0bY7n
+UwcjpOHg8Oc7
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem
new file mode 100755
index 000000000000..c403402f3dd4
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4124 (0x101c)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:19:13 2010 GMT
+ Not After : Jan 13 10:19:13 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=comma, comma, comma ,
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:af:2e:02:1a:b8:ed:7e:6e:27:2f:6e:ca:dc:57:
+ 11:17:88:37:38:37:26:d0:fb:d0:ee:ad:f3:a8:ad:
+ f5:8a:53:04:6a:82:a7:31:b5:e6:ce:88:24:fa:22:
+ 75:84:1b:a8:8c:fd:7f:63:0c:fc:13:41:82:60:a3:
+ 19:33:3d:d3:18:6e:09:c5:c7:e7:e9:9e:49:dd:f4:
+ 77:ef:f1:06:91:9a:c5:57:68:e5:0f:59:19:8d:53:
+ ff:cb:ae:11:33:48:5c:eb:72:e8:2f:67:ae:94:42:
+ d3:5b:2e:31:e3:6f:a7:5e:5e:9c:ea:2c:d2:c3:af:
+ 66:10:34:32:e5:2d:3f:55:c1
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ A1:FB:82:9C:27:AD:83:67:5E:8C:CC:A2:BA:32:3C:30:26:74:F4:CE
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 27 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ c6:72:8b:f8:57:9e:b7:bf:b1:f3:99:41:1c:8c:47:a1:93:d8:
+ 62:8e:2d:68:6c:db:12:02:86:e0:66:65:c1:7c:c4:83:35:4c:
+ 16:53:fd:34:c1:3c:60:15:fc:3d:3b:90:07:68:ca:af:a1:10:
+ 39:c4:6b:15:a6:1a:71:51:20:ea:35:84:ef:8f:ac:51:bc:d7:
+ 84:d8:35:71:44:8e:8c:4f:59:76:3d:b3:5f:5c:26:9e:bc:ee:
+ 09:40:13:3b:38:85:02:56:7d:97:db:4d:3d:b5:a1:66:cf:df:
+ 19:7a:2f:71:b7:a4:12:c3:9b:df:83:f9:a8:8a:00:68:e4:3a:
+ ee:25
+-----BEGIN CERTIFICATE-----
+MIICvTCCAiagAwIBAgICEBwwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE5
+MTNaFw0zNTAxMTMxMDE5MTNaMG4xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxHjAcBgNVBAMTFWNvbW1hLCBjb21tYSwgY29tbWEgLDCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEAry4CGrjtfm4nL27K3FcRF4g3ODcm0PvQ7q3zqK31ilME
+aoKnMbXmzogk+iJ1hBuojP1/Ywz8E0GCYKMZMz3TGG4Jxcfn6Z5J3fR37/EGkZrF
+V2jlD1kZjVP/y64RM0hc63LoL2eulELTWy4x42+nXl6c6izSw69mEDQy5S0/VcEC
+AwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBSh+4KcJ62DZ16MzKK6Mjww
+JnT0zjAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAnBgNVHREEIDAe
+pBwwGjEYMBYGA1UEAxMPVXNlciAyNyBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GB
+AMZyi/hXnre/sfOZQRyMR6GT2GKOLWhs2xIChuBmZcF8xIM1TBZT/TTBPGAV/D07
+kAdoyq+hEDnEaxWmGnFRIOo1hO+PrFG814TYNXFEjoxPWXY9s19cJp687glAEzs4
+hQJWfZfbTT21oWbP3xl6L3G3pBLDm9+D+aiKAGjkOu4l
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem
new file mode 100755
index 000000000000..2790a2abd2a1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4125 (0x101d)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:20:47 2010 GMT
+ Not After : Jan 13 10:20:47 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=equal CN=User 28
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ae:df:12:64:ab:d9:2f:ee:21:64:b5:08:c5:c8:
+ 8f:a1:ad:0e:b9:28:91:69:74:13:a5:aa:49:fe:fa:
+ 02:9d:37:db:0a:3b:26:6a:20:25:3d:f9:2d:b2:3b:
+ 39:c8:c6:e3:a7:aa:a1:0b:b2:1b:58:43:e6:3c:3f:
+ 67:fe:bb:bd:9b:b5:d9:de:e9:ed:76:ab:fd:f5:c8:
+ 15:b2:fb:a6:3f:23:ef:9f:5f:71:43:b3:be:55:1e:
+ 85:5f:13:b1:6b:9d:42:d7:30:a8:d2:9b:fe:71:7a:
+ c7:d3:60:7a:cf:e2:83:75:83:b8:1c:d3:ef:ee:94:
+ 3f:14:63:aa:7c:15:4e:42:1d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 3B:2D:2B:5F:2E:E6:32:23:AE:47:B7:30:25:CB:ED:B0:6D:0C:30:E4
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 28 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 5b:cf:de:92:f8:ac:39:fb:0a:81:70:5b:17:d0:0d:0d:85:5e:
+ 2e:7d:be:d1:1a:ad:1d:99:a4:a6:f0:48:5a:7b:04:39:e2:93:
+ ff:80:84:f6:a1:e6:8a:52:12:55:46:c0:57:84:d9:c3:13:92:
+ 61:d7:41:af:39:09:57:05:25:01:90:68:7c:7c:5c:85:c6:f2:
+ fe:0e:37:e3:58:68:f9:32:fc:41:2c:35:36:f4:cf:ea:55:2d:
+ 52:7c:fb:37:32:35:cf:82:eb:fc:f1:39:f1:51:f1:e1:5b:d6:
+ 58:e1:7f:d4:50:ce:cf:07:f2:e5:f5:e2:dd:fe:55:3f:64:07:
+ 90:4f
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgICEB0wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDIw
+NDdaFw0zNTAxMTMxMDIwNDdaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxGTAXBgNVBAMTEGVxdWFsIENOPVVzZXIgMjgwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAK7fEmSr2S/uIWS1CMXIj6GtDrkokWl0E6WqSf76Ap032wo7Jmog
+JT35LbI7OcjG46eqoQuyG1hD5jw/Z/67vZu12d7p7Xar/fXIFbL7pj8j759fcUOz
+vlUehV8TsWudQtcwqNKb/nF6x9Nges/ig3WDuBzT7+6UPxRjqnwVTkIdAgMBAAGj
+eDB2MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQUOy0rXy7mMiOuR7cwJcvtsG0MMOQw
+HwYDVR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBox
+GDAWBgNVBAMTD1VzZXIgMjggUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBbz96S
++Kw5+wqBcFsX0A0NhV4ufb7RGq0dmaSm8EhaewQ54pP/gIT2oeaKUhJVRsBXhNnD
+E5Jh10GvOQlXBSUBkGh8fFyFxvL+DjfjWGj5MvxBLDU29M/qVS1SfPs3MjXPguv8
+8TnxUfHhW9ZY4X/UUM7PB/Ll9eLd/lU/ZAeQTw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem
new file mode 100755
index 000000000000..f12a0c1c0d9d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4126 (0x101e)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:22:13 2010 GMT
+ Not After : Jan 13 10:22:13 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 29+OU=ooo
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ae:12:dc:26:fe:7f:b8:3f:47:a2:dc:83:a1:70:
+ 6d:ab:db:e5:3c:28:d5:18:32:2c:8d:ee:85:c6:f9:
+ f4:8b:31:34:71:de:91:79:fb:56:b4:9c:af:3e:b1:
+ c6:de:06:3f:32:fc:45:9d:9b:dd:15:0f:b5:c3:98:
+ ab:8c:1e:3d:63:7c:2a:c5:b9:38:3d:50:6c:81:9e:
+ f0:b3:5b:41:1a:ec:15:b2:7f:2b:b4:d4:42:aa:ca:
+ e6:89:b0:c6:58:bd:2d:38:f3:4d:85:c3:08:d7:45:
+ 48:42:d7:fe:ee:7a:c0:22:41:c0:c6:cb:77:7c:22:
+ 43:07:35:dc:88:7c:49:3a:9b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ E0:19:7F:AC:F8:6A:42:7E:84:CA:8C:84:45:75:4E:9D:A1:D1:2A:72
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 29 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 85:c9:ea:82:e2:ac:f6:b3:15:51:11:bd:69:81:31:8f:ee:d3:
+ f9:f4:8e:d5:27:34:20:89:76:eb:8a:5b:02:69:9b:97:89:d7:
+ 6b:aa:03:7f:b5:40:f9:ac:54:ce:8f:30:fd:3e:78:72:91:96:
+ dc:a6:bd:64:42:f8:e4:18:1a:e3:b5:db:08:fe:1e:fc:3d:a2:
+ 55:21:ad:0f:1a:87:df:f2:65:87:4d:91:52:c1:46:c1:c0:7c:
+ cc:81:79:97:dc:2e:41:cc:ae:8c:8e:79:4e:02:49:7c:c5:b0:
+ 3e:8e:d9:f0:aa:6b:a6:2f:e7:d2:21:5b:7f:57:e8:f7:f6:00:
+ 3c:ad
+-----BEGIN CERTIFICATE-----
+MIICtjCCAh+gAwIBAgICEB4wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDIy
+MTNaFw0zNTAxMTMxMDIyMTNaMGcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxFzAVBgNVBAMTDlVzZXIgMjkrT1U9b29vMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCuEtwm/n+4P0ei3IOhcG2r2+U8KNUYMiyN7oXG+fSLMTRx3pF5+1a0
+nK8+scbeBj8y/EWdm90VD7XDmKuMHj1jfCrFuTg9UGyBnvCzW0Ea7BWyfyu01EKq
+yuaJsMZYvS04802FwwjXRUhC1/7uesAiQcDGy3d8IkMHNdyIfEk6mwIDAQABo3gw
+djALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFOAZf6z4akJ+hMqMhEV1Tp2h0SpyMB8G
+A1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgw
+FgYDVQQDEw9Vc2VyIDI5IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAhcnqguKs
+9rMVURG9aYExj+7T+fSO1Sc0IIl264pbAmmbl4nXa6oDf7VA+axUzo8w/T54cpGW
+3Ka9ZEL45Bga47XbCP4e/D2iVSGtDxqH3/Jlh02RUsFGwcB8zIF5l9wuQcyujI55
+TgJJfMWwPo7Z8Kprpi/n0iFbf1fo9/YAPK0=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem
new file mode 100755
index 000000000000..1393b9ed3ed3
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4127 (0x101f)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:26:01 2010 GMT
+ Not After : Jan 13 10:26:01 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x003\x000\x00<\x00 \x00>\x00#\x00;\x00 \x00"\x00+\x00"
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:cf:40:99:4d:a5:5d:73:2a:78:72:9c:32:94:15:
+ 1e:01:40:b4:68:8f:b8:4e:38:aa:b9:82:96:5a:5c:
+ 03:d5:db:09:42:46:d8:2d:f0:da:f8:1a:f0:85:10:
+ f2:cb:1f:be:50:b7:ae:6f:22:80:f2:bf:14:73:84:
+ da:30:b9:54:26:0d:72:1c:55:99:50:c6:78:a3:37:
+ 15:b2:9c:03:22:dc:ea:8b:f5:07:32:f3:d9:76:64:
+ 92:a3:4f:73:12:e2:43:79:0e:e6:44:17:99:79:49:
+ 73:65:da:03:3d:be:db:e3:4f:ae:6c:d0:6c:e6:4a:
+ d3:83:45:5d:83:18:d5:cc:29
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ D9:EA:10:1D:D3:F5:30:AD:30:0E:80:73:14:22:1A:26:35:90:DC:67
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 30 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 42:3a:02:d5:7b:23:9f:cc:5b:b8:d4:c8:e8:0c:e3:0d:8a:17:
+ 65:b6:87:ce:c9:dc:f7:84:95:e0:17:ea:11:8b:15:30:e1:a2:
+ 42:6c:4e:f0:31:fa:fd:ff:03:37:d4:ec:4c:1d:29:8d:07:8a:
+ c8:de:0b:d6:df:d7:2e:12:8a:00:a0:ca:be:48:af:17:36:63:
+ 8e:f2:cf:80:8b:a1:e2:33:ef:42:db:91:d3:8e:4b:02:55:5e:
+ f7:79:11:5c:6d:ef:64:8b:53:a6:af:f5:0f:e2:75:7a:d6:85:
+ f6:60:d5:7e:d6:8c:0e:37:84:a9:50:2b:c7:e6:63:bf:1d:14:
+ aa:bf
+-----BEGIN CERTIFICATE-----
+MIICyDCCAjGgAwIBAgICEB8wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDI2
+MDFaFw0zNTAxMTMxMDI2MDFaMHkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxKTAnBgNVBAMeIABVAHMAZQByACAAMwAwADwAIAA+ACMAOwAgACIAKwAiMIGf
+MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPQJlNpV1zKnhynDKUFR4BQLRoj7hO
+OKq5gpZaXAPV2wlCRtgt8Nr4GvCFEPLLH75Qt65vIoDyvxRzhNowuVQmDXIcVZlQ
+xnijNxWynAMi3OqL9Qcy89l2ZJKjT3MS4kN5DuZEF5l5SXNl2gM9vtvjT65s0Gzm
+StODRV2DGNXMKQIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNnqEB3T
+9TCtMA6AcxQiGiY1kNxnMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZV
+MCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDMwIFJvb3QgMTEwDQYJKoZI
+hvcNAQEFBQADgYEAQjoC1Xsjn8xbuNTI6AzjDYoXZbaHzsnc94SV4BfqEYsVMOGi
+QmxO8DH6/f8DN9TsTB0pjQeKyN4L1t/XLhKKAKDKvkivFzZjjvLPgIuh4jPvQtuR
+045LAlVe93kRXG3vZItTpq/1D+J1etaF9mDVftaMDjeEqVArx+Zjvx0Uqr8=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem
new file mode 100755
index 000000000000..40e90d4cbea9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4128 (0x1020)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:28:47 2010 GMT
+ Not After : Jan 13 10:28:47 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x003\x001\x00 \x00\\x00"\x00a\x00,\x00b\x00"\x00+\x00C\x00N\x00=\x00U\x00S\x00,\x00 \x00>\x00 \x00\\x00\\x00d\x00e\x00 \x00<
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ac:02:18:e0:1c:54:bb:76:97:2e:d3:67:78:b7:
+ 14:78:46:83:7c:e9:5c:2b:2f:25:bb:bf:90:c0:52:
+ ea:2c:79:d6:9d:af:b5:f8:86:a2:bf:56:9b:0f:33:
+ ed:ef:d2:2c:57:c6:0a:25:b3:f7:9b:a1:7a:3b:75:
+ 0b:18:86:23:64:2a:23:b0:60:f1:d8:05:b4:a6:7b:
+ 77:21:30:b4:0d:f1:af:e1:fb:d6:88:a8:5b:5d:7e:
+ a2:bf:ce:20:f6:c0:7a:89:f2:0f:33:47:6d:49:0f:
+ 3d:59:27:f9:95:c0:3b:a3:1c:18:a1:2d:95:09:e8:
+ d2:95:ac:10:92:fc:db:84:e3
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ F8:BA:7E:78:BC:70:33:D3:45:68:37:59:3A:06:AC:65:B1:15:74:F0
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 31 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 0f:a8:53:f0:56:76:df:a8:b3:5b:d1:e8:98:62:8f:a6:13:96:
+ c3:6b:ca:3f:e1:09:37:54:6f:ac:15:4b:74:0c:6c:3f:fe:de:
+ 36:58:a2:9d:a0:1f:18:97:2c:1d:bc:c6:df:ee:aa:5b:d3:da:
+ 2f:51:02:7a:ba:a9:7e:4d:cf:47:16:0b:f1:b1:e1:28:2b:fe:
+ a4:9d:50:96:cd:c5:45:09:35:50:93:9b:97:a9:23:2a:5e:f0:
+ 2e:16:18:3f:50:7a:83:59:c5:6c:79:99:d3:ea:12:ef:15:a9:
+ b0:93:1e:4b:26:6c:63:13:7f:d3:5a:0c:4d:0b:f4:51:21:98:
+ 4f:81
+-----BEGIN CERTIFICATE-----
+MIIC5TCCAk6gAwIBAgICECAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDI4
+NDdaFw0zNTAxMTMxMDI4NDdaMIGVMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MUUwQwYDVQQDHjwAVQBzAGUAcgAgADMAMQAgAFwAIgBhACwAYgAiACsAQwBO
+AD0AVQBTACwAIAA+ACAAXABcAGQAZQAgADwwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
+MIGJAoGBAKwCGOAcVLt2ly7TZ3i3FHhGg3zpXCsvJbu/kMBS6ix51p2vtfiGor9W
+mw8z7e/SLFfGCiWz95uhejt1CxiGI2QqI7Bg8dgFtKZ7dyEwtA3xr+H71oioW11+
+or/OIPbAeonyDzNHbUkPPVkn+ZXAO6McGKEtlQno0pWsEJL824TjAgMBAAGjeDB2
+MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQU+Lp+eLxwM9NFaDdZOgasZbEVdPAwHwYD
+VR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAW
+BgNVBAMTD1VzZXIgMzEgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAPqFPwVnbf
+qLNb0eiYYo+mE5bDa8o/4Qk3VG+sFUt0DGw//t42WKKdoB8YlywdvMbf7qpb09ov
+UQJ6uql+Tc9HFgvxseEoK/6knVCWzcVFCTVQk5uXqSMqXvAuFhg/UHqDWcVseZnT
+6hLvFamwkx5LJmxjE3/TWgxNC/RRIZhPgQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem
new file mode 100755
index 000000000000..443c07462820
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem
@@ -0,0 +1,61 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4129 (0x1021)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11
+ Validity
+ Not Before: Jan 19 10:40:59 2010 GMT
+ Not After : Jan 13 10:40:59 2035 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:da:7a:30:0d:63:da:74:05:ef:3e:d2:f4:2b:1b:
+ 50:e3:64:67:98:7d:2f:83:e7:77:7b:b8:72:9b:c8:
+ 9e:65:de:cc:2a:7b:76:c2:08:05:7a:ce:88:3e:ed:
+ b5:75:89:36:d2:4a:bb:3b:66:ac:57:2b:15:99:c9:
+ d4:74:ca:f5:eb:ff:80:b7:9f:6b:48:2f:3b:a7:51:
+ c4:12:af:96:ca:ac:b9:ea:23:fd:93:f7:7d:5b:d1:
+ ab:7c:24:1e:fe:48:dc:33:de:45:d6:8c:86:5a:b9:
+ 56:3c:e4:a9:f1:8c:d7:41:01:da:04:2a:7d:06:c3:
+ 5b:a4:cc:5f:6c:ef:7c:4e:ef
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 49:E2:AE:12:D7:EF:C3:B5:02:65:DD:CF:B2:62:E6:25:ED:3D:10:9C
+ X509v3 Authority Key Identifier:
+ keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55
+
+ X509v3 Subject Alternative Name:
+ DirName:/CN=User 14 Root 11
+ Signature Algorithm: sha1WithRSAEncryption
+ 8b:ca:d2:93:cb:d1:cc:a9:67:a3:be:75:cf:ca:cd:22:78:cc:
+ 7c:f9:f1:2c:94:2c:60:bd:0f:18:16:26:fe:de:0d:19:5a:87:
+ de:34:8c:1f:eb:89:37:74:63:d4:d9:cd:59:35:06:24:a5:6f:
+ f2:c6:69:f4:b5:37:6d:ae:8b:d3:5d:5e:43:8f:36:7d:f8:0c:
+ 30:3f:74:3d:e2:85:89:75:58:36:0f:df:72:17:47:22:c6:fd:
+ 47:e3:d6:73:d1:40:89:e8:9a:ba:53:14:5c:3a:de:a9:85:a8:
+ 8f:b0:27:81:4d:87:ef:bb:6b:bf:8c:8a:71:9b:94:1d:30:d5:
+ 12:ed
+-----BEGIN CERTIFICATE-----
+MIIC1TCCAj6gAwIBAgICECEwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDQw
+NTlaFw0zNTAxMTMxMDQwNTlaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt
+YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt
+ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADEANAAgACIALABtAGkAZABkAGwAZQAg
+AHEAdQBvAHQAZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2nowDWPadAXv
+PtL0KxtQ42RnmH0vg+d3e7hym8ieZd7MKnt2wggFes6IPu21dYk20kq7O2asVysV
+mcnUdMr16/+At59rSC87p1HEEq+Wyqy56iP9k/d9W9GrfCQe/kjcM95F1oyGWrlW
+POSp8YzXQQHaBCp9BsNbpMxfbO98Tu8CAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G
+A1UdDgQWBBRJ4q4S1+/DtQJl3c+yYuYl7T0QnDAfBgNVHSMEGDAWgBToarvCkOps
+cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxNCBS
+b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAIvK0pPL0cypZ6O+dc/KzSJ4zHz58SyU
+LGC9DxgWJv7eDRlah940jB/riTd0Y9TZzVk1BiSlb/LGafS1N22ui9NdXkOPNn34
+DDA/dD3ihYl1WDYP33IXRyLG/Ufj1nPRQInomrpTFFw63qmFqI+wJ4FNh++7a7+M
+inGblB0w1RLt
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..fb0dd164efc2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,F268674FF1377D42
+
+kJQy9qJMCqZyDVs3+ZKQnh22enecltKSYzd0S1dIN1chgQ0RzLEiWBHmHCVP/yB0
+YoKrQ07FUR/uSLqTbyhAl+KDVcNvqrj/NeWs0n8zqN0ZF6wQtxtDrWFWmHNAvQXU
+2kO1CvjYiruapgwmVDDJV1qf25byenQv9LMyQMD6EPU1XqFeamklidALdkb7DylA
+WL6EIg4vhh96ZaG6PwLcB9rho0QRrXrLS6SHiklNBN5fHUWOfDyhXJ7K4HvzH1SS
+/EtqgyKKxH5irTRdoJg2OaDBAahyW93CneEnFdufDgzvCdrsg79Z2GFz7TDJEfW4
+rnoqoXTdei1Ah+t1BC4uXXAU8DR0xusnJi0qJDJ7ETRBhROlNhTRF8TAHll+5dIf
+9772GwVT+hADZn1qJgmhPiN4f8Fx33k5NOcwb0X/0Z1mzULrwm1P6lng0DsusDo0
+dr/wFyRjWZEWhMcL/sIO1BwVTBPcE8CACnXutehs44DBWd91EQ4+PWNq7oPtHFw8
+09d30h4aJJZF/SGRi+f/czFyZF4WS2Q+UWmNNKJX8wCGQqzUb02kVwMEWHiNFiEo
+V8xI3JXVmKHDWlgdoIz9kVe//3AfY5y+52cYLdqaNW8IsgWZC8SC9Lk9j5uaNZ/I
+leNppt4ID7mfYPqjEXEKleC+1ncwFwdVl/zaa/fM78sWqDYrLZC47DToLfoQ9Gez
+3dj3554iHTe61Jd7JsK85pYsrIHAeYppOpqzLyQmCu3twBl3uGD7KXxvdZRt8foE
+Vrg/QSIB4E6gfSBP0UrXzsnga8tjVyqRW2vAvt0uLn945ducapf9oQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial
new file mode 100755
index 000000000000..c7781419a38b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial
@@ -0,0 +1 @@
+1022
diff --git a/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg
new file mode 100755
index 000000000000..8bf98da50e74
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg
@@ -0,0 +1,295 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+utf8 = yes
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask =pkix
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+commonName_default =User 14 \",middle quote
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+subjectAltName=dirName:dn_subjectAlt
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+[dn_subjectAlt]
+CN=User 14 Root 11
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem
new file mode 100755
index 000000000000..e64badeef6c7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAKKvFYnsc1SGMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMjAeFw0wOTEx
+MTgxNTQ2NTJaFw0zNDExMTIxNTQ2NTJaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAsJSDLnSsoNY1U8hS0g5cmu7ihp+nvDvx8C75Wav80KumG9gcS3icmSOm
+vPVqUmJq5o9CKM8z4vJR7D3e+Wf7S7XHMdL0uXuQi+QQCB1aMAWMxo7xnoWAXZrS
+LG1BWUjD9sdKCHuQfFQv9ke3cA2dGZFSMsUD73JYoo0RD72ftFkCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUX7xM2usKDLUjQ14kMid5QfWCowIwgZEGA1UdIwSBiTCBhoAU
+X7xM2usKDLUjQ14kMid5QfWCowKhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMoIJAKKvFYnsc1SGMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqfEPhXASt24n8P9mDKisEn2EIYmJKLaY
+AVwXLPXUOiMlqrfPRKpseQII4WmDCRxMa6bKCwf4pKUWIpTpDhRZCUespaLz1AcU
+ntv+HTXq1ECK+akK33fsh5qMvokfzZM+Q0zCiFV/c2aTTGSM5mV3/q810RUlNQY3
+1y+AN+6fRqE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt
new file mode 100755
index 000000000000..3e79e22d7cf1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt
@@ -0,0 +1 @@
+V 341112155538Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 2
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..36a8eb3c0709
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 2
+ Validity
+ Not Before: Nov 18 15:55:38 2009 GMT
+ Not After : Nov 12 15:55:38 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f0:7a:16:4c:ab:06:b2:af:27:9c:7d:3f:86:da:
+ de:7a:c3:01:67:77:56:49:09:ed:ed:31:72:83:e8:
+ 75:9c:4c:ce:f9:97:b6:63:3c:e2:ca:83:80:92:03:
+ 9c:96:e2:de:72:79:c1:cf:3e:3f:b9:0d:b4:87:c7:
+ 75:e6:56:8d:aa:f8:77:47:11:4e:fe:07:b0:1d:64:
+ 06:73:4b:6f:d4:ac:da:0f:05:87:b1:f1:98:a9:f5:
+ 8a:a1:a8:ed:17:9c:26:b8:da:92:63:d2:53:87:e6:
+ fc:ed:44:de:94:56:90:3e:a2:a1:67:08:cb:38:d4:
+ cf:17:3b:7e:ff:7a:97:c0:7b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8
+ X509v3 Authority Key Identifier:
+ keyid:5F:BC:4C:DA:EB:0A:0C:B5:23:43:5E:24:32:27:79:41:F5:82:A3:02
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 2
+ serial:A2:AF:15:89:EC:73:54:86
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 52:83:16:ab:0e:43:2d:b3:e4:0f:6c:c1:63:d4:86:ac:e7:1e:
+ ee:7b:ee:9b:0c:ff:4f:e0:59:d5:e4:27:af:68:bf:a7:f5:2a:
+ a3:c9:e3:2b:8d:b7:31:26:f6:04:80:4e:f2:a5:bf:da:63:5e:
+ 8c:d6:c6:b2:46:a0:46:10:2f:84:9f:02:76:f3:c8:33:05:62:
+ 0c:5f:2d:cc:06:23:53:9f:d9:f8:46:e4:2e:5c:da:05:fc:bf:
+ db:45:b4:ac:8d:8b:b5:4b:60:7b:7b:26:34:7f:b1:4b:41:96:
+ 41:26:70:7a:9d:78:a2:9b:e0:de:62:a2:04:86:9f:ed:7c:a6:
+ 20:eb
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyMB4XDTA5MTExODE1NTUz
+OFoXDTM0MTExMjE1NTUzOFowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLK
+g4CSA5yW4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip
+9YqhqO0XnCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABo4HH
+MIHEMB0GA1UdDgQWBBSM8ywwouhiUHC8/HGgQfrgWLRNuDCBkQYDVR0jBIGJMIGG
+gBRfvEza6woMtSNDXiQyJ3lB9YKjAqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyggkAoq8ViexzVIYwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBSgxarDkMts+QPbMFj1Ias5x7ue+6b
+DP9P4FnV5CevaL+n9SqjyeMrjbcxJvYEgE7ypb/aY16M1sayRqBGEC+EnwJ288gz
+BWIMXy3MBiNTn9n4RuQuXNoF/L/bRbSsjYu1S2B7eyY0f7FLQZZBJnB6nXiim+De
+YqIEhp/tfKYg6w==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..7ef7ef0a5e81
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,52B792B2B0E03BD6
+
+GIFY+N2q5LMcrtTplZUToF0/nuplr7ASLAe7lEcDLTTHeBTO+w4ScB62Dl6veeEU
+3/pPevG+V3HIA5ukywX334DuWjL3bFIsPg8a3NKKn0nTpmwqHqXZ53kbSMHIiu6v
+MkvGeVLLxLhnCsqQ8HI2ccuxGSXLA0rqlnrZTOtvQpw9ohpCM3CX1GeekLc83bL/
+4HHmw8nNL+OCH4l9g3Y8XpN3ySRgl+lWmoKxl9s2Mn7jFoaqSXuuH3wIu9D2kJxS
+qfVs/fo12j8RWXSIMpiCJFCOx1v+zzX7dJ0cyim83WF2OHsOW03UYnWzgk44iz4d
+/WVWJuRU3gEwpN3CDdhzBZuYw9DmaG8HLHYT15CSdkQrfHeFM3Axcoju7b887JX7
+sOHU6h4ebMVhAswAXKGlTKOY2PO1GE9cKoa2jxnB2z8Dhe8rxzuvWyr5BfXrS3KT
+lM6pjxZSoGMcmG7FtDgU/aAIn+DPR/rdB7tfZwP3GoVV+n3jRi8LU5I3wbi4z70o
+bwXMb7zN13WHFszZgPX4tHD3jjyLwk7rFmMJ17L3K6eOAlGg8o+FBgoqYFQo05sY
+2SElOibX8RIj9m9lerNLOxB5ty2VDUSaytJ0b1gPTXAdsaryq7tKFxIrNKpiJ1qk
+snQSJyr2JwRqBLRwkXZV5CliWwZJGGJsC9I5fAMuuW6qkDhsSQ1fIJsGn/SbbiZj
+lnZVY/33vHMltbwEgY4GuQWm29VYJwLWk925BY/nQ5fWPARYsap04JIwtperrZKj
+XETzTrnTje6sVl32aCLdYlwsVbh04zRwUFharCz5vtDdVeHrfsBDKA==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg
new file mode 100755
index 000000000000..bf73e3549d66
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem
new file mode 100755
index 000000000000..55be1552189e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAJVv8OMrvnb5MA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMzAeFw0wOTEx
+MjAwNzM2MTVaFw0zNDExMTQwNzM2MTVaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMzCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEA3L6zaGhxFC+Mf55dzotmPKxdZndlxSVVOVI93JrxKVfn8mYOCZEjdb9Q
+65vgLxGXMC9LCiF6SfT8dIfav1hUugmLaLzBesPu6h4kHN33/7Asj8BzY5I57uvF
+sMLNL5hHFRRqtBqHvmO2G8zjHPluObnBzaQNCbdZxYODeh1GFpECAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUaf8w7B80mmc6ayDS33/1BQTt+RwwgZEGA1UdIwSBiTCBhoAU
+af8w7B80mmc6ayDS33/1BQTt+RyhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgM4IJAJVv8OMrvnb5MA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEABPdAJer/8FoOAMWszhfz/BEjF97TTFs1
+KqSEiuymswG706weo9tcnP8u81AITQPSWZE1ALQN5L35Zvg6ubJsNM3+VSoQ6hZj
+G9oWAJzFN7DhIqs3Xb13eBH/0yqAdTuFB5uLcJdR3GIXGFvcU/5FZBpYnORVqvg4
+irKv2VvyCR0=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt
new file mode 100755
index 000000000000..dd9a47ee641b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114074039Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 3
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..c14880b580c7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 3
+ Validity
+ Not Before: Nov 20 07:40:39 2009 GMT
+ Not After : Nov 14 07:40:39 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:9e:87:1f:af:f0:a0:1c:f4:9e:f8:c3:e7:ee:d3:
+ cb:a8:e2:54:98:ba:dd:7e:dc:6e:14:e1:7e:7f:5b:
+ 1e:ef:53:3d:89:76:ea:e2:b3:6c:08:0d:e8:c8:4d:
+ 24:40:ff:92:f3:5b:51:f7:90:ac:69:37:29:90:f5:
+ e8:95:6f:67:d1:10:cd:7b:dd:65:38:d6:25:ec:63:
+ 39:ba:2e:ea:13:58:8e:7a:82:8e:10:d1:7b:77:7a:
+ 08:d5:82:66:62:a4:83:39:ad:f5:83:d5:2f:5c:bc:
+ 23:6e:c8:78:8b:38:9f:eb:a3:67:ba:43:fa:e4:07:
+ 3f:90:72:db:0c:f9:49:0e:0d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D
+ X509v3 Authority Key Identifier:
+ keyid:69:FF:30:EC:1F:34:9A:67:3A:6B:20:D2:DF:7F:F5:05:04:ED:F9:1C
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 3
+ serial:95:6F:F0:E3:2B:BE:76:F9
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6f:ac:53:9d:16:6e:95:ed:97:60:ed:c8:a8:96:ab:24:c5:1e:
+ d5:d7:26:98:fb:b5:aa:ef:da:a4:91:6a:82:55:ec:21:a2:08:
+ 24:c7:0c:a7:58:0c:06:69:3d:04:7d:08:f1:0b:77:41:ad:1c:
+ 13:c2:bd:17:c9:9e:ff:df:64:69:8b:58:f1:bc:40:bd:cf:e4:
+ 57:29:bc:5e:93:84:61:56:4c:e6:c1:3a:2c:6e:71:ea:5d:67:
+ c0:54:be:4f:2f:27:a8:59:8d:29:94:ba:c6:6c:ff:ed:25:3d:
+ 0b:fa:93:c9:45:f4:d5:a3:3d:be:8a:f1:9d:c4:92:d5:5c:d2:
+ 77:7c
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzMB4XDTA5MTEyMDA3NDAz
+OVoXDTM0MTExNDA3NDAzOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wI
+DejITSRA/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3
+egjVgmZipIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBQbLeCiJn8Nujh+7AaBgQ8SdExaTTCBkQYDVR0jBIGJMIGG
+gBRp/zDsHzSaZzprINLff/UFBO35HKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzggkAlW/w4yu+dvkwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBvrFOdFm6V7Zdg7ciolqskxR7V1yaY
++7Wq79qkkWqCVewhoggkxwynWAwGaT0EfQjxC3dBrRwTwr0XyZ7/32Rpi1jxvEC9
+z+RXKbxek4RhVkzmwTosbnHqXWfAVL5PLyeoWY0plLrGbP/tJT0L+pPJRfTVoz2+
+ivGdxJLVXNJ3fA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..445d86f99540
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,24B61B9BC2D90894
+
+pJUmVTVcjD3b4WKoSDJHrxHYOJ5/6P0FyQRYaJhnDXpcC5cQywl7yuD3HpRh3cXT
+Y5k6d1E64St3I/IDImdbiEEDbjlSG9gfFf9vYeP/Xlpaja0Y9Q2ePnQvJY47HB7+
+qkrt6b+3yIW024wHi83dzaeYeNUJaY1jGsra2TzGk/+hYrf6yvnyehEAsy5WChof
+bfaQ29RrGTlzf6IpSRpiHUL7nVl+eHfbGLX4Ih8aEFXpcnoWtpY8FgQ5+bJxMeR4
+R2ge0c3G0VIBXBRRUoGsU0ZcRLdxYUFcDGZse50ZboUwvROfPCimowcyWKluV9yj
+l4+e3glYcwGHRqHYArsLDUV2hzHHEJ1IKn4E+oExqQSGgDQgUDN0kjlRPPxWQb29
+6dZSHW4VXW609Q10FKbPuCocgQ2Ut2bNGWqXsiNNTr39iB0r/hA/V4bKy3G8ogsH
+AQFp6D9LaFlt9ZFA49Y4WoPzSY9J2C4eFJzQ+jhCpeapzQ54BWNTYMQe+SJHkp1O
+PWVovUrRbTDesIUeY1UJuSnbDotOc6vzEAsP+FIL2qUySUGG/CPyAf3R4FyahwjL
+bgU5kmpzBKsgqRYrO2yfLz5/3/e9xUGfHVi8lbI5f21NQKesqHY2xS2NmGvakzbe
+ZvD3bhythAR5L0Pp+tiiHE1LUAbcKp90aFPeaONDpUtrRU21gqqvEKnnubCvnjmE
+l6GrH2WKSgxJbQ3GGqNaDg1ivB8XXyjx7guvBzpA0Pe2YCYMa0RI27GywNkv+RsR
+eo3ox2QhUpvPxUl3ijwOPN3EFXrq0gdlYQJBWW3GLlX4Q71KJF+jUQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_4/README.txt b/xmlsecurity/test_docs/CAs/Root_4/README.txt
new file mode 100755
index 000000000000..b9fb278a2724
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/README.txt
@@ -0,0 +1,4 @@
+Revoked certificates:
+
+- Sub CA 2 Root 4
+
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem
new file mode 100755
index 000000000000..45b4ce8a5f29
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAKKTRnQ7puOtMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNDAeFw0wOTEx
+MjAwODM1MDRaFw0zNDExMTQwODM1MDRaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEA2k+jPArotoY09an0BpF3RYIPP/5RN04E4S+Ulp/ipttaVxtAC0ojJSlp
+0PGp/vIodFT9pkBb0nq56LHjFLj+lyW5tKAR+4B+VVvzwJhUBD8qHjYJE30vWZ88
+3+3I+GmXDzy962kQxrb4J6dBwGImoqhBTXWOxGnPjXxtovzYmMECAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUuo2hl9zEOR+QtVFrEBnyRg2pZY4wgZEGA1UdIwSBiTCBhoAU
+uo2hl9zEOR+QtVFrEBnyRg2pZY6hY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNIIJAKKTRnQ7puOtMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEARdHX1KRJ/DE1zOkbjINPX4pFjTMIIfKd
+ncEBM7Po20it75Hbl8bHoxwCrjOu+9L1xaTCWcunyqv26yrjVpORPHPODLMc2W8x
+FQm39hL6a0RjqurDlhcrjor3HD7hQ+GjEUDAX6Pk9RDxN+uMHvF5/5WCEhSn2aLT
+IozGu5SmZys=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt
new file mode 100755
index 000000000000..f07b3377de4a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114083727Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 4
+R 341114092227Z 091120092718Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 4
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..391037118147
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4
+ Validity
+ Not Before: Nov 20 08:37:27 2009 GMT
+ Not After : Nov 14 08:37:27 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:da:b0:21:94:89:b0:00:89:cb:69:59:9b:0d:fe:
+ 1f:b9:a0:a8:44:92:55:5f:0b:d5:e5:08:63:bd:47:
+ 6b:11:4d:b1:a8:12:6f:c1:cf:cb:9e:ae:e2:c1:03:
+ 68:46:59:0b:96:7c:21:45:9b:14:81:d8:f1:83:70:
+ 6b:3d:b4:56:65:49:87:1d:ab:e2:08:6a:49:66:0e:
+ 59:b4:da:7a:3f:72:23:b8:1f:fb:78:f5:f0:2d:c4:
+ fe:d9:94:6e:2e:c3:6e:95:ba:38:60:d1:0b:fa:16:
+ c7:02:71:ef:3e:71:72:63:26:56:35:1e:8b:ec:47:
+ 87:25:6e:bc:90:d0:8b:37:2d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4
+ X509v3 Authority Key Identifier:
+ keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4
+ serial:A2:93:46:74:3B:A6:E3:AD
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 45:77:ba:6b:b6:a7:2a:0f:6b:38:90:9f:0a:18:11:c7:54:7b:
+ c9:3b:9a:93:90:96:f0:04:0a:56:87:30:e0:f5:d8:84:40:39:
+ 90:85:ca:e7:38:1b:d8:df:2f:bd:73:91:13:cb:a6:c9:b0:7a:
+ f7:59:77:6b:9a:d5:86:78:06:dc:40:14:ce:ea:43:a8:ae:ed:
+ a2:03:64:51:3a:47:7a:9f:df:2d:65:49:56:a5:39:cf:28:2a:
+ ac:ab:fd:e1:93:fd:3e:56:e8:eb:7a:11:a8:f7:f9:1a:a1:83:
+ 1f:92:f7:da:4e:c6:d9:67:dd:67:ff:be:6f:e5:24:e1:6e:cc:
+ 94:3c
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA4Mzcy
+N1oXDTM0MTExNDA4MzcyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDasCGUibAAictpWZsN/h+5oKhEklVfC9XlCGO9R2sRTbGoEm/Bz8ue
+ruLBA2hGWQuWfCFFmxSB2PGDcGs9tFZlSYcdq+IIaklmDlm02no/ciO4H/t49fAt
+xP7ZlG4uw26Vujhg0Qv6FscCce8+cXJjJlY1HovsR4clbryQ0Is3LQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBSWmi0G9nZPg2h7nGnEGLtK60Y45DCBkQYDVR0jBIGJMIGG
+gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBFd7prtqcqD2s4kJ8KGBHHVHvJO5qT
+kJbwBApWhzDg9diEQDmQhcrnOBvY3y+9c5ETy6bJsHr3WXdrmtWGeAbcQBTO6kOo
+ru2iA2RROkd6n98tZUlWpTnPKCqsq/3hk/0+VujrehGo9/kaoYMfkvfaTsbZZ91n
+/75v5SThbsyUPA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..9d951ee26728
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4
+ Validity
+ Not Before: Nov 20 09:22:27 2009 GMT
+ Not After : Nov 14 09:22:27 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e5:8d:27:4e:09:53:08:61:c6:23:25:9e:dd:9c:
+ 07:bf:81:38:5c:5c:10:8f:e4:12:2f:4e:2e:b1:a1:
+ cf:21:46:53:bf:e8:5e:de:17:3a:9d:f7:e8:ef:3e:
+ 9c:b4:29:37:4c:31:35:15:dc:98:e0:93:9c:ce:6a:
+ d6:e1:35:19:6b:d4:1d:3b:81:86:b1:e7:ff:1f:b8:
+ 34:a9:f9:de:4d:b8:62:ac:3b:d4:58:8e:5c:76:b5:
+ 07:7f:32:8a:3a:90:73:71:d5:da:f1:79:39:14:ed:
+ 1b:f1:8a:3e:be:48:bc:07:ec:f9:7c:03:14:fc:e7:
+ 55:a3:65:81:c7:6c:70:0b:ff
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D
+ X509v3 Authority Key Identifier:
+ keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4
+ serial:A2:93:46:74:3B:A6:E3:AD
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ bc:cf:43:eb:72:b1:71:a7:94:8e:cd:5b:fc:d8:21:31:83:db:
+ a9:de:c7:5b:14:e5:7b:90:43:e6:05:df:db:6e:95:5f:24:ac:
+ 0c:a1:8a:ac:c6:cf:f2:03:cd:a0:30:ae:d3:a9:41:07:c9:b1:
+ be:4b:e0:fc:a2:76:09:07:75:6a:fa:e4:2f:a3:3a:cd:81:68:
+ ab:f6:06:c4:32:08:25:6e:e8:e7:36:9c:1a:f7:42:73:f8:b0:
+ d8:42:3e:85:c2:11:23:10:d6:6a:e4:8f:53:cb:8b:8b:1b:5a:
+ 4d:6d:9d:34:45:26:52:d2:ee:6d:8f:23:ff:00:92:f5:99:62:
+ 4c:41
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA5MjIy
+N1oXDTM0MTExNDA5MjIyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDljSdOCVMIYcYjJZ7dnAe/gThcXBCP5BIvTi6xoc8hRlO/6F7eFzqd
+9+jvPpy0KTdMMTUV3Jjgk5zOatbhNRlr1B07gYax5/8fuDSp+d5NuGKsO9RYjlx2
+tQd/Moo6kHNx1drxeTkU7Rvxij6+SLwH7Pl8AxT851WjZYHHbHAL/wIDAQABo4HH
+MIHEMB0GA1UdDgQWBBRp3raZxJX3WvpBa0z2w22JqjcxnTCBkQYDVR0jBIGJMIGG
+gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQC8z0PrcrFxp5SOzVv82CExg9up3sdb
+FOV7kEPmBd/bbpVfJKwMoYqsxs/yA82gMK7TqUEHybG+S+D8onYJB3Vq+uQvozrN
+gWir9gbEMgglbujnNpwa90Jz+LDYQj6FwhEjENZq5I9Ty4uLG1pNbZ00RSZS0u5t
+jyP/AJL1mWJMQQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..003d2f3b56d5
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,26D3AA1ECCD64EF2
+
+Smy62JNi1/1qKZI1q2lF13336vwJWfw+ii4g/ZwMJWuwTWUGXWZ1o9B9pZFo78KM
+pMlasoCwAoI3lepMIwxtSRMgstxacJ4QRVPdevo7Qq6+++qNXdkqq9pYM19dsOiu
+UNpbPXVvKQZnvm0ZFCjqiylvjCaQVQRScdwu9cJyq2qIQ1laXQoW2fPYBb8KSsCO
+B5E76zAGdRlzEglT9Qkjbi2dQWxWpMHFfWZydFJnNbuh7O+RxCSOJN3jXlDRGPag
+IwL4mFX8dElCwWhNpdd1pXF2ZXQ2S6Ke1MoOXRvJ7XVvEfnGyHpHQRdNB0M9gJCf
+3ynJ0UUiCvXJs/6NEcOZzZ+R38XfMvsOcG1jNuh2KE5hW3cGbQMV2TPZMHjGE/qn
+EhX+vzIOhRUPTUQjrjmV/lgioL4pMKFBXyfr2tkNLVOfzQtIXVfgxF1ooVmZFGKR
+fAmHRbXKSrGWPJkX75bdlVnQ15qz5dU7PkIohGwGojOHuTWLXzKtOuLs7KMmH/i1
+5MhxcoXbI4R+hX/oj2Es4MKYFcSI0MID9Z5Se6z/yaz++5P9OrEGrXydg4W5YSuc
+Q+MovUuqNoDH+Mo0z2P2DL4OxcIkBYoUVFOnIL2v5thRgbdWk05m0OBWYnvue9MG
+CiuA49Lqg0H2ViZrDCyGDQNBkDkW7AKHYhVe3afHSDENX+wsgB1oj1bMvWNLQfCB
+2IOYjv+of7tNOvIH6AuaJDqF2TYOm4ipcjSD/SEuKfrOgXlq6702tRhL4aAfHa6K
+o1yrUfAxLwqN/TjSDNfOIUr5ro24tYnUaUnYPpn/zwZ5WfitZ4RGBg==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem
new file mode 100755
index 000000000000..631deb24de3f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAPA9tqmpnKNOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNTAeFw0wOTEx
+MjAxMDEwMzdaFw0zNDExMTQxMDEwMzdaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAwbqFK0+BWGylCl9gJj/eVuuNBcSgVetgx0cXwMRPHiwFZ8ilxPJm4kd0
+k2WDKHox5Ol8T0pU4n3fA5VmxjcfGnx03R8rFTn5deetrKQzyWUjz7EIl4mZYSvK
+hwlbg5ZB4FJDYUoC/3eVHdQq2jUvRaQad1TvdBmvIMbDaYmTT3cCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUwdGg1FsLnX4xYfk5EJ8xEODSBrUwgZEGA1UdIwSBiTCBhoAU
+wdGg1FsLnX4xYfk5EJ8xEODSBrWhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNYIJAPA9tqmpnKNOMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAeX2QYyrs9an5ObWjzauPCzr8hx6k8dF3
+YXU8f/JCf/fKG5u5WQZmmu0YZXMSaDyzqS3rKupDSm4kbfB9l9oTkgZszueI29pd
+C/QIh8vUTiAlV5zxR4ypqmBg489W/uXdQPicuFhGFYX9EWjuGhwk8dL0dcUCufwX
+UBYBlUiceFU=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt
new file mode 100755
index 000000000000..d910b9acc97e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114113023Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 5
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..b350f6eb33ef
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 5
+ Validity
+ Not Before: Nov 20 11:30:23 2009 GMT
+ Not After : Nov 14 11:30:23 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:97:fa:a2:49:d3:bf:c1:2e:7a:ed:83:83:3c:78:
+ 96:c8:b2:b9:67:af:c0:5e:0a:89:89:fb:94:59:32:
+ a8:2a:e4:20:2f:3b:3d:ce:53:4f:72:fc:6c:0b:93:
+ 38:c3:df:66:6e:d5:79:d0:a4:4e:41:84:43:3c:99:
+ 79:0c:e0:5f:19:1a:3d:f5:4b:11:28:0f:80:b0:a0:
+ 71:34:5b:90:71:c2:ef:1e:85:2e:5b:9f:3b:22:c3:
+ 18:f8:7c:1f:ef:1b:78:17:a0:44:60:46:7e:88:eb:
+ a7:60:a0:5c:2a:7c:37:99:fa:27:97:08:e8:89:ba:
+ bc:69:4b:79:93:8f:ad:b5:9b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF
+ X509v3 Authority Key Identifier:
+ keyid:C1:D1:A0:D4:5B:0B:9D:7E:31:61:F9:39:10:9F:31:10:E0:D2:06:B5
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 5
+ serial:F0:3D:B6:A9:A9:9C:A3:4E
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_5.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6d:ca:34:05:99:ff:99:49:d3:6d:9d:ad:c6:99:da:9d:6c:94:
+ 62:77:ed:1c:39:23:d2:e8:b6:3e:df:63:dc:7c:10:3f:c2:ed:
+ f4:04:26:58:05:01:4c:ed:a9:83:43:3a:5d:fe:60:6d:5b:58:
+ dc:93:8c:94:69:b6:7f:02:48:30:9c:31:f4:7d:de:e0:de:04:
+ d2:dc:79:b7:60:c2:87:f7:c7:92:a2:f5:86:a7:0c:70:3b:a3:
+ a7:35:11:cf:a4:28:21:aa:8b:24:50:2e:96:41:be:66:01:bd:
+ b9:ec:04:0c:92:d9:8a:e7:a0:96:24:9b:f1:a2:9f:59:59:4a:
+ 32:a4
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA1MB4XDTA5MTEyMDExMzAy
+M1oXDTM0MTExNDExMzAyM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCX+qJJ07/BLnrtg4M8eJbIsrlnr8BeComJ+5RZMqgq5CAvOz3OU09y
+/GwLkzjD32Zu1XnQpE5BhEM8mXkM4F8ZGj31SxEoD4CwoHE0W5Bxwu8ehS5bnzsi
+wxj4fB/vG3gXoERgRn6I66dgoFwqfDeZ+ieXCOiJurxpS3mTj621mwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFAHptZnkbfmMQj0JEA+ndcYneEqvMIGRBgNVHSMEgYkw
+gYaAFMHRoNRbC51+MWH5ORCfMRDg0ga1oWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDWCCQDwPbapqZyjTjA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzUuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAbco0BZn/
+mUnTbZ2txpnanWyUYnftHDkj0ui2Pt9j3HwQP8Lt9AQmWAUBTO2pg0M6Xf5gbVtY
+3JOMlGm2fwJIMJwx9H3e4N4E0tx5t2DCh/fHkqL1hqcMcDujpzURz6QoIaqLJFAu
+lkG+ZgG9uewEDJLZiuegliSb8aKfWVlKMqQ=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..222320a9a05e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,5F2D7F26BBEBD8FB
+
+qFyJ/G/DFwA+Kx3cVldc6bOMRbbduL7x5DBjCqS20YfoQoyvDcyel8FYz4/8CQ9d
+kmb4nrM0Dj8/FgDiite2E8+qJV4U8OIBsXelFd8FWC8hB4z0DtwVxIAiM6mTMMcu
+bWta3Lu5xrNvU/vosB967COztoYB5XLLQ/DrRPoV+tvJx0Le3zXLzceIj4PicuIk
+/Mh5NVqN5a5blaV1/1JvcfOQLCI0rNebP3iAYhwCkKyu6WkpSNuHIw5gaMC6KXpq
+ORPf3m+3/YKHLS9/tg+9CPQrRpyzLV/TOUduq6HFfzh9ZRXd04Dpn0P61JVCypYo
+9u62lnNCAtreyvCUttzANLgujbgT9HNsjzKTAD2g+zjwQPgIS4epNm5LBPsQv15A
+Vuw7CnNlLa8PxUxuDUjoW2YaGUR3PHNUz+TA1U0UFxlNK/lgeekIvmSvPjVyROOB
+SxOH88yAZWe6pWioS3uzeg1kf1F5sj9u+KHPyikUe3nUBrS1cZSRtQczhlWWocgm
+GtfwQSSVSwRtd7CWe/nQHuSJyrIJCbWFaDhnVXRhr+tyDpLtoeApCvefvel0p/AY
+LTaRcno3zUxZS3G8Cv71hBPR8y5di5dAxBSfLgMYxwBD3UFO6CPkmiJteIhHska9
+FJqR98hfvF+0hwFnaFUTszDMGK1xV20MeTMhLAwSlttbuwtWMTourFKtS6t1SomB
+JOTkpiVfojTSAJX40ExQgNtvY+7ayNUBLX9NIuIcOjFbQa1LNmGy9cOPQD49x067
+fALGA+V1KO7sFeUrunkpHncYoux5OThq3iDJ2tPfBmyhTQhOSzN38w==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg
new file mode 100755
index 000000000000..7a23cf2df5b9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_5.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_6/README.txt b/xmlsecurity/test_docs/CAs/Root_6/README.txt
new file mode 100755
index 000000000000..e49615a51c0c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/README.txt
@@ -0,0 +1,5 @@
+To provide the CRL via HTTP run
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8901
+
+
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem
new file mode 100755
index 000000000000..5a7fc185b421
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJANhqTyT5yZQnMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNjAeFw0wOTEx
+MjAxMjI2MDFaFw0zNDExMTQxMjI2MDFaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAslt6KM0bikDy8n0lNMeaNQiZk9Pcfsf6Vaasn9A8FABFn1chxV5zOMag
+jo6CyZG1CNLhA841RtgiWVMc8BA+pDKzOQAzfgSk4VjXaY8nYgKEmGDKuNvls+kE
+OKMkJibh/scNMDUOx8Bnc6S9LyYJAhZFrxm/lgmoIo7QMcdseIsCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUrCVem7W6TY69d7Kd2eKErnoxj/IwgZEGA1UdIwSBiTCBhoAU
+rCVem7W6TY69d7Kd2eKErnoxj/KhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNoIJANhqTyT5yZQnMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAU6Sjyeo650mhSGK8JJBhDroVJgAryVF4
+wXEKWxK0yuO0TVZJxUWeHOESpegBW1eP5m9Pz0IHnxj6MsGBYq7SZU84awt4HJto
+6O1ARZYfT9r+qTts33I/VVQVTJbvETF1vGsuAZfTTDhAJDqS2oueiPDSinzQxNMy
+16L4Rajm8LE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl
new file mode 100755
index 000000000000..df6dcb21eec7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt
new file mode 100755
index 000000000000..7f0df0d959b5
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114122807Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 6
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..0490b88cd769
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 6
+ Validity
+ Not Before: Nov 20 12:28:07 2009 GMT
+ Not After : Nov 14 12:28:07 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c4:d9:ab:27:06:66:41:0e:36:ff:d4:b1:d0:8c:
+ f7:b4:25:55:cd:fd:fa:a4:5a:e6:4f:d0:05:dc:a3:
+ e5:bd:8d:53:77:d1:ea:95:5a:52:81:c8:b6:36:a0:
+ 5f:3a:e1:85:1e:8a:48:91:7d:29:78:ff:ea:c5:e3:
+ ad:c4:27:d5:b7:8f:59:20:26:d4:45:87:6a:56:db:
+ ac:f5:f8:0a:88:82:9e:c2:00:06:fc:98:8a:fe:35:
+ c3:02:a1:67:08:06:42:e3:88:48:e0:8f:33:ff:f8:
+ a4:87:1a:3a:d9:54:0e:1c:09:3e:a0:f0:70:cd:b5:
+ b0:b2:7e:07:73:ad:20:64:69
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7
+ X509v3 Authority Key Identifier:
+ keyid:AC:25:5E:9B:B5:BA:4D:8E:BD:77:B2:9D:D9:E2:84:AE:7A:31:8F:F2
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 6
+ serial:D8:6A:4F:24:F9:C9:94:27
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_6.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 55:5b:3b:6b:8a:d0:1b:d8:19:d9:96:85:4d:b4:a0:98:b1:bd:
+ 9f:0b:62:21:92:8b:4e:d3:d0:1b:91:3d:e3:f5:bd:ce:16:57:
+ fc:b7:84:15:51:fd:98:ab:32:59:28:0b:44:57:49:ec:ac:11:
+ 67:26:7a:a3:c5:b8:9d:2a:de:b6:7c:76:0a:e9:18:9f:98:87:
+ e8:80:c8:72:99:56:74:ab:73:1b:f4:e7:b9:b1:3a:f3:7b:0d:
+ 2f:5d:82:6c:d1:99:9f:23:be:23:fb:4c:0e:15:5e:f5:9f:90:
+ 88:d7:51:3a:6a:7a:f0:54:a5:c4:89:a5:0d:0a:4e:94:59:64:
+ 59:54
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA2MB4XDTA5MTEyMDEyMjgw
+N1oXDTM0MTExNDEyMjgwN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDE2asnBmZBDjb/1LHQjPe0JVXN/fqkWuZP0AXco+W9jVN30eqVWlKB
+yLY2oF864YUeikiRfSl4/+rF463EJ9W3j1kgJtRFh2pW26z1+AqIgp7CAAb8mIr+
+NcMCoWcIBkLjiEjgjzP/+KSHGjrZVA4cCT6g8HDNtbCyfgdzrSBkaQIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFImM13HrZ3hO1gE1sqyhtIhDznCnMIGRBgNVHSMEgYkw
+gYaAFKwlXpu1uk2OvXeyndnihK56MY/yoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDaCCQDYak8k+cmUJzA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzYuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAVVs7a4rQ
+G9gZ2ZaFTbSgmLG9nwtiIZKLTtPQG5E94/W9zhZX/LeEFVH9mKsyWSgLRFdJ7KwR
+ZyZ6o8W4nSretnx2CukYn5iH6IDIcplWdKtzG/TnubE683sNL12CbNGZnyO+I/tM
+DhVe9Z+QiNdROmp68FSlxImlDQpOlFlkWVQ=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..166be0166530
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,BADC417CBCEF5888
+
+5vIfuyyd2rgqSPUElPa2YM8on+FeoYuAIB+mfVHy0nSGisUKjmQQACaeTVD+aO6S
+UFBz3W/RJXCj/8x5+ZYa8Rj44DeSwlDrxSy5VBrWegOzujfGPqrzwCL/ASKGPPFN
+RwK0i0niJsj6+oQOGgP6AIb08reX1tkT0GItwQMjIQAFETcDP8m1sA1kFpLhvBCF
+dHyw0lfnh+NZ9nnpAdpVXwt8teccLUyEHARNscebg8vqjc2gRxi3KpT3pURg0dUc
+eaGH8DIB5CuAYW2Mo1LLRQ0uvkFgSl56WcolYiRTy2KUMW7Gz7oBA5Qyb9lz25yV
+9djt4Hrs9cI1p1TGmvSklGPKJUaTf0Yrf0XRkS6xknFVX4zzkbD4vYFelITSxeMT
+pPVbjLSWiIo+mqBuW6i+LUNMt45b1RWM96pomrPRrGne4saJOkhVXTvv/pR4KB+S
+J2iwlEDNOwzkxeqSB7lJuzIce/iUqERAzlXe8e0VVgy0P0UfOIViLWS98cuqR86H
+P1rMYtWilAkLKBUYo+lS7f/3YD8E3V10XdBmYJFvmpHPXM2SP5HQZXtoNCXJNcvB
+aAlb3c7InxfqLLn+kH6WgPzXXcXO7cxlZ3cXBbJf3IhRT3aBEnAH+s+DDCi0RCII
+UiLOnrgfOEZuNyRhGin9R7WFRtnGYJjHTP54FMOY0f0Rj7ElT+xymeAZE8wyXKfi
+MWDgswTYYkcC7uPJAJ8HnLtFixr9aEriug7yemGyr686oX8gLPdwrYwPYJBt7Q+b
+0nf22SoMqMNWSCWcr89sc1AIb0ebX+FxtsN6j45ztEjZGjXYkk2iXQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg
new file mode 100755
index 000000000000..ee8469fe548b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_6.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_7/README.txt b/xmlsecurity/test_docs/CAs/Root_7/README.txt
new file mode 100755
index 000000000000..056f1b13397e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/README.txt
@@ -0,0 +1,10 @@
+Revoked certificates:
+
+- Sub CA 2 Root 7
+
+
+To provide the CRL via HTTP run
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8901
+
+
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem
new file mode 100755
index 000000000000..01761f55bf00
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJANXmY18YCYKJMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNzAeFw0wOTEx
+MjAxMzA0NDhaFw0zNDExMTQxMzA0NDhaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNzCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAvG//bRySIKOz1hmmH6qx02wtf2ZO2skK/wxPnTAd+LLuH2upOfGkaFCi
+hd1zsIshs9/TjtLNa4nplkYSvZlYBsbpIuNQZrEedbvLYV/zNdsnLfht+aX3yMuk
+q1dh2BI0LdwXiyMyPwATJwQ96AXq/a+cZi1ZRBToCztZArJK/xMCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUgMb4C198SeSG/ciSxoBw2cBve94wgZEGA1UdIwSBiTCBhoAU
+gMb4C198SeSG/ciSxoBw2cBve96hY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgN4IJANXmY18YCYKJMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAg15QATKSYmz+XGtnBLDnWu2Gk59nglH4
+gG3p1xiVVgOyQVGsvNr+3ETPTTcf6x+ap1+AHE9SJJ0/WQSuUHtOv6y/prp4MWbw
+/QBL2WHS7adTFWxOJ/VWpb8GhTtJdG9PKYeSmVAtC1qzdI1zsjPYvHO3UJnokDkB
+fY7kpaTJprg=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl
new file mode 100755
index 000000000000..0eefbda68048
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt
new file mode 100755
index 000000000000..24c3538724a1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114130753Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 7
+R 341114133506Z 091120133621Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 7
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..2dda8f2b286f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7
+ Validity
+ Not Before: Nov 20 13:07:53 2009 GMT
+ Not After : Nov 14 13:07:53 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b0:ae:6d:0a:21:ae:8a:92:b1:16:25:d3:08:cb:
+ ac:b7:4c:53:6d:4b:b3:12:82:40:54:c9:44:28:fc:
+ 4e:10:e6:65:40:de:70:5d:8b:ab:1f:5c:77:03:43:
+ 3d:3a:3d:9e:f7:37:66:9a:33:68:a0:cf:ad:8f:f4:
+ fb:9c:a3:87:57:5d:ec:d6:55:5a:18:b5:e1:2b:d2:
+ c4:10:fe:f0:01:a5:da:29:ee:c4:af:15:c9:8c:dc:
+ 7c:45:84:bd:e5:5b:09:1f:16:1d:11:e7:61:e6:22:
+ e7:1f:c8:86:bf:a1:da:cb:fe:6b:7e:c0:6e:aa:7f:
+ 97:84:e8:8f:81:69:f1:26:87
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE
+ X509v3 Authority Key Identifier:
+ keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7
+ serial:D5:E6:63:5F:18:09:82:89
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_7.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 1a:bc:5a:4b:9a:d5:e8:c0:35:c2:61:0a:58:7d:33:e2:87:01:
+ 61:83:80:42:8d:1a:7e:b1:9a:58:d5:01:fd:e7:ae:5c:c8:65:
+ fb:9e:1d:bf:49:ba:ed:40:f4:05:7c:3b:2d:db:0e:53:d0:05:
+ a0:bd:15:87:c4:37:22:0b:a0:04:a3:ad:cb:57:b2:00:97:ee:
+ 8f:89:91:8e:7d:0b:e2:27:96:6e:0f:ab:73:33:59:fa:9f:37:
+ f2:77:79:99:af:72:ad:f9:49:05:ed:55:08:31:eb:97:0f:99:
+ 6e:9c:a3:df:f0:52:1a:14:4e:78:25:0c:8b:02:cb:56:e9:4d:
+ f5:9f
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMDc1
+M1oXDTM0MTExNDEzMDc1M1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCwrm0KIa6KkrEWJdMIy6y3TFNtS7MSgkBUyUQo/E4Q5mVA3nBdi6sf
+XHcDQz06PZ73N2aaM2igz62P9Puco4dXXezWVVoYteEr0sQQ/vABpdop7sSvFcmM
+3HxFhL3lWwkfFh0R52HmIucfyIa/odrL/mt+wG6qf5eE6I+BafEmhwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFFRkFX6TihnI+bfvYKDfXMgVVsDuMIGRBgNVHSMEgYkw
+gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAGrxaS5rV
+6MA1wmEKWH0z4ocBYYOAQo0afrGaWNUB/eeuXMhl+54dv0m67UD0BXw7LdsOU9AF
+oL0Vh8Q3IgugBKOty1eyAJfuj4mRjn0L4ieWbg+rczNZ+p838nd5ma9yrflJBe1V
+CDHrlw+Zbpyj3/BSGhROeCUMiwLLVulN9Z8=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..0d2a0f02a3eb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7
+ Validity
+ Not Before: Nov 20 13:35:06 2009 GMT
+ Not After : Nov 14 13:35:06 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f9:3f:5e:76:52:9a:ce:5d:98:b0:00:d8:e0:65:
+ e7:78:11:4c:7b:c7:e2:d3:44:bf:8e:60:42:69:3e:
+ 75:67:65:24:ab:f7:07:d8:9d:be:0f:23:b5:c1:26:
+ 00:6b:c3:22:84:72:a9:96:dc:5f:63:fc:f5:e0:e3:
+ cc:da:0c:74:e9:31:51:91:89:27:8f:e5:17:41:6e:
+ 3d:5e:2a:13:cd:08:f7:f3:61:34:a1:f7:79:c6:bd:
+ 5d:2c:34:01:ea:5a:8c:48:97:36:d6:57:e0:80:03:
+ 2e:7a:03:83:4c:bd:b4:af:a2:fd:d7:4b:1a:f7:ab:
+ 9f:5a:22:2b:d1:25:73:dd:6f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92
+ X509v3 Authority Key Identifier:
+ keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7
+ serial:D5:E6:63:5F:18:09:82:89
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_7.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 5f:b4:70:11:4f:d9:df:6a:6a:5a:4a:97:fe:8b:5d:9e:46:84:
+ e2:27:67:41:7c:a9:2e:9d:77:cc:e4:8c:d6:16:3c:39:7d:51:
+ 29:60:80:32:4f:a1:d0:b4:7f:2a:e5:60:f4:b8:d3:3b:94:f8:
+ a5:fb:15:99:cf:a9:c5:a7:59:c1:11:89:67:11:9c:ff:a9:ac:
+ dd:ca:a9:92:a8:60:26:c3:ab:74:41:86:b9:4d:1e:4a:c5:de:
+ 63:e6:da:2a:36:39:7b:6c:66:f3:20:57:d1:f1:36:4b:69:c5:
+ 04:a3:1f:cf:de:0c:10:d0:3f:07:e2:8e:0f:cd:41:26:c9:2e:
+ e9:1b
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMzUw
+NloXDTM0MTExNDEzMzUwNlowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQD5P152UprOXZiwANjgZed4EUx7x+LTRL+OYEJpPnVnZSSr9wfYnb4P
+I7XBJgBrwyKEcqmW3F9j/PXg48zaDHTpMVGRiSeP5RdBbj1eKhPNCPfzYTSh93nG
+vV0sNAHqWoxIlzbWV+CAAy56A4NMvbSvov3XSxr3q59aIivRJXPdbwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFDtQJkVs4v4osXEKqJUteGOOLEiSMIGRBgNVHSMEgYkw
+gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAX7RwEU/Z
+32pqWkqX/otdnkaE4idnQXypLp13zOSM1hY8OX1RKWCAMk+h0LR/KuVg9LjTO5T4
+pfsVmc+pxadZwRGJZxGc/6ms3cqpkqhgJsOrdEGGuU0eSsXeY+baKjY5e2xm8yBX
+0fE2S2nFBKMfz94MENA/B+KOD81BJsku6Rs=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..147ca4e9b6f7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,B17A06040862AC63
+
+9VJMswLGoelYtmpO17/f34Lb7j1I2vaK+RUg7fH09M6rQKurA2SmpsO7kJo7lMUb
+lwXEC8+JC5b3OoUcPeHLkZ5e9bB+flMJQq+bkzWs4NWYI17gRs2Tc74xm04XRTsO
+OYU+H7uOyRMAuS86hkQF13H3hCHcZkg8RZcvqfDXhsY8S7iyp0gErQv8IDmbIije
+R7go3NdZXCmkuINKhhABFYnPxnEpaHxhIMNKykbSn+jby02LX57X/u4JDGfkzjCH
+wyJMi9PiO7VbXvi8IPYnFz0IaCMVr5cltTh47/KiqACeAADQ6ETekrX9r7lngkRz
+sqFuyqEtdi02ujElsGIaDCImQ5KbD2u2IQ3FX2b6Jwmd/uDmqQQwtEfarEoUxich
+chCEUBGAiqRxLcrnRzjT+Reqgx7qGNurjP78kmKeD91hDm3tEHeWtecy4iA3C8z0
+aMZFOZLx1r7kf5/YaRMREcLPmreEWgFmkIMN004GdIvOwlsUjmAM7UMle+cef17v
+h1hxbFsznzYLBk0zOYjmsTpI3dQHtxSUVsyUWXXVJ0Y4YhJSjMHlMOOCanGYOpGS
+vipUNzLx4aIWfMmQdJePQM4uxO2FNwTc1IGyRpoOhj6vxroICuGK3WkxqZsN3VwR
+hwNol0cNMNHbVacKvhh5PQJcmWiqmLEXaQD8VWgCNQVa0otS59vj+SeyW4ZvULBM
+Od/9FhFfEBHQDxNSL+c6B/dXFIO1oY159ErdElAn+NPRtQcHAsnu8HknKLhry1NP
+b4d+KZcTZAq9q97ltRQf9/hXBpA3ophMtbBFnnnh5WJuMMdDMNgGsg==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg
new file mode 100755
index 000000000000..a63458d084b4
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_8/README.txt b/xmlsecurity/test_docs/CAs/Root_8/README.txt
new file mode 100755
index 000000000000..d749d8ebcfe8
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/README.txt
@@ -0,0 +1,9 @@
+Revoked certificates:
+
+- Sub CA 2 Root 8
+
+
+Start the OCSP responder:
+openssl ocsp -index demoCA/index.txt -port 8888 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text
+
+
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem
new file mode 100755
index 000000000000..ef431ec9528f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJALJH3moqTIMZMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgODAeFw0wOTEx
+MjAxNTI4NTZaFw0zNDExMTQxNTI4NTZaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgODCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAmR4R07C/I8zEPsAEQdc/nzH74hLjEwImtiWKL8nVc70fwquIRzWLaavm
+DaQE3g/ha00d2hepB2dUiR1nV2GhMYdV64eq1utEPU+tTIYpx163axOGLYLWwKc3
+cBaR2mCqZmAkS+WABHkCX9hsBn+Ju/XNxLDVcpBohVrx882+3kMCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQU1mZ2yQX/qVCIlmDd+8cwGHJnQRkwgZEGA1UdIwSBiTCBhoAU
+1mZ2yQX/qVCIlmDd+8cwGHJnQRmhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOIIJALJH3moqTIMZMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAfZylT15q6Dnpvf9jWoCovzvUoBqAwL1Z
+UDEikhCpajYsrfXI3MRvKYkTvt18lgg2Y09gJ2vhfLBCaDp+ELUq0Vc5hIbblGGO
+EA4vBuH5Yfho3AK3gKAtk7Rc9l/qP2rBPb1JVw79pRaz95IkYGeOp35pVDQfBN+i
+jji5JSyOeYQ=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl
new file mode 100755
index 000000000000..8f91a1949a68
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt
new file mode 100755
index 000000000000..831cbf1a38ed
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114153321Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 8
+R 341114155533Z 091120155655Z,superseded 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 8
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..b2d1deb75960
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8
+ Validity
+ Not Before: Nov 20 15:33:21 2009 GMT
+ Not After : Nov 14 15:33:21 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:96:79:01:9f:4f:68:c1:09:0d:44:3a:82:e4:eb:
+ ad:70:7a:cf:b9:71:e5:fb:e0:c8:0c:21:79:3e:cb:
+ 78:91:7f:4a:a0:de:3e:37:0f:a1:6b:73:10:12:9b:
+ 08:c4:96:dc:cb:a8:5b:87:9b:75:24:e4:00:5e:4a:
+ 6f:4c:13:79:1f:57:13:8c:3e:1b:38:31:e1:77:74:
+ 52:f9:94:47:36:57:33:bd:de:08:11:a3:01:e1:53:
+ 1c:bd:7b:39:9c:5e:96:5c:a9:61:6c:cc:2b:90:8d:
+ 5a:3c:9e:f4:4b:6e:e5:97:64:86:f3:8e:e8:72:20:
+ 5d:0d:50:bf:e9:cf:be:d4:13
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A
+ X509v3 Authority Key Identifier:
+ keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8
+ serial:B2:47:DE:6A:2A:4C:83:19
+
+ Authority Information Access:
+ OCSP - URI:http://localhost:8888
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 4c:95:44:3b:57:08:ec:01:ec:f9:3e:7c:89:1c:30:b1:4e:26:
+ 32:b6:57:fa:25:bc:ed:eb:d4:a2:1c:67:ee:b9:8b:d0:4c:57:
+ 8a:0e:db:a0:9d:92:e7:de:c6:73:01:e7:de:61:1b:b5:0e:d0:
+ c5:c1:a7:a6:ab:e0:c6:0b:51:dd:e5:a2:32:1f:c6:52:ea:d3:
+ 03:68:3a:f5:92:bd:8b:b8:03:bb:50:70:63:cc:ec:ed:3c:11:
+ 76:ca:ac:72:47:ad:99:6b:8e:07:9e:38:f2:63:e1:ba:d4:df:
+ a9:73:54:1d:74:89:94:01:2e:68:dd:97:e7:53:f9:cf:b6:7d:
+ fc:87
+-----BEGIN CERTIFICATE-----
+MIIDOTCCAqKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1MzMy
+MVoXDTM0MTExNDE1MzMyMVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCWeQGfT2jBCQ1EOoLk661wes+5ceX74MgMIXk+y3iRf0qg3j43D6Fr
+cxASmwjEltzLqFuHm3Uk5ABeSm9ME3kfVxOMPhs4MeF3dFL5lEc2VzO93ggRowHh
+Uxy9ezmcXpZcqWFszCuQjVo8nvRLbuWXZIbzjuhyIF0NUL/pz77UEwIDAQABo4H6
+MIH3MB0GA1UdDgQWBBTvvciOeHn5dksRWbbDMhAHwLzjijCBkQYDVR0jBIGJMIGG
+gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH
+AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBMlUQ7VwjsAez5PnyJHDCxTiYy
+tlf6Jbzt69SiHGfuuYvQTFeKDtugnZLn3sZzAefeYRu1DtDFwaemq+DGC1Hd5aIy
+H8ZS6tMDaDr1kr2LuAO7UHBjzOztPBF2yqxyR62Za44HnjjyY+G61N+pc1QddImU
+AS5o3ZfnU/nPtn38hw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..26368962e8d0
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8
+ Validity
+ Not Before: Nov 20 15:55:33 2009 GMT
+ Not After : Nov 14 15:55:33 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e9:91:38:d8:c1:36:e5:c1:d0:32:e8:ae:02:11:
+ 97:e5:c5:07:8f:5b:46:3a:3c:d9:49:5e:9a:4b:51:
+ 4c:b7:7d:e9:d1:4f:a7:15:8c:c6:10:f6:fa:5f:a9:
+ 0b:1b:bc:de:56:f5:ad:a3:a0:40:f1:75:10:58:74:
+ 37:f9:b7:9f:76:ca:46:96:4c:1a:81:f4:a2:ce:88:
+ 8b:9e:00:6d:42:b3:d6:68:d1:67:d6:9f:b8:9c:3f:
+ 43:c7:36:bf:41:88:1b:e8:74:26:a0:51:5c:e2:ee:
+ 6d:9d:73:bb:0d:36:e1:5c:68:9f:21:3b:b2:aa:ed:
+ 39:1d:ae:fc:b4:ca:38:c2:fb
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73
+ X509v3 Authority Key Identifier:
+ keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8
+ serial:B2:47:DE:6A:2A:4C:83:19
+
+ Authority Information Access:
+ OCSP - URI:http://localhost:8888
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 89:f8:8d:a8:e5:0b:2a:fb:f3:6a:80:2c:26:a1:a7:36:7e:a0:
+ c5:61:65:9d:7e:d6:47:60:b4:f6:72:e9:6e:2c:d9:f8:7f:c8:
+ 7a:5d:75:98:ad:88:de:e7:1b:44:a3:96:37:84:c0:b3:20:98:
+ 3b:b5:f6:ee:70:9c:04:7a:6c:88:05:75:7f:12:cf:b9:76:e8:
+ c0:17:0c:5e:eb:10:38:1e:54:41:58:56:f6:3c:ec:07:a5:c0:
+ 74:24:34:af:b3:c7:b2:58:85:47:0f:6c:e4:a0:9f:c8:7b:5c:
+ 95:77:17:e5:ad:eb:c3:86:44:f7:81:ef:cb:58:12:1a:6a:c7:
+ 19:95
+-----BEGIN CERTIFICATE-----
+MIIDOTCCAqKgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1NTUz
+M1oXDTM0MTExNDE1NTUzM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDpkTjYwTblwdAy6K4CEZflxQePW0Y6PNlJXppLUUy3fenRT6cVjMYQ
+9vpfqQsbvN5W9a2joEDxdRBYdDf5t592ykaWTBqB9KLOiIueAG1Cs9Zo0WfWn7ic
+P0PHNr9BiBvodCagUVzi7m2dc7sNNuFcaJ8hO7Kq7Tkdrvy0yjjC+wIDAQABo4H6
+MIH3MB0GA1UdDgQWBBQbq2sPQpHcHtR6lYcwLcwRTzW3czCBkQYDVR0jBIGJMIGG
+gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH
+AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCJ+I2o5Qsq+/NqgCwmoac2fqDF
+YWWdftZHYLT2culuLNn4f8h6XXWYrYje5xtEo5Y3hMCzIJg7tfbucJwEemyIBXV/
+Es+5dujAFwxe6xA4HlRBWFb2POwHpcB0JDSvs8eyWIVHD2zkoJ/Ie1yVdxflrevD
+hkT3ge/LWBIaascZlQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..dd11db44373a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,1DE6DE80057C280E
+
+1pXaFFR4KgVEWQzq73tQrfEkLZn7J0G0fxp1ZZYKOVdL3g/S4su2cXn5zfkSypjG
+sTPnj9YuHzZiW1sB5M+U84b0aCSuh4+HK1Y+K6Us99psx/VaDq36uEBJZQviJ4zb
+uF7ZT6NRGWMs3pIkFEHqi9TQ6mmeRgHMgkiI/mpM/26Y00dLpXdxBIGOCpKIPXwp
+02mx/o9CHqI7ASuXV6ZAhawEmvFKKRNCKsKOaSs0CylGOT5nAaqWRp/IVMrm46wr
+o7cErGgCZCPzQ5Ndx4553oSeWTjnm4iTS5UKg0nwPgS6sVhsr3zrTxIhS9zzcW2G
+ycREX312K7q0zxtCxdNZxGeSfowRRy54JRoLf+O5yoNTRXYFjLxXGHgCTQRWgpIh
+ggOmgUyIeNQXts4Qf6ddUtEcfGzMowCAJWTakXpOBoWj42mF85lDlcAAn8V1L90Q
+MDF31HzrDAe3po4g+dNA6qdZrpSpnDDVp0oPsr3ooz1dLlwa8LWpPpq5PRgDWeQF
+hcYrywI5tfUJyXv0xkEv+BIGKjGofWHGNtZWazBunhAVgWG/GQbzWxdSBS5w2waE
+2Zo65PBqfLgRdnO6HYl15Pc5wm3gEQJo5VYgl7HmRpEt7lQrcnReqLWnsuHmqZ/H
+vaEmGnSfXauVTvBVRXnrpznM/ROC9n2FR50lNIO1nAtMM7a0S0PIKgB+uNwAtsAR
+Y4dY4YCS/io8wCL+DNBPtdvuY85/y5lnURpj9ojWO916WZsK/EFPJIQFuVwhal2C
+Q9NVu8PXPDiBAHTVGZz8HoG32eYYUtqzeIY4Xo5ybUlnsNGlncWSqw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg
new file mode 100755
index 000000000000..0353bced3bd2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt b/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt
new file mode 100755
index 000000000000..ee3d2b339ef1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt
@@ -0,0 +1 @@
+!!!DO NOT INSTALL THIS ROOT CERTIFICATE!!!
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE b/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt b/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt
new file mode 100755
index 000000000000..66e316546ed4
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem
new file mode 100755
index 000000000000..ca53f28f7adb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBDCCAm2gAwIBAgIJAKTbFg1LjNSmMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
+BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y
+ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOTAeFw0wOTEx
+MjMxMzUyNDNaFw0zNDExMTcxMzUyNDNaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
+gYkCgYEAsOgehurKuYszsH2LFeGyHA9WYmCOMZmQfBFOgS/kO1Hkv6tNrDbshzyc
+I/qOlpkosXUbQaaJPYoQmv3eTpfYxM9Dju5GkzOL03Q9J8AGe8RW1urMCfD5fC9g
+XmhxAnIbrmDhS4K0lV8ngWwTQjmec9CV8SVBLQerrNtmcY/VvcMCAwEAAaOBxzCB
+xDAdBgNVHQ4EFgQUzTNeq3MjUYC4A60SAQvFXo5VymQwgZEGA1UdIwSBiTCBhoAU
+zTNeq3MjUYC4A60SAQvFXo5VymShY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI
+EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2
+ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOYIJAKTbFg1LjNSmMA8GA1UdEwEB/wQF
+MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqQkfiXNJm8l5v6qQzv6HwcDIgSQBuwkp
+bN5FgHdLXaae/UOelXpmLSfrAbizw0Om1xLH/tnSeNY9MCGMGA4ScGU1hdNLUTIU
+LK9upl/q+cHQayZL/Hz4Z8sqRNrP+E2m0GY0RMF1getJunfYZZV9VcsfbO3SqgAQ
+exqICFDFi8M=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt
new file mode 100755
index 000000000000..c741bbfdaccc
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt
@@ -0,0 +1 @@
+V 341117135919Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 9
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..0b38d4db4c7a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 9
+ Validity
+ Not Before: Nov 23 13:59:19 2009 GMT
+ Not After : Nov 17 13:59:19 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a9:6d:7f:6a:08:fb:e2:3a:5e:83:3f:ff:58:ba:
+ 92:a1:79:9d:ce:d2:0c:16:15:f2:7e:b3:e4:45:9c:
+ 02:32:65:9b:02:90:78:05:95:e4:04:1d:4a:05:bb:
+ ea:f6:ac:ab:15:74:c2:bc:ee:2a:c1:80:55:3e:93:
+ 1f:5c:94:eb:cf:cf:8f:15:eb:b8:22:fe:69:61:51:
+ a9:08:b8:80:bd:48:99:da:85:10:1c:75:97:fd:d3:
+ c3:c4:0b:dd:eb:01:12:5d:ee:62:62:c3:0c:18:ea:
+ ed:76:ff:9b:1c:1f:c7:81:f9:9a:cd:e5:25:89:b2:
+ 13:57:56:f3:27:53:72:76:69
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46
+ X509v3 Authority Key Identifier:
+ keyid:CD:33:5E:AB:73:23:51:80:B8:03:AD:12:01:0B:C5:5E:8E:55:CA:64
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 9
+ serial:A4:DB:16:0D:4B:8C:D4:A6
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 17:67:b0:21:da:0d:a1:fe:09:62:d0:cf:1d:c0:c8:bd:d4:22:
+ dd:75:ec:04:e2:23:ae:ea:8c:15:fa:73:2e:83:f4:16:eb:c1:
+ e1:87:36:bd:58:d0:64:e0:6e:2c:bc:27:cb:dc:4b:58:01:80:
+ 48:27:53:bb:75:85:a7:19:b8:e2:c0:1f:9f:a2:18:27:82:3f:
+ 25:bf:17:d1:34:32:de:c4:81:9d:8a:39:6f:6b:1f:b6:12:61:
+ 74:78:96:6d:6e:52:23:4a:67:30:78:03:91:b7:89:bf:3c:4a:
+ 36:e3:95:21:38:35:af:05:55:81:05:25:91:78:ca:2f:5d:79:
+ d2:05
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5MB4XDTA5MTEyMzEzNTkx
+OVoXDTM0MTExNzEzNTkxOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCpbX9qCPviOl6DP/9YupKheZ3O0gwWFfJ+s+RFnAIyZZsCkHgFleQE
+HUoFu+r2rKsVdMK87irBgFU+kx9clOvPz48V67gi/mlhUakIuIC9SJnahRAcdZf9
+08PEC93rARJd7mJiwwwY6u12/5scH8eB+ZrN5SWJshNXVvMnU3J2aQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBR701e/astsEIGR2pXciE+l0NvRRjCBkQYDVR0jBIGJMIGG
+gBTNM16rcyNRgLgDrRIBC8VejlXKZKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5ggkApNsWDUuM1KYwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAXZ7Ah2g2h/gli0M8dwMi91CLddewE
+4iOu6owV+nMug/QW68Hhhza9WNBk4G4svCfL3EtYAYBIJ1O7dYWnGbjiwB+fohgn
+gj8lvxfRNDLexIGdijlvax+2EmF0eJZtblIjSmcweAORt4m/PEo245UhODWvBVWB
+BSWReMovXXnSBQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..65149ff6505b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,EEC173CF380C4BEC
+
+3ZAmsMS1aFKb3EfOncYO+hg0ucK80Y7pHg7GaH2/XZ+b6HmVQrHKuDrIcQNGEY5Z
+QTCBeCGhmh7hnemBSrco4HURl/2LlA5CoYyd6CCc79VeUQZRJdLjL2thD4x/QwQs
+Vh9uG+nunEAXK2kI2sFAxCScoCXSZmAgQqAANQ3SHyJ14e8BlOVgucfD0afYEDNE
+udc86lO8+Lz7HfTvysnKO06pgp30ZFJlnBzSBXkXsTShPWEPg8f+2JRc+A5PbxVM
+gz/S/ZrPMg8QyIfwwCGjRKzyRBeXVfquXqrwNqtGI+HXo4QaYYT8zuYUn9XuJsac
+ZFn2BoXhI6TCBzyM+yuoXp+Xx5plY2A8QXaiLdKO2usV5xcXaBY3XTczrnOfJh7f
+F3B2mbfhr/s4UJaFmnG4eULklFGADRY5tN2bIutsWmuuw17/ZwUSZxsjl+TybqVi
+uvfmEqrSgoZ9Qz1vvRngVAAwJPAvQqsBQwkq3WapNeoLqmQeSHq/6z4G5RKPbkMs
+t21L4SBUGQMhkZWAnJEtECDGsQpDjjwbDuJzrbVTSBiNvDWWeXJuGdyhzI6b17v7
+CZosIrzE82Oo0C+afWJVek2cB8rIMbgqEL+3Sj7x9c/kGeLx957d+geTSStqjD3z
+P574kcEDP9ppEHalg1ygJ6t3SjkTNMWrbuYH+GlY8all7rniMDYUDMECIj3Xrv+Q
+x3Yzv07FAooDYBE4pdWtTjpBlmwxa68XaMSDG28jQwTHck30GU/gwrM74CKWsg8y
+4eZAaeQKHeUYFGsxWeYfmwr7aD4pG+VYGOmRmdia5PA=
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg
new file mode 100755
index 000000000000..cc9663bbd5c5
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem
new file mode 100755
index 000000000000..be26aa5d8f4b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 1
+ Validity
+ Not Before: Nov 18 15:07:13 2009 GMT
+ Not After : Nov 12 15:07:13 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d9:3a:8d:64:95:87:76:76:e8:61:c3:e9:65:f4:
+ a6:b7:0c:77:0e:4b:10:e8:14:a3:e1:84:69:7c:8e:
+ 97:d2:7d:01:ad:b2:dc:5c:cd:c6:91:a1:f3:93:7c:
+ 54:36:64:e3:ca:22:ca:00:cb:c6:91:ab:6b:26:88:
+ 69:60:9a:61:d7:59:17:db:93:7d:09:36:da:28:cb:
+ ec:2d:a4:26:bb:1a:42:20:b8:08:b2:0f:b9:77:a6:
+ 80:71:cf:13:f5:37:a2:90:4d:ab:e8:97:49:d2:80:
+ 94:8f:b1:9d:5a:b4:9f:de:ff:fa:b6:d6:e0:45:5f:
+ cc:d4:10:1e:32:46:7b:ba:55
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A
+ X509v3 Authority Key Identifier:
+ keyid:0F:FA:C6:EB:DF:CE:B8:BB:B3:A9:3E:42:A6:BA:EC:D2:93:CA:47:A4
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 1
+ serial:95:B0:05:2B:ED:C2:39:2D
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 18:f6:02:5e:75:04:5f:eb:3b:07:41:85:c0:9e:08:29:58:3d:
+ b5:6f:c2:aa:24:0d:93:1d:17:fc:be:d6:43:ac:43:d7:4d:a0:
+ 2c:40:fd:3d:d5:7e:91:46:25:49:62:ba:e9:7f:67:c2:fc:8a:
+ c3:a0:37:bf:ec:f9:54:bf:61:10:35:dd:5b:bb:da:7c:70:54:
+ 32:13:b9:ae:7d:ea:a5:7d:aa:55:3e:ef:0a:ef:12:fd:c3:f6:
+ e5:25:98:97:34:02:64:fd:88:79:b3:e2:f4:fc:ff:e7:d3:98:
+ f1:d9:d5:18:d9:b4:62:ae:99:88:61:2e:ff:02:6a:13:35:fe:
+ 37:c7
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxMB4XDTA5MTExODE1MDcx
+M1oXDTM0MTExMjE1MDcxM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDZOo1klYd2duhhw+ll9Ka3DHcOSxDoFKPhhGl8jpfSfQGtstxczcaR
+ofOTfFQ2ZOPKIsoAy8aRq2smiGlgmmHXWRfbk30JNtooy+wtpCa7GkIguAiyD7l3
+poBxzxP1N6KQTavol0nSgJSPsZ1atJ/e//q21uBFX8zUEB4yRnu6VQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBQ3cXSBRN0esWCWQbdLOMS3eRvPijCBkQYDVR0jBIGJMIGG
+gBQP+sbr3864u7OpPkKmuuzSk8pHpKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxggkAlbAFK+3COS0wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAY9gJedQRf6zsHQYXAnggpWD21b8Kq
+JA2THRf8vtZDrEPXTaAsQP091X6RRiVJYrrpf2fC/IrDoDe/7PlUv2EQNd1bu9p8
+cFQyE7mufeqlfapVPu8K7xL9w/blJZiXNAJk/Yh5s+L0/P/n05jx2dUY2bRirpmI
+YS7/AmoTNf43xw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt
new file mode 100755
index 000000000000..e2027ce9f4ce
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt
@@ -0,0 +1 @@
+V 341112152323Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 1
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..e7d22dfd0c87
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem
@@ -0,0 +1,58 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1
+ Validity
+ Not Before: Nov 18 15:23:23 2009 GMT
+ Not After : Nov 12 15:23:23 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 1
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c8:41:66:84:c7:d5:c5:72:8f:a6:98:1b:59:e2:
+ 33:ca:0d:d2:24:b3:c1:47:db:11:e2:bf:23:da:32:
+ 68:41:cc:ff:28:fe:9a:39:49:e7:08:f0:22:75:15:
+ 61:99:9e:99:e5:14:65:71:60:00:0f:58:42:70:78:
+ 5a:1e:d8:fa:97:92:82:0e:e3:0c:ac:20:dc:b8:e3:
+ 5e:87:8b:89:e3:a1:c3:87:49:1d:92:a5:fd:7c:77:
+ 79:ce:1f:fa:9c:5a:17:d9:11:0c:f2:7f:1a:fa:d8:
+ 32:41:f8:69:80:ae:8a:66:bd:36:c2:21:65:57:08:
+ be:cf:f0:ec:83:15:98:6d:65
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ FF:BB:B0:7F:E3:0E:E3:8C:CF:EC:88:49:A9:0E:62:B5:D3:60:12:46
+ X509v3 Authority Key Identifier:
+ keyid:37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 33:dd:e8:57:3e:69:1b:a0:4c:83:51:99:dd:73:b0:0c:cb:c7:
+ c0:ff:12:8b:b6:3b:59:12:b9:f1:20:87:75:f0:71:6e:bc:94:
+ 47:72:62:ae:93:90:05:e2:ff:63:31:5a:d2:80:a5:4a:7f:57:
+ e9:f7:4e:3e:be:bd:4c:9e:74:07:19:b0:4d:88:97:af:23:a7:
+ 5a:23:af:d1:a9:98:9b:55:7e:fa:6b:18:77:03:c4:aa:49:bc:
+ b6:3d:66:3e:8d:0a:80:5f:ac:b9:58:fb:11:ef:60:db:ad:a8:
+ 79:41:83:1a:6a:61:87:99:64:2d:e4:6a:bb:c0:30:00:dd:69:
+ e5:92
+-----BEGIN CERTIFICATE-----
+MIICvjCCAiegAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMB4XDTA5
+MTExODE1MjMyM1oXDTM0MTExMjE1MjMyM1owbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyEFmhMfVxXKPppgbWeIzyg3SJLPBR9sR
+4r8j2jJoQcz/KP6aOUnnCPAidRVhmZ6Z5RRlcWAAD1hCcHhaHtj6l5KCDuMMrCDc
+uONeh4uJ46HDh0kdkqX9fHd5zh/6nFoX2REM8n8a+tgyQfhpgK6KZr02wiFlVwi+
+z/DsgxWYbWUCAwEAAaNwMG4wLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh
+dGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBT/u7B/4w7jjM/siEmpDmK102ASRjAf
+BgNVHSMEGDAWgBQ3cXSBRN0esWCWQbdLOMS3eRvPijANBgkqhkiG9w0BAQUFAAOB
+gQAz3ehXPmkboEyDUZndc7AMy8fA/xKLtjtZErnxIId18HFuvJRHcmKuk5AF4v9j
+MVrSgKVKf1fp904+vr1MnnQHGbBNiJevI6daI6/RqZibVX76axh3A8SqSby2PWY+
+jQqAX6y5WPsR72Dbrah5QYMaamGHmWQt5Gq7wDAA3Wnlkg==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..602026a47014
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,4E900CB191575111
+
+vHLTGKUgxa3C35alVr0gWT30x8WW5Pmz4oFv23fMMWIXjrp/QLlRRmd2AO9H8rLb
+3MWnA7cby5UTcrcsqwBA30TqhduNDi4iQFcOM60/S7yUFKjF5nj9bGi8XuUzMgTx
+OrJuxMGkayLiELskZxEpi6SJvTEsSdreT6OvyhzXQfAFDodoJSW65oF08cuYxXzi
+FFYFqvyWXa29WUyinBav5k3Mjax3Av3dYfMf/1u2n4vjGyjkfMg7mHrno19daWqa
+FJsxHHFezq//G5+JvePWFQUo1b0fVh13fx9x1dCbCRGQ9duSXaI7BNfl2Jd2rlVk
+xUMqnvd8VBNkW1AHxZL4csurQyO8ZQzg46w/kWaIMroeXbUnZYNJV7/TCs6nLGJF
+iNwtsFAjunWgWttFbMx3X7L7T6f6cWXocOOTNeIDpH+W6Pw9vltrjzNPAyBBok17
+sboWXDtlihMrSq5lWzUSPE8gOueh7Bcf7fSnLTeXuOXgKooJVXelookSQzsilWmS
+Fo5PTM+jOOaXVlbf8zfKFreLawohNkzagIxrCEP+HU+tF52ybJDP4mwPi1sQNcA0
+0luHyCL5EmaH5hVIqYeGUQoNPois5TqgYH1SEujyIuoNdEBi5r5qIRR/zz+BEpKU
+Z1B+HmmSWb0hjfenFSSaSSmGyS6VW1wZsU2B+wcPr7r0uFqoWllkxYNmSdky6qmw
+4Or0D6ayFUaJOQG6aTEfEVS31B4TUfFGfOLbeuUdwNa4/pNwMeFFSx+Xj7J3oYrn
+udjIL0Hz8hhjLVXaPVcu/qkZ7pXhOVlRQJ7byx730G3+elUFalJ/eQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg
new file mode 100755
index 000000000000..bf73e3549d66
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt
new file mode 100755
index 000000000000..a18ed9ce0cd9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt
@@ -0,0 +1,19 @@
+Do NOT install !!!
+
+
+
+To provide the CRL via HTTP run
+
+
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902
+
+
+To provide the intermediate certificate run
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8910
+
+
+
+
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt
new file mode 100755
index 000000000000..2bb9a4289404
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem
new file mode 100755
index 000000000000..1f27b97b3d17
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 10
+ Validity
+ Not Before: Nov 23 15:14:48 2009 GMT
+ Not After : Nov 17 15:14:48 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e4:d5:66:14:88:9f:79:41:50:b0:d1:a0:1b:98:
+ bf:b0:21:34:30:36:70:58:6f:8b:58:f1:b9:58:3a:
+ ce:29:6b:65:b6:11:f7:0d:c8:a6:c3:be:db:0f:2a:
+ 4e:c7:42:df:c9:0e:13:c0:00:0f:af:b5:71:c4:bc:
+ dd:82:fc:4a:27:c0:ee:af:ba:e1:7b:67:de:6b:bb:
+ ac:4c:fe:88:01:1a:73:4e:f5:32:15:3a:d0:cb:6b:
+ 97:84:1b:6c:d0:d6:91:a8:a4:5a:87:2a:69:61:36:
+ 1d:42:cc:16:d0:03:9c:c6:90:5c:61:20:8b:b1:be:
+ b6:54:24:5b:6f:1f:a9:5a:6f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39
+ X509v3 Authority Key Identifier:
+ keyid:C8:A7:A3:80:20:74:6C:6F:EC:11:7A:F6:BE:26:10:37:31:87:B0:7A
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 10
+ serial:BF:C8:0F:BB:D9:A0:3A:6B
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6b:0f:75:6d:56:b0:4e:45:19:65:ad:50:ef:4e:87:6c:95:5d:
+ 05:39:5a:43:5c:b4:51:25:9a:ec:f4:93:d1:f0:f6:91:dd:a3:
+ 77:95:0c:74:3c:a9:7c:c2:f6:62:ce:bf:58:5f:66:1f:d0:55:
+ ca:d8:2d:c4:1e:29:3a:ad:55:2c:9d:2c:8f:8e:9e:ce:ac:17:
+ 7e:1b:d1:16:d9:12:76:5c:2d:3f:9d:70:66:aa:39:34:f0:ec:
+ 31:4b:4b:5a:14:0c:c5:5b:3c:c8:47:02:90:cb:77:d7:4f:88:
+ 10:a7:80:3d:ca:19:5c:b5:04:c9:f0:e1:1b:5a:5f:fb:61:b2:
+ 14:b5
+-----BEGIN CERTIFICATE-----
+MIIDCTCCAnKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMDAeFw0wOTExMjMxNTE0
+NDhaFw0zNDExMTcxNTE0NDhaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i
+dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l
+bnQxGTAXBgNVBAMTEFN1YiBDQSAxIFJvb3QgMTAwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAOTVZhSIn3lBULDRoBuYv7AhNDA2cFhvi1jxuVg6zilrZbYR9w3I
+psO+2w8qTsdC38kOE8AAD6+1ccS83YL8SifA7q+64Xtn3mu7rEz+iAEac071MhU6
+0Mtrl4QbbNDWkaikWocqaWE2HULMFtADnMaQXGEgi7G+tlQkW28fqVpvAgMBAAGj
+gcgwgcUwHQYDVR0OBBYEFBFjob6L41YH5qOfIzlyfeMitlM5MIGSBgNVHSMEgYow
+gYeAFMino4AgdGxv7BF69r4mEDcxh7B6oWSkYjBgMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwggkAv8gPu9mgOmswDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBrD3VtVrBORRllrVDvTodslV0F
+OVpDXLRRJZrs9JPR8PaR3aN3lQx0PKl8wvZizr9YX2Yf0FXK2C3EHik6rVUsnSyP
+jp7OrBd+G9EW2RJ2XC0/nXBmqjk08OwxS0taFAzFWzzIRwKQy3fXT4gQp4A9yhlc
+tQTJ8OEbWl/7YbIUtQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl
new file mode 100755
index 000000000000..67ed32da5f5b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt
new file mode 100755
index 000000000000..810ec7ef2ffe
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt
@@ -0,0 +1 @@
+V 341117153149Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 10
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..7449048bbc59
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem
@@ -0,0 +1,67 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10
+ Validity
+ Not Before: Nov 23 15:31:49 2009 GMT
+ Not After : Nov 17 15:31:49 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 10
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ce:41:53:5f:ba:d9:26:e4:45:14:74:a9:f2:9e:
+ fa:91:50:ea:fe:e7:76:76:6e:62:26:4c:a2:bd:c9:
+ 98:ce:1d:b3:74:ea:95:04:ec:d8:24:ac:29:de:2d:
+ 7f:2f:7f:10:94:24:d2:0c:0b:ff:d0:38:f1:a9:8f:
+ ee:25:97:bf:bd:b0:1f:24:d7:9d:7a:20:79:c0:73:
+ 97:12:cb:5a:cf:6d:4f:df:4a:a8:9c:1b:be:49:63:
+ 1f:b1:03:6d:c6:5f:69:5c:0d:7e:81:23:48:2a:76:
+ 80:53:53:d2:03:f6:56:6d:dc:e3:cc:be:cb:0f:c3:
+ 1b:b7:6e:79:33:e0:da:f6:5d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Authority Information Access:
+ CA Issuers - URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 90:DC:ED:B0:CB:62:A1:BE:8F:23:65:01:79:14:85:22:48:70:7B:A1
+ X509v3 Authority Key Identifier:
+ keyid:11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 54:e3:d2:eb:dc:aa:db:8b:88:34:c6:b9:5b:f6:d8:ca:81:24:
+ d0:ba:4c:c2:a7:8e:82:22:d3:68:64:c9:61:9b:0a:00:3e:d1:
+ 4e:cb:83:1d:b9:c7:07:6a:5e:7b:b4:ca:92:0c:93:d7:9e:99:
+ e1:58:47:17:b0:a7:6d:68:5f:e5:59:f9:2a:d1:96:df:b6:9f:
+ bc:47:40:f2:71:ed:71:2b:8a:6e:6f:aa:29:9f:4d:98:ee:f1:
+ aa:63:b4:44:39:58:8a:f8:c2:af:8d:c1:49:92:b4:99:02:2f:
+ 27:c7:5b:f5:30:7c:ed:67:ff:cd:12:dc:a7:c4:8e:98:4f:2c:
+ e0:05
+-----BEGIN CERTIFICATE-----
+MIIDODCCAqGgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaTELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEZMBcGA1UEAxMQU3ViIENBIDEgUm9vdCAxMDAeFw0w
+OTExMjMxNTMxNDlaFw0zNDExMTcxNTMxNDlaMHAxCzAJBgNVBAYTAkRFMRAwDgYD
+VQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxML
+RGV2ZWxvcG1lbnQxIDAeBgNVBAMTF1VzZXIgMSBTdWIgQ0EgMSBSb290IDEwMIGf
+MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOQVNfutkm5EUUdKnynvqRUOr+53Z2
+bmImTKK9yZjOHbN06pUE7NgkrCneLX8vfxCUJNIMC//QOPGpj+4ll7+9sB8k1516
+IHnAc5cSy1rPbU/fSqicG75JYx+xA23GX2lcDX6BI0gqdoBTU9ID9lZt3OPMvssP
+wxu3bnkz4Nr2XQIDAQABo4HnMIHkME0GCCsGAQUFBwEBBEEwPzA9BggrBgEFBQcw
+AoYxaHR0cDovL2xvY2FsaG9zdDo4OTEwL2RlbW9DQS9TdWJfQ0FfMV9Sb290XzEw
+LmNydDBGBgNVHR8EPzA9MDugOaA3hjVodHRwOi8vbG9jYWxob3N0Ojg5MDIvZGVt
+b0NBL2NybC9TdWJfQ0FfMV9Sb290XzEwLmNybDALBgNVHQ8EBAMCBeAwHQYDVR0O
+BBYEFJDc7bDLYqG+jyNlAXkUhSJIcHuhMB8GA1UdIwQYMBaAFBFjob6L41YH5qOf
+IzlyfeMitlM5MA0GCSqGSIb3DQEBBQUAA4GBAFTj0uvcqtuLiDTGuVv22MqBJNC6
+TMKnjoIi02hkyWGbCgA+0U7Lgx25xwdqXnu0ypIMk9eemeFYRxewp21oX+VZ+SrR
+lt+2n7xHQPJx7XErim5vqimfTZju8apjtEQ5WIr4wq+NwUmStJkCLyfHW/UwfO1n
+/80S3KfEjphPLOAF
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..260e3aa94624
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,170F9697C268C4B5
+
+eIaE0ShuxMcOUBJBlI7PXIuKg69hDunjUz55iy0I+4sGc9tFK+vtjvDZWxx+dpZI
+WKGto0fDeobBf3f2xgKQFcwAtUPtiTMXk8C0BYfAbXsTYBgOgvKwJGOIo5FsjukZ
+VJCNlUM1mwX5P3OrLdyT0j8OoL6lINztYDhSC8XL12YJk1j05yN4Gl8N108JQMLA
+sywA2Q6WIhPloZQXtHkiN2mlQ7WWwbSBbaUbdXNQKk6sXelFLPMOk+JOTCLp9kHU
+svTBAg7RyWKBuUmtEmkipNLtYhdkRVJ/dgL3/TAsZET6cjDd/eZg+1Kl0pn93KGv
+avSQKppkKNjUcWkZiuM1imS8+0qeMiw56JQGzMdEeSjadcTdsyYb0lssXmndK/z0
+90bA6GegvCnsq6Wj0Nz97GbK+ZMzA76e+HPQLli0j3poAlVwdzBCFRyLO4ET5Qzl
+OhTewxKZxe2yx75chECWJS+CLOajHkVyUe3x6QzyVuU+YZqjXWkJP7rTcQJZFcml
++3PHYWy5RnZ2sKOegksr3+QtL+UmDVa1xEeIhk3m0IMiYZ9HNWlrg1gedY02y9yY
+MGsCOkCF10KnCNIp4j5s1kGMicdMquDt0jTXwu+8jt6Skh8FWcr9aLf0bNc63oHg
+NaI7Y3+Ssl3GLUGFOGwC0lpooZ10SoJJDK9xxEjt48vUfX+Npn3bRv+UlwfLBYLo
+GENyNV3OVAsKYQ8fGIh/gTeIqwMUdo7Efcs6bdeqiOrYQhBl04Gty0I4cO6/lFGd
+by/4SesYDXoVtaKto1B5VOQn+QxovF7eY1pK6wDBU8+EaJbGSNK9Rw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg
new file mode 100755
index 000000000000..c67e455ac4e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg
@@ -0,0 +1,293 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8889
+authorityInfoAccess = caIssuers;URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt
+crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem
new file mode 100755
index 000000000000..36a8eb3c0709
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 2
+ Validity
+ Not Before: Nov 18 15:55:38 2009 GMT
+ Not After : Nov 12 15:55:38 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f0:7a:16:4c:ab:06:b2:af:27:9c:7d:3f:86:da:
+ de:7a:c3:01:67:77:56:49:09:ed:ed:31:72:83:e8:
+ 75:9c:4c:ce:f9:97:b6:63:3c:e2:ca:83:80:92:03:
+ 9c:96:e2:de:72:79:c1:cf:3e:3f:b9:0d:b4:87:c7:
+ 75:e6:56:8d:aa:f8:77:47:11:4e:fe:07:b0:1d:64:
+ 06:73:4b:6f:d4:ac:da:0f:05:87:b1:f1:98:a9:f5:
+ 8a:a1:a8:ed:17:9c:26:b8:da:92:63:d2:53:87:e6:
+ fc:ed:44:de:94:56:90:3e:a2:a1:67:08:cb:38:d4:
+ cf:17:3b:7e:ff:7a:97:c0:7b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8
+ X509v3 Authority Key Identifier:
+ keyid:5F:BC:4C:DA:EB:0A:0C:B5:23:43:5E:24:32:27:79:41:F5:82:A3:02
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 2
+ serial:A2:AF:15:89:EC:73:54:86
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 52:83:16:ab:0e:43:2d:b3:e4:0f:6c:c1:63:d4:86:ac:e7:1e:
+ ee:7b:ee:9b:0c:ff:4f:e0:59:d5:e4:27:af:68:bf:a7:f5:2a:
+ a3:c9:e3:2b:8d:b7:31:26:f6:04:80:4e:f2:a5:bf:da:63:5e:
+ 8c:d6:c6:b2:46:a0:46:10:2f:84:9f:02:76:f3:c8:33:05:62:
+ 0c:5f:2d:cc:06:23:53:9f:d9:f8:46:e4:2e:5c:da:05:fc:bf:
+ db:45:b4:ac:8d:8b:b5:4b:60:7b:7b:26:34:7f:b1:4b:41:96:
+ 41:26:70:7a:9d:78:a2:9b:e0:de:62:a2:04:86:9f:ed:7c:a6:
+ 20:eb
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyMB4XDTA5MTExODE1NTUz
+OFoXDTM0MTExMjE1NTUzOFowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLK
+g4CSA5yW4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip
+9YqhqO0XnCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABo4HH
+MIHEMB0GA1UdDgQWBBSM8ywwouhiUHC8/HGgQfrgWLRNuDCBkQYDVR0jBIGJMIGG
+gBRfvEza6woMtSNDXiQyJ3lB9YKjAqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyggkAoq8ViexzVIYwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBSgxarDkMts+QPbMFj1Ias5x7ue+6b
+DP9P4FnV5CevaL+n9SqjyeMrjbcxJvYEgE7ypb/aY16M1sayRqBGEC+EnwJ288gz
+BWIMXy3MBiNTn9n4RuQuXNoF/L/bRbSsjYu1S2B7eyY0f7FLQZZBJnB6nXiim+De
+YqIEhp/tfKYg6w==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt
new file mode 100755
index 000000000000..ae1f2d1e4c05
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt
@@ -0,0 +1 @@
+V 341112160955Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 2
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..a8c0b74caf11
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2
+ Validity
+ Not Before: Nov 18 16:09:55 2009 GMT
+ Not After : Nov 12 16:09:55 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 2
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c7:00:aa:e0:5a:42:af:9c:b5:43:8c:f4:7d:7a:
+ 0f:ee:a9:19:22:d8:47:14:af:b4:e4:dd:5d:41:92:
+ a1:2b:32:39:5c:71:88:10:e3:77:87:b6:d5:38:85:
+ de:4b:91:c6:17:97:8e:3d:96:b3:af:8c:9d:74:8c:
+ 88:7f:2a:72:9a:ca:1a:1b:56:6c:63:2e:a4:a0:fc:
+ 3a:7b:0d:c2:16:15:d0:80:15:29:de:cd:0b:74:bc:
+ 5e:31:84:71:a4:fd:be:9b:06:6a:0c:47:1d:f9:e4:
+ c1:98:ae:46:e6:e2:51:55:d5:bb:ab:05:28:69:b5:
+ f8:35:32:d6:f0:64:d8:44:81
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 71:60:2B:22:B5:DF:FC:38:7E:79:F3:EF:7C:96:5F:C1:D2:42:9C:61
+ X509v3 Authority Key Identifier:
+ keyid:8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8
+
+ Signature Algorithm: sha1WithRSAEncryption
+ e5:b8:1a:43:82:75:20:48:e0:52:d0:46:25:6f:f7:5b:a9:3f:
+ 9e:cd:db:45:da:15:53:95:e7:c8:74:7b:e0:e4:2c:8c:f6:4d:
+ 1c:73:6e:2c:11:eb:c1:dc:4c:1d:50:e3:e8:10:2f:03:20:06:
+ ff:d7:4f:c9:a2:2e:ef:85:27:92:31:47:64:c8:75:f2:fc:a4:
+ 9d:c9:53:55:c5:da:69:b0:96:99:fd:ac:c4:16:40:ea:0c:1b:
+ 32:c3:fd:65:1d:03:ad:be:60:88:7c:70:53:35:91:ce:13:e2:
+ 3d:23:6b:e8:23:c0:3c:9a:57:5f:ad:4b:03:94:92:16:62:f9:
+ d4:01
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMB4XDTA5
+MTExODE2MDk1NVoXDTM0MTExMjE2MDk1NVowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMjCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwCq4FpCr5y1Q4z0fXoP7qkZIthHFK+0
+5N1dQZKhKzI5XHGIEON3h7bVOIXeS5HGF5eOPZazr4yddIyIfypymsoaG1ZsYy6k
+oPw6ew3CFhXQgBUp3s0LdLxeMYRxpP2+mwZqDEcd+eTBmK5G5uJRVdW7qwUoabX4
+NTLW8GTYRIECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUcWArIrXf/Dh+
+efPvfJZfwdJCnGEwHwYDVR0jBBgwFoAUjPMsMKLoYlBwvPxxoEH64Fi0TbgwDQYJ
+KoZIhvcNAQEFBQADgYEA5bgaQ4J1IEjgUtBGJW/3W6k/ns3bRdoVU5XnyHR74OQs
+jPZNHHNuLBHrwdxMHVDj6BAvAyAG/9dPyaIu74UnkjFHZMh18vyknclTVcXaabCW
+mf2sxBZA6gwbMsP9ZR0Drb5giHxwUzWRzhPiPSNr6CPAPJpXX61LA5SSFmL51AE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..ba6119464f9e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,A5EF3D451C410026
+
+RByk5Bn7uG1eixW1qTghnNri2bQHvnrNUYcpSL/mJIx6NjuYEY6vE/vQ9A9qcjuZ
+8NInLR1w+EmSlDS499za8dfllaJ4/djswWN+4gtkoP/kKF390AcNgIpf/gIiJX6d
+tkrw3Esst2gUwdtdhWItQNh0qZoeWpY9KlraDdEYVZt46JmsgwEIufzHyHTHf53C
+E9ZP7/vYBQeHPOvMGsvhwZWAZZOO5GnD4fktbVAnybQdnlPgJDrRTGabbTdawQNc
+8GJoG6hgJPcwlYm7NbRrtB18L3bG4bxx95fjqeOtvGDSUxSY+FNV7B2xQpivnBu6
+ppLdwTRYHQGOCJSCZoCtW+GYM7wXR2L4kGXMPwB4hHUAQXt+Tva9TP0t96313lMW
+bFTRgTcT71eBidEkUIn1OrOL/Al2lXvSaDhm0P2F0yElzj3JN/gqrIUChaXWcLrS
+CZuOGA2zGpoBASQ5jF+CyC+5mEkmDgvbmAXiJNjNmK/ColklpTNRSGk65Vr8AufA
+d/yoSQCGprhMgqhviue40MGSsOD58TLwR4Tsm5ptze0QYRNC2SkKCrgtS0IEXh/Z
+/9cMAgwOypW1T7LMOV+rG9DOyKx9Ye+oxPLCHdS7wN4h6blusiESbbUW0f5wqAzF
+FCe6VEd+AjahnQLjw7O8vP4zl8q99cjOYD5SB+wqYrr0beEely7xdpKrDMgXqiBe
+tOE9XvgU9KR59GZd0l6FPRkpZCUA+3Wuu4Zvrbam5kEbxVy+VTamWd5cRrxbJBM4
+Ipn414lfeq/5Foz13roErJE6gbWxXeCFDzg0z5fjWc2T41PX58x4Tw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem
new file mode 100755
index 000000000000..cc93d02e540c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBqDCCARECAQAwaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1cmcxFzAV
+BgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVudDEYMBYG
+A1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
+gQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLKg4CSA5yW
+4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip9YqhqO0X
+nCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABoAAwDQYJKoZI
+hvcNAQEFBQADgYEADbuni6Yq0l5FJGFDUaabv4T75XxyMWy+k6wSojSt1thtwcJI
+Bx5x1ngG5VyxeNmqyjLvd2KeYsVaV8M9J9ty40QGL8F83OArJPGADtBSM+gwmjdu
+C+ksYL+5Yl8vSY3M7tKqJB2AFk2QlfP5okMQWRJ5QFTTwA8EFpHFsy4gsks=
+-----END CERTIFICATE REQUEST-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem
new file mode 100755
index 000000000000..c14880b580c7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 3
+ Validity
+ Not Before: Nov 20 07:40:39 2009 GMT
+ Not After : Nov 14 07:40:39 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:9e:87:1f:af:f0:a0:1c:f4:9e:f8:c3:e7:ee:d3:
+ cb:a8:e2:54:98:ba:dd:7e:dc:6e:14:e1:7e:7f:5b:
+ 1e:ef:53:3d:89:76:ea:e2:b3:6c:08:0d:e8:c8:4d:
+ 24:40:ff:92:f3:5b:51:f7:90:ac:69:37:29:90:f5:
+ e8:95:6f:67:d1:10:cd:7b:dd:65:38:d6:25:ec:63:
+ 39:ba:2e:ea:13:58:8e:7a:82:8e:10:d1:7b:77:7a:
+ 08:d5:82:66:62:a4:83:39:ad:f5:83:d5:2f:5c:bc:
+ 23:6e:c8:78:8b:38:9f:eb:a3:67:ba:43:fa:e4:07:
+ 3f:90:72:db:0c:f9:49:0e:0d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D
+ X509v3 Authority Key Identifier:
+ keyid:69:FF:30:EC:1F:34:9A:67:3A:6B:20:D2:DF:7F:F5:05:04:ED:F9:1C
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 3
+ serial:95:6F:F0:E3:2B:BE:76:F9
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6f:ac:53:9d:16:6e:95:ed:97:60:ed:c8:a8:96:ab:24:c5:1e:
+ d5:d7:26:98:fb:b5:aa:ef:da:a4:91:6a:82:55:ec:21:a2:08:
+ 24:c7:0c:a7:58:0c:06:69:3d:04:7d:08:f1:0b:77:41:ad:1c:
+ 13:c2:bd:17:c9:9e:ff:df:64:69:8b:58:f1:bc:40:bd:cf:e4:
+ 57:29:bc:5e:93:84:61:56:4c:e6:c1:3a:2c:6e:71:ea:5d:67:
+ c0:54:be:4f:2f:27:a8:59:8d:29:94:ba:c6:6c:ff:ed:25:3d:
+ 0b:fa:93:c9:45:f4:d5:a3:3d:be:8a:f1:9d:c4:92:d5:5c:d2:
+ 77:7c
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzMB4XDTA5MTEyMDA3NDAz
+OVoXDTM0MTExNDA3NDAzOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wI
+DejITSRA/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3
+egjVgmZipIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBQbLeCiJn8Nujh+7AaBgQ8SdExaTTCBkQYDVR0jBIGJMIGG
+gBRp/zDsHzSaZzprINLff/UFBO35HKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzggkAlW/w4yu+dvkwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBvrFOdFm6V7Zdg7ciolqskxR7V1yaY
++7Wq79qkkWqCVewhoggkxwynWAwGaT0EfQjxC3dBrRwTwr0XyZ7/32Rpi1jxvEC9
+z+RXKbxek4RhVkzmwTosbnHqXWfAVL5PLyeoWY0plLrGbP/tJT0L+pPJRfTVoz2+
+ivGdxJLVXNJ3fA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt
new file mode 100755
index 000000000000..bd3b5eaeaeb0
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114075225Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 3
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..46d60bda0a83
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3
+ Validity
+ Not Before: Nov 20 07:52:25 2009 GMT
+ Not After : Nov 14 07:52:25 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 3
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:bc:82:f1:75:77:02:f8:fb:3a:c2:8d:3c:1b:cb:
+ b2:63:2e:89:07:92:6b:b4:e1:ab:ce:30:a1:a4:82:
+ 38:30:64:2a:ba:01:c6:ac:ee:03:cc:65:bf:83:3e:
+ 39:b8:ce:ac:45:99:97:f9:94:e2:7d:5d:f3:c5:f7:
+ d4:a5:d6:57:cf:24:c1:d7:56:eb:00:9c:5d:80:bc:
+ 23:0c:91:d6:8e:2a:62:f6:af:4d:c9:19:5b:dd:16:
+ be:21:54:51:71:be:f2:c6:64:c5:bb:8e:37:49:c9:
+ 4d:68:82:3a:42:8a:e3:de:ab:fa:c7:ff:a5:b4:c7:
+ 53:8f:17:a4:66:9d:c3:8e:b1
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 0B:DD:2E:E9:5C:8A:5F:67:C9:75:4C:B3:04:DB:95:2F:D8:74:76:EF
+ X509v3 Authority Key Identifier:
+ keyid:1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 18:2f:af:1a:27:c7:f8:81:cd:d5:31:a0:f2:06:05:94:d6:12:
+ 11:88:24:ae:4f:f6:86:18:bf:d0:1b:c9:19:7a:47:30:0e:fb:
+ 30:b2:50:31:8d:30:6b:8b:54:17:67:bc:b8:c1:d5:1c:6c:95:
+ c5:e4:c4:ad:12:39:2f:38:ee:53:6a:cf:be:1c:4f:ac:98:0c:
+ ea:eb:0b:48:3d:5e:7a:2b:ed:02:8b:34:89:0a:d8:32:b4:6f:
+ f4:b2:06:96:aa:6b:ae:19:38:ec:9f:47:43:3b:7b:bd:71:38:
+ 99:4f:b4:1e:87:95:73:63:76:d4:ff:21:57:2c:c3:f4:3c:fd:
+ cb:c3
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMB4XDTA5
+MTEyMDA3NTIyNVoXDTM0MTExNDA3NTIyNVowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvILxdXcC+Ps6wo08G8uyYy6JB5JrtOGr
+zjChpII4MGQqugHGrO4DzGW/gz45uM6sRZmX+ZTifV3zxffUpdZXzyTB11brAJxd
+gLwjDJHWjipi9q9NyRlb3Ra+IVRRcb7yxmTFu443SclNaII6Qorj3qv6x/+ltMdT
+jxekZp3DjrECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUC90u6VyKX2fJ
+dUyzBNuVL9h0du8wHwYDVR0jBBgwFoAUGy3goiZ/Dbo4fuwGgYEPEnRMWk0wDQYJ
+KoZIhvcNAQEFBQADgYEAGC+vGifH+IHN1TGg8gYFlNYSEYgkrk/2hhi/0BvJGXpH
+MA77MLJQMY0wa4tUF2e8uMHVHGyVxeTErRI5LzjuU2rPvhxPrJgM6usLSD1eeivt
+Aos0iQrYMrRv9LIGlqprrhk47J9HQzt7vXE4mU+0HoeVc2N21P8hVyzD9Dz9y8M=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..8d893cdf9e43
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,EF032FCF0827A7AA
+
+vTlvOy1d4MK41zEZfeUWDO7kjLqZ53jK6JdXhKT2P9MnstGf1S0QxwbEKP+KWj+4
+lwS7fSXs6/s2Q5OrG9QSV4bm5Sob0OpDfoc1GS24uSGvYXzhuyM9sjiITXvyGKCH
++0VQPV/GSXWShsk5CCzUXIBSBHDVxlEzmBvzWiHfcLEAwF1JJlh6ex9Xju9JL9sN
+Gp4VMw9PML11V4iqNXKeyBZ87Bv/yew+bDACLCe7e1liBxdOj2ntc7mtpCrkf/pn
+hLnJ1qKodcwgmmMLufa7//E1RCBMn1gml0YXMe+Grrn7tFdVWT/puKiSrKGgIbbB
+RNf7JnG5E8Oy2V8NRk4SV5Au784fw5NMykQDCMJFp9aldwP7LlIUBPtPm/jpaY0V
+e6tKT20e4Ru2mDzyfef8nhFRogMxvPrxVSxN8aI1u/soPMp55ypWrqg99QlsiZgG
+MhpHaFODSWvHaFcwFY+gEDUmEH76S3wuOSgeFolvIPEETjw6Vc46Zi32N1ycQ1wz
+NCbIGy2ftEzKIEOeXHAsuQiP+Cic1QYJEOxhvOq9VteYfilT7D9FQ2+QOqrl4+2X
+hj2RaTJawpSFoWfEh7QM1ir0TPj3wRSTg6g3e0f+vAvI9AfVEP3ctPm6tpXirUgh
+QOA1LZKZzHUYqr0q2TBvItyGsg3w7dxyeB6brCtzOzg+GpvNhaRZ1/+SVPxzYVgf
+buLQIfvvLE6TmABxOloop1m61u6c6+Bg5kKHXSnUKehGv+iIxVLZgxrNkCFyyzX0
+Dpu9hkGYzVzE8QCujC09MZCKH/85iYGuEZtP81Mjyjs=
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem
new file mode 100755
index 000000000000..dd08bf6717c7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBqDCCARECAQAwaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1cmcxFzAV
+BgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVudDEYMBYG
+A1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
+gQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wIDejITSRA
+/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3egjVgmZi
+pIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABoAAwDQYJKoZI
+hvcNAQEFBQADgYEAiwW4WbC3V3wEBfPlIFiUagJHOettp5NyCzLULyQZE1FXs/zV
+RxIi3Oxdaj643QZ8h6upKf9F60T8+oG15RBdp1ZjmBXnv7ZRx33LynExbxX0XKjo
+Pg/8dGLFBomZqE8MpWbQtY5lRkQOkgt5XZLj5SMJQsgpVaAOPQcOg5Sqfag=
+-----END CERTIFICATE REQUEST-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt
new file mode 100755
index 000000000000..3ac354b8f8c7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt
@@ -0,0 +1,4 @@
+Revoked certificates:
+---------------------
+- User 2 Sub CA 1 Root 4
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem
new file mode 100755
index 000000000000..391037118147
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4
+ Validity
+ Not Before: Nov 20 08:37:27 2009 GMT
+ Not After : Nov 14 08:37:27 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:da:b0:21:94:89:b0:00:89:cb:69:59:9b:0d:fe:
+ 1f:b9:a0:a8:44:92:55:5f:0b:d5:e5:08:63:bd:47:
+ 6b:11:4d:b1:a8:12:6f:c1:cf:cb:9e:ae:e2:c1:03:
+ 68:46:59:0b:96:7c:21:45:9b:14:81:d8:f1:83:70:
+ 6b:3d:b4:56:65:49:87:1d:ab:e2:08:6a:49:66:0e:
+ 59:b4:da:7a:3f:72:23:b8:1f:fb:78:f5:f0:2d:c4:
+ fe:d9:94:6e:2e:c3:6e:95:ba:38:60:d1:0b:fa:16:
+ c7:02:71:ef:3e:71:72:63:26:56:35:1e:8b:ec:47:
+ 87:25:6e:bc:90:d0:8b:37:2d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4
+ X509v3 Authority Key Identifier:
+ keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4
+ serial:A2:93:46:74:3B:A6:E3:AD
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 45:77:ba:6b:b6:a7:2a:0f:6b:38:90:9f:0a:18:11:c7:54:7b:
+ c9:3b:9a:93:90:96:f0:04:0a:56:87:30:e0:f5:d8:84:40:39:
+ 90:85:ca:e7:38:1b:d8:df:2f:bd:73:91:13:cb:a6:c9:b0:7a:
+ f7:59:77:6b:9a:d5:86:78:06:dc:40:14:ce:ea:43:a8:ae:ed:
+ a2:03:64:51:3a:47:7a:9f:df:2d:65:49:56:a5:39:cf:28:2a:
+ ac:ab:fd:e1:93:fd:3e:56:e8:eb:7a:11:a8:f7:f9:1a:a1:83:
+ 1f:92:f7:da:4e:c6:d9:67:dd:67:ff:be:6f:e5:24:e1:6e:cc:
+ 94:3c
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA4Mzcy
+N1oXDTM0MTExNDA4MzcyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDasCGUibAAictpWZsN/h+5oKhEklVfC9XlCGO9R2sRTbGoEm/Bz8ue
+ruLBA2hGWQuWfCFFmxSB2PGDcGs9tFZlSYcdq+IIaklmDlm02no/ciO4H/t49fAt
+xP7ZlG4uw26Vujhg0Qv6FscCce8+cXJjJlY1HovsR4clbryQ0Is3LQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBSWmi0G9nZPg2h7nGnEGLtK60Y45DCBkQYDVR0jBIGJMIGG
+gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBFd7prtqcqD2s4kJ8KGBHHVHvJO5qT
+kJbwBApWhzDg9diEQDmQhcrnOBvY3y+9c5ETy6bJsHr3WXdrmtWGeAbcQBTO6kOo
+ru2iA2RROkd6n98tZUlWpTnPKCqsq/3hk/0+VujrehGo9/kaoYMfkvfaTsbZZ91n
+/75v5SThbsyUPA==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt
new file mode 100755
index 000000000000..88e41b76acb1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114084401Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 4
+R 341114085720Z 091120085929Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 4
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..73563ed969ab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4
+ Validity
+ Not Before: Nov 20 08:44:01 2009 GMT
+ Not After : Nov 14 08:44:01 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c3:55:aa:1b:4f:f6:b4:78:be:ac:61:2a:92:94:
+ 73:1b:39:4c:0e:57:7e:da:78:03:7e:65:11:57:97:
+ e6:f4:0d:72:1f:f6:2b:a4:33:f9:5c:bd:2b:25:6c:
+ 58:29:73:b9:46:d5:db:e9:03:1d:a2:f8:8e:6e:c2:
+ b5:95:ec:ba:95:c3:ac:2e:c0:b6:40:ba:23:1d:74:
+ 75:91:cc:d6:3a:4c:15:4d:15:03:a4:e6:80:4a:93:
+ fe:6c:91:ab:77:60:3b:43:65:21:cd:04:3d:01:71:
+ 99:47:28:12:c8:9d:f9:d7:25:7a:30:82:76:c0:27:
+ 5e:c3:70:42:54:2a:0a:02:97
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ D5:2F:1A:60:8E:F9:2E:8F:51:EB:F7:AB:24:47:80:CE:B6:8D:F1:63
+ X509v3 Authority Key Identifier:
+ keyid:96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 7a:83:0c:a0:2d:14:52:97:a1:0e:dd:b3:2e:a1:1f:0d:51:e7:
+ 98:2e:89:9a:36:a3:1b:af:28:95:13:ab:3e:31:2e:f6:fa:5f:
+ f7:85:8c:01:7a:1b:25:63:7e:d6:f9:8e:ad:84:9e:42:3e:1d:
+ f4:ad:dc:b1:20:91:83:8b:48:ad:34:2a:b9:cc:ae:06:e6:bc:
+ e1:05:e6:35:71:ca:43:98:3a:e5:93:52:e1:3c:3a:1b:83:53:
+ d3:a6:ba:6a:43:38:00:92:ba:fb:8f:a8:17:46:f9:32:ac:42:
+ 47:87:7f:2e:ae:76:49:88:55:1e:65:70:6c:d6:35:ab:64:48:
+ a9:66
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MB4XDTA5
+MTEyMDA4NDQwMVoXDTM0MTExNDA4NDQwMVowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNDCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw1WqG0/2tHi+rGEqkpRzGzlMDld+2ngD
+fmURV5fm9A1yH/YrpDP5XL0rJWxYKXO5RtXb6QMdoviObsK1ley6lcOsLsC2QLoj
+HXR1kczWOkwVTRUDpOaASpP+bJGrd2A7Q2UhzQQ9AXGZRygSyJ351yV6MIJ2wCde
+w3BCVCoKApcCAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQU1S8aYI75Lo9R
+6/erJEeAzraN8WMwHwYDVR0jBBgwFoAUlpotBvZ2T4Noe5xpxBi7SutGOOQwDQYJ
+KoZIhvcNAQEFBQADgYEAeoMMoC0UUpehDt2zLqEfDVHnmC6JmjajG68olROrPjEu
+9vpf94WMAXobJWN+1vmOrYSeQj4d9K3csSCRg4tIrTQqucyuBua84QXmNXHKQ5g6
+5ZNS4Tw6G4NT06a6akM4AJK6+4+oF0b5MqxCR4d/Lq52SYhVHmVwbNY1q2RIqWY=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..7068aa0afdc9
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4
+ Validity
+ Not Before: Nov 20 08:57:20 2009 GMT
+ Not After : Nov 14 08:57:20 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ab:2a:df:93:6c:f0:b1:34:54:15:5b:06:4e:15:
+ bb:94:53:89:96:96:47:db:43:49:e7:66:d5:6b:53:
+ eb:04:54:d0:96:48:08:8f:8e:cc:70:e1:62:88:6a:
+ f3:ff:bc:65:55:b9:55:a6:29:22:c1:f6:16:9a:01:
+ 25:86:a9:72:c8:7c:0f:29:87:b9:14:51:34:d2:fc:
+ 01:3e:20:46:dc:54:3f:f3:03:d8:07:e0:6b:0c:78:
+ 70:d0:d0:93:83:e2:cf:53:fc:3b:d5:b0:c9:7d:40:
+ 8b:ee:5d:d3:30:e9:24:01:1e:b0:ac:de:1a:18:97:
+ a1:0d:58:79:5e:67:cd:99:bf
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 47:DB:A7:93:38:C2:0F:34:7F:B7:DE:35:C9:23:75:CC:30:93:A4:42
+ X509v3 Authority Key Identifier:
+ keyid:96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 97:70:47:74:ce:e1:f6:51:bf:cc:cf:0f:cf:cc:23:75:df:4b:
+ 3d:36:f0:70:0f:47:5d:c7:96:ad:b0:78:95:89:3a:2a:7a:ba:
+ 79:45:fe:2f:37:4c:69:76:ab:0a:10:ea:0d:5e:fe:28:04:44:
+ 9c:f3:8d:43:f5:15:fa:79:be:d3:86:f3:c1:b5:8b:5a:74:a9:
+ c5:b7:fe:e8:63:6e:1f:13:3a:c9:49:3b:45:0c:a6:64:b9:07:
+ 9b:1a:30:09:1d:5e:f0:2b:a9:55:aa:41:fa:85:0d:ef:dd:c3:
+ f5:58:52:bf:7f:6d:f4:18:06:f4:5a:71:af:e4:57:b0:0a:6e:
+ f6:76
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MB4XDTA5
+MTEyMDA4NTcyMFoXDTM0MTExNDA4NTcyMFowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgNDCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqyrfk2zwsTRUFVsGThW7lFOJlpZH20NJ
+52bVa1PrBFTQlkgIj47McOFiiGrz/7xlVblVpikiwfYWmgElhqlyyHwPKYe5FFE0
+0vwBPiBG3FQ/8wPYB+BrDHhw0NCTg+LPU/w71bDJfUCL7l3TMOkkAR6wrN4aGJeh
+DVh5XmfNmb8CAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUR9unkzjCDzR/
+t941ySN1zDCTpEIwHwYDVR0jBBgwFoAUlpotBvZ2T4Noe5xpxBi7SutGOOQwDQYJ
+KoZIhvcNAQEFBQADgYEAl3BHdM7h9lG/zM8Pz8wjdd9LPTbwcA9HXceWrbB4lYk6
+Knq6eUX+LzdMaXarChDqDV7+KAREnPONQ/UV+nm+04bzwbWLWnSpxbf+6GNuHxM6
+yUk7RQymZLkHmxowCR1e8CupVapB+oUN793D9VhSv39t9BgG9Fpxr+RXsApu9nY=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..4c3de720f9eb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,48187111D008BD14
+
+9y5tseMMq8fPCuUelw75mRr1ALSrxNWatiMrmFM44I27wxIlaVgePNk3ovpuUpjB
+RTArkp0zqA8tHCE/ZzE0cKtkxabTfrghxeKb2lAIrIUFwAFnMPEoB69M23qKblQD
+/CbYquy6mpjzLBYwM0Ub8fj4d6fMCJ29Mqlbzj9XJ2oif8zW90lxE4CZNGEWKWaO
+pF0ytqUM0aVIBVXZOGmeUpJlAgwdshYHD0JwoULWzFOa+9aks+wjYwQcDxbPq3YC
+TBSzHiKd68YSDvK5VevIAIrSKEEqrXgsnL0k23/xkK5ZN8w9gmROrwpqg78Aa/cp
+13luMYMRAm+hBfCFzKXvc8hV49UCPWOJcB4/p8to8Bx95UcJ17npG71yrNJgwTA6
+Wgj4pxtddt4QItVqv6usIvkMwD4pQqZ4y+5UMEvw2paG428+SN6YElH6/6yB/9Cc
+B7BxhhaazM+AEulpvvfQgjpIqn5+QyaZ7GVcNh/Bi66tenNv9NBVqP1PmuZUMF77
+QddQGzCpxaSb/x/3InhMP2PgGN37B9ezm8ee+AQpmk1VzJ5zpiuoGbQ3oLnDVMKS
+aNe7VIyhovq7tnJIuIft8jOEMFfPot9vgIwnHVQ4PF+KK0bzWjSK+6HyO+1Jkw/5
+TpHfQSxEVf8brC8g9l7+FjGSbHF80EzOUx1lMDe/BUzuVvRhiewqrlkCrPf90uuy
+hEf1UKqrDK2i2iLBzZ0+OXba3wj20jFRaYLN5YykE6fKo/H6UjEn203nMI2Qi+2m
+5j5dgDAOXnNWQN45MxIMu6xxPSaEcb8YUgfMqwytfVmo/xSioyoV+w==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt
new file mode 100755
index 000000000000..b266749a9e78
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt
@@ -0,0 +1,5 @@
+To provide the CRL via HTTP run
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902
+
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem
new file mode 100755
index 000000000000..b350f6eb33ef
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 5
+ Validity
+ Not Before: Nov 20 11:30:23 2009 GMT
+ Not After : Nov 14 11:30:23 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:97:fa:a2:49:d3:bf:c1:2e:7a:ed:83:83:3c:78:
+ 96:c8:b2:b9:67:af:c0:5e:0a:89:89:fb:94:59:32:
+ a8:2a:e4:20:2f:3b:3d:ce:53:4f:72:fc:6c:0b:93:
+ 38:c3:df:66:6e:d5:79:d0:a4:4e:41:84:43:3c:99:
+ 79:0c:e0:5f:19:1a:3d:f5:4b:11:28:0f:80:b0:a0:
+ 71:34:5b:90:71:c2:ef:1e:85:2e:5b:9f:3b:22:c3:
+ 18:f8:7c:1f:ef:1b:78:17:a0:44:60:46:7e:88:eb:
+ a7:60:a0:5c:2a:7c:37:99:fa:27:97:08:e8:89:ba:
+ bc:69:4b:79:93:8f:ad:b5:9b
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF
+ X509v3 Authority Key Identifier:
+ keyid:C1:D1:A0:D4:5B:0B:9D:7E:31:61:F9:39:10:9F:31:10:E0:D2:06:B5
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 5
+ serial:F0:3D:B6:A9:A9:9C:A3:4E
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_5.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 6d:ca:34:05:99:ff:99:49:d3:6d:9d:ad:c6:99:da:9d:6c:94:
+ 62:77:ed:1c:39:23:d2:e8:b6:3e:df:63:dc:7c:10:3f:c2:ed:
+ f4:04:26:58:05:01:4c:ed:a9:83:43:3a:5d:fe:60:6d:5b:58:
+ dc:93:8c:94:69:b6:7f:02:48:30:9c:31:f4:7d:de:e0:de:04:
+ d2:dc:79:b7:60:c2:87:f7:c7:92:a2:f5:86:a7:0c:70:3b:a3:
+ a7:35:11:cf:a4:28:21:aa:8b:24:50:2e:96:41:be:66:01:bd:
+ b9:ec:04:0c:92:d9:8a:e7:a0:96:24:9b:f1:a2:9f:59:59:4a:
+ 32:a4
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA1MB4XDTA5MTEyMDExMzAy
+M1oXDTM0MTExNDExMzAyM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCX+qJJ07/BLnrtg4M8eJbIsrlnr8BeComJ+5RZMqgq5CAvOz3OU09y
+/GwLkzjD32Zu1XnQpE5BhEM8mXkM4F8ZGj31SxEoD4CwoHE0W5Bxwu8ehS5bnzsi
+wxj4fB/vG3gXoERgRn6I66dgoFwqfDeZ+ieXCOiJurxpS3mTj621mwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFAHptZnkbfmMQj0JEA+ndcYneEqvMIGRBgNVHSMEgYkw
+gYaAFMHRoNRbC51+MWH5ORCfMRDg0ga1oWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDWCCQDwPbapqZyjTjA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzUuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAbco0BZn/
+mUnTbZ2txpnanWyUYnftHDkj0ui2Pt9j3HwQP8Lt9AQmWAUBTO2pg0M6Xf5gbVtY
+3JOMlGm2fwJIMJwx9H3e4N4E0tx5t2DCh/fHkqL1hqcMcDujpzURz6QoIaqLJFAu
+lkG+ZgG9uewEDJLZiuegliSb8aKfWVlKMqQ=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl
new file mode 100755
index 000000000000..3aec2bba1d83
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt
new file mode 100755
index 000000000000..2f83d6f9b733
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114113322Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 5
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem
new file mode 100755
index 000000000000..59d5f7a2b431
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4098 (0x1002)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5
+ Validity
+ Not Before: Nov 20 11:33:22 2009 GMT
+ Not After : Nov 14 11:33:22 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 5
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d3:fd:a7:4f:ea:02:e2:b4:32:80:3f:64:bb:37:
+ 9d:9e:fa:86:b2:25:b3:1d:f6:5d:05:8e:2b:0c:bd:
+ 60:1e:e6:52:39:4c:84:9e:93:6c:d2:b4:2d:34:1a:
+ e7:42:b6:bf:34:bd:ca:44:31:fb:06:5e:20:0a:a1:
+ 22:ca:9b:4f:01:57:bd:b1:30:57:a9:0f:fc:06:ae:
+ 18:6c:2d:9e:70:7a:21:2a:fd:0c:f8:03:00:32:60:
+ 5d:37:c5:11:56:74:30:e4:03:3c:88:71:d5:79:d3:
+ 76:02:e1:85:87:63:4b:5b:cd:c9:1f:ca:85:7a:8c:
+ 3a:fd:a9:83:94:b9:6d:f6:95
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ E0:53:2E:E4:6B:0B:99:C0:AD:C1:02:40:46:6C:35:EE:49:73:5D:0B
+ X509v3 Authority Key Identifier:
+ keyid:01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 5f:6a:81:3b:56:e8:6d:33:0e:1e:6a:73:b1:e8:69:b7:3f:83:
+ 81:6c:73:7c:9d:f7:12:c9:bf:99:16:cf:56:38:e4:58:db:28:
+ a5:9c:e3:8e:ed:27:d2:da:53:41:80:2a:d4:c3:92:5d:b5:b4:
+ 5a:d6:17:f7:74:9d:83:13:06:7f:20:8e:50:5f:60:5b:3a:9a:
+ 9f:c2:58:5f:fa:07:90:df:a0:02:cf:c4:d7:7d:2e:b7:72:df:
+ 8f:93:ce:5a:b3:17:ba:73:93:20:64:b9:b2:ad:6e:89:63:c5:
+ 08:e1:a0:6a:b2:9d:1e:33:31:83:98:d1:05:7d:ec:48:72:1f:
+ dd:60
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MB4XDTA5
+MTEyMDExMzMyMloXDTM0MTExNDExMzMyMlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0/2nT+oC4rQygD9kuzednvqGsiWzHfZd
+BY4rDL1gHuZSOUyEnpNs0rQtNBrnQra/NL3KRDH7Bl4gCqEiyptPAVe9sTBXqQ/8
+Bq4YbC2ecHohKv0M+AMAMmBdN8URVnQw5AM8iHHVedN2AuGFh2NLW83JH8qFeow6
+/amDlLlt9pUCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzUuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQU4FMu5GsLmcCtwQJARmw17klzXQswHwYDVR0jBBgw
+FoAUAem1meRt+YxCPQkQD6d1xid4Sq8wDQYJKoZIhvcNAQEFBQADgYEAX2qBO1bo
+bTMOHmpzsehptz+DgWxzfJ33Esm/mRbPVjjkWNsopZzjju0n0tpTQYAq1MOSXbW0
+WtYX93SdgxMGfyCOUF9gWzqan8JYX/oHkN+gAs/E130ut3Lfj5POWrMXunOTIGS5
+sq1uiWPFCOGgarKdHjMxg5jRBX3sSHIf3WA=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..fb9af1caa35e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,30B50FFE9747C5F2
+
+pXO59gJmBcDztjZDwRRcJV+m/BBdF/NlI0WD7WBr4vR663B6hZw0hqAkCn3o0VbO
+DzLsoQUMUv/70aXc2SgvS8LleG+mWCkPE+huzFjPAn6Z6+p0MhHrYRJ7iulPAVV0
++wCs8+1UbvKyozLy+BfvEwGHEho8sr3w81y2noE2pjaQOE1JGKY91VnFz1yPhYHC
+r26sO1DqoqtWS8XSe2FdREG/guKpoHtoUazQhCkgeBk18OImKlrxp1pT/haObv5i
+5qILjSvMBjmrTCJDi1vgShEiAZTE318ipK5wCLKiA6UvZ3GMxb2xjy+na3CUTrzf
+AAefrW4NaoyIWI8dRtPxFic678ZgqcRMdMW7BgdffLXX5IueCqHeTNS7xcr2T2gd
+hzKxinZnY8MQosFeyzP3fYWxv5PY54HNmCnsN2SXJSOq+CPSsIvbDR5p1bhrcEf9
+1O815NhJTx2nPAkIC+7bemAkz2f3g09SuhtQTaCnZMwcAmnMAT0ewWJSxDCVOg5s
+B/OPe8RJ1tiO7DnaZH6RQDPUCKaUgS9xSzCu1q0IWWbzUWioPIX13fFlvl9gAxbY
++FI6dD2DwHBTyiPLLyT7FBfwjnHul2zSn/jXnby7n1sILQIP0AQK0cJDS1ZdC2CB
+oe4gwzSVCxp7v3Zfp1ZoyYOtei0gT6+bDvjBYsl90jyvyucWfKjlZiEauQV8gSOQ
+G2iY5QZ0clAFg7MQKmHuTaAALk0IrauSW20eR/HF0/2R6xCt91zcyhwbOiZFNyQ3
+gtvwLu9ZzAHfWcnIEWxpYF68O+vj+g6Jpl/q6j8KaTta3smEBzgpow==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial
new file mode 100755
index 000000000000..baccd0398f98
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial
@@ -0,0 +1 @@
+1003
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg
new file mode 100755
index 000000000000..eaa527d3dc41
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem
new file mode 100755
index 000000000000..0490b88cd769
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 6
+ Validity
+ Not Before: Nov 20 12:28:07 2009 GMT
+ Not After : Nov 14 12:28:07 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c4:d9:ab:27:06:66:41:0e:36:ff:d4:b1:d0:8c:
+ f7:b4:25:55:cd:fd:fa:a4:5a:e6:4f:d0:05:dc:a3:
+ e5:bd:8d:53:77:d1:ea:95:5a:52:81:c8:b6:36:a0:
+ 5f:3a:e1:85:1e:8a:48:91:7d:29:78:ff:ea:c5:e3:
+ ad:c4:27:d5:b7:8f:59:20:26:d4:45:87:6a:56:db:
+ ac:f5:f8:0a:88:82:9e:c2:00:06:fc:98:8a:fe:35:
+ c3:02:a1:67:08:06:42:e3:88:48:e0:8f:33:ff:f8:
+ a4:87:1a:3a:d9:54:0e:1c:09:3e:a0:f0:70:cd:b5:
+ b0:b2:7e:07:73:ad:20:64:69
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7
+ X509v3 Authority Key Identifier:
+ keyid:AC:25:5E:9B:B5:BA:4D:8E:BD:77:B2:9D:D9:E2:84:AE:7A:31:8F:F2
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 6
+ serial:D8:6A:4F:24:F9:C9:94:27
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_6.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 55:5b:3b:6b:8a:d0:1b:d8:19:d9:96:85:4d:b4:a0:98:b1:bd:
+ 9f:0b:62:21:92:8b:4e:d3:d0:1b:91:3d:e3:f5:bd:ce:16:57:
+ fc:b7:84:15:51:fd:98:ab:32:59:28:0b:44:57:49:ec:ac:11:
+ 67:26:7a:a3:c5:b8:9d:2a:de:b6:7c:76:0a:e9:18:9f:98:87:
+ e8:80:c8:72:99:56:74:ab:73:1b:f4:e7:b9:b1:3a:f3:7b:0d:
+ 2f:5d:82:6c:d1:99:9f:23:be:23:fb:4c:0e:15:5e:f5:9f:90:
+ 88:d7:51:3a:6a:7a:f0:54:a5:c4:89:a5:0d:0a:4e:94:59:64:
+ 59:54
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA2MB4XDTA5MTEyMDEyMjgw
+N1oXDTM0MTExNDEyMjgwN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDE2asnBmZBDjb/1LHQjPe0JVXN/fqkWuZP0AXco+W9jVN30eqVWlKB
+yLY2oF864YUeikiRfSl4/+rF463EJ9W3j1kgJtRFh2pW26z1+AqIgp7CAAb8mIr+
+NcMCoWcIBkLjiEjgjzP/+KSHGjrZVA4cCT6g8HDNtbCyfgdzrSBkaQIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFImM13HrZ3hO1gE1sqyhtIhDznCnMIGRBgNVHSMEgYkw
+gYaAFKwlXpu1uk2OvXeyndnihK56MY/yoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDaCCQDYak8k+cmUJzA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzYuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAVVs7a4rQ
+G9gZ2ZaFTbSgmLG9nwtiIZKLTtPQG5E94/W9zhZX/LeEFVH9mKsyWSgLRFdJ7KwR
+ZyZ6o8W4nSretnx2CukYn5iH6IDIcplWdKtzG/TnubE683sNL12CbNGZnyO+I/tM
+DhVe9Z+QiNdROmp68FSlxImlDQpOlFlkWVQ=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber
new file mode 100755
index 000000000000..83b33d238dab
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber
@@ -0,0 +1 @@
+1000
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt
new file mode 100755
index 000000000000..6e4d7577dfdc
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt
@@ -0,0 +1 @@
+V 341114123743Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 6
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..538cb4e0bfcb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6
+ Validity
+ Not Before: Nov 20 12:37:43 2009 GMT
+ Not After : Nov 14 12:37:43 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 6
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:bb:ac:68:10:41:28:94:fd:fe:39:5e:63:cf:eb:
+ 9f:2b:20:82:f3:86:d2:e1:38:05:7e:95:cc:46:e5:
+ 42:8b:5c:0d:2c:ad:ad:44:c0:4c:2f:7c:75:e8:bd:
+ aa:cd:f2:05:16:18:a5:a3:fa:e7:a0:ba:57:31:e2:
+ b0:4d:85:9d:60:e4:41:92:49:3f:e1:79:47:52:e8:
+ 9e:71:be:88:10:6c:30:89:9f:55:84:9d:83:d0:c9:
+ 11:66:95:33:8b:44:38:86:45:05:b3:3a:54:c4:cf:
+ 4e:72:4c:00:07:d7:59:3a:8d:2f:cd:5e:0c:a0:95:
+ be:00:85:7a:a4:42:c2:f3:b7
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 57:51:A4:44:AE:92:01:3C:9F:7E:82:67:C0:E5:B9:D7:A6:8F:A5:79
+ X509v3 Authority Key Identifier:
+ keyid:89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 7b:de:f2:2b:d7:94:ce:12:e2:f9:a7:b2:91:08:c6:51:3f:bc:
+ e2:87:ed:79:6d:3b:f5:38:6e:02:d4:63:e6:b8:a7:e5:df:f4:
+ 6e:b0:8a:bd:bb:b1:0b:e0:c2:cf:fa:af:0a:6a:a5:1f:28:ff:
+ de:21:bd:8a:f7:ec:48:35:bb:ab:97:c2:7a:31:6d:d1:73:8e:
+ ae:74:9b:94:86:73:06:06:da:6a:2c:82:04:b1:49:19:62:a9:
+ 05:e5:e7:2c:68:a1:3b:f4:bf:80:85:5b:1b:dc:21:7b:3d:c1:
+ ee:97:6c:72:35:2d:80:19:90:b4:ab:19:34:bb:88:5e:ea:70:
+ 27:df
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MB4XDTA5
+MTEyMDEyMzc0M1oXDTM0MTExNDEyMzc0M1owbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNjCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu6xoEEEolP3+OV5jz+ufKyCC84bS4TgF
+fpXMRuVCi1wNLK2tRMBML3x16L2qzfIFFhilo/rnoLpXMeKwTYWdYORBkkk/4XlH
+Uuiecb6IEGwwiZ9VhJ2D0MkRZpUzi0Q4hkUFszpUxM9OckwAB9dZOo0vzV4MoJW+
+AIV6pELC87cCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzYuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUV1GkRK6SATyffoJnwOW516aPpXkwHwYDVR0jBBgw
+FoAUiYzXcetneE7WATWyrKG0iEPOcKcwDQYJKoZIhvcNAQEFBQADgYEAe97yK9eU
+zhLi+aeykQjGUT+84ofteW079ThuAtRj5rin5d/0brCKvbuxC+DCz/qvCmqlHyj/
+3iG9ivfsSDW7q5fCejFt0XOOrnSblIZzBgbaaiyCBLFJGWKpBeXnLGihO/S/gIVb
+G9whez3B7pdscjUtgBmQtKsZNLuIXupwJ98=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..9912ee088064
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,8F1C89446B1EC221
+
+joSSrVc7E1RavSuMdWDDAozXOV4Z0XIusMv5NjIWHLyKdW/SmFv6yfPy7PeuK1Qj
+p/DuEO/ULU6SLmAhESXrdC8UzyL/B3hfPK3UzUzJzIRrDitF21SXLjMKU+KVxMrb
+GkmstfsIQM157TZHOHJbk4F9zs9Xkl8ipKYDBpJrtVJo8gf4SeLfcEVXW9J0tlLU
+Qi13SWWn4kGK+Latypx684S247Y0JfKSJ5BVHUGunmd+b/3mRpH1WARU03JmNqG9
+tyCJxyvCkkQh5Jnm4UEI72ywxSscemtFAzd5fa5LOrsVWOImSixfP1VdJvU0jCTv
+gyXK03e/L+B+DhbUm2a6xkt+u83hQ2QjoGdmnfKwhX4vdYZBYINlBnHtHn2B8x2o
+IXgLQmBFO/heY/K9wJ1BwwqPW31wHG3MhjRY7ooac1JAZsxS0/pU8cR/GNMpKjvE
+fer3tGGUvPL3H1v3pT2XAA4Gm9pOtvnOHuLjbzg2mgNZScYMpcqa/vaQ5gXqCnhw
+dtFrGVxEEQ5jTL23EAh4WfhPvsnewujr7Rkc6+a8xKpDJOHejgAPJYpXrYHg4poA
+L0aQlIFSX1jriGu4KYAQiZO7bouhVWqcf9B3BNewr0kTaD7qq0gDvygCKLyrUyb7
+hqk0TwVfvmk7nYNFLBsTEcsB/el6jqH40oOfFo+ErlQzmdzRrKy9gBEaecDj8DxV
+Fa8XPapE81O8WjS09a/WJNPW+3NdrI5wYMg72srOW8ll+AMtiUTWrAY2hIRxzZGt
+VntCKwG/3j0v60jg+0wCP+l/IV4pPbV4He3ysxwM6lH1Y86XfaUBiA==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg
new file mode 100755
index 000000000000..6251ef7ee99e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt
new file mode 100755
index 000000000000..d70e0550a90a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt
@@ -0,0 +1,3 @@
+To provide the CRL run:
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem
new file mode 100755
index 000000000000..2dda8f2b286f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7
+ Validity
+ Not Before: Nov 20 13:07:53 2009 GMT
+ Not After : Nov 14 13:07:53 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b0:ae:6d:0a:21:ae:8a:92:b1:16:25:d3:08:cb:
+ ac:b7:4c:53:6d:4b:b3:12:82:40:54:c9:44:28:fc:
+ 4e:10:e6:65:40:de:70:5d:8b:ab:1f:5c:77:03:43:
+ 3d:3a:3d:9e:f7:37:66:9a:33:68:a0:cf:ad:8f:f4:
+ fb:9c:a3:87:57:5d:ec:d6:55:5a:18:b5:e1:2b:d2:
+ c4:10:fe:f0:01:a5:da:29:ee:c4:af:15:c9:8c:dc:
+ 7c:45:84:bd:e5:5b:09:1f:16:1d:11:e7:61:e6:22:
+ e7:1f:c8:86:bf:a1:da:cb:fe:6b:7e:c0:6e:aa:7f:
+ 97:84:e8:8f:81:69:f1:26:87
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE
+ X509v3 Authority Key Identifier:
+ keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7
+ serial:D5:E6:63:5F:18:09:82:89
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_7.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 1a:bc:5a:4b:9a:d5:e8:c0:35:c2:61:0a:58:7d:33:e2:87:01:
+ 61:83:80:42:8d:1a:7e:b1:9a:58:d5:01:fd:e7:ae:5c:c8:65:
+ fb:9e:1d:bf:49:ba:ed:40:f4:05:7c:3b:2d:db:0e:53:d0:05:
+ a0:bd:15:87:c4:37:22:0b:a0:04:a3:ad:cb:57:b2:00:97:ee:
+ 8f:89:91:8e:7d:0b:e2:27:96:6e:0f:ab:73:33:59:fa:9f:37:
+ f2:77:79:99:af:72:ad:f9:49:05:ed:55:08:31:eb:97:0f:99:
+ 6e:9c:a3:df:f0:52:1a:14:4e:78:25:0c:8b:02:cb:56:e9:4d:
+ f5:9f
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMDc1
+M1oXDTM0MTExNDEzMDc1M1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCwrm0KIa6KkrEWJdMIy6y3TFNtS7MSgkBUyUQo/E4Q5mVA3nBdi6sf
+XHcDQz06PZ73N2aaM2igz62P9Puco4dXXezWVVoYteEr0sQQ/vABpdop7sSvFcmM
+3HxFhL3lWwkfFh0R52HmIucfyIa/odrL/mt+wG6qf5eE6I+BafEmhwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFFRkFX6TihnI+bfvYKDfXMgVVsDuMIGRBgNVHSMEgYkw
+gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAGrxaS5rV
+6MA1wmEKWH0z4ocBYYOAQo0afrGaWNUB/eeuXMhl+54dv0m67UD0BXw7LdsOU9AF
+oL0Vh8Q3IgugBKOty1eyAJfuj4mRjn0L4ieWbg+rczNZ+p838nd5ma9yrflJBe1V
+CDHrlw+Zbpyj3/BSGhROeCUMiwLLVulN9Z8=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl
new file mode 100755
index 000000000000..f3f7e5cba23b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt
new file mode 100755
index 000000000000..8bcb130f6c23
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114131904Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 7
+R 341114132648Z 091120132827Z,CACompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 7
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..234638d8ce9e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7
+ Validity
+ Not Before: Nov 20 13:19:04 2009 GMT
+ Not After : Nov 14 13:19:04 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:ce:23:98:19:ac:0d:7c:f0:60:a2:94:72:c3:ab:
+ a5:a1:6b:d3:af:8c:cb:b9:c9:ee:0b:3e:a4:2e:0e:
+ 08:a5:a9:4c:09:2f:1a:a0:fe:87:89:41:4a:aa:b6:
+ ac:b4:bc:d3:0e:f9:c3:12:1f:b1:90:b3:6d:72:a6:
+ 38:5b:9d:05:7e:97:ff:f4:e1:31:2b:b4:08:de:b1:
+ 43:fe:1d:7e:32:54:ce:db:d5:14:21:f3:ad:9f:26:
+ f3:c6:0b:77:51:e4:11:88:ad:86:e1:30:d1:af:87:
+ 29:c0:7b:92:db:68:06:74:ca:27:ac:0b:61:3a:ac:
+ ba:03:35:e7:8e:08:28:58:7d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ DE:66:84:E4:9B:BF:70:00:BD:60:3D:34:45:96:FE:FD:D5:88:9B:CD
+ X509v3 Authority Key Identifier:
+ keyid:54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 6e:da:66:d2:3b:00:d6:0b:5a:9f:21:28:de:e1:10:fe:fd:26:
+ db:a6:75:86:74:47:e4:b0:b7:c4:c1:dc:43:82:51:71:00:8f:
+ bf:71:9a:23:db:2d:79:27:a2:80:2e:12:a4:5f:13:0c:73:53:
+ 1e:5c:33:6a:e9:31:be:e2:ae:4f:55:b0:e8:0a:0f:54:f0:3a:
+ 7e:14:41:d7:34:18:58:90:26:63:7d:2c:1a:ab:93:7f:4a:3d:
+ 5e:cf:f1:9d:c3:76:ee:a4:76:1c:d8:f9:d0:ac:53:3c:1a:4d:
+ c7:fa:b6:23:54:4b:04:a1:e2:76:a5:e3:0d:b8:db:8e:d3:39:
+ c2:65
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MB4XDTA5
+MTEyMDEzMTkwNFoXDTM0MTExNDEzMTkwNFowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAziOYGawNfPBgopRyw6uloWvTr4zLucnu
+Cz6kLg4IpalMCS8aoP6HiUFKqrastLzTDvnDEh+xkLNtcqY4W50Ffpf/9OExK7QI
+3rFD/h1+MlTO29UUIfOtnybzxgt3UeQRiK2G4TDRr4cpwHuS22gGdMonrAthOqy6
+AzXnjggoWH0CAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzcuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQU3maE5Ju/cAC9YD00RZb+/dWIm80wHwYDVR0jBBgw
+FoAUVGQVfpOKGcj5t+9goN9cyBVWwO4wDQYJKoZIhvcNAQEFBQADgYEAbtpm0jsA
+1gtanyEo3uEQ/v0m26Z1hnRH5LC3xMHcQ4JRcQCPv3GaI9steSeigC4SpF8TDHNT
+HlwzaukxvuKuT1Ww6AoPVPA6fhRB1zQYWJAmY30sGquTf0o9Xs/xncN27qR2HNj5
+0KxTPBpNx/q2I1RLBKHidqXjDbjbjtM5wmU=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..ddc504d77c26
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7
+ Validity
+ Not Before: Nov 20 13:26:48 2009 GMT
+ Not After : Nov 14 13:26:48 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b3:58:b2:22:45:b9:37:83:e5:a4:6f:5d:4e:59:
+ 60:60:4e:46:26:27:9a:70:4d:34:89:cf:cb:4f:4f:
+ 0b:22:6e:e4:21:e6:ab:c9:0a:4a:c4:cd:6f:3c:db:
+ e8:a3:52:55:2d:26:1d:13:9a:8b:cf:38:25:4e:4f:
+ 4a:e3:39:01:fa:5b:10:a5:3e:e1:93:65:19:ca:8b:
+ 5c:9f:e8:19:ed:0a:ef:47:e9:11:73:28:ce:b0:95:
+ 10:3a:ce:b5:46:89:79:a3:90:ea:d5:ca:ac:c9:af:
+ ee:55:0d:6c:32:5f:d2:f1:76:1c:b9:e7:d2:ac:07:
+ 61:83:82:c5:95:5a:62:ff:67
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 12:7A:7A:69:C5:FE:E0:23:FD:8E:51:25:55:94:9F:C8:44:D8:F2:29
+ X509v3 Authority Key Identifier:
+ keyid:54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 4a:57:08:6a:66:af:b4:05:4f:b3:4c:39:23:2b:5d:c9:88:7b:
+ 6f:b5:28:a3:5a:72:e6:0b:e2:9e:64:65:ce:8f:b5:31:0f:5f:
+ c7:b7:56:96:4f:d3:34:65:1a:ea:84:60:2b:fe:27:1f:75:fd:
+ 0f:53:e5:eb:25:d3:f6:2c:21:72:59:40:32:ba:ec:72:cc:64:
+ d6:1d:db:cf:ca:ec:91:0a:81:ef:f5:e4:56:31:a3:c2:9a:1d:
+ e9:5c:48:b0:7c:7b:e2:51:35:33:ad:a8:5c:79:ac:ee:bf:42:
+ fa:0b:a0:02:72:cc:5e:07:c0:d4:d3:96:26:16:3e:8c:32:8d:
+ b4:09
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MB4XDTA5
+MTEyMDEzMjY0OFoXDTM0MTExNDEzMjY0OFowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgNzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs1iyIkW5N4PlpG9dTllgYE5GJieacE00
+ic/LT08LIm7kIearyQpKxM1vPNvoo1JVLSYdE5qLzzglTk9K4zkB+lsQpT7hk2UZ
+yotcn+gZ7QrvR+kRcyjOsJUQOs61Rol5o5Dq1cqsya/uVQ1sMl/S8XYcuefSrAdh
+g4LFlVpi/2cCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzcuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUEnp6acX+4CP9jlElVZSfyETY8ikwHwYDVR0jBBgw
+FoAUVGQVfpOKGcj5t+9goN9cyBVWwO4wDQYJKoZIhvcNAQEFBQADgYEASlcIamav
+tAVPs0w5IytdyYh7b7Uoo1py5gvinmRlzo+1MQ9fx7dWlk/TNGUa6oRgK/4nH3X9
+D1Pl6yXT9iwhcllAMrrscsxk1h3bz8rskQqB7/XkVjGjwpod6VxIsHx74lE1M62o
+XHms7r9C+gugAnLMXgfA1NOWJhY+jDKNtAk=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..c107913a2fc1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,D710D797627524D4
+
+SC46mzOOSpNMZ9t2F3syLy0MmYOk3zBJnY/qcm/ggD4ETOse6zGpqhXVSeZdn3OG
+Uwj+b9tCjVC/7GMWanH4DmshCv89IRljMyy5DShsOVmgAr0hqLZNlkKqQRRRHC4d
+y9ozYq1J9Zcj16jTmCbpPJW8Ul7kblelNbD0nVgJABc6m6Di/syCFEC0KVGmoJZv
+5QjxyNiulh0UNmmP+X6iEGPWw4s5JJdcAg5DFXjPiCvvGazvjCGTT38Hcnya4GkB
+9aHo7KbjFU4P98zQKUAV0fSVU7+tzJrLxH0aefenbkIKI45xegOTJmcv8NEZ3YgQ
+64r+OlmqOONmvcWrtUdhADvsl8oJ8Lz+1UYcyPpbYLUvMhj8Potf6C6rCz1GuQPS
+EmGPltUAOcaylpnP/neyuErAMHGQI9Mn2dhLc/NGK6gxqZi1SawGbrit7Uv5il/n
+O3zc7D+d1Jmdkcqm/BZKsMW5hwM3KF4gzb6zMe/8ZCmtqT4iH4eDqjFQfaWeBXNK
+kTM8vMUNCU8yQjMYoWL8iL4NNJxRheD0l2FABcGTbWI159eXy8laenk5eBfYKIwl
+YGnoylDD2F4W0mdMl2MJIYNYTRP7pAQhLnMbVNSgGDgk5Z0kUF2Kl2rNz+3w1c36
+L3VC/CGFp5/spnQHhYMH2oUAkliS0iev7bNJyhvycVQkMlwYu8KZKMtqyn9bnpU4
+Kd6XlXPwF3BHGrVVdcb6RQo65GrwT6j+hWRwUKgEvcxC7BjtsY1ZV3xRfsRQpA/b
+1sTQ/W0ev09+OJAHWEedIg2sTTp5WSiF2whCz6yviFxEAeYIUEGVHw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg
new file mode 100755
index 000000000000..16b905bdcb5a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt
new file mode 100755
index 000000000000..4d510fe39b27
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt
@@ -0,0 +1,13 @@
+Revoked certificates:
+
+- User 2 Sub CA 1 Root 8
+
+
+Start the OCSP responder:
+openssl ocsp -index demoCA/index.txt -port 8889 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text
+
+
+
+
+
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem
new file mode 100755
index 000000000000..b2d1deb75960
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8
+ Validity
+ Not Before: Nov 20 15:33:21 2009 GMT
+ Not After : Nov 14 15:33:21 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:96:79:01:9f:4f:68:c1:09:0d:44:3a:82:e4:eb:
+ ad:70:7a:cf:b9:71:e5:fb:e0:c8:0c:21:79:3e:cb:
+ 78:91:7f:4a:a0:de:3e:37:0f:a1:6b:73:10:12:9b:
+ 08:c4:96:dc:cb:a8:5b:87:9b:75:24:e4:00:5e:4a:
+ 6f:4c:13:79:1f:57:13:8c:3e:1b:38:31:e1:77:74:
+ 52:f9:94:47:36:57:33:bd:de:08:11:a3:01:e1:53:
+ 1c:bd:7b:39:9c:5e:96:5c:a9:61:6c:cc:2b:90:8d:
+ 5a:3c:9e:f4:4b:6e:e5:97:64:86:f3:8e:e8:72:20:
+ 5d:0d:50:bf:e9:cf:be:d4:13
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A
+ X509v3 Authority Key Identifier:
+ keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8
+ serial:B2:47:DE:6A:2A:4C:83:19
+
+ Authority Information Access:
+ OCSP - URI:http://localhost:8888
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 4c:95:44:3b:57:08:ec:01:ec:f9:3e:7c:89:1c:30:b1:4e:26:
+ 32:b6:57:fa:25:bc:ed:eb:d4:a2:1c:67:ee:b9:8b:d0:4c:57:
+ 8a:0e:db:a0:9d:92:e7:de:c6:73:01:e7:de:61:1b:b5:0e:d0:
+ c5:c1:a7:a6:ab:e0:c6:0b:51:dd:e5:a2:32:1f:c6:52:ea:d3:
+ 03:68:3a:f5:92:bd:8b:b8:03:bb:50:70:63:cc:ec:ed:3c:11:
+ 76:ca:ac:72:47:ad:99:6b:8e:07:9e:38:f2:63:e1:ba:d4:df:
+ a9:73:54:1d:74:89:94:01:2e:68:dd:97:e7:53:f9:cf:b6:7d:
+ fc:87
+-----BEGIN CERTIFICATE-----
+MIIDOTCCAqKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1MzMy
+MVoXDTM0MTExNDE1MzMyMVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCWeQGfT2jBCQ1EOoLk661wes+5ceX74MgMIXk+y3iRf0qg3j43D6Fr
+cxASmwjEltzLqFuHm3Uk5ABeSm9ME3kfVxOMPhs4MeF3dFL5lEc2VzO93ggRowHh
+Uxy9ezmcXpZcqWFszCuQjVo8nvRLbuWXZIbzjuhyIF0NUL/pz77UEwIDAQABo4H6
+MIH3MB0GA1UdDgQWBBTvvciOeHn5dksRWbbDMhAHwLzjijCBkQYDVR0jBIGJMIGG
+gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH
+AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBMlUQ7VwjsAez5PnyJHDCxTiYy
+tlf6Jbzt69SiHGfuuYvQTFeKDtugnZLn3sZzAefeYRu1DtDFwaemq+DGC1Hd5aIy
+H8ZS6tMDaDr1kr2LuAO7UHBjzOztPBF2yqxyR62Za44HnjjyY+G61N+pc1QddImU
+AS5o3ZfnU/nPtn38hw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl
new file mode 100755
index 000000000000..7a9ee345ea8f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt
new file mode 100755
index 000000000000..ff1b3fe19486
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114154212Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 8
+R 341114154716Z 091120155036Z,superseded 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 8
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..71456d01b1a0
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8
+ Validity
+ Not Before: Nov 20 15:42:12 2009 GMT
+ Not After : Nov 14 15:42:12 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b6:aa:34:ec:31:e5:9a:aa:fe:90:31:1f:e5:83:
+ 90:cb:9a:9e:15:cd:bb:35:1b:fc:3c:8b:d9:3d:29:
+ de:f4:07:3f:4c:06:9b:4f:db:21:a2:4b:87:8b:fd:
+ b4:61:31:de:34:6c:14:10:f9:a7:7a:e0:0a:e9:bf:
+ b3:83:a3:35:44:f4:ad:c3:d0:60:e8:71:8e:6d:c0:
+ 70:9a:16:85:65:7a:82:68:7c:67:ee:57:31:6b:e8:
+ fd:f2:3f:5f:c7:ec:4e:db:e7:8a:98:d6:15:45:13:
+ 14:03:bc:4e:8a:03:48:c2:e4:aa:c5:32:cf:80:82:
+ 45:16:8b:63:37:4b:d5:7a:97
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Authority Information Access:
+ OCSP - URI:http://localhost:8889
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 4E:0B:28:05:B5:07:8F:77:1E:A6:37:CB:CC:F0:CB:09:A4:8C:4A:1E
+ X509v3 Authority Key Identifier:
+ keyid:EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 3e:f7:c5:94:58:2f:18:c9:11:29:29:28:33:bb:e7:6c:70:7c:
+ f8:c7:60:4a:e5:37:f2:bb:78:d9:52:1e:c2:a3:dd:b1:7f:da:
+ e1:8a:8b:9c:7e:d6:ee:ec:ef:94:37:b5:b8:97:26:92:01:56:
+ 78:15:44:4b:95:4d:d9:59:12:b0:89:86:e4:b5:7d:b4:73:0f:
+ f1:0d:a8:04:69:e4:3f:2a:6a:65:b9:0e:9a:06:f7:16:29:94:
+ 4d:ac:64:ab:e9:0f:06:3c:74:fe:4c:e1:71:98:bd:9f:bb:c1:
+ 2d:47:70:6a:3c:b3:76:0b:fc:c8:05:d6:4e:bf:33:9f:dd:58:
+ 74:9c
+-----BEGIN CERTIFICATE-----
+MIIC0jCCAjugAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MB4XDTA5
+MTEyMDE1NDIxMloXDTM0MTExNDE1NDIxMlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgODCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtqo07DHlmqr+kDEf5YOQy5qeFc27NRv8
+PIvZPSne9Ac/TAabT9shokuHi/20YTHeNGwUEPmneuAK6b+zg6M1RPStw9Bg6HGO
+bcBwmhaFZXqCaHxn7lcxa+j98j9fx+xO2+eKmNYVRRMUA7xOigNIwuSqxTLPgIJF
+FotjN0vVepcCAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG
+FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFE4L
+KAW1B493HqY3y8zwywmkjEoeMB8GA1UdIwQYMBaAFO+9yI54efl2SxFZtsMyEAfA
+vOOKMA0GCSqGSIb3DQEBBQUAA4GBAD73xZRYLxjJESkpKDO752xwfPjHYErlN/K7
+eNlSHsKj3bF/2uGKi5x+1u7s75Q3tbiXJpIBVngVREuVTdlZErCJhuS1fbRzD/EN
+qARp5D8qamW5DpoG9xYplE2sZKvpDwY8dP5M4XGYvZ+7wS1HcGo8s3YL/MgF1k6/
+M5/dWHSc
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..51102e24a554
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8
+ Validity
+ Not Before: Nov 20 15:47:16 2009 GMT
+ Not After : Nov 14 15:47:16 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a1:55:67:7e:e5:7a:62:eb:2b:36:45:fa:1d:4d:
+ c7:0e:6d:db:f6:54:65:4d:55:39:14:ea:c1:ad:75:
+ 1b:2f:2f:3c:6e:67:e0:6d:c6:76:66:0c:11:a2:89:
+ fe:70:3b:24:3e:0d:2a:13:9f:86:b4:8a:a3:27:50:
+ 52:77:1f:b8:7b:85:4e:36:94:68:4f:23:2c:f6:a1:
+ 0f:01:bc:6d:d4:e9:a4:54:12:15:37:bd:6c:ba:ad:
+ ed:78:ed:00:cc:be:a9:20:99:f5:a5:db:96:ba:cb:
+ 89:6b:ff:30:36:5c:84:77:a8:0d:28:d3:f8:20:99:
+ 01:4d:0f:8e:b3:8e:de:8d:09
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Authority Information Access:
+ OCSP - URI:http://localhost:8889
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ FC:DC:A7:1C:CE:D2:A9:DA:9A:76:9D:AE:8F:C8:1E:56:BA:D2:D5:D5
+ X509v3 Authority Key Identifier:
+ keyid:EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 87:30:ed:08:e6:03:fa:cf:65:5a:ed:9e:83:db:64:5f:bb:6b:
+ 5c:f3:db:8d:b7:d0:95:35:8c:f6:c1:1c:2c:d9:0c:0a:41:27:
+ f9:1f:e4:aa:25:95:59:3c:45:85:ac:0f:02:42:92:67:e2:09:
+ 45:d3:c1:7b:6e:db:42:84:7b:0d:57:47:f5:07:38:dd:cf:38:
+ ac:29:b9:14:79:2e:04:a5:a0:d6:71:be:fa:6d:9e:b5:cd:89:
+ 99:d1:47:58:56:81:8c:d4:b0:96:c6:dc:a7:1b:b0:ef:6b:0c:
+ 25:5f:92:b8:01:b7:74:f0:e3:49:eb:30:29:9f:f3:b5:bd:ae:
+ 45:99
+-----BEGIN CERTIFICATE-----
+MIIC0jCCAjugAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MB4XDTA5
+MTEyMDE1NDcxNloXDTM0MTExNDE1NDcxNlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgODCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoVVnfuV6YusrNkX6HU3HDm3b9lRlTVU5
+FOrBrXUbLy88bmfgbcZ2ZgwRoon+cDskPg0qE5+GtIqjJ1BSdx+4e4VONpRoTyMs
+9qEPAbxt1OmkVBIVN71suq3teO0AzL6pIJn1pduWusuJa/8wNlyEd6gNKNP4IJkB
+TQ+Os47ejQkCAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG
+FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFPzc
+pxzO0qnamnadro/IHla60tXVMB8GA1UdIwQYMBaAFO+9yI54efl2SxFZtsMyEAfA
+vOOKMA0GCSqGSIb3DQEBBQUAA4GBAIcw7QjmA/rPZVrtnoPbZF+7a1zz24230JU1
+jPbBHCzZDApBJ/kf5KollVk8RYWsDwJCkmfiCUXTwXtu20KEew1XR/UHON3POKwp
+uRR5LgSloNZxvvptnrXNiZnRR1hWgYzUsJbG3KcbsO9rDCVfkrgBt3Tw40nrMCmf
+87W9rkWZ
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..6c934e3ec83f
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,D40C0B2149B20A3E
+
+u5VzDci4c2i/pIElAbIAVT81F72A2V3fpvZv8yUpQRai5ZPzciSc4oYgavdu3tLV
+p8bS+60akNpr3/ti7sB4tQBcql/3FMdKLFCgflJgCH9ivr2UrUSIJOyu9UNoG2ym
+UcJrvCSAqtksL11VLMb3SJO7TRYxJ/xOl69Auf0R+aRwdof9nSBO4jDPTqvR/X8L
+j/plBnw7ENO0ravRnEEEAEiSgx/z0LkhzAsPTkrrkNN5eZ+kR2Sk/Uo5aTx3FTpB
+RU+iZQxmbNTrxCErfYvSnMJ4w6soT+Bzezwfn2tVGLwbur/3gtuNMEHJpL0Y2st9
+aRBHHF6+DlJ30rqNWCVV5ZY+2wMUEPBtcRftLdmh3caw/9aN/NqVUGuvqmhWyTt7
+TJmnKLJhE9NSztQM2PuV7ka9jWp5D6KLv0g+cbedpEOw6VjYL5e1EKt0AOu4Pp2r
+HerL1ouRmpzIQLpskFTwkccjVDQm/H2fnB/nVrjdWxi/U4QJ0EPHL8iCyyox5np+
+3HilWBkpyBSvMOhyGfPkUucsMZA6O7/XhDcciBSsCJ4SSMa5gQmfYfixQHKRwixS
+O5sJADUnJkbo4hyvrptAolM/JJU+HN8IYnq541mJ72dXbyodheedRPIOpTCiLQam
+1Y04wfuIFMN4w98O0oMpCbqcDsOHysxN1XYg2kMzlxYbwooFC5cud5+cEW6d9FWQ
+kpZ8Wkigno3ytjpUXWb9TmsRcMNiQdgxlpkvN/eYhk4xsUpwzhA/M/HTkLkn8WtC
+52EwCv9KcxF31AA0lOeI+oNfcyMruwNXwEkFn3eD36axZQ8QjPHfhw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg
new file mode 100755
index 000000000000..177888124500
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+authorityInfoAccess = OCSP;URI:http://localhost:8889
+#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem
new file mode 100755
index 000000000000..0b38d4db4c7a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 9
+ Validity
+ Not Before: Nov 23 13:59:19 2009 GMT
+ Not After : Nov 17 13:59:19 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a9:6d:7f:6a:08:fb:e2:3a:5e:83:3f:ff:58:ba:
+ 92:a1:79:9d:ce:d2:0c:16:15:f2:7e:b3:e4:45:9c:
+ 02:32:65:9b:02:90:78:05:95:e4:04:1d:4a:05:bb:
+ ea:f6:ac:ab:15:74:c2:bc:ee:2a:c1:80:55:3e:93:
+ 1f:5c:94:eb:cf:cf:8f:15:eb:b8:22:fe:69:61:51:
+ a9:08:b8:80:bd:48:99:da:85:10:1c:75:97:fd:d3:
+ c3:c4:0b:dd:eb:01:12:5d:ee:62:62:c3:0c:18:ea:
+ ed:76:ff:9b:1c:1f:c7:81:f9:9a:cd:e5:25:89:b2:
+ 13:57:56:f3:27:53:72:76:69
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46
+ X509v3 Authority Key Identifier:
+ keyid:CD:33:5E:AB:73:23:51:80:B8:03:AD:12:01:0B:C5:5E:8E:55:CA:64
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 9
+ serial:A4:DB:16:0D:4B:8C:D4:A6
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 17:67:b0:21:da:0d:a1:fe:09:62:d0:cf:1d:c0:c8:bd:d4:22:
+ dd:75:ec:04:e2:23:ae:ea:8c:15:fa:73:2e:83:f4:16:eb:c1:
+ e1:87:36:bd:58:d0:64:e0:6e:2c:bc:27:cb:dc:4b:58:01:80:
+ 48:27:53:bb:75:85:a7:19:b8:e2:c0:1f:9f:a2:18:27:82:3f:
+ 25:bf:17:d1:34:32:de:c4:81:9d:8a:39:6f:6b:1f:b6:12:61:
+ 74:78:96:6d:6e:52:23:4a:67:30:78:03:91:b7:89:bf:3c:4a:
+ 36:e3:95:21:38:35:af:05:55:81:05:25:91:78:ca:2f:5d:79:
+ d2:05
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5MB4XDTA5MTEyMzEzNTkx
+OVoXDTM0MTExNzEzNTkxOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQCpbX9qCPviOl6DP/9YupKheZ3O0gwWFfJ+s+RFnAIyZZsCkHgFleQE
+HUoFu+r2rKsVdMK87irBgFU+kx9clOvPz48V67gi/mlhUakIuIC9SJnahRAcdZf9
+08PEC93rARJd7mJiwwwY6u12/5scH8eB+ZrN5SWJshNXVvMnU3J2aQIDAQABo4HH
+MIHEMB0GA1UdDgQWBBR701e/astsEIGR2pXciE+l0NvRRjCBkQYDVR0jBIGJMIGG
+gBTNM16rcyNRgLgDrRIBC8VejlXKZKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5ggkApNsWDUuM1KYwDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAXZ7Ah2g2h/gli0M8dwMi91CLddewE
+4iOu6owV+nMug/QW68Hhhza9WNBk4G4svCfL3EtYAYBIJ1O7dYWnGbjiwB+fohgn
+gj8lvxfRNDLexIGdijlvax+2EmF0eJZtblIjSmcweAORt4m/PEo245UhODWvBVWB
+BSWReMovXXnSBQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt
new file mode 100755
index 000000000000..8c466eaffd80
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt
@@ -0,0 +1 @@
+V 341117140202Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 9
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..e3ca26a8a386
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem
@@ -0,0 +1,58 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9
+ Validity
+ Not Before: Nov 23 14:02:02 2009 GMT
+ Not After : Nov 17 14:02:02 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 9
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f2:d3:15:3c:73:42:ce:22:e4:40:3a:6b:02:f6:
+ 59:bd:66:0d:87:91:f4:c0:be:a9:ce:33:21:09:d9:
+ 4e:4b:03:51:87:c3:e9:75:91:e9:80:5e:fc:a1:f7:
+ 43:9b:c6:32:af:6d:77:4b:b6:dc:b1:08:a3:1f:a0:
+ 6d:ec:81:12:23:48:36:2d:7a:5a:d0:88:88:49:7c:
+ ce:ae:98:45:d8:ff:9f:15:72:ab:b4:85:f6:a5:23:
+ af:43:e4:64:45:da:20:e1:e0:3e:f2:87:ea:67:ea:
+ 0e:08:8a:c8:1c:ef:85:a5:e6:f3:54:68:02:fd:de:
+ bc:4d:a2:eb:7d:0d:7d:80:59
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 1B:56:DD:11:CE:38:A0:97:FF:BE:39:9C:AF:F4:60:82:3A:CA:5D:51
+ X509v3 Authority Key Identifier:
+ keyid:7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 54:5e:40:1d:83:35:67:23:01:28:35:e3:02:7f:9e:9f:ce:83:
+ fb:45:dd:5c:96:62:f5:28:45:c8:90:2a:7e:84:88:e9:e9:b7:
+ 21:17:e0:3b:ea:de:6d:a1:d5:37:90:ae:15:86:30:7f:82:81:
+ d1:bb:ca:d2:6c:7c:39:2e:e9:65:57:2b:74:47:04:49:99:74:
+ 63:c7:03:cc:7d:f4:b0:6e:92:75:bb:aa:28:dc:71:d3:95:73:
+ 15:f4:4f:38:43:9e:4f:9f:e3:97:5c:8d:dc:1e:ad:ad:1e:b7:
+ c2:b2:ca:87:ee:8e:a2:93:12:60:95:1a:fb:bf:42:c8:31:48:
+ 8a:43
+-----BEGIN CERTIFICATE-----
+MIICnTCCAgagAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MB4XDTA5
+MTEyMzE0MDIwMloXDTM0MTExNzE0MDIwMlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgOTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA8tMVPHNCziLkQDprAvZZvWYNh5H0wL6p
+zjMhCdlOSwNRh8PpdZHpgF78ofdDm8Yyr213S7bcsQijH6Bt7IESI0g2LXpa0IiI
+SXzOrphF2P+fFXKrtIX2pSOvQ+RkRdog4eA+8ofqZ+oOCIrIHO+FpebzVGgC/d68
+TaLrfQ19gFkCAwEAAaNPME0wCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQbVt0Rzjig
+l/++OZyv9GCCOspdUTAfBgNVHSMEGDAWgBR701e/astsEIGR2pXciE+l0NvRRjAN
+BgkqhkiG9w0BAQUFAAOBgQBUXkAdgzVnIwEoNeMCf56fzoP7Rd1clmL1KEXIkCp+
+hIjp6bchF+A76t5todU3kK4VhjB/goHRu8rSbHw5LullVyt0RwRJmXRjxwPMffSw
+bpJ1u6oo3HHTlXMV9E84Q55Pn+OXXI3cHq2tHrfCssqH7o6ikxJglRr7v0LIMUiK
+Qw==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..be54b542a4b8
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,6D4A43A204C02659
+
+ZPB/XY3gNrLz1f2DqTRkoZiL64CjVUEPw6ujRi/cAaMfAB+p32O/obtFbMyZWfpv
+aLaoPmQH5hagNgsQqOW6OrSguxQ9i64Wv795TzRBrSYRHJ1as73AfDcS9aeI61AM
+kiweFkVFAOPfgKOczYO152uXxtdRm4kpVr/CMsYuViE7966dzFvjDlY4vTDAD32+
+KJemzfjwsyErT/nYJaaabEkxxn+O3nwhgVqueoYWI8VeLYotFU41wO1NrOQvshs0
+tyrs5meiuSNPVuKagTltWfHv9PlMyVne7XYiRv1k7CIPmEansBge9/lY5KoPLHGQ
+CHjuuwPykf6jnW7QG9IAGKRNPSdlMBpOT97EvKgNZ9I0FB4lSumhrxkjPHrRKz/J
+usV+mEcGGYrfAb2OT0B/YSddOk1rCtKXpRVUMF8dzD7AyVxnU0Sdub6lwjNojAGh
+Nb8exIFnVBM0/ka19xvlcdY0q9du7e0MuVvy8NhE0vkoqqDrUUnCP8iqg+uRBVts
+0P7yk1lucsrNw8JQveLuiHm6zxN91iUAsBguwoOHG6szp3X9GLvvGhpQWPxTIOyo
+obPMw6lY0y9MHY6eW9ekXVWGMZL2GDpIKLq9kqzLTqhY9kDw9OXYio4UYLl9vQG4
+Akr4ogzm8SKNQkPnGHprCdQV5J4V7fOa4HTNJb6NlTvMFuC99Sst+PYdE4RAn3sT
+Jn+Lj2g0fDDSjvLNohmrT08DAYAAinbNt/+6gI975syPxuqxggrgfis4cliI7pf8
+ecmKIoSlbsJVCSfgd5a/d7e+9KwNuqBqopLu2vfgUN1YiFlEwAEQaQ==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg
new file mode 100755
index 000000000000..a9628b957b3a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8889
+#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt
new file mode 100755
index 000000000000..e020f03a5477
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt
@@ -0,0 +1,4 @@
+Revoked certificates:
+
+- User 2 Sub CA 2 Root 4
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem
new file mode 100755
index 000000000000..9d951ee26728
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4
+ Validity
+ Not Before: Nov 20 09:22:27 2009 GMT
+ Not After : Nov 14 09:22:27 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e5:8d:27:4e:09:53:08:61:c6:23:25:9e:dd:9c:
+ 07:bf:81:38:5c:5c:10:8f:e4:12:2f:4e:2e:b1:a1:
+ cf:21:46:53:bf:e8:5e:de:17:3a:9d:f7:e8:ef:3e:
+ 9c:b4:29:37:4c:31:35:15:dc:98:e0:93:9c:ce:6a:
+ d6:e1:35:19:6b:d4:1d:3b:81:86:b1:e7:ff:1f:b8:
+ 34:a9:f9:de:4d:b8:62:ac:3b:d4:58:8e:5c:76:b5:
+ 07:7f:32:8a:3a:90:73:71:d5:da:f1:79:39:14:ed:
+ 1b:f1:8a:3e:be:48:bc:07:ec:f9:7c:03:14:fc:e7:
+ 55:a3:65:81:c7:6c:70:0b:ff
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D
+ X509v3 Authority Key Identifier:
+ keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4
+ serial:A2:93:46:74:3B:A6:E3:AD
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ bc:cf:43:eb:72:b1:71:a7:94:8e:cd:5b:fc:d8:21:31:83:db:
+ a9:de:c7:5b:14:e5:7b:90:43:e6:05:df:db:6e:95:5f:24:ac:
+ 0c:a1:8a:ac:c6:cf:f2:03:cd:a0:30:ae:d3:a9:41:07:c9:b1:
+ be:4b:e0:fc:a2:76:09:07:75:6a:fa:e4:2f:a3:3a:cd:81:68:
+ ab:f6:06:c4:32:08:25:6e:e8:e7:36:9c:1a:f7:42:73:f8:b0:
+ d8:42:3e:85:c2:11:23:10:d6:6a:e4:8f:53:cb:8b:8b:1b:5a:
+ 4d:6d:9d:34:45:26:52:d2:ee:6d:8f:23:ff:00:92:f5:99:62:
+ 4c:41
+-----BEGIN CERTIFICATE-----
+MIIDBjCCAm+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA5MjIy
+N1oXDTM0MTExNDA5MjIyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDljSdOCVMIYcYjJZ7dnAe/gThcXBCP5BIvTi6xoc8hRlO/6F7eFzqd
+9+jvPpy0KTdMMTUV3Jjgk5zOatbhNRlr1B07gYax5/8fuDSp+d5NuGKsO9RYjlx2
+tQd/Moo6kHNx1drxeTkU7Rvxij6+SLwH7Pl8AxT851WjZYHHbHAL/wIDAQABo4HH
+MIHEMB0GA1UdDgQWBBRp3raZxJX3WvpBa0z2w22JqjcxnTCBkQYDVR0jBIGJMIGG
+gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/
+BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQC8z0PrcrFxp5SOzVv82CExg9up3sdb
+FOV7kEPmBd/bbpVfJKwMoYqsxs/yA82gMK7TqUEHybG+S+D8onYJB3Vq+uQvozrN
+gWir9gbEMgglbujnNpwa90Jz+LDYQj6FwhEjENZq5I9Ty4uLG1pNbZ00RSZS0u5t
+jyP/AJL1mWJMQQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt
new file mode 100755
index 000000000000..554a773b4a6d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114093339Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 4
+R 341114095105Z 091120095246Z,keyCompromise 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 4
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..3fbf2133fb9c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4
+ Validity
+ Not Before: Nov 20 09:33:39 2009 GMT
+ Not After : Nov 14 09:33:39 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:c6:b2:8e:e4:f1:67:0b:07:3c:8c:b8:78:d9:79:
+ b1:2e:d5:10:c5:e8:76:9a:25:3f:dd:a3:0b:e0:3f:
+ 9f:50:87:e9:f1:15:74:86:ce:a0:01:07:b2:37:d0:
+ 74:dc:96:69:b4:f1:0e:cd:15:37:ca:ba:ed:ea:a3:
+ 99:ec:43:d4:ac:1c:8b:9b:18:d0:cd:80:78:49:80:
+ ca:e3:85:c6:2d:9a:15:02:73:d3:97:08:1d:4b:68:
+ 95:52:e6:92:57:c7:f6:76:0c:f1:a7:3d:90:10:0c:
+ 35:a8:9c:d3:e4:10:30:20:04:7f:ea:ad:ef:39:0c:
+ 65:05:43:f4:b6:51:3a:e7:95
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 79:C2:63:88:76:DF:C6:6F:BD:1D:AF:57:6E:87:08:AC:55:5D:AD:D1
+ X509v3 Authority Key Identifier:
+ keyid:69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 07:68:5f:e9:01:bc:e4:d7:78:16:2b:19:7f:c2:9d:15:74:91:
+ ea:6d:fb:c9:ee:29:07:ff:62:e2:6a:85:5e:85:7d:5f:b4:bc:
+ 48:e1:89:24:3e:03:21:42:c1:10:3f:c6:41:7e:04:30:86:db:
+ c5:7e:7e:9f:04:49:a0:1e:fc:93:8e:b3:d1:cf:39:e3:41:89:
+ c3:06:51:3f:15:d5:02:49:2a:0b:15:d1:25:30:12:b6:2a:f9:
+ 03:06:f1:03:84:ae:4e:86:e1:dc:e6:a3:36:a4:27:24:2b:db:
+ 3a:3c:15:48:6f:c7:9f:ce:38:34:06:94:e3:d3:64:f7:4d:9e:
+ b6:c0
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MB4XDTA5
+MTEyMDA5MzMzOVoXDTM0MTExNDA5MzMzOVowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgNDCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxrKO5PFnCwc8jLh42XmxLtUQxeh2miU/
+3aML4D+fUIfp8RV0hs6gAQeyN9B03JZptPEOzRU3yrrt6qOZ7EPUrByLmxjQzYB4
+SYDK44XGLZoVAnPTlwgdS2iVUuaSV8f2dgzxpz2QEAw1qJzT5BAwIAR/6q3vOQxl
+BUP0tlE655UCAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUecJjiHbfxm+9
+Ha9XbocIrFVdrdEwHwYDVR0jBBgwFoAUad62mcSV91r6QWtM9sNtiao3MZ0wDQYJ
+KoZIhvcNAQEFBQADgYEAB2hf6QG85Nd4FisZf8KdFXSR6m37ye4pB/9i4mqFXoV9
+X7S8SOGJJD4DIULBED/GQX4EMIbbxX5+nwRJoB78k46z0c8540GJwwZRPxXVAkkq
+CxXRJTAStir5AwbxA4SuTobh3OajNqQnJCvbOjwVSG/Hn844NAaU49Nk902etsA=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem
new file mode 100755
index 000000000000..595fbbfafb1e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem
@@ -0,0 +1,60 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4098 (0x1002)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4
+ Validity
+ Not Before: Nov 20 09:51:05 2009 GMT
+ Not After : Nov 14 09:51:05 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 4
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f5:2d:4a:b8:5d:39:da:58:5c:3c:a5:7d:4c:98:
+ b8:32:db:43:a0:13:cb:25:f8:5b:0b:6a:f2:e0:8d:
+ de:8f:c6:ea:c5:1c:03:bf:e0:b1:c9:14:a4:85:4b:
+ ed:95:87:f7:88:88:86:9e:65:3d:6e:e8:c5:be:17:
+ e6:9b:09:8e:44:c1:0a:20:00:ae:b4:3d:ba:68:9f:
+ 3e:ea:76:3c:96:64:ee:a7:91:65:31:03:f5:fd:01:
+ e5:60:a0:5e:62:a0:37:7b:db:cf:71:78:58:cc:dd:
+ 74:fc:b3:b1:2e:6b:f3:ec:ad:ac:75:ae:d8:d6:42:
+ 28:0a:20:68:8d:20:4a:30:61
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 32:E4:11:DF:CD:54:D6:80:67:68:85:36:A0:C5:14:88:D6:85:DB:C9
+ X509v3 Authority Key Identifier:
+ keyid:69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D
+
+ Signature Algorithm: sha1WithRSAEncryption
+ e1:c2:5d:63:42:27:f4:df:a2:f0:f5:61:c3:e3:ac:f7:b6:29:
+ a9:dd:34:63:0c:cc:c9:7b:5c:1b:ac:77:8f:1a:e1:f4:3b:c8:
+ 96:8a:89:f6:c0:f0:c4:3b:bd:6e:b7:e7:84:5c:38:4f:d3:66:
+ 55:d6:d3:f8:70:1f:14:ce:9f:d3:04:68:be:6b:81:fc:6c:b6:
+ 2f:31:3d:de:2a:4e:6c:66:c0:c2:09:c8:ef:be:c4:88:39:28:
+ e8:62:da:44:63:f4:5c:f4:bb:cf:4b:54:c9:c0:ce:b4:27:7b:
+ 1e:9c:2f:90:9e:18:da:8a:27:af:e5:37:ea:3f:99:86:f8:5d:
+ d1:cb
+-----BEGIN CERTIFICATE-----
+MIICyzCCAjSgAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MB4XDTA5
+MTEyMDA5NTEwNVoXDTM0MTExNDA5NTEwNVowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgNDCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA9S1KuF052lhcPKV9TJi4MttDoBPLJfhb
+C2ry4I3ej8bqxRwDv+CxyRSkhUvtlYf3iIiGnmU9bujFvhfmmwmORMEKIACutD26
+aJ8+6nY8lmTup5FlMQP1/QHlYKBeYqA3e9vPcXhYzN10/LOxLmvz7K2sda7Y1kIo
+CiBojSBKMGECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P
+cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUMuQR381U1oBn
+aIU2oMUUiNaF28kwHwYDVR0jBBgwFoAUad62mcSV91r6QWtM9sNtiao3MZ0wDQYJ
+KoZIhvcNAQEFBQADgYEA4cJdY0In9N+i8PVhw+Os97Ypqd00YwzMyXtcG6x3jxrh
+9DvIloqJ9sDwxDu9brfnhFw4T9NmVdbT+HAfFM6f0wRovmuB/Gy2LzE93ipObGbA
+wgnI777EiDko6GLaRGP0XPS7z0tUycDOtCd7HpwvkJ4Y2oonr+U36j+Zhvhd0cs=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..a8f9640c8a3d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,1BD121CFCC6764E4
+
+k3SMhf7UEWvpfhEyvd7Zc6kJFmiZ1JTg7KAawQhFhoRbGIVA1rSmRbuBdJm4XdQ5
+OxEAC5bVx5o3yxyhGmEkZr1dkGXkzQ1tc2a4Exf2p0O5zjlHUaxd2A4/mRYVAT0e
+LAIQ+D+yqSd2wmLkLaz3EGGlfIPS8amTpnhSOvai40NjbLlRpw5DqDP/2KVWp7jH
+T4JNzU33Xd6QuBsTSWyXuhIEeuzyrDbou0LceHIZSaa8Jqvp3yKX6OBTUdCNakwR
+QtLLag63ie87qEhqeHg2VvZuVVEyhNCjPf2zRfxsCx742wI4TyY28JpxjYlFzJxX
+Zd9toqIGFwritEOcr6wAqVX7NlE8/dDFFdEK9fPuv/jLoOYCCwDRvIMgDTE76c1k
+foRMDMmqe0KcMdp+fbcfNDnV/U8gle2902AbEOXJLhdDEVUG/LCwrnIeUrfMOKiY
+LwPysGwVndUb3uTFJ2e+PqV9i96G+ewpN9/hI9fThE12t8rhkpIsozEMl7WsBMgD
+tdKrA5l7eibshCpk+zkIwGhkdMYXhj7hmioWWBJeMdJ93Ba8f91kt1IvI+J2Mn2K
+1/5D0ZKEGPoTSAlEgMZ888sYWkT6WMk0UXH2Nq8BqdrrSTUypY2Uz0nDbWvhLrCf
+zac6RZu9TtFsKAY6CQnXHFUJ+dvRmcSNQMhrIKS2VZ2UkL2oXASzXW2c9Hx6LO7T
+WHuR7bXZiJhI63gUGI9pMRCs5NoRuXdg3KutzSTy8EWKJDXDKcvTemiomUZFB6i5
+zduXL73Wf/VjMcs7iOAijd7czGre0LBwyvgeNUAK2gj7SaGkR3bPZg==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial
new file mode 100755
index 000000000000..baccd0398f98
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial
@@ -0,0 +1 @@
+1003
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg
new file mode 100755
index 000000000000..5f9493f47e9b
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt
new file mode 100755
index 000000000000..e04f69532d14
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt
@@ -0,0 +1,12 @@
+Revoked certificates:
+
+- User 2 Sub 2 Root 7
+
+
+To provide the CRL via HTTP run
+
+java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902
+
+
+
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem
new file mode 100755
index 000000000000..0d2a0f02a3eb
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7
+ Validity
+ Not Before: Nov 20 13:35:06 2009 GMT
+ Not After : Nov 14 13:35:06 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:f9:3f:5e:76:52:9a:ce:5d:98:b0:00:d8:e0:65:
+ e7:78:11:4c:7b:c7:e2:d3:44:bf:8e:60:42:69:3e:
+ 75:67:65:24:ab:f7:07:d8:9d:be:0f:23:b5:c1:26:
+ 00:6b:c3:22:84:72:a9:96:dc:5f:63:fc:f5:e0:e3:
+ cc:da:0c:74:e9:31:51:91:89:27:8f:e5:17:41:6e:
+ 3d:5e:2a:13:cd:08:f7:f3:61:34:a1:f7:79:c6:bd:
+ 5d:2c:34:01:ea:5a:8c:48:97:36:d6:57:e0:80:03:
+ 2e:7a:03:83:4c:bd:b4:af:a2:fd:d7:4b:1a:f7:ab:
+ 9f:5a:22:2b:d1:25:73:dd:6f
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92
+ X509v3 Authority Key Identifier:
+ keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7
+ serial:D5:E6:63:5F:18:09:82:89
+
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8901/demoCA/crl/Root_7.crl
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 5f:b4:70:11:4f:d9:df:6a:6a:5a:4a:97:fe:8b:5d:9e:46:84:
+ e2:27:67:41:7c:a9:2e:9d:77:cc:e4:8c:d6:16:3c:39:7d:51:
+ 29:60:80:32:4f:a1:d0:b4:7f:2a:e5:60:f4:b8:d3:3b:94:f8:
+ a5:fb:15:99:cf:a9:c5:a7:59:c1:11:89:67:11:9c:ff:a9:ac:
+ dd:ca:a9:92:a8:60:26:c3:ab:74:41:86:b9:4d:1e:4a:c5:de:
+ 63:e6:da:2a:36:39:7b:6c:66:f3:20:57:d1:f1:36:4b:69:c5:
+ 04:a3:1f:cf:de:0c:10:d0:3f:07:e2:8e:0f:cd:41:26:c9:2e:
+ e9:1b
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMzUw
+NloXDTM0MTExNDEzMzUwNlowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQD5P152UprOXZiwANjgZed4EUx7x+LTRL+OYEJpPnVnZSSr9wfYnb4P
+I7XBJgBrwyKEcqmW3F9j/PXg48zaDHTpMVGRiSeP5RdBbj1eKhPNCPfzYTSh93nG
+vV0sNAHqWoxIlzbWV+CAAy56A4NMvbSvov3XSxr3q59aIivRJXPdbwIDAQABo4IB
+BjCCAQIwHQYDVR0OBBYEFDtQJkVs4v4osXEKqJUteGOOLEiSMIGRBgNVHSMEgYkw
+gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G
+A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT
+C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E
+NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290
+XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAX7RwEU/Z
+32pqWkqX/otdnkaE4idnQXypLp13zOSM1hY8OX1RKWCAMk+h0LR/KuVg9LjTO5T4
+pfsVmc+pxadZwRGJZxGc/6ms3cqpkqhgJsOrdEGGuU0eSsXeY+baKjY5e2xm8yBX
+0fE2S2nFBKMfz94MENA/B+KOD81BJsku6Rs=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl
new file mode 100755
index 000000000000..c4dd13d8390d
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt
new file mode 100755
index 000000000000..a5e282ddd15e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114134608Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 7
+R 341114135230Z 091120135413Z,CACompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 7
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem
new file mode 100755
index 000000000000..ff1f1fa667a8
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4096 (0x1000)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7
+ Validity
+ Not Before: Nov 20 13:46:08 2009 GMT
+ Not After : Nov 14 13:46:08 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a7:6b:af:a2:6e:61:33:2e:71:7b:e2:38:44:d9:
+ 4c:da:6e:86:bb:c6:f5:64:8e:2e:8b:e8:71:c8:46:
+ ad:c5:46:05:d2:06:a6:89:e2:ce:1f:1c:a7:4c:94:
+ a4:24:56:93:07:b1:c4:52:44:69:27:0b:34:eb:31:
+ 20:71:63:5c:0a:33:aa:0c:39:71:ac:08:49:c3:66:
+ ac:cb:e3:a8:66:ab:5c:a2:00:7a:bb:24:e6:93:91:
+ 1e:0e:7c:83:9e:f2:10:87:3f:0e:c0:f6:e5:bf:2c:
+ d3:cc:17:4c:d5:9a:96:35:4b:4e:ca:72:3a:9b:90:
+ c8:4c:24:04:2f:51:99:20:95
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 27:98:7E:F6:AD:82:6D:F4:7A:32:AE:F1:54:D1:07:AE:08:0E:0E:2B
+ X509v3 Authority Key Identifier:
+ keyid:3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 06:7d:0a:e8:fa:8b:87:1d:75:61:2b:c7:d1:6d:56:5f:26:e3:
+ 29:b4:c3:27:05:35:0f:b7:c1:20:42:95:0b:9d:34:16:5d:9b:
+ c2:48:c8:67:e1:e7:43:eb:10:9e:45:3e:44:da:7c:4b:19:05:
+ 00:66:91:83:ea:82:86:48:e8:87:ea:a0:9f:c9:1d:f8:af:13:
+ fd:2e:4e:50:7e:a0:d2:b0:5e:a4:6f:dd:e6:c8:11:60:bc:41:
+ e5:b6:01:4c:7a:af:32:f6:cc:5b:57:e6:e4:87:21:ec:17:98:
+ 67:eb:4d:2f:07:db:8f:70:e2:f3:77:8f:c7:ff:60:d6:d9:f7:
+ 82:e3
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MB4XDTA5
+MTEyMDEzNDYwOFoXDTM0MTExNDEzNDYwOFowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgNzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp2uvom5hMy5xe+I4RNlM2m6Gu8b1ZI4u
+i+hxyEatxUYF0gamieLOHxynTJSkJFaTB7HEUkRpJws06zEgcWNcCjOqDDlxrAhJ
+w2asy+OoZqtcogB6uyTmk5EeDnyDnvIQhz8OwPblvyzTzBdM1ZqWNUtOynI6m5DI
+TCQEL1GZIJUCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMl9Sb290XzcuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUJ5h+9q2CbfR6Mq7xVNEHrggODiswHwYDVR0jBBgw
+FoAUO1AmRWzi/iixcQqolS14Y44sSJIwDQYJKoZIhvcNAQEFBQADgYEABn0K6PqL
+hx11YSvH0W1WXybjKbTDJwU1D7fBIEKVC500Fl2bwkjIZ+HnQ+sQnkU+RNp8SxkF
+AGaRg+qChkjoh+qgn8kd+K8T/S5OUH6g0rBepG/d5sgRYLxB5bYBTHqvMvbMW1fm
+5Ich7BeYZ+tNLwfbj3Di83ePx/9g1tn3guM=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem
new file mode 100755
index 000000000000..f16cdf4aab53
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7
+ Validity
+ Not Before: Nov 20 13:52:30 2009 GMT
+ Not After : Nov 14 13:52:30 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 7
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d3:1f:7e:28:b6:fd:f0:bb:01:21:88:04:c4:da:
+ 3d:6a:ce:09:8e:04:29:a5:0f:38:db:74:d0:ee:ad:
+ 5c:95:79:16:11:c0:b1:51:69:95:bb:a8:8f:8b:1c:
+ 7b:8c:82:27:16:21:82:82:d7:36:6f:b3:bb:36:a8:
+ ad:69:e2:e3:cd:6f:ef:81:ac:fa:e3:a9:ac:86:b7:
+ 31:1d:75:11:a3:2e:1d:89:0b:9c:5e:03:45:7a:b0:
+ a9:9d:ee:31:f1:15:c1:c5:f6:26:8e:d4:89:72:8f:
+ f4:86:94:d1:49:37:24:56:84:10:db:cc:f2:1d:3e:
+ 58:66:97:b2:17:6f:15:cb:81
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 CRL Distribution Points:
+ URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ CD:A2:AE:51:D0:CF:A2:89:3A:53:23:74:1D:69:10:EE:2A:40:3A:22
+ X509v3 Authority Key Identifier:
+ keyid:3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 40:8a:be:55:1f:d9:0f:96:fd:54:dd:9f:6b:1d:b1:34:ed:b7:
+ 11:6d:72:a9:65:9a:39:bd:79:3b:d3:4e:0c:22:60:39:e8:c0:
+ 2c:34:64:09:2c:0c:aa:f7:f9:9d:f1:d9:b9:04:d6:e2:c4:cb:
+ d5:05:33:75:5e:87:c0:2c:80:06:8b:6e:9c:ad:0c:7f:03:c0:
+ f5:91:e4:3a:64:b9:52:3b:5a:e0:e5:79:32:89:fb:4a:54:68:
+ 9a:e6:72:3e:61:93:a3:2a:67:aa:95:d0:3d:37:33:5c:da:6e:
+ a6:ac:3d:b6:b1:ac:68:f0:8c:8b:6b:96:a5:f7:ed:2d:6e:64:
+ c7:11
+-----BEGIN CERTIFICATE-----
+MIIC5jCCAk+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MB4XDTA5
+MTEyMDEzNTIzMFoXDTM0MTExNDEzNTIzMFowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgNzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0x9+KLb98LsBIYgExNo9as4JjgQppQ84
+23TQ7q1clXkWEcCxUWmVu6iPixx7jIInFiGCgtc2b7O7NqitaeLjzW/vgaz646ms
+hrcxHXURoy4diQucXgNFerCpne4x8RXBxfYmjtSJco/0hpTRSTckVoQQ28zyHT5Y
+ZpeyF28Vy4ECAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j
+YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMl9Sb290XzcuY3JsMAsGA1Ud
+DwQEAwIF4DAdBgNVHQ4EFgQUzaKuUdDPook6UyN0HWkQ7ipAOiIwHwYDVR0jBBgw
+FoAUO1AmRWzi/iixcQqolS14Y44sSJIwDQYJKoZIhvcNAQEFBQADgYEAQIq+VR/Z
+D5b9VN2fax2xNO23EW1yqWWaOb15O9NODCJgOejALDRkCSwMqvf5nfHZuQTW4sTL
+1QUzdV6HwCyABotunK0MfwPA9ZHkOmS5Ujta4OV5Mon7SlRomuZyPmGToypnqpXQ
+PTczXNpupqw9trGsaPCMi2uWpfftLW5kxxE=
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..1f95ffa3c3f3
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,70BBA561902B1296
+
++Pbay3A7tcxOMNFXIlyQ6Hpl4QxJJmzZzXT5UOfGZYYRYrFKv1489pqvzLNgp06z
+nWvyILc3AUd4dWnzfkWvPN3fjJazGWXoZaYLfGgdccA0LdXh+TmqVHHxFjOZVFeO
+lYlKqK6dUsybaciOhkYBKPs1ZFAaNtQLZc1/GVAA9jVYnfwNVmW14d5Q8gurZTp8
+qYwQmT9Sjm2j9USIFcD9MDH94gW77PI+XD1hu6PJTF8m7n8eSY9KcWfVmd/Qj9Ly
+nzLRaS6SOKETWL4+fUaN6aDtddKGwFgagyDwlRRuizX18ZSue2qoK73AhLtZ8Gx/
+vgFLTsvcniZus9kzVrRm2dsWvzaVAmOwqN04IqD6bEr+kXq1obP/T+deGsRwR54K
+wEy7NrkkMSGw4AOuxVNSO7NYgU2kXueAfvGU8SQiXuU1S7fdZpWci8T5Dm7FuP9B
+iKsHqUH9GYgAVl+Y3dwa9n+mDaFkn4wxeVHDdL40XJT0LYCMz9PGKRy3JSTiHF//
+j9BHDpIC+E8L9N01cJ74+p0bzLLOhZ7vyjx8umVJbNIAAlDbCrEi4ZFqwGvmdjHF
+2dti2S0ALixAFQybub4s9Cp3QxfaWnYQOvV7A0SGhtHkjycaJwO0cSonQ8yEjJJJ
+PQkIW9SK+xz/yDYMHqa/Yo5t53GkpCTKBo2STSdnXjnABNk3FAusf72POkIPcH99
+5uyje8bo+lS2VB/O/pm8tbf9mW9YEh/xd3VAglWiAMzYSfO1x0rSTpdqJMSDfOhK
+ogim9NdrVwASi0JrE8nCovwO3auOPu+5sRvYstnt18IVNisZZoW/Qg==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial
new file mode 100755
index 000000000000..7d802a3e7104
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial
@@ -0,0 +1 @@
+1002
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg
new file mode 100755
index 000000000000..a0556456eaf7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt
new file mode 100755
index 000000000000..645ae6037dea
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt
@@ -0,0 +1,13 @@
+Revoked certificates:
+
+- User 2 Sub CA 2 Root 8
+
+
+Start the OCSP responder:
+openssl ocsp -index demoCA/index.txt -port 8889 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text
+
+
+
+
+
+
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem
new file mode 100755
index 000000000000..26368962e8d0
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem
@@ -0,0 +1,66 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4097 (0x1001)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8
+ Validity
+ Not Before: Nov 20 15:55:33 2009 GMT
+ Not After : Nov 14 15:55:33 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:e9:91:38:d8:c1:36:e5:c1:d0:32:e8:ae:02:11:
+ 97:e5:c5:07:8f:5b:46:3a:3c:d9:49:5e:9a:4b:51:
+ 4c:b7:7d:e9:d1:4f:a7:15:8c:c6:10:f6:fa:5f:a9:
+ 0b:1b:bc:de:56:f5:ad:a3:a0:40:f1:75:10:58:74:
+ 37:f9:b7:9f:76:ca:46:96:4c:1a:81:f4:a2:ce:88:
+ 8b:9e:00:6d:42:b3:d6:68:d1:67:d6:9f:b8:9c:3f:
+ 43:c7:36:bf:41:88:1b:e8:74:26:a0:51:5c:e2:ee:
+ 6d:9d:73:bb:0d:36:e1:5c:68:9f:21:3b:b2:aa:ed:
+ 39:1d:ae:fc:b4:ca:38:c2:fb
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Subject Key Identifier:
+ 1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73
+ X509v3 Authority Key Identifier:
+ keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19
+ DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8
+ serial:B2:47:DE:6A:2A:4C:83:19
+
+ Authority Information Access:
+ OCSP - URI:http://localhost:8888
+
+ X509v3 Basic Constraints: critical
+ CA:TRUE
+ Signature Algorithm: sha1WithRSAEncryption
+ 89:f8:8d:a8:e5:0b:2a:fb:f3:6a:80:2c:26:a1:a7:36:7e:a0:
+ c5:61:65:9d:7e:d6:47:60:b4:f6:72:e9:6e:2c:d9:f8:7f:c8:
+ 7a:5d:75:98:ad:88:de:e7:1b:44:a3:96:37:84:c0:b3:20:98:
+ 3b:b5:f6:ee:70:9c:04:7a:6c:88:05:75:7f:12:cf:b9:76:e8:
+ c0:17:0c:5e:eb:10:38:1e:54:41:58:56:f6:3c:ec:07:a5:c0:
+ 74:24:34:af:b3:c7:b2:58:85:47:0f:6c:e4:a0:9f:c8:7b:5c:
+ 95:77:17:e5:ad:eb:c3:86:44:f7:81:ef:cb:58:12:1a:6a:c7:
+ 19:95
+-----BEGIN CERTIFICATE-----
+MIIDOTCCAqKgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1NTUz
+M1oXDTM0MTExNDE1NTUzM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1
+cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu
+dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDpkTjYwTblwdAy6K4CEZflxQePW0Y6PNlJXppLUUy3fenRT6cVjMYQ
+9vpfqQsbvN5W9a2joEDxdRBYdDf5t592ykaWTBqB9KLOiIueAG1Cs9Zo0WfWn7ic
+P0PHNr9BiBvodCagUVzi7m2dc7sNNuFcaJ8hO7Kq7Tkdrvy0yjjC+wIDAQABo4H6
+MIH3MB0GA1UdDgQWBBQbq2sPQpHcHtR6lYcwLcwRTzW3czCBkQYDVR0jBIGJMIGG
+gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH
+AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCJ+I2o5Qsq+/NqgCwmoac2fqDF
+YWWdftZHYLT2culuLNn4f8h6XXWYrYje5xtEo5Y3hMCzIJg7tfbucJwEemyIBXV/
+Es+5dujAFwxe6xA4HlRBWFb2POwHpcB0JDSvs8eyWIVHD2zkoJ/Ie1yVdxflrevD
+hkT3ge/LWBIaascZlQ==
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
new file mode 100755
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl
new file mode 100755
index 000000000000..f4e88754b5e0
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber
new file mode 100755
index 000000000000..dd11724042e2
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber
@@ -0,0 +1 @@
+1001
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt
new file mode 100755
index 000000000000..cdace00f7e8a
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt
@@ -0,0 +1,2 @@
+V 341114161332Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 8
+R 341114161602Z 091120161700Z,superseded 1003 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 8
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr
new file mode 100755
index 000000000000..8f7e63a3475c
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem
new file mode 100755
index 000000000000..1107a4327fc1
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4098 (0x1002)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8
+ Validity
+ Not Before: Nov 20 16:13:32 2009 GMT
+ Not After : Nov 14 16:13:32 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:d2:f6:25:c0:95:4b:07:1e:a0:57:67:52:36:b3:
+ 3e:5d:32:7f:61:25:e9:dd:31:a1:67:6e:02:9f:4f:
+ ca:ff:82:50:64:2e:ed:4e:8d:09:73:48:91:e1:90:
+ ca:df:06:ab:f4:c3:3d:8b:7d:d1:6b:5f:f8:f8:d6:
+ c0:f4:81:59:7c:0e:53:32:a9:cd:e4:34:3c:20:a9:
+ 08:b6:c2:b3:b7:91:d2:db:46:06:09:55:ff:f9:f4:
+ 4e:2a:28:36:46:0e:04:f1:78:7d:a3:ff:ac:08:1b:
+ 21:99:f5:b4:5b:f6:be:fd:1a:89:26:4b:eb:b9:58:
+ fc:c2:5f:44:42:a9:00:76:ff
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Authority Information Access:
+ OCSP - URI:http://localhost:8889
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 9D:91:CD:7F:70:3B:00:C1:2A:FD:2F:5D:64:C4:8F:EB:0E:37:25:1B
+ X509v3 Authority Key Identifier:
+ keyid:1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 2c:68:5e:5b:2e:d7:48:ca:2a:01:b4:a0:99:0e:06:2d:e8:23:
+ b3:66:31:97:cd:9e:73:61:35:af:9d:d9:2f:7c:e6:87:7f:2a:
+ ae:3e:b0:99:c9:20:10:30:e3:a0:5b:28:8b:57:f2:12:3a:87:
+ c1:7a:5e:c8:21:b9:ae:49:c1:aa:4f:1c:9e:a8:ae:0f:ad:a2:
+ 3e:aa:61:94:64:41:f8:d7:19:8d:a1:be:c0:15:04:25:2c:35:
+ 29:af:00:1e:40:7c:e7:d7:41:89:a7:ab:2d:dd:78:dd:c7:ba:
+ d0:1b:7b:68:fa:7e:a4:0f:4c:ab:02:6e:d2:ff:b8:5b:05:f6:
+ 47:29
+-----BEGIN CERTIFICATE-----
+MIIC0jCCAjugAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MB4XDTA5
+MTEyMDE2MTMzMloXDTM0MTExNDE2MTMzMlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgODCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0vYlwJVLBx6gV2dSNrM+XTJ/YSXp3TGh
+Z24Cn0/K/4JQZC7tTo0Jc0iR4ZDK3war9MM9i33Ra1/4+NbA9IFZfA5TMqnN5DQ8
+IKkItsKzt5HS20YGCVX/+fROKig2Rg4E8Xh9o/+sCBshmfW0W/a+/RqJJkvruVj8
+wl9EQqkAdv8CAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG
+FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFJ2R
+zX9wOwDBKv0vXWTEj+sONyUbMB8GA1UdIwQYMBaAFBuraw9Ckdwe1HqVhzAtzBFP
+NbdzMA0GCSqGSIb3DQEBBQUAA4GBACxoXlsu10jKKgG0oJkOBi3oI7NmMZfNnnNh
+Na+d2S985od/Kq4+sJnJIBAw46BbKItX8hI6h8F6Xsghua5JwapPHJ6org+toj6q
+YZRkQfjXGY2hvsAVBCUsNSmvAB5AfOfXQYmnqy3deN3HutAbe2j6fqQPTKsCbtL/
+uFsF9kcp
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem
new file mode 100755
index 000000000000..53268ff52df7
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem
@@ -0,0 +1,62 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 4099 (0x1003)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8
+ Validity
+ Not Before: Nov 20 16:16:02 2009 GMT
+ Not After : Nov 14 16:16:02 2034 GMT
+ Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 8
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:b4:58:05:7c:f5:f2:48:af:35:03:82:62:af:d3:
+ ef:50:f0:0b:b1:a9:a1:9b:14:1c:54:a9:71:b4:f6:
+ e0:7d:8a:25:b3:21:e2:53:ab:a5:08:9e:ed:5a:ef:
+ 8b:4f:be:75:40:b0:10:05:eb:08:3b:94:c2:57:37:
+ 51:41:08:57:b9:1c:a5:2f:e9:cc:3c:a8:70:2b:eb:
+ 00:92:43:64:44:18:23:9f:85:5f:7f:a5:c9:30:b3:
+ 14:c0:2b:fc:94:a5:a6:ad:46:a8:37:12:20:ab:cf:
+ e0:02:74:5d:1f:2e:ec:1c:9f:27:1f:83:fc:c4:62:
+ d2:0b:6b:f4:65:21:1d:94:ff
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ Authority Information Access:
+ OCSP - URI:http://localhost:8889
+
+ X509v3 Key Usage:
+ Digital Signature, Non Repudiation, Key Encipherment
+ X509v3 Subject Key Identifier:
+ 1E:C7:A3:43:33:6B:EC:90:B5:66:81:64:D6:43:72:45:DB:D9:E4:57
+ X509v3 Authority Key Identifier:
+ keyid:1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73
+
+ Signature Algorithm: sha1WithRSAEncryption
+ a8:66:0d:4b:6a:00:fc:31:e3:f5:8f:49:44:3d:60:26:76:2e:
+ 51:f8:41:35:3b:5b:7f:87:e3:00:d7:ae:85:bb:d9:81:a5:30:
+ db:6a:0a:a0:d2:e8:69:f5:47:d8:19:e5:2a:bd:c5:8e:99:f9:
+ 57:fc:b0:64:f5:43:bc:37:4a:8e:28:70:a4:6d:7d:da:2c:9e:
+ c1:55:8d:00:89:fe:f7:ef:c9:d9:8d:fe:01:3e:83:23:58:c3:
+ 3e:41:09:ab:5c:60:0e:9e:18:69:9e:99:7f:a2:cd:b7:95:5c:
+ ea:31:02:79:32:eb:1a:07:dc:75:98:80:8e:56:f2:0a:8f:0e:
+ cf:4f
+-----BEGIN CERTIFICATE-----
+MIIC0jCCAjugAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD
+VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MB4XDTA5
+MTEyMDE2MTYwMloXDTM0MTExNDE2MTYwMlowbzELMAkGA1UEBhMCREUxEDAOBgNV
+BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgODCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtFgFfPXySK81A4Jir9PvUPALsamhmxQc
+VKlxtPbgfYolsyHiU6ulCJ7tWu+LT751QLAQBesIO5TCVzdRQQhXuRylL+nMPKhw
+K+sAkkNkRBgjn4Vff6XJMLMUwCv8lKWmrUaoNxIgq8/gAnRdHy7sHJ8nH4P8xGLS
+C2v0ZSEdlP8CAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG
+FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFB7H
+o0Mza+yQtWaBZNZDckXb2eRXMB8GA1UdIwQYMBaAFBuraw9Ckdwe1HqVhzAtzBFP
+NbdzMA0GCSqGSIb3DQEBBQUAA4GBAKhmDUtqAPwx4/WPSUQ9YCZ2LlH4QTU7W3+H
+4wDXroW72YGlMNtqCqDS6Gn1R9gZ5Sq9xY6Z+Vf8sGT1Q7w3So4ocKRtfdosnsFV
+jQCJ/vfvydmN/gE+gyNYwz5BCatcYA6eGGmemX+izbeVXOoxAnky6xoH3HWYgI5W
+8gqPDs9P
+-----END CERTIFICATE-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem
new file mode 100755
index 000000000000..e063b97262fe
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,B84323C471CC815A
+
+UrT9eGAJB4+hzdjcS7YBCJi6jCL9n9/vZC0fC6mjZRK/dw4CxLka0KapKUVd+pj/
+I+XG6JOqa5tmsHcp9OWaWpzyu9W5DJqjodTum6pNlig68GVVSs21u7q0mF5mA6OR
+PmRu+iOe2oZO6kVaRnpdGBnbsUsvlsbayiY3nHjXeDPxyc+XGnIMjT7mBOO360iR
+h6IEOyapRho8klyuOXLy8hHZuUyspm66Nq+czorGdv3nlEdSI4t4LPTcqJGUMiHb
+hLYsCK9Zwu7RQWne3OmGjAspU37TB3F1YrWjnHFIKE6YSvtdYMwXosMbybdUZFwQ
+w4dGUhIxCxWLDF99Qfnygi8HJOC1FiFcJslVem0Xi3M654sshGLCiA4jMjdUAEmL
+R+rzjUNZEHqvO/bGm7zsEoLWQFWEYqQZguwxDScam9Sii/fcnEBcSERbEi3yjvlX
+7L3q4j/7/PlpYuRVB+f21ZuoI8R6M+omwF1ZzuSQNMSvUMyhAgQ+yB/pFJbArU68
+4l7ks0wNcSlLyGzjsexrzU9UB8Y8avFOMGuRiWGt4Kh54hNxgaCRGp9ugoyEq5H5
++QNB1x8tBJSe1YC4T06olH2xZTYCd5e9qTyjQrbnqTK4SEBDrOL+XSASkleH3vVH
+SO1paXDjh9fSSTxPo1T8DnAadIcouVlUNdvO4WrtqO4Kbf0rDHbqzZDtrNYG3Hwd
+w86nEo6J1AKrTKyXysOLdhuAhNr+hGx4ITT5HfV/H5BE3ba0/fmLxvenqTxBXrJc
+wkEeORwtu1XWW1hxYKRi3lRgfi4OH/ciMwxU530mKZzIJTOdvsKPgw==
+-----END RSA PRIVATE KEY-----
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial
new file mode 100755
index 000000000000..59c11226623e
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial
@@ -0,0 +1 @@
+1004
diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg
new file mode 100755
index 000000000000..177888124500
--- /dev/null
+++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg
@@ -0,0 +1,292 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca' and 'req'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = ./demoCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem # The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = sha1 # which md to use.
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString.
+# utf8only: only UTF8Strings.
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
+# so use this option with caution!
+string_mask = nombstr
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = DE
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Hamburg
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = OpenOffice.org
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Development
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+authorityInfoAccess = OCSP;URI:http://localhost:8889
+#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl
+# This is typical in keyUsage for a client certificate.
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+#nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+#authorityInfoAccess = OCSP;URI:http://localhost:8888/
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer:always
+
+#authorityInfoAccess = OCSP;URI:http://localhost:8888
+#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = critical, CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always,issuer:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer:always
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt
new file mode 100755
index 000000000000..ff4f23a90fde
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt
new file mode 100755
index 000000000000..64f80334b12b
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt
new file mode 100755
index 000000000000..bbf0819dd5c2
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt
new file mode 100755
index 000000000000..5f4bd15cd870
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt
new file mode 100755
index 000000000000..306aa56491f9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt
new file mode 100755
index 000000000000..a4c1dd84dbc8
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt
new file mode 100755
index 000000000000..e9af2c33032c
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt
new file mode 100755
index 000000000000..03f2ff0b3169
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt
new file mode 100755
index 000000000000..96eb50459531
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt
new file mode 100755
index 000000000000..c714844ad96f
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt
new file mode 100755
index 000000000000..d83ce86deaf5
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt
new file mode 100755
index 000000000000..c4857c541a52
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt
new file mode 100755
index 000000000000..d39b18b5725a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt
new file mode 100755
index 000000000000..b881f8a12e23
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt
new file mode 100755
index 000000000000..61391a8c257f
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt
new file mode 100755
index 000000000000..223d047ca977
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt
new file mode 100755
index 000000000000..af6a36003324
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt
new file mode 100755
index 000000000000..05297a327748
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt
new file mode 100755
index 000000000000..209059facde4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt
new file mode 100755
index 000000000000..a981a091cc4c
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt
new file mode 100755
index 000000000000..d73827e10366
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt
new file mode 100755
index 000000000000..69da1318b025
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Root_10.crl b/xmlsecurity/test_docs/certs/crl/Root_10.crl
new file mode 100755
index 000000000000..e7fee3ade801
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Root_10.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Root_11.crl b/xmlsecurity/test_docs/certs/crl/Root_11.crl
new file mode 100755
index 000000000000..95e18ae6aff2
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Root_11.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Root_3.crl b/xmlsecurity/test_docs/certs/crl/Root_3.crl
new file mode 100755
index 000000000000..5978b2613d00
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Root_3.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Root_4.crl b/xmlsecurity/test_docs/certs/crl/Root_4.crl
new file mode 100755
index 000000000000..10b370c14933
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Root_4.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Root_9.crl b/xmlsecurity/test_docs/certs/crl/Root_9.crl
new file mode 100755
index 000000000000..90bf8eba4a12
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Root_9.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl
new file mode 100755
index 000000000000..c9f542029371
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl
new file mode 100755
index 000000000000..7fc03f255ec4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl
new file mode 100755
index 000000000000..567b8b5d11b9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl
new file mode 100755
index 000000000000..a2ce79b3a0f5
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt
new file mode 100755
index 000000000000..16abebe51148
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt
new file mode 100755
index 000000000000..08f5040ced1c
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt
new file mode 100755
index 000000000000..18bd2475cdba
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt
new file mode 100755
index 000000000000..c7c83cf19a32
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt
new file mode 100755
index 000000000000..3ff2118d286e
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt
new file mode 100755
index 000000000000..0fcd6393ac57
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt
new file mode 100755
index 000000000000..9f28740601cb
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt
new file mode 100755
index 000000000000..49442c6df7b9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt
new file mode 100755
index 000000000000..27109c5bb04e
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt
new file mode 100755
index 000000000000..5cce769b44dc
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt
new file mode 100755
index 000000000000..09f2a54f4463
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt
new file mode 100755
index 000000000000..c3810ab508b1
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt
new file mode 100755
index 000000000000..1531d1e8d350
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt
new file mode 100755
index 000000000000..3dab25877854
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt
new file mode 100755
index 000000000000..278b11b77ecb
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt
new file mode 100755
index 000000000000..fa6e84547fc6
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt
new file mode 100755
index 000000000000..863f6f613eea
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt
new file mode 100755
index 000000000000..cae3959d17c3
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt
new file mode 100755
index 000000000000..e5786dc6c030
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt
new file mode 100755
index 000000000000..a63a9f8c95e4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt
new file mode 100755
index 000000000000..59a77df71e19
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt
new file mode 100755
index 000000000000..3b12b29c16e9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt
new file mode 100755
index 000000000000..c11e716d7c32
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt
new file mode 100755
index 000000000000..026274f632a1
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt
new file mode 100755
index 000000000000..4a026790e723
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt
new file mode 100755
index 000000000000..46b008eebf17
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt
new file mode 100755
index 000000000000..7c1c2cb29f0a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt
new file mode 100755
index 000000000000..cc6185cc93b4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt
new file mode 100755
index 000000000000..fa646e4029da
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt
new file mode 100755
index 000000000000..673db6cc9291
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt
new file mode 100755
index 000000000000..e284dca9b558
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt
new file mode 100755
index 000000000000..5b2cda4613af
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt
new file mode 100755
index 000000000000..532010b18c37
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt
new file mode 100755
index 000000000000..282aa47af342
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt
new file mode 100755
index 000000000000..26a51418fdfa
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt
new file mode 100755
index 000000000000..8a00d300802e
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt
new file mode 100755
index 000000000000..935da38c2390
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt
new file mode 100755
index 000000000000..79ea4fbcfe83
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt
new file mode 100755
index 000000000000..011c4ae2a88a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt
new file mode 100755
index 000000000000..b1425442888c
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt
new file mode 100755
index 000000000000..8c8689e10eaa
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt
new file mode 100755
index 000000000000..ed39bea1ec7b
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt
new file mode 100755
index 000000000000..7f9e13698681
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt
new file mode 100755
index 000000000000..879f4578c091
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt
new file mode 100755
index 000000000000..75a9c7c843da
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt
new file mode 100755
index 000000000000..cf07f4aa2ce6
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt
new file mode 100755
index 000000000000..993a09f957f7
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt
new file mode 100755
index 000000000000..a1cebacb3b25
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt
new file mode 100755
index 000000000000..12410ebc81a9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt
new file mode 100755
index 000000000000..f7372d09f33a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12
new file mode 100755
index 000000000000..048ca8e8f509
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12
new file mode 100755
index 000000000000..4498cdb76ec9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12
new file mode 100755
index 000000000000..d85e0b7d47e2
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12
new file mode 100755
index 000000000000..ff666ff1e5b6
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12
new file mode 100755
index 000000000000..55e0d6233e33
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12
new file mode 100755
index 000000000000..baa32f26b729
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12
new file mode 100755
index 000000000000..7b20ff98cf55
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12
new file mode 100755
index 000000000000..6e980df49e4e
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12
new file mode 100755
index 000000000000..4d343d6e7672
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12
new file mode 100755
index 000000000000..aa5f27d2d945
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12
new file mode 100755
index 000000000000..80e5bf47c030
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12
new file mode 100755
index 000000000000..1e9a14cb8af5
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12
new file mode 100755
index 000000000000..d7096919be7c
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12
new file mode 100755
index 000000000000..adc61fff40d6
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12
new file mode 100755
index 000000000000..9213427a16b9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12
new file mode 100755
index 000000000000..005191d1646e
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12
new file mode 100755
index 000000000000..e4599b113a9b
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12
new file mode 100755
index 000000000000..32b4926ad74d
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12
new file mode 100755
index 000000000000..2c0ea4acbfa7
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12
new file mode 100755
index 000000000000..b69a19e4e1b4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12
new file mode 100755
index 000000000000..7897733c4ea5
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12
new file mode 100755
index 000000000000..99eb944528c8
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12
new file mode 100755
index 000000000000..1aefff504ea3
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12
new file mode 100755
index 000000000000..6b6d5fd4e703
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12
new file mode 100755
index 000000000000..bebfdc88a66a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12
new file mode 100755
index 000000000000..cbd6730a8488
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12
new file mode 100755
index 000000000000..ab2b651c1f6a
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12
new file mode 100755
index 000000000000..518388c5b4a4
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12
new file mode 100755
index 000000000000..775b1359dc39
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12
new file mode 100755
index 000000000000..f76a61869cb2
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12
new file mode 100755
index 000000000000..ef1273c72415
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12
new file mode 100755
index 000000000000..4208dc4316f0
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12
new file mode 100755
index 000000000000..4826f2d04584
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12
new file mode 100755
index 000000000000..bc211718a5f3
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12
new file mode 100755
index 000000000000..876151de3fbd
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12
new file mode 100755
index 000000000000..268eeb938732
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12
new file mode 100755
index 000000000000..2fc86b9afdf1
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12
new file mode 100755
index 000000000000..80dd6a8b08f8
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12
new file mode 100755
index 000000000000..821bb8ea50c9
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12
new file mode 100755
index 000000000000..3671d176d9ce
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12
new file mode 100755
index 000000000000..a4c63b7f23eb
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12
new file mode 100755
index 000000000000..99b0be699aea
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12
new file mode 100755
index 000000000000..5dbaf524c3b8
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12
new file mode 100755
index 000000000000..bc476b2572a0
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12
new file mode 100755
index 000000000000..0b9bd319b5a2
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12
new file mode 100755
index 000000000000..99de803de356
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12
new file mode 100755
index 000000000000..a663a92d9bfe
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12
new file mode 100755
index 000000000000..c3d4e7532f10
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12
new file mode 100755
index 000000000000..9db9c0ad4a07
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12
new file mode 100755
index 000000000000..ccb03b327d2b
--- /dev/null
+++ b/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/aia_ca_issuers.odt b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt
new file mode 100755
index 000000000000..8c34889df75d
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/aia_ocsp.odt b/xmlsecurity/test_docs/documents/aia_ocsp.odt
new file mode 100755
index 000000000000..6a1b48c6ae44
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/aia_ocsp.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt
new file mode 100755
index 000000000000..248fcceddc43
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt
new file mode 100755
index 000000000000..2e0dbd6f7af3
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt
new file mode 100755
index 000000000000..3519e4a818e6
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crl.odt b/xmlsecurity/test_docs/documents/crl.odt
new file mode 100755
index 000000000000..06e412fa3ca4
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crl.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crl_revoked_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt
new file mode 100755
index 000000000000..851fc87e7693
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt
new file mode 100755
index 000000000000..a97598d554bd
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt
new file mode 100755
index 000000000000..f82a02a4545c
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp.odt b/xmlsecurity/test_docs/documents/crldp.odt
new file mode 100755
index 000000000000..5cbf289de34f
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt
new file mode 100755
index 000000000000..20c28d9252e7
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt
new file mode 100755
index 000000000000..d3f59e6015a1
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt
new file mode 100755
index 000000000000..8c6416b808ba
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt
new file mode 100755
index 000000000000..fce479cc66b2
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt
new file mode 100755
index 000000000000..53d1e01e7ae3
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt
new file mode 100755
index 000000000000..1f69a324823b
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt
new file mode 100755
index 000000000000..53a29310e9f2
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/dn_quoting.odt b/xmlsecurity/test_docs/documents/dn_quoting.odt
new file mode 100755
index 000000000000..ca17f6aab62e
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/dn_quoting.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/incomplete_path.odt b/xmlsecurity/test_docs/documents/incomplete_path.odt
new file mode 100755
index 000000000000..cb0763b0a124
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/incomplete_path.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt
new file mode 100755
index 000000000000..f0555b1a2da4
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt
new file mode 100755
index 000000000000..b2e24fc6177c
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt
new file mode 100755
index 000000000000..640a80dced51
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt
new file mode 100755
index 000000000000..35847216be74
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt
new file mode 100755
index 000000000000..575f3a12d084
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt
new file mode 100755
index 000000000000..75a417cab6f7
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt
new file mode 100755
index 000000000000..f7d71762fd88
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt
new file mode 100755
index 000000000000..9984aa1bbb27
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt
new file mode 100755
index 000000000000..5ad7b68abbbb
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt
new file mode 100755
index 000000000000..d126a8dff529
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt
new file mode 100755
index 000000000000..dd475c354957
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/ocsp_crl.odt b/xmlsecurity/test_docs/documents/ocsp_crl.odt
new file mode 100755
index 000000000000..f8ab95c046de
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/ocsp_crl.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt
new file mode 100755
index 000000000000..4d7c5cd8094d
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/stateOrProvinceName.odt b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt
new file mode 100755
index 000000000000..0979ae5a9d86
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_no_revocation.odt b/xmlsecurity/test_docs/documents/valid_no_revocation.odt
new file mode 100755
index 000000000000..f7c9bbf5ed40
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_no_revocation.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt
new file mode 100755
index 000000000000..d26eb58f025c
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt
new file mode 100755
index 000000000000..5d6c053c2b7c
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt
new file mode 100755
index 000000000000..cb6401c1641f
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt
new file mode 100755
index 000000000000..09b63b40a3e0
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt
new file mode 100755
index 000000000000..e810d785d1b1
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt
new file mode 100755
index 000000000000..6c2bbd045a0e
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt
new file mode 100755
index 000000000000..b8b036cc8fa7
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt
new file mode 100755
index 000000000000..6ba0ec52a9b7
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt
new file mode 100755
index 000000000000..de1c635c198b
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt
new file mode 100755
index 000000000000..f6575ec88578
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt
new file mode 100755
index 000000000000..41f676f6376e
--- /dev/null
+++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/test_description.odt b/xmlsecurity/test_docs/test_description.odt
new file mode 100755
index 000000000000..9c2eff18ddcc
--- /dev/null
+++ b/xmlsecurity/test_docs/test_description.odt
Binary files differ
diff --git a/xmlsecurity/test_docs/tools/README.txt b/xmlsecurity/test_docs/tools/README.txt
new file mode 100755
index 000000000000..dd1431b7cf64
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/README.txt
@@ -0,0 +1,23 @@
+httpserv
+============
+Simple http server for testing of Certificate Revocation Lists (CRL).
+
+Netbeans 6.7.1 project. httpserv.jar requires java 6.
+
+Run with
+
+java -jar httpserv/dist/httpserv.jar --accept portnumber
+
+portnumber: an arbitrary port number to which the server should listen.
+
+httpserv looks for the requested file relativ to the current directory. For
+example, you are in a directory which contains the index.html. From there
+you run httpserv.jar:
+
+java -jar <path_to_wherever_it_is>/httpserv.jar --accept 8000
+
+now enter in the Browser:
+
+localhost:8000/index.html
+
+
diff --git a/xmlsecurity/test_docs/tools/httpserv/build.xml b/xmlsecurity/test_docs/tools/httpserv/build.xml
new file mode 100755
index 000000000000..831e963bce65
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/build.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="httpserv" default="default" basedir=".">
+ <description>Builds, tests, and runs the project httpserv.</description>
+ <import file="nbproject/build-impl.xml"/>
+ <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project properties
+ -post-init: called after initialization of project properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single file
+ -post-compile-single: called after javac compilation of single file
+ -pre-compile-test: called before javac compilation of JUnit tests
+ -post-compile-test: called after javac compilation of JUnit tests
+ -pre-compile-test-single: called before javac compilation of single JUnit test
+ -post-compile-test-single: called after javac compilation of single JUunit test
+ -pre-jar: called before JAR building
+ -post-jar: called after JAR building
+ -post-clean: called after cleaning build products
+
+ (Targets beginning with '-' are not intended to be called on their own.)
+
+ Example of inserting an obfuscator after compilation could look like this:
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Another way to customize the build is by overriding existing main targets.
+ The targets of interest are:
+
+ -init-macrodef-javac: defines macro for javac compilation
+ -init-macrodef-junit: defines macro for junit execution
+ -init-macrodef-debug: defines macro for class debugging
+ -init-macrodef-java: defines macro for class execution
+ -do-jar-with-manifest: JAR building (if you are using a manifest)
+ -do-jar-without-manifest: JAR building (if you are not using a manifest)
+ run: execution of project
+ -javadoc-build: Javadoc generation
+ test-report: JUnit report generation
+
+ An example of overriding the target for project execution could look like this:
+
+ <target name="run" depends="httpserv-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that the overridden target depends on the jar target and not only on
+ the compile target as the regular run target does. Again, for a list of available
+ properties which you can use, check the target you are overriding in the
+ nbproject/build-impl.xml file.
+
+ -->
+</project>
diff --git a/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT b/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT
new file mode 100755
index 000000000000..28db189bb94d
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT
@@ -0,0 +1,33 @@
+========================
+BUILD OUTPUT DESCRIPTION
+========================
+
+When you build an Java application project that has a main class, the IDE
+automatically copies all of the JAR
+files on the projects classpath to your projects dist/lib folder. The IDE
+also adds each of the JAR files to the Class-Path element in the application
+JAR files manifest file (MANIFEST.MF).
+
+To run the project from the command line, go to the dist folder and
+type the following:
+
+java -jar "httpserv.jar"
+
+To distribute this project, zip up the dist folder (including the lib folder)
+and distribute the ZIP file.
+
+Notes:
+
+* If two JAR files on the project classpath have the same name, only the first
+JAR file is copied to the lib folder.
+* Only JAR files are copied to the lib folder.
+If the classpath contains other types of files or folders, none of the
+classpath elements are copied to the lib folder. In such a case,
+you need to copy the classpath elements to the lib folder manually after the build.
+* If a library on the projects classpath also has a Class-Path element
+specified in the manifest,the content of the Class-Path element has to be on
+the projects runtime path.
+* To set a main class in a standard Java project, right-click the project node
+in the Projects window and choose Properties. Then click Run and enter the
+class name in the Main Class field. Alternatively, you can manually type the
+class name in the manifest Main-Class element.
diff --git a/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar b/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar
new file mode 100755
index 000000000000..b80b60978dc0
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar
Binary files differ
diff --git a/xmlsecurity/test_docs/tools/httpserv/manifest.mf b/xmlsecurity/test_docs/tools/httpserv/manifest.mf
new file mode 100755
index 000000000000..328e8e5bc3b7
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml
new file mode 100755
index 000000000000..9064a3305e2d
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml
@@ -0,0 +1,700 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+ - initialization
+ - compilation
+ - jar
+ - execution
+ - debugging
+ - javadoc
+ - junit compilation
+ - junit execution
+ - junit debugging
+ - applet
+ - cleanup
+
+ -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="httpserv-impl">
+ <fail message="Please build using Ant 1.7.1 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.7.1"/>
+ </not>
+ </condition>
+ </fail>
+ <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+ <!--
+ ======================
+ INITIALIZATION SECTION
+ ======================
+ -->
+ <target name="-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init" name="-init-private">
+ <property file="nbproject/private/config.properties"/>
+ <property file="nbproject/private/configs/${config}.properties"/>
+ <property file="nbproject/private/private.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private" name="-init-user">
+ <property file="${user.properties.file}"/>
+ <!-- The two properties below are usually overridden -->
+ <!-- by the active platform. Just a fallback. -->
+ <property name="default.javac.source" value="1.4"/>
+ <property name="default.javac.target" value="1.4"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+ <property file="nbproject/configs/${config}.properties"/>
+ <property file="nbproject/project.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+ <available file="${manifest.file}" property="manifest.available"/>
+ <condition property="manifest.available+main.class">
+ <and>
+ <isset property="manifest.available"/>
+ <isset property="main.class"/>
+ <not>
+ <equals arg1="${main.class}" arg2="" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="manifest.available+main.class+mkdist.available">
+ <and>
+ <istrue value="${manifest.available+main.class}"/>
+ <isset property="libs.CopyLibs.classpath"/>
+ </and>
+ </condition>
+ <condition property="have.tests">
+ <or>
+ <available file="${test.src.dir}"/>
+ </or>
+ </condition>
+ <condition property="have.sources">
+ <or>
+ <available file="${src.dir}"/>
+ </or>
+ </condition>
+ <condition property="netbeans.home+have.tests">
+ <and>
+ <isset property="netbeans.home"/>
+ <isset property="have.tests"/>
+ </and>
+ </condition>
+ <condition property="no.javadoc.preview">
+ <and>
+ <isset property="javadoc.preview"/>
+ <isfalse value="${javadoc.preview}"/>
+ </and>
+ </condition>
+ <property name="run.jvmargs" value=""/>
+ <property name="javac.compilerargs" value=""/>
+ <property name="work.dir" value="${basedir}"/>
+ <condition property="no.deps">
+ <and>
+ <istrue value="${no.dependencies}"/>
+ </and>
+ </condition>
+ <property name="javac.debug" value="true"/>
+ <property name="javadoc.preview" value="true"/>
+ <property name="application.args" value=""/>
+ <property name="source.encoding" value="${file.encoding}"/>
+ <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+ <and>
+ <isset property="javadoc.encoding"/>
+ <not>
+ <equals arg1="${javadoc.encoding}" arg2=""/>
+ </not>
+ </and>
+ </condition>
+ <property name="javadoc.encoding.used" value="${source.encoding}"/>
+ <property name="includes" value="**"/>
+ <property name="excludes" value=""/>
+ <property name="do.depend" value="false"/>
+ <condition property="do.depend.true">
+ <istrue value="${do.depend}"/>
+ </condition>
+ <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
+ <and>
+ <isset property="jaxws.endorsed.dir"/>
+ <available file="nbproject/jaxws-build.xml"/>
+ </and>
+ </condition>
+ </target>
+ <target name="-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+ <fail unless="src.dir">Must set src.dir</fail>
+ <fail unless="test.src.dir">Must set test.src.dir</fail>
+ <fail unless="build.dir">Must set build.dir</fail>
+ <fail unless="dist.dir">Must set dist.dir</fail>
+ <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+ <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+ <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+ <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+ <fail unless="dist.jar">Must set dist.jar</fail>
+ </target>
+ <target name="-init-macrodef-property">
+ <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-javac">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <sequential>
+ <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </depend>
+ </sequential>
+ </macrodef>
+ <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <sequential>
+ <fail unless="javac.includes">Must set javac.includes</fail>
+ <pathconvert pathsep="," property="javac.includes.binary">
+ <path>
+ <filelist dir="@{destdir}" files="${javac.includes}"/>
+ </path>
+ <globmapper from="*.java" to="*.class"/>
+ </pathconvert>
+ <delete>
+ <files includes="${javac.includes.binary}"/>
+ </delete>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-junit">
+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <sequential>
+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
+ <batchtest todir="${build.test.results.dir}">
+ <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+ <filename name="@{testincludes}"/>
+ </fileset>
+ </batchtest>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <jvmarg line="${run.jvmargs}"/>
+ </junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+ <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${main.class}" name="name"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <attribute default="" name="stopclassname"/>
+ <sequential>
+ <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </nbjpdastart>
+ </sequential>
+ </macrodef>
+ <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${build.classes.dir}" name="dir"/>
+ <sequential>
+ <nbjpdareload>
+ <fileset dir="@{dir}" includes="${fix.classes}">
+ <include name="${fix.includes}*.class"/>
+ </fileset>
+ </nbjpdareload>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-debug-args">
+ <property name="version-output" value="java version &quot;${ant.java.version}"/>
+ <condition property="have-jdk-older-than-1.4">
+ <or>
+ <contains string="${version-output}" substring="java version &quot;1.0"/>
+ <contains string="${version-output}" substring="java version &quot;1.1"/>
+ <contains string="${version-output}" substring="java version &quot;1.2"/>
+ <contains string="${version-output}" substring="java version &quot;1.3"/>
+ </or>
+ </condition>
+ <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+ <istrue value="${have-jdk-older-than-1.4}"/>
+ </condition>
+ <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+ <os family="windows"/>
+ </condition>
+ <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+ <isset property="debug.transport"/>
+ </condition>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-debug">
+ <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" fork="true">
+ <jvmarg line="${debug-args-line}"/>
+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+ <jvmarg value="-Dfile.encoding=${source.encoding}"/>
+ <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-java">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${run.classpath}" name="classpath"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" fork="true">
+ <jvmarg value="-Dfile.encoding=${source.encoding}"/>
+ <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-presetdef-jar">
+ <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <jar compress="${jar.compress}" jarfile="${dist.jar}">
+ <j2seproject1:fileset dir="${build.classes.dir}"/>
+ </jar>
+ </presetdef>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
+ <!--
+ ===================
+ COMPILATION SECTION
+ ===================
+ -->
+ <target depends="init" name="deps-jar" unless="no.deps"/>
+ <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+ <target depends="init" name="-check-automatic-build">
+ <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+ </target>
+ <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+ <antcall target="clean"/>
+ </target>
+ <target depends="init,deps-jar" name="-pre-pre-compile">
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+ <target name="-pre-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="do.depend.true" name="-compile-depend">
+ <pathconvert property="build.generated.subdirs">
+ <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </pathconvert>
+ <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
+ <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+ <copy todir="${build.classes.dir}">
+ <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+ <target name="-pre-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile/>
+ <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
+ </target>
+ <target name="-post-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+ <!--
+ ====================
+ JAR BUILDING SECTION
+ ====================
+ -->
+ <target depends="init" name="-pre-pre-jar">
+ <dirname file="${dist.jar}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ </target>
+ <target name="-pre-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
+ <j2seproject1:jar/>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+ <j2seproject1:jar manifest="${manifest.file}"/>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+ <j2seproject1:jar manifest="${manifest.file}">
+ <j2seproject1:manifest>
+ <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+ </j2seproject1:manifest>
+ </j2seproject1:jar>
+ <echo>To run this application from the command line without Ant, try:</echo>
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <pathconvert property="run.classpath.with.dist.jar">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+ </pathconvert>
+ <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <pathconvert property="run.classpath.without.build.classes.dir">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to=""/>
+ </pathconvert>
+ <pathconvert pathsep=" " property="jar.classpath">
+ <path path="${run.classpath.without.build.classes.dir}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ <globmapper from="*" to="lib/*"/>
+ </chainedmapper>
+ </pathconvert>
+ <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+ <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <fileset dir="${build.classes.dir}"/>
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}"/>
+ <attribute name="Class-Path" value="${jar.classpath}"/>
+ </manifest>
+ </copylibs>
+ <echo>To run this application from the command line without Ant, try:</echo>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <echo>java -jar "${dist.jar.resolved}"</echo>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="libs.CopyLibs.classpath" name="-do-jar-with-libraries-without-manifest" unless="manifest.available+main.class">
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <pathconvert property="run.classpath.without.build.classes.dir">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to=""/>
+ </pathconvert>
+ <pathconvert pathsep=" " property="jar.classpath">
+ <path path="${run.classpath.without.build.classes.dir}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ <globmapper from="*" to="lib/*"/>
+ </chainedmapper>
+ </pathconvert>
+ <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+ <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <fileset dir="${build.classes.dir}"/>
+ </copylibs>
+ </target>
+ <target name="-post-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
+ <!--
+ =================
+ EXECUTION SECTION
+ =================
+ -->
+ <target depends="init,compile" description="Run a main class." name="run">
+ <j2seproject1:java>
+ <customize>
+ <arg line="${application.args}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <target name="-do-not-recompile">
+ <property name="javac.includes.binary" value=""/>
+ </target>
+ <target depends="init,-do-not-recompile,compile-single" name="run-single">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}"/>
+ </target>
+ <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+ </target>
+ <!--
+ =================
+ DEBUGGING SECTION
+ =================
+ -->
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+ <j2seproject1:nbjpdastart name="${debug.class}"/>
+ </target>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+ </target>
+ <target depends="init,compile" name="-debug-start-debuggee">
+ <j2seproject3:debug>
+ <customize>
+ <arg line="${application.args}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+ <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+ </target>
+ <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}"/>
+ </target>
+ <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+ <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+ </target>
+ <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+ <target depends="init" name="-pre-debug-fix">
+ <fail unless="fix.includes">Must set fix.includes</fail>
+ <property name="javac.includes" value="${fix.includes}.java"/>
+ </target>
+ <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+ <j2seproject1:nbjpdareload/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+ <!--
+ ===============
+ JAVADOC SECTION
+ ===============
+ -->
+ <target depends="init" name="-javadoc-build">
+ <mkdir dir="${dist.javadoc.dir}"/>
+ <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+ <classpath>
+ <path path="${javac.classpath}"/>
+ </classpath>
+ <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+ <filename name="**/*.java"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/*.java"/>
+ </fileset>
+ </javadoc>
+ </target>
+ <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+ </target>
+ <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+ <!--
+ =========================
+ JUNIT COMPILATION SECTION
+ =========================
+ -->
+ <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+ <mkdir dir="${build.test.classes.dir}"/>
+ </target>
+ <target name="-pre-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="do.depend.true" name="-compile-test-depend">
+ <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+ <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+ <target name="-pre-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+ <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+ <!--
+ =======================
+ JUNIT EXECUTION SECTION
+ =======================
+ -->
+ <target depends="init" if="have.tests" name="-pre-test-run">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+ <j2seproject3:junit testincludes="**/*Test.java"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init" if="have.tests" name="test-report"/>
+ <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+ <target depends="init" if="have.tests" name="-pre-test-run-single">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+ <j2seproject3:junit excludes="" includes="${test.includes}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+ <!--
+ =======================
+ JUNIT DEBUGGING SECTION
+ =======================
+ -->
+ <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+ <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+ <delete file="${test.report.file}"/>
+ <mkdir dir="${build.test.results.dir}"/>
+ <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+ <customize>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <arg value="${test.class}"/>
+ <arg value="showoutput=true"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+ <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+ </target>
+ <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+ <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+ <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+ <!--
+ =========================
+ APPLET EXECUTION SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" name="run-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject1:java classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <!--
+ =========================
+ APPLET DEBUGGING SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject3:debug classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+ <!--
+ ===============
+ CLEANUP SECTION
+ ===============
+ -->
+ <target depends="init" name="deps-clean" unless="no.deps"/>
+ <target depends="init" name="-do-clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.dir}"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+</project>
diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties b/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties
new file mode 100755
index 000000000000..562eec670951
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=8071b819
+build.xml.script.CRC32=deb21e95
+build.xml.stylesheet.CRC32=958a1d3e@1.26.2.45
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=8071b819
+nbproject/build-impl.xml.script.CRC32=21d1be7e
+nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.2.45
diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties
new file mode 100755
index 000000000000..9addce600715
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties
@@ -0,0 +1,64 @@
+application.title=httpserv
+application.vendor=jochen
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/httpserv.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}:\
+ ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=httpserv.Main
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml
new file mode 100755
index 000000000000..6fc771ca7669
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.java.j2seproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+ <name>httpserv</name>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.src.dir"/>
+ </test-roots>
+ </data>
+ </configuration>
+</project>
diff --git a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
new file mode 100755
index 000000000000..c67e41549c5f
--- /dev/null
+++ b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * 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: WeakReference.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 httpserv;
+
+import com.sun.net.httpserver.Headers;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+
+/**
+ *
+ * @author jochen
+ */
+public class Main {
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ try {
+
+ Option[] opts = new Option[2];
+ opts[0] = new Option("--help", "-h", false);
+ opts[1] = new Option("--accept", "-a", true);
+ if (!parseOptions(args, opts)) {
+ return;
+ }
+ HttpServer server = HttpServer.create(
+ new InetSocketAddress((Integer) opts[1].value), 0);
+ server.createContext("/", new MyHandler());
+ server.setExecutor(null);
+ server.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } // TODO code application logic here
+
+ static boolean parseOptions(String[] args, Option[] inout_options) {
+ if (args.length == 0) {
+ printUsage();
+ return false;
+ }
+
+ boolean bWrongArgs = true;
+ Option currentOpt = null;
+
+ for (String s : args) {
+ // get the value for an option
+ if (currentOpt != null && currentOpt.bHasValue) {
+ //now we expect the value for the option
+ //check the type
+ try {
+ if (currentOpt.sLong.equals("--accept")) {
+ currentOpt.value = Integer.decode(s);
+ }
+ } catch (Exception e ) {
+ printUsage();
+ return false;
+ }
+ currentOpt = null;
+ continue;
+ } else {
+ currentOpt = null;
+ }
+
+
+ // get the option
+ for (Option o : inout_options) {
+ if (s.equals(o.sLong) || s.equals(o.sShort)) {
+ bWrongArgs = false;
+ //special handling for --help
+ if (o.sLong.equals("--help")) {
+ printUsage();
+ return false;
+ }
+ else
+ {
+ currentOpt = o;
+ if (!o.bHasValue) {
+ o.bSet = true;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ if (bWrongArgs) {
+ printUsage();
+ return false;
+ }
+ return true;
+ }
+
+ static void printUsage() {
+ String usage = new String(
+ "Usage: \n" +
+ "java -jar httpserv [options] \n" +
+ "\n" +
+ "Options are: \n" +
+ "-h --help \t this help \n" +
+ "-a --accept port \t the port number to which this server listens \n");
+ System.out.println(usage);
+ }
+}
+
+class MyHandler implements HttpHandler {
+
+ public void handle(HttpExchange xchange) throws IOException {
+ try {
+ //First get the path to the file
+ File fileCurrent = new File(".");
+ String sRequestPath = xchange.getRequestURI().getPath();
+ System.out.println("requested: " + sRequestPath);
+ File fileRequest = new File(new File(".").getCanonicalPath(), sRequestPath);
+ if (!fileRequest.exists()) {
+ throw new Exception("The file " + fileRequest.toString() + " does not exist!\n");
+ }
+ else if (fileRequest.isDirectory()) {
+ throw new Exception(fileRequest.toString() + " is a directory!\n");
+ }
+
+
+ //Read the file into a byte array
+ byte[] data = new byte[(int) fileRequest.length()];
+ FileInputStream fr = new FileInputStream(fileRequest);
+ int count = fr.read(data);
+
+ //set the Content-type header
+ Headers h = xchange.getResponseHeaders();
+ String canonicalPath = fileRequest.getCanonicalPath();
+ int lastIndex = canonicalPath.lastIndexOf(".");
+ String fileExtension = canonicalPath.substring(lastIndex + 1);
+
+ if (fileExtension.equalsIgnoreCase("crl"))
+ {
+ //h.set("Content-Type","application/x-pkcs7-crl");
+ h.set("Content-Type","application/pkix-crl");
+ }
+ else if (fileExtension.equalsIgnoreCase("crt")
+ || fileExtension.equalsIgnoreCase("cer")
+ || fileExtension.equalsIgnoreCase("der"))
+ {
+ h.set("Content-Type", "application/x-x509-ca-cert");
+ }
+
+ //write out the requested file
+ xchange.sendResponseHeaders(200, data.length);
+ OutputStream os = xchange.getResponseBody();
+ os.write(data);
+ os.close();
+ System.out.println("delivered: " + fileRequest.toString());
+
+ } catch (Exception e) {
+ xchange.sendResponseHeaders(404, e.getMessage().length());
+ OutputStream os = xchange.getResponseBody();
+ os.write(e.getMessage().getBytes());
+ os.close();
+ System.out.println("Error: " + e.getMessage());
+ }
+ }
+}
+
+class Option {
+
+ Option(String _sLong, String _sShort, boolean _bHasValue) {
+ sLong = _sLong;
+ sShort = _sShort;
+ bHasValue = _bHasValue;
+ }
+ String sLong;
+ String sShort;
+ boolean bHasValue;
+ Object value;
+ //indicates if this option was set if it does not need a value. Otherwise value
+ //is set.
+ boolean bSet;
+}
+
+